AoU: ETAS_RTACAR_SM_OS_182 ************************** This AoU checks that forbidden OS API calls are not made within a critical section protected by SuspendAllInterrupts()/ResumeAllInterrupts(), according to the ETAS_RTACAR_SM_OS_182 requirement and ISO 17356. The validation procedure ensures that only the following OS API calls are permitted within a SuspendAllInterrupts/ResumeAllInterrupts critical section: - SuspendAllInterrupts() - ResumeAllInterrupts() - SuspendOSInterrupts() - ResumeOSInterrupts() All other OS API calls are prohibited within this critical section. .. include:: os_api_name_expansion.rst .. include:: restricted_os_regions_common_rationale.rst The tool analyzes the code to: - Detect the boundaries of Suspend/ResumeAllInterrupts critical sections. - Check that no prohibited OS API calls are made within these sections. - Report issues if forbidden calls are found. - Report warnings, as a result indicating human review need, if section identification is not possible due to conditional statements, tool limitations, or the call graph contains unsupported function calls (ie. call by pointer). .. important:: Os API call region delimiters The tool detects the start of a critical region when a call to the **Os_SuspendAllInterrupts()** function is made. The end of the critical region is detected when a corresponding call to **Os_ResumeAllInterrupts()** is made. Function macro delimiters ========================= The following couples of function macros are detected as critical region delimiters: - **SuspendAllInterrupts()** / **ResumeAllInterrupts()** - **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 recognize 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 to consider 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 it self is considered as region delimiter. This verification process helps to ensure that some macro definitions are not mistakenly identified as region delimiters like the Rte_GetResource()/Rte_ReleaseResource() macros in some specific scenarios. .. include:: ../rules/ETAS_RTACAR_SM_OS_182.rst