AoU: ETAS_RTACAR_SM_OS_221 ************************** This AoU checks that all resources acquired via ``GetResource()`` are released before a task or Category 2 ISR terminates, according to the ETAS_RTACAR_SM_OS_221 requirement. The validation procedure simulates a resource stack along all feasible paths leading to task or ISR termination and verifies that the stack is empty at every termination boundary. Termination boundaries considered include: - Explicit termination calls: ``TerminateTask()``, ``ChainTask()`` , ``Os_TerminateTask()``, ``Os_ChainTask()`` - Implicit return from a task main function - Return from a Category 2 ISR function The check is applied only to functions identified as task or Category 2 ISR implementations (i.e., functions matching the ``TASK`` or ``ISR`` macro patterns). .. include:: restricted_os_regions_common_rationale.rst .. important:: Os API call region delimiters The tool detects resource acquisition when a call to **Os_GetResource()** (or ``GetResource()``) is made and resource release 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. This is a known limitation; the tool reports the affected path result as ambiguous when call targets are unresolved. .. include:: ../rules/ETAS_RTACAR_SM_OS_221.rst