AoU: ETAS_RTACAR_SM_OS_185 ************************** This AoU checks that calls to ``SuspendOSInterrupts()`` and ``ResumeOSInterrupts()`` are correctly paired and properly nested along all feasible execution paths, according to the ETAS_RTACAR_SM_OS_185 requirement. The validation procedure simulates a push/pop stack of ``SuspendOSInterrupts`` calls and verifies that: - Every ``SuspendOSInterrupts()`` call is matched by a corresponding ``ResumeOSInterrupts()`` call. - The nesting of suspend/resume pairs is strictly respected along all execution paths. - No path reaches a function exit point with an unbalanced (open) suspend region. .. include:: restricted_os_regions_common_rationale.rst .. important:: Os API call region delimiters The tool detects the start of a critical region when a call to the **Os_SuspendOSInterrupts()** function is made. The end of the critical region is detected when a corresponding call to **Os_ResumeOSInterrupts()** is made. Function macro delimiters ========================= The following couples of function macros are detected as critical region delimiters: - **SuspendOSInterrupts()** / **ResumeOSInterrupts()** - **Rte_SuspendOSInterrupts()** / **Rte_ResumeOSInterrupts()** - **Rte_GetResource()** / **Rte_ReleaseResource()** When the region starts/ends due to a function macro call, the tool will consider the entire macro body as part of the region delimiter, so no further analysis will be performed within the expansion code of the macros. .. attention:: The tool recognizes only the listed macros as critical region delimiters. In case of usage of unsupported macros, or new macros mapped to the supported ones, the detection process will be downgraded to the analysis of the call graph considering the full expansion of the macro. .. note:: Macro Delimiters verification Before considering a macro as region delimiter, a check to the macro expansion code is performed: only when, inside the body of the macro expansion, a call to the expected Os API delimiter functions is found, the macro itself is considered as region delimiter. This approach helps to cover cases where the macros are defined by invoking functions that act on different primitives than the ones expected by the check. .. include:: ../rules/ETAS_RTACAR_SM_OS_185.rst