AoU: ETAS_RTACAR_SM_OS_223 ************************** This AoU checks that calls to ``GetResource()`` and ``ReleaseResource()`` are correctly paired and strictly nested along all feasible execution paths, according to the ETAS_RTACAR_SM_OS_223 requirement and ISO 17356. The validation procedure simulates a resource stack and verifies that: - Every ``GetResource()`` call is matched by a corresponding ``ReleaseResource()`` call. - ``ReleaseResource()`` always matches the most-recent outstanding ``GetResource()`` for the same resource (LIFO order). - No path reaches a function exit point with an unmatched ``GetResource()`` call still outstanding. - Nested acquisition of the same resource (e.g., ``GetResource(R)`` followed by another ``GetResource(R)``) is flagged as a violation per ISO 17356. .. include:: restricted_os_regions_common_rationale.rst .. important:: Os API call region delimiters The tool detects the start of a resource critical region when a call to the **Os_GetResource()** (or ``GetResource()``) function is made. The end of the critical region is detected when a corresponding call to **Os_ReleaseResource()** (or ``ReleaseResource()``) is made. .. attention:: Resource identifier resolution The tool does not resolve resource identifiers during analysis. Rules that require matching a specific resource identifier are therefore applied without identifier verification. When call targets are unresolved (function pointers, external calls), the tool marks the affected path result as ambiguous. .. include:: ../rules/ETAS_RTACAR_SM_OS_223.rst