SchM_Mcu.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. /*==================================================================================================
  2. * Project : RTD AUTOSAR 4.4
  3. * Platform : CORTEXM
  4. * Peripheral :
  5. * Dependencies : none
  6. *
  7. * Autosar Version : 4.4.0
  8. * Autosar Revision : ASR_REL_4_4_REV_0000
  9. * Autosar Conf.Variant :
  10. * SW Version : 1.0.0
  11. * Build Version : S32K1_RTD_1_0_0_HF01_D2109_ASR_REL_4_4_REV_0000_20210907
  12. *
  13. * (c) Copyright 2020-2021 NXP Semiconductors
  14. * All Rights Reserved.
  15. *
  16. * NXP Confidential. This software is owned or controlled by NXP and may only be
  17. * used strictly in accordance with the applicable license terms. By expressly
  18. * accepting such terms or by downloading, installing, activating and/or otherwise
  19. * using the software, you are agreeing that you have read, and that you agree to
  20. * comply with and are bound by, such license terms. If you do not agree to be
  21. * bound by the applicable license terms, then you may not retain, install,
  22. * activate or otherwise use the software.
  23. ==================================================================================================*/
  24. /**
  25. * @file
  26. *
  27. * @addtogroup RTE_MODULE
  28. * @{
  29. */
  30. #ifdef __cplusplus
  31. extern "C"{
  32. #endif
  33. /*==================================================================================================
  34. * INCLUDE FILES
  35. * 1) system and project includes
  36. * 2) needed interfaces from external units
  37. * 3) internal and external interfaces from this unit
  38. ==================================================================================================*/
  39. #include "Std_Types.h"
  40. #include "Mcal.h"
  41. #include "OsIf.h"
  42. #include "SchM_Mcu.h"
  43. #ifdef MCAL_TESTING_ENVIRONMENT
  44. #include "EUnit.h" /* EUnit Test Suite */
  45. #endif
  46. /*==================================================================================================
  47. * SOURCE FILE VERSION INFORMATION
  48. ==================================================================================================*/
  49. #define SCHM_MCU_AR_RELEASE_MAJOR_VERSION_C 4
  50. #define SCHM_MCU_AR_RELEASE_MINOR_VERSION_C 4
  51. #define SCHM_MCU_AR_RELEASE_REVISION_VERSION_C 0
  52. #define SCHM_MCU_SW_MAJOR_VERSION_C 1
  53. #define SCHM_MCU_SW_MINOR_VERSION_C 0
  54. #define SCHM_MCU_SW_PATCH_VERSION_C 0
  55. /*==================================================================================================
  56. * LOCAL CONSTANTS
  57. ==================================================================================================*/
  58. #ifdef MCAL_PLATFORM_ARM
  59. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  60. #define ISR_STATE_MASK ((uint32)0x00000002UL) /**< @brief DAIF bit I and F */
  61. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  62. #define ISR_STATE_MASK ((uint32)0x00000080UL) /**< @brief CPSR bit I */
  63. #else
  64. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  65. #define ISR_STATE_MASK ((uint32)0x000000FFUL) /**< @brief BASEPRI[7:0] mask */
  66. #else
  67. #define ISR_STATE_MASK ((uint32)0x00000001UL) /**< @brief PRIMASK bit 0 */
  68. #endif
  69. #endif
  70. #else
  71. #ifdef MCAL_PLATFORM_S12
  72. #define ISR_STATE_MASK ((uint32)0x00000010UL) /**< @brief I bit of CCR */
  73. #else
  74. #define ISR_STATE_MASK ((uint32)0x00008000UL) /**< @brief EE bit of MSR */
  75. #endif
  76. #endif
  77. /*==================================================================================================
  78. * LOCAL MACROS
  79. ==================================================================================================*/
  80. #ifdef MCAL_PLATFORM_ARM
  81. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  82. #define ISR_ON(msr) (uint32)(((uint32)(msr) & (uint32)(ISR_STATE_MASK)) != (uint32)3)
  83. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  84. #define ISR_ON(msr) (uint32)(((uint32)(msr) & (uint32)(ISR_STATE_MASK)) != (uint32)(ISR_STATE_MASK))
  85. #else
  86. #define ISR_ON(msr) (uint32)(((uint32)(msr) & (uint32)(ISR_STATE_MASK)) == (uint32)0)
  87. #endif
  88. #else
  89. #ifdef MCAL_PLATFORM_S12
  90. #define ISR_ON(msr) (uint32)(((uint32)(msr) & (uint32)(ISR_STATE_MASK)) == (uint32)0)
  91. #else
  92. #define ISR_ON(msr) (uint32)((uint32)(msr) & (uint32)(ISR_STATE_MASK))
  93. #endif
  94. #endif
  95. /*==================================================================================================
  96. * FILE VERSION CHECKS
  97. ==================================================================================================*/
  98. /*==================================================================================================
  99. * LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
  100. ==================================================================================================*/
  101. /*==================================================================================================
  102. * LOCAL VARIABLES
  103. ==================================================================================================*/
  104. #define RTE_START_SEC_VAR_CLEARED_32_NO_CACHEABLE
  105. #include "Rte_MemMap.h"
  106. static volatile uint32 msr_MCU_EXCLUSIVE_AREA_00[NUMBER_OF_CORES];
  107. static volatile uint32 reentry_guard_MCU_EXCLUSIVE_AREA_00[NUMBER_OF_CORES];
  108. static volatile uint32 msr_MCU_EXCLUSIVE_AREA_01[NUMBER_OF_CORES];
  109. static volatile uint32 reentry_guard_MCU_EXCLUSIVE_AREA_01[NUMBER_OF_CORES];
  110. static volatile uint32 msr_MCU_EXCLUSIVE_AREA_02[NUMBER_OF_CORES];
  111. static volatile uint32 reentry_guard_MCU_EXCLUSIVE_AREA_02[NUMBER_OF_CORES];
  112. #define RTE_STOP_SEC_VAR_CLEARED_32_NO_CACHEABLE
  113. #include "Rte_MemMap.h"
  114. /*==================================================================================================
  115. * GLOBAL CONSTANTS
  116. ==================================================================================================*/
  117. /*==================================================================================================
  118. * GLOBAL VARIABLES
  119. ==================================================================================================*/
  120. /*==================================================================================================
  121. * LOCAL FUNCTION PROTOTYPES
  122. ==================================================================================================*/
  123. #ifndef _COSMIC_C_S32K1XX_
  124. /*================================================================================================*/
  125. /**
  126. * @brief This function returns the MSR register value (32 bits).
  127. * @details This function returns the MSR register value (32 bits).
  128. *
  129. * @param[in] void No input parameters
  130. * @return uint32 msr This function returns the MSR register value (32 bits).
  131. *
  132. * @pre None
  133. * @post None
  134. *
  135. */
  136. uint32 Mcu_schm_read_msr(void);
  137. #endif /*ifndef _COSMIC_C_S32K1XX_*/
  138. /*==================================================================================================
  139. * LOCAL FUNCTIONS
  140. ==================================================================================================*/
  141. #define RTE_START_SEC_CODE
  142. #include "Rte_MemMap.h"
  143. #if (defined(_GREENHILLS_C_S32K1XX_) || defined(_CODEWARRIOR_C_S32K1XX_))
  144. /*================================================================================================*/
  145. /**
  146. * @brief This macro returns the MSR register value (32 bits).
  147. * @details This macro function implementation returns the MSR register value in r3 (32 bits).
  148. *
  149. * @pre None
  150. * @post None
  151. *
  152. */
  153. #ifdef MCAL_PLATFORM_ARM
  154. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  155. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  156. {
  157. mrs x0, S3_3_c4_c2_1
  158. }
  159. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  160. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  161. {
  162. mrs r0, CPSR
  163. }
  164. #else
  165. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  166. {
  167. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  168. mrs r0, BASEPRI
  169. #else
  170. mrs r0, PRIMASK
  171. #endif
  172. }
  173. #endif
  174. #else
  175. #ifdef MCAL_PLATFORM_S12
  176. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  177. {
  178. tfr ccr, d6
  179. }
  180. #else
  181. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  182. {
  183. mfmsr r3
  184. }
  185. #endif
  186. #endif
  187. #endif /*#ifdef GHS||CW*/
  188. #ifdef _DIABDATA_C_S32K1XX_
  189. /**
  190. * @brief This function returns the MSR register value (32 bits).
  191. * @details This function returns the MSR register value (32 bits).
  192. *
  193. * @param[in] void No input parameters
  194. * @return uint32 msr This function returns the MSR register value (32 bits).
  195. *
  196. * @pre None
  197. * @post None
  198. *
  199. */
  200. #ifdef MCAL_PLATFORM_ARM
  201. uint32 Mcu_schm_read_msr(void)
  202. {
  203. register uint32 reg_tmp;
  204. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  205. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  206. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  207. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  208. #else
  209. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  210. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  211. #else
  212. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  213. #endif
  214. #endif
  215. return (uint32)reg_tmp;
  216. }
  217. #else
  218. ASM_KEYWORD uint32 Mcu_schm_read_msr(void)
  219. {
  220. mfmsr r3
  221. }
  222. #endif /* MCAL_PLATFORM_ARM */
  223. #endif /* _DIABDATA_C_S32K1XX_*/
  224. #ifdef _COSMIC_C_S32K1XX_
  225. /*================================================================================================*/
  226. /**
  227. * @brief This function returns the MSR register value (32 bits).
  228. * @details This function returns the MSR register value (32 bits).
  229. *
  230. * @param[in] void No input parameters
  231. * @return uint32 msr This function returns the MSR register value (32 bits).
  232. *
  233. * @pre None
  234. * @post None
  235. *
  236. */
  237. #ifdef MCAL_PLATFORM_S12
  238. #define Mcu_schm_read_msr() ASM_KEYWORD("tfr ccr, d6")
  239. #else
  240. #define Mcu_schm_read_msr() ASM_KEYWORD("mfmsr r3")
  241. #endif
  242. #endif /*Cosmic compiler only*/
  243. #ifdef _HITECH_C_S32K1XX_
  244. /*================================================================================================*/
  245. /**
  246. * @brief This function returns the MSR register value (32 bits).
  247. * @details This function returns the MSR register value (32 bits).
  248. *
  249. * @param[in] void No input parameters
  250. * @return uint32 msr This function returns the MSR register value (32 bits).
  251. *
  252. * @pre None
  253. * @post None
  254. *
  255. */
  256. uint32 Mcu_schm_read_msr(void)
  257. {
  258. uint32 result;
  259. __asm volatile("mfmsr %0" : "=r" (result) :);
  260. return result;
  261. }
  262. #endif /*HighTec compiler only*/
  263. /*================================================================================================*/
  264. #ifdef _LINARO_C_S32K1XX_
  265. /**
  266. * @brief This function returns the MSR register value (32 bits).
  267. * @details This function returns the MSR register value (32 bits).
  268. *
  269. * @param[in] void No input parameters
  270. * @return uint32 msr This function returns the MSR register value (32 bits).
  271. *
  272. * @pre None
  273. * @post None
  274. *
  275. */
  276. uint32 Mcu_schm_read_msr(void)
  277. {
  278. register uint32 reg_tmp;
  279. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  280. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  281. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  282. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  283. #else
  284. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  285. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  286. #else
  287. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  288. #endif
  289. #endif
  290. return (uint32)reg_tmp;
  291. }
  292. #endif /* _LINARO_C_S32K1XX_*/
  293. /*================================================================================================*/
  294. #ifdef _ARM_DS5_C_S32K1XX_
  295. /**
  296. * @brief This function returns the MSR register value (32 bits).
  297. * @details This function returns the MSR register value (32 bits).
  298. *
  299. * @param[in] void No input parameters
  300. * @return uint32 msr This function returns the MSR register value (32 bits).
  301. *
  302. * @pre None
  303. * @post None
  304. *
  305. */
  306. uint32 Mcu_schm_read_msr(void)
  307. {
  308. register uint32 reg_tmp;
  309. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  310. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  311. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  312. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  313. #else
  314. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  315. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  316. #else
  317. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  318. #endif
  319. #endif
  320. return (uint32)reg_tmp;
  321. }
  322. #endif /* _ARM_DS5_C_S32K1XX_ */
  323. #ifdef _IAR_C_S32K1XX_
  324. /**
  325. * @brief This function returns the MSR register value (32 bits).
  326. * @details This function returns the MSR register value (32 bits).
  327. *
  328. * @param[in] void No input parameters
  329. * @return uint32 msr This function returns the MSR register value (32 bits).
  330. *
  331. * @pre None
  332. * @post None
  333. *
  334. */
  335. uint32 Mcu_schm_read_msr(void)
  336. {
  337. register uint32 reg_tmp;
  338. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  339. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  340. #else
  341. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  342. #endif
  343. return (uint32)reg_tmp;
  344. }
  345. #endif /* _IAR_C_S32K1XX_ */
  346. #define RTE_STOP_SEC_CODE
  347. #include "Rte_MemMap.h"
  348. /*==================================================================================================
  349. * GLOBAL FUNCTIONS
  350. ==================================================================================================*/
  351. #define RTE_START_SEC_CODE
  352. #include "Rte_MemMap.h"
  353. void SchM_Enter_Mcu_MCU_EXCLUSIVE_AREA_00(void)
  354. {
  355. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  356. if(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId])
  357. {
  358. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  359. msr_MCU_EXCLUSIVE_AREA_00[u32CoreId] = OsIf_Trusted_Call_Return(Mcu_schm_read_msr);
  360. #else
  361. msr_MCU_EXCLUSIVE_AREA_00[u32CoreId] = Mcu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  362. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  363. if (ISR_ON(msr_MCU_EXCLUSIVE_AREA_00[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  364. {
  365. OsIf_SuspendAllInterrupts();
  366. #ifdef _ARM_DS5_C_S32K1XX_
  367. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  368. #endif
  369. }
  370. }
  371. reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId]++;
  372. }
  373. void SchM_Exit_Mcu_MCU_EXCLUSIVE_AREA_00(void)
  374. {
  375. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  376. reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId]--;
  377. if ((ISR_ON(msr_MCU_EXCLUSIVE_AREA_00[u32CoreId]))&&(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId])) /*if interrupts were enabled*/
  378. {
  379. OsIf_ResumeAllInterrupts();
  380. #ifdef _ARM_DS5_C_S32K1XX_
  381. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  382. #endif
  383. }
  384. }
  385. void SchM_Enter_Mcu_MCU_EXCLUSIVE_AREA_01(void)
  386. {
  387. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  388. if(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId])
  389. {
  390. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  391. msr_MCU_EXCLUSIVE_AREA_01[u32CoreId] = OsIf_Trusted_Call_Return(Mcu_schm_read_msr);
  392. #else
  393. msr_MCU_EXCLUSIVE_AREA_01[u32CoreId] = Mcu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  394. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  395. if (ISR_ON(msr_MCU_EXCLUSIVE_AREA_01[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  396. {
  397. OsIf_SuspendAllInterrupts();
  398. #ifdef _ARM_DS5_C_S32K1XX_
  399. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  400. #endif
  401. }
  402. }
  403. reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId]++;
  404. }
  405. void SchM_Exit_Mcu_MCU_EXCLUSIVE_AREA_01(void)
  406. {
  407. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  408. reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId]--;
  409. if ((ISR_ON(msr_MCU_EXCLUSIVE_AREA_01[u32CoreId]))&&(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId])) /*if interrupts were enabled*/
  410. {
  411. OsIf_ResumeAllInterrupts();
  412. #ifdef _ARM_DS5_C_S32K1XX_
  413. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  414. #endif
  415. }
  416. }
  417. void SchM_Enter_Mcu_MCU_EXCLUSIVE_AREA_02(void)
  418. {
  419. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  420. if(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId])
  421. {
  422. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  423. msr_MCU_EXCLUSIVE_AREA_02[u32CoreId] = OsIf_Trusted_Call_Return(Mcu_schm_read_msr);
  424. #else
  425. msr_MCU_EXCLUSIVE_AREA_02[u32CoreId] = Mcu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  426. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  427. if (ISR_ON(msr_MCU_EXCLUSIVE_AREA_02[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  428. {
  429. OsIf_SuspendAllInterrupts();
  430. #ifdef _ARM_DS5_C_S32K1XX_
  431. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  432. #endif
  433. }
  434. }
  435. reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId]++;
  436. }
  437. void SchM_Exit_Mcu_MCU_EXCLUSIVE_AREA_02(void)
  438. {
  439. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  440. reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId]--;
  441. if ((ISR_ON(msr_MCU_EXCLUSIVE_AREA_02[u32CoreId]))&&(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId])) /*if interrupts were enabled*/
  442. {
  443. OsIf_ResumeAllInterrupts();
  444. #ifdef _ARM_DS5_C_S32K1XX_
  445. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  446. #endif
  447. }
  448. }
  449. #ifdef MCAL_TESTING_ENVIRONMENT
  450. /**
  451. @brief This function checks that all entered exclusive areas were also exited.
  452. @details This function checks that all entered exclusive areas were also exited. The check
  453. is done by verifying that all reentry_guard_* static variables are back to the
  454. zero value.
  455. @param[in] void No input parameters
  456. @return void This function does not return a value. Test asserts are used instead.
  457. @pre None
  458. @post None
  459. @remarks Covers
  460. @remarks Implements
  461. */
  462. void SchM_Check_mcu(void)
  463. {
  464. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  465. EU_ASSERT(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId]);
  466. reentry_guard_MCU_EXCLUSIVE_AREA_00[u32CoreId] = 0UL; /*reset reentry_guard_MCU_EXCLUSIVE_AREA_00 for the next test in the suite*/
  467. EU_ASSERT(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId]);
  468. reentry_guard_MCU_EXCLUSIVE_AREA_01[u32CoreId] = 0UL; /*reset reentry_guard_MCU_EXCLUSIVE_AREA_01 for the next test in the suite*/
  469. EU_ASSERT(0UL == reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId]);
  470. reentry_guard_MCU_EXCLUSIVE_AREA_02[u32CoreId] = 0UL; /*reset reentry_guard_MCU_EXCLUSIVE_AREA_02 for the next test in the suite*/
  471. }
  472. #endif /*MCAL_TESTING_ENVIRONMENT*/
  473. #define RTE_STOP_SEC_CODE
  474. #include "Rte_MemMap.h"
  475. #ifdef __cplusplus
  476. }
  477. #endif
  478. /** @} */