SchM_Icu.c 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172
  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_Icu.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_ICU_AR_RELEASE_MAJOR_VERSION_C 4
  50. #define SCHM_ICU_AR_RELEASE_MINOR_VERSION_C 4
  51. #define SCHM_ICU_AR_RELEASE_REVISION_VERSION_C 0
  52. #define SCHM_ICU_SW_MAJOR_VERSION_C 1
  53. #define SCHM_ICU_SW_MINOR_VERSION_C 0
  54. #define SCHM_ICU_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_ICU_EXCLUSIVE_AREA_00[NUMBER_OF_CORES];
  107. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_00[NUMBER_OF_CORES];
  108. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_01[NUMBER_OF_CORES];
  109. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_01[NUMBER_OF_CORES];
  110. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_02[NUMBER_OF_CORES];
  111. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_02[NUMBER_OF_CORES];
  112. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_03[NUMBER_OF_CORES];
  113. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_03[NUMBER_OF_CORES];
  114. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_04[NUMBER_OF_CORES];
  115. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_04[NUMBER_OF_CORES];
  116. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_05[NUMBER_OF_CORES];
  117. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_05[NUMBER_OF_CORES];
  118. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_06[NUMBER_OF_CORES];
  119. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_06[NUMBER_OF_CORES];
  120. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_07[NUMBER_OF_CORES];
  121. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_07[NUMBER_OF_CORES];
  122. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_08[NUMBER_OF_CORES];
  123. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_08[NUMBER_OF_CORES];
  124. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_09[NUMBER_OF_CORES];
  125. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_09[NUMBER_OF_CORES];
  126. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_11[NUMBER_OF_CORES];
  127. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_11[NUMBER_OF_CORES];
  128. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_15[NUMBER_OF_CORES];
  129. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_15[NUMBER_OF_CORES];
  130. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_16[NUMBER_OF_CORES];
  131. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_16[NUMBER_OF_CORES];
  132. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_17[NUMBER_OF_CORES];
  133. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_17[NUMBER_OF_CORES];
  134. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_18[NUMBER_OF_CORES];
  135. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_18[NUMBER_OF_CORES];
  136. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_19[NUMBER_OF_CORES];
  137. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_19[NUMBER_OF_CORES];
  138. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_20[NUMBER_OF_CORES];
  139. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_20[NUMBER_OF_CORES];
  140. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_21[NUMBER_OF_CORES];
  141. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_21[NUMBER_OF_CORES];
  142. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_22[NUMBER_OF_CORES];
  143. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_22[NUMBER_OF_CORES];
  144. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_23[NUMBER_OF_CORES];
  145. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_23[NUMBER_OF_CORES];
  146. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_24[NUMBER_OF_CORES];
  147. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_24[NUMBER_OF_CORES];
  148. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_25[NUMBER_OF_CORES];
  149. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_25[NUMBER_OF_CORES];
  150. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_26[NUMBER_OF_CORES];
  151. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_26[NUMBER_OF_CORES];
  152. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_27[NUMBER_OF_CORES];
  153. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_27[NUMBER_OF_CORES];
  154. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_28[NUMBER_OF_CORES];
  155. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_28[NUMBER_OF_CORES];
  156. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_29[NUMBER_OF_CORES];
  157. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_29[NUMBER_OF_CORES];
  158. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_30[NUMBER_OF_CORES];
  159. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_30[NUMBER_OF_CORES];
  160. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_31[NUMBER_OF_CORES];
  161. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_31[NUMBER_OF_CORES];
  162. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_32[NUMBER_OF_CORES];
  163. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_32[NUMBER_OF_CORES];
  164. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_33[NUMBER_OF_CORES];
  165. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_33[NUMBER_OF_CORES];
  166. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_44[NUMBER_OF_CORES];
  167. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_44[NUMBER_OF_CORES];
  168. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_45[NUMBER_OF_CORES];
  169. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_45[NUMBER_OF_CORES];
  170. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_46[NUMBER_OF_CORES];
  171. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_46[NUMBER_OF_CORES];
  172. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_47[NUMBER_OF_CORES];
  173. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_47[NUMBER_OF_CORES];
  174. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_48[NUMBER_OF_CORES];
  175. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_48[NUMBER_OF_CORES];
  176. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_49[NUMBER_OF_CORES];
  177. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_49[NUMBER_OF_CORES];
  178. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_50[NUMBER_OF_CORES];
  179. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_50[NUMBER_OF_CORES];
  180. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_51[NUMBER_OF_CORES];
  181. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_51[NUMBER_OF_CORES];
  182. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_52[NUMBER_OF_CORES];
  183. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_52[NUMBER_OF_CORES];
  184. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_53[NUMBER_OF_CORES];
  185. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_53[NUMBER_OF_CORES];
  186. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_57[NUMBER_OF_CORES];
  187. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_57[NUMBER_OF_CORES];
  188. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_58[NUMBER_OF_CORES];
  189. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_58[NUMBER_OF_CORES];
  190. static volatile uint32 msr_ICU_EXCLUSIVE_AREA_59[NUMBER_OF_CORES];
  191. static volatile uint32 reentry_guard_ICU_EXCLUSIVE_AREA_59[NUMBER_OF_CORES];
  192. #define RTE_STOP_SEC_VAR_CLEARED_32_NO_CACHEABLE
  193. #include "Rte_MemMap.h"
  194. /*==================================================================================================
  195. * GLOBAL CONSTANTS
  196. ==================================================================================================*/
  197. /*==================================================================================================
  198. * GLOBAL VARIABLES
  199. ==================================================================================================*/
  200. /*==================================================================================================
  201. * LOCAL FUNCTION PROTOTYPES
  202. ==================================================================================================*/
  203. #ifndef _COSMIC_C_S32K1XX_
  204. /*================================================================================================*/
  205. /**
  206. * @brief This function returns the MSR register value (32 bits).
  207. * @details This function returns the MSR register value (32 bits).
  208. *
  209. * @param[in] void No input parameters
  210. * @return uint32 msr This function returns the MSR register value (32 bits).
  211. *
  212. * @pre None
  213. * @post None
  214. *
  215. */
  216. uint32 Icu_schm_read_msr(void);
  217. #endif /*ifndef _COSMIC_C_S32K1XX_*/
  218. /*==================================================================================================
  219. * LOCAL FUNCTIONS
  220. ==================================================================================================*/
  221. #define RTE_START_SEC_CODE
  222. #include "Rte_MemMap.h"
  223. #if (defined(_GREENHILLS_C_S32K1XX_) || defined(_CODEWARRIOR_C_S32K1XX_))
  224. /*================================================================================================*/
  225. /**
  226. * @brief This macro returns the MSR register value (32 bits).
  227. * @details This macro function implementation returns the MSR register value in r3 (32 bits).
  228. *
  229. * @pre None
  230. * @post None
  231. *
  232. */
  233. #ifdef MCAL_PLATFORM_ARM
  234. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  235. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  236. {
  237. mrs x0, S3_3_c4_c2_1
  238. }
  239. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  240. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  241. {
  242. mrs r0, CPSR
  243. }
  244. #else
  245. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  246. {
  247. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  248. mrs r0, BASEPRI
  249. #else
  250. mrs r0, PRIMASK
  251. #endif
  252. }
  253. #endif
  254. #else
  255. #ifdef MCAL_PLATFORM_S12
  256. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  257. {
  258. tfr ccr, d6
  259. }
  260. #else
  261. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  262. {
  263. mfmsr r3
  264. }
  265. #endif
  266. #endif
  267. #endif /*#ifdef GHS||CW*/
  268. #ifdef _DIABDATA_C_S32K1XX_
  269. /**
  270. * @brief This function returns the MSR register value (32 bits).
  271. * @details This function returns the MSR register value (32 bits).
  272. *
  273. * @param[in] void No input parameters
  274. * @return uint32 msr This function returns the MSR register value (32 bits).
  275. *
  276. * @pre None
  277. * @post None
  278. *
  279. */
  280. #ifdef MCAL_PLATFORM_ARM
  281. uint32 Icu_schm_read_msr(void)
  282. {
  283. register uint32 reg_tmp;
  284. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  285. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  286. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  287. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  288. #else
  289. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  290. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  291. #else
  292. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  293. #endif
  294. #endif
  295. return (uint32)reg_tmp;
  296. }
  297. #else
  298. ASM_KEYWORD uint32 Icu_schm_read_msr(void)
  299. {
  300. mfmsr r3
  301. }
  302. #endif /* MCAL_PLATFORM_ARM */
  303. #endif /* _DIABDATA_C_S32K1XX_*/
  304. #ifdef _COSMIC_C_S32K1XX_
  305. /*================================================================================================*/
  306. /**
  307. * @brief This function returns the MSR register value (32 bits).
  308. * @details This function returns the MSR register value (32 bits).
  309. *
  310. * @param[in] void No input parameters
  311. * @return uint32 msr This function returns the MSR register value (32 bits).
  312. *
  313. * @pre None
  314. * @post None
  315. *
  316. */
  317. #ifdef MCAL_PLATFORM_S12
  318. #define Icu_schm_read_msr() ASM_KEYWORD("tfr ccr, d6")
  319. #else
  320. #define Icu_schm_read_msr() ASM_KEYWORD("mfmsr r3")
  321. #endif
  322. #endif /*Cosmic compiler only*/
  323. #ifdef _HITECH_C_S32K1XX_
  324. /*================================================================================================*/
  325. /**
  326. * @brief This function returns the MSR register value (32 bits).
  327. * @details This function returns the MSR register value (32 bits).
  328. *
  329. * @param[in] void No input parameters
  330. * @return uint32 msr This function returns the MSR register value (32 bits).
  331. *
  332. * @pre None
  333. * @post None
  334. *
  335. */
  336. uint32 Icu_schm_read_msr(void)
  337. {
  338. uint32 result;
  339. __asm volatile("mfmsr %0" : "=r" (result) :);
  340. return result;
  341. }
  342. #endif /*HighTec compiler only*/
  343. /*================================================================================================*/
  344. #ifdef _LINARO_C_S32K1XX_
  345. /**
  346. * @brief This function returns the MSR register value (32 bits).
  347. * @details This function returns the MSR register value (32 bits).
  348. *
  349. * @param[in] void No input parameters
  350. * @return uint32 msr This function returns the MSR register value (32 bits).
  351. *
  352. * @pre None
  353. * @post None
  354. *
  355. */
  356. uint32 Icu_schm_read_msr(void)
  357. {
  358. register uint32 reg_tmp;
  359. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  360. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  361. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  362. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  363. #else
  364. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  365. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  366. #else
  367. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  368. #endif
  369. #endif
  370. return (uint32)reg_tmp;
  371. }
  372. #endif /* _LINARO_C_S32K1XX_*/
  373. /*================================================================================================*/
  374. #ifdef _ARM_DS5_C_S32K1XX_
  375. /**
  376. * @brief This function returns the MSR register value (32 bits).
  377. * @details This function returns the MSR register value (32 bits).
  378. *
  379. * @param[in] void No input parameters
  380. * @return uint32 msr This function returns the MSR register value (32 bits).
  381. *
  382. * @pre None
  383. * @post None
  384. *
  385. */
  386. uint32 Icu_schm_read_msr(void)
  387. {
  388. register uint32 reg_tmp;
  389. #if (MCAL_PLATFORM_ARM == MCAL_ARM_AARCH64)
  390. __asm volatile( " mrs %x0, DAIF " : "=r" (reg_tmp) );
  391. #elif (MCAL_PLATFORM_ARM == MCAL_ARM_RARCH)
  392. __asm volatile( " mrs %0, CPSR " : "=r" (reg_tmp) );
  393. #else
  394. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  395. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  396. #else
  397. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  398. #endif
  399. #endif
  400. return (uint32)reg_tmp;
  401. }
  402. #endif /* _ARM_DS5_C_S32K1XX_ */
  403. #ifdef _IAR_C_S32K1XX_
  404. /**
  405. * @brief This function returns the MSR register value (32 bits).
  406. * @details This function returns the MSR register value (32 bits).
  407. *
  408. * @param[in] void No input parameters
  409. * @return uint32 msr This function returns the MSR register value (32 bits).
  410. *
  411. * @pre None
  412. * @post None
  413. *
  414. */
  415. uint32 Icu_schm_read_msr(void)
  416. {
  417. register uint32 reg_tmp;
  418. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  419. __asm volatile( " mrs %0, basepri " : "=r" (reg_tmp) );
  420. #else
  421. __asm volatile( " mrs %0, primask " : "=r" (reg_tmp) );
  422. #endif
  423. return (uint32)reg_tmp;
  424. }
  425. #endif /* _IAR_C_S32K1XX_ */
  426. #define RTE_STOP_SEC_CODE
  427. #include "Rte_MemMap.h"
  428. /*==================================================================================================
  429. * GLOBAL FUNCTIONS
  430. ==================================================================================================*/
  431. #define RTE_START_SEC_CODE
  432. #include "Rte_MemMap.h"
  433. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_00(void)
  434. {
  435. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  436. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId])
  437. {
  438. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  439. msr_ICU_EXCLUSIVE_AREA_00[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  440. #else
  441. msr_ICU_EXCLUSIVE_AREA_00[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  442. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  443. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_00[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  444. {
  445. OsIf_SuspendAllInterrupts();
  446. #ifdef _ARM_DS5_C_S32K1XX_
  447. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  448. #endif
  449. }
  450. }
  451. reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId]++;
  452. }
  453. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_00(void)
  454. {
  455. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  456. reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId]--;
  457. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_00[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId])) /*if interrupts were enabled*/
  458. {
  459. OsIf_ResumeAllInterrupts();
  460. #ifdef _ARM_DS5_C_S32K1XX_
  461. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  462. #endif
  463. }
  464. }
  465. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_01(void)
  466. {
  467. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  468. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId])
  469. {
  470. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  471. msr_ICU_EXCLUSIVE_AREA_01[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  472. #else
  473. msr_ICU_EXCLUSIVE_AREA_01[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  474. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  475. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_01[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  476. {
  477. OsIf_SuspendAllInterrupts();
  478. #ifdef _ARM_DS5_C_S32K1XX_
  479. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  480. #endif
  481. }
  482. }
  483. reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId]++;
  484. }
  485. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_01(void)
  486. {
  487. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  488. reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId]--;
  489. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_01[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId])) /*if interrupts were enabled*/
  490. {
  491. OsIf_ResumeAllInterrupts();
  492. #ifdef _ARM_DS5_C_S32K1XX_
  493. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  494. #endif
  495. }
  496. }
  497. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_02(void)
  498. {
  499. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  500. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId])
  501. {
  502. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  503. msr_ICU_EXCLUSIVE_AREA_02[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  504. #else
  505. msr_ICU_EXCLUSIVE_AREA_02[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  506. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  507. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_02[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  508. {
  509. OsIf_SuspendAllInterrupts();
  510. #ifdef _ARM_DS5_C_S32K1XX_
  511. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  512. #endif
  513. }
  514. }
  515. reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId]++;
  516. }
  517. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_02(void)
  518. {
  519. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  520. reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId]--;
  521. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_02[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId])) /*if interrupts were enabled*/
  522. {
  523. OsIf_ResumeAllInterrupts();
  524. #ifdef _ARM_DS5_C_S32K1XX_
  525. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  526. #endif
  527. }
  528. }
  529. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_03(void)
  530. {
  531. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  532. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId])
  533. {
  534. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  535. msr_ICU_EXCLUSIVE_AREA_03[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  536. #else
  537. msr_ICU_EXCLUSIVE_AREA_03[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  538. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  539. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_03[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  540. {
  541. OsIf_SuspendAllInterrupts();
  542. #ifdef _ARM_DS5_C_S32K1XX_
  543. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  544. #endif
  545. }
  546. }
  547. reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId]++;
  548. }
  549. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_03(void)
  550. {
  551. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  552. reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId]--;
  553. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_03[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId])) /*if interrupts were enabled*/
  554. {
  555. OsIf_ResumeAllInterrupts();
  556. #ifdef _ARM_DS5_C_S32K1XX_
  557. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  558. #endif
  559. }
  560. }
  561. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_04(void)
  562. {
  563. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  564. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId])
  565. {
  566. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  567. msr_ICU_EXCLUSIVE_AREA_04[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  568. #else
  569. msr_ICU_EXCLUSIVE_AREA_04[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  570. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  571. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_04[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  572. {
  573. OsIf_SuspendAllInterrupts();
  574. #ifdef _ARM_DS5_C_S32K1XX_
  575. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  576. #endif
  577. }
  578. }
  579. reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId]++;
  580. }
  581. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_04(void)
  582. {
  583. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  584. reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId]--;
  585. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_04[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId])) /*if interrupts were enabled*/
  586. {
  587. OsIf_ResumeAllInterrupts();
  588. #ifdef _ARM_DS5_C_S32K1XX_
  589. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  590. #endif
  591. }
  592. }
  593. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_05(void)
  594. {
  595. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  596. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId])
  597. {
  598. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  599. msr_ICU_EXCLUSIVE_AREA_05[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  600. #else
  601. msr_ICU_EXCLUSIVE_AREA_05[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  602. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  603. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_05[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  604. {
  605. OsIf_SuspendAllInterrupts();
  606. #ifdef _ARM_DS5_C_S32K1XX_
  607. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  608. #endif
  609. }
  610. }
  611. reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId]++;
  612. }
  613. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_05(void)
  614. {
  615. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  616. reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId]--;
  617. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_05[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId])) /*if interrupts were enabled*/
  618. {
  619. OsIf_ResumeAllInterrupts();
  620. #ifdef _ARM_DS5_C_S32K1XX_
  621. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  622. #endif
  623. }
  624. }
  625. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_06(void)
  626. {
  627. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  628. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId])
  629. {
  630. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  631. msr_ICU_EXCLUSIVE_AREA_06[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  632. #else
  633. msr_ICU_EXCLUSIVE_AREA_06[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  634. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  635. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_06[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  636. {
  637. OsIf_SuspendAllInterrupts();
  638. #ifdef _ARM_DS5_C_S32K1XX_
  639. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  640. #endif
  641. }
  642. }
  643. reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId]++;
  644. }
  645. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_06(void)
  646. {
  647. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  648. reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId]--;
  649. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_06[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId])) /*if interrupts were enabled*/
  650. {
  651. OsIf_ResumeAllInterrupts();
  652. #ifdef _ARM_DS5_C_S32K1XX_
  653. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  654. #endif
  655. }
  656. }
  657. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_07(void)
  658. {
  659. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  660. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId])
  661. {
  662. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  663. msr_ICU_EXCLUSIVE_AREA_07[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  664. #else
  665. msr_ICU_EXCLUSIVE_AREA_07[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  666. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  667. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_07[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  668. {
  669. OsIf_SuspendAllInterrupts();
  670. #ifdef _ARM_DS5_C_S32K1XX_
  671. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  672. #endif
  673. }
  674. }
  675. reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId]++;
  676. }
  677. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_07(void)
  678. {
  679. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  680. reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId]--;
  681. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_07[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId])) /*if interrupts were enabled*/
  682. {
  683. OsIf_ResumeAllInterrupts();
  684. #ifdef _ARM_DS5_C_S32K1XX_
  685. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  686. #endif
  687. }
  688. }
  689. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_08(void)
  690. {
  691. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  692. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId])
  693. {
  694. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  695. msr_ICU_EXCLUSIVE_AREA_08[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  696. #else
  697. msr_ICU_EXCLUSIVE_AREA_08[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  698. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  699. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_08[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  700. {
  701. OsIf_SuspendAllInterrupts();
  702. #ifdef _ARM_DS5_C_S32K1XX_
  703. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  704. #endif
  705. }
  706. }
  707. reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId]++;
  708. }
  709. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_08(void)
  710. {
  711. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  712. reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId]--;
  713. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_08[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId])) /*if interrupts were enabled*/
  714. {
  715. OsIf_ResumeAllInterrupts();
  716. #ifdef _ARM_DS5_C_S32K1XX_
  717. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  718. #endif
  719. }
  720. }
  721. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_09(void)
  722. {
  723. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  724. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId])
  725. {
  726. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  727. msr_ICU_EXCLUSIVE_AREA_09[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  728. #else
  729. msr_ICU_EXCLUSIVE_AREA_09[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  730. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  731. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_09[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  732. {
  733. OsIf_SuspendAllInterrupts();
  734. #ifdef _ARM_DS5_C_S32K1XX_
  735. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  736. #endif
  737. }
  738. }
  739. reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId]++;
  740. }
  741. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_09(void)
  742. {
  743. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  744. reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId]--;
  745. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_09[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId])) /*if interrupts were enabled*/
  746. {
  747. OsIf_ResumeAllInterrupts();
  748. #ifdef _ARM_DS5_C_S32K1XX_
  749. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  750. #endif
  751. }
  752. }
  753. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_11(void)
  754. {
  755. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  756. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId])
  757. {
  758. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  759. msr_ICU_EXCLUSIVE_AREA_11[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  760. #else
  761. msr_ICU_EXCLUSIVE_AREA_11[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  762. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  763. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_11[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  764. {
  765. OsIf_SuspendAllInterrupts();
  766. #ifdef _ARM_DS5_C_S32K1XX_
  767. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  768. #endif
  769. }
  770. }
  771. reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId]++;
  772. }
  773. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_11(void)
  774. {
  775. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  776. reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId]--;
  777. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_11[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId])) /*if interrupts were enabled*/
  778. {
  779. OsIf_ResumeAllInterrupts();
  780. #ifdef _ARM_DS5_C_S32K1XX_
  781. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  782. #endif
  783. }
  784. }
  785. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_15(void)
  786. {
  787. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  788. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId])
  789. {
  790. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  791. msr_ICU_EXCLUSIVE_AREA_15[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  792. #else
  793. msr_ICU_EXCLUSIVE_AREA_15[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  794. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  795. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_15[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  796. {
  797. OsIf_SuspendAllInterrupts();
  798. #ifdef _ARM_DS5_C_S32K1XX_
  799. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  800. #endif
  801. }
  802. }
  803. reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId]++;
  804. }
  805. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_15(void)
  806. {
  807. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  808. reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId]--;
  809. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_15[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId])) /*if interrupts were enabled*/
  810. {
  811. OsIf_ResumeAllInterrupts();
  812. #ifdef _ARM_DS5_C_S32K1XX_
  813. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  814. #endif
  815. }
  816. }
  817. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_16(void)
  818. {
  819. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  820. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId])
  821. {
  822. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  823. msr_ICU_EXCLUSIVE_AREA_16[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  824. #else
  825. msr_ICU_EXCLUSIVE_AREA_16[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  826. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  827. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_16[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  828. {
  829. OsIf_SuspendAllInterrupts();
  830. #ifdef _ARM_DS5_C_S32K1XX_
  831. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  832. #endif
  833. }
  834. }
  835. reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId]++;
  836. }
  837. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_16(void)
  838. {
  839. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  840. reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId]--;
  841. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_16[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId])) /*if interrupts were enabled*/
  842. {
  843. OsIf_ResumeAllInterrupts();
  844. #ifdef _ARM_DS5_C_S32K1XX_
  845. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  846. #endif
  847. }
  848. }
  849. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_17(void)
  850. {
  851. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  852. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId])
  853. {
  854. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  855. msr_ICU_EXCLUSIVE_AREA_17[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  856. #else
  857. msr_ICU_EXCLUSIVE_AREA_17[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  858. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  859. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_17[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  860. {
  861. OsIf_SuspendAllInterrupts();
  862. #ifdef _ARM_DS5_C_S32K1XX_
  863. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  864. #endif
  865. }
  866. }
  867. reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId]++;
  868. }
  869. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_17(void)
  870. {
  871. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  872. reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId]--;
  873. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_17[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId])) /*if interrupts were enabled*/
  874. {
  875. OsIf_ResumeAllInterrupts();
  876. #ifdef _ARM_DS5_C_S32K1XX_
  877. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  878. #endif
  879. }
  880. }
  881. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_18(void)
  882. {
  883. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  884. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId])
  885. {
  886. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  887. msr_ICU_EXCLUSIVE_AREA_18[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  888. #else
  889. msr_ICU_EXCLUSIVE_AREA_18[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  890. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  891. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_18[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  892. {
  893. OsIf_SuspendAllInterrupts();
  894. #ifdef _ARM_DS5_C_S32K1XX_
  895. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  896. #endif
  897. }
  898. }
  899. reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId]++;
  900. }
  901. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_18(void)
  902. {
  903. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  904. reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId]--;
  905. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_18[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId])) /*if interrupts were enabled*/
  906. {
  907. OsIf_ResumeAllInterrupts();
  908. #ifdef _ARM_DS5_C_S32K1XX_
  909. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  910. #endif
  911. }
  912. }
  913. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_19(void)
  914. {
  915. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  916. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId])
  917. {
  918. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  919. msr_ICU_EXCLUSIVE_AREA_19[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  920. #else
  921. msr_ICU_EXCLUSIVE_AREA_19[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  922. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  923. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_19[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  924. {
  925. OsIf_SuspendAllInterrupts();
  926. #ifdef _ARM_DS5_C_S32K1XX_
  927. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  928. #endif
  929. }
  930. }
  931. reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId]++;
  932. }
  933. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_19(void)
  934. {
  935. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  936. reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId]--;
  937. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_19[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId])) /*if interrupts were enabled*/
  938. {
  939. OsIf_ResumeAllInterrupts();
  940. #ifdef _ARM_DS5_C_S32K1XX_
  941. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  942. #endif
  943. }
  944. }
  945. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_20(void)
  946. {
  947. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  948. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId])
  949. {
  950. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  951. msr_ICU_EXCLUSIVE_AREA_20[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  952. #else
  953. msr_ICU_EXCLUSIVE_AREA_20[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  954. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  955. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_20[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  956. {
  957. OsIf_SuspendAllInterrupts();
  958. #ifdef _ARM_DS5_C_S32K1XX_
  959. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  960. #endif
  961. }
  962. }
  963. reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId]++;
  964. }
  965. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_20(void)
  966. {
  967. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  968. reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId]--;
  969. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_20[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId])) /*if interrupts were enabled*/
  970. {
  971. OsIf_ResumeAllInterrupts();
  972. #ifdef _ARM_DS5_C_S32K1XX_
  973. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  974. #endif
  975. }
  976. }
  977. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_21(void)
  978. {
  979. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  980. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId])
  981. {
  982. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  983. msr_ICU_EXCLUSIVE_AREA_21[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  984. #else
  985. msr_ICU_EXCLUSIVE_AREA_21[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  986. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  987. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_21[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  988. {
  989. OsIf_SuspendAllInterrupts();
  990. #ifdef _ARM_DS5_C_S32K1XX_
  991. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  992. #endif
  993. }
  994. }
  995. reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId]++;
  996. }
  997. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_21(void)
  998. {
  999. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1000. reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId]--;
  1001. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_21[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId])) /*if interrupts were enabled*/
  1002. {
  1003. OsIf_ResumeAllInterrupts();
  1004. #ifdef _ARM_DS5_C_S32K1XX_
  1005. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1006. #endif
  1007. }
  1008. }
  1009. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_22(void)
  1010. {
  1011. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1012. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId])
  1013. {
  1014. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1015. msr_ICU_EXCLUSIVE_AREA_22[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1016. #else
  1017. msr_ICU_EXCLUSIVE_AREA_22[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1018. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1019. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_22[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1020. {
  1021. OsIf_SuspendAllInterrupts();
  1022. #ifdef _ARM_DS5_C_S32K1XX_
  1023. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1024. #endif
  1025. }
  1026. }
  1027. reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId]++;
  1028. }
  1029. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_22(void)
  1030. {
  1031. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1032. reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId]--;
  1033. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_22[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId])) /*if interrupts were enabled*/
  1034. {
  1035. OsIf_ResumeAllInterrupts();
  1036. #ifdef _ARM_DS5_C_S32K1XX_
  1037. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1038. #endif
  1039. }
  1040. }
  1041. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_23(void)
  1042. {
  1043. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1044. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId])
  1045. {
  1046. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1047. msr_ICU_EXCLUSIVE_AREA_23[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1048. #else
  1049. msr_ICU_EXCLUSIVE_AREA_23[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1050. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1051. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_23[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1052. {
  1053. OsIf_SuspendAllInterrupts();
  1054. #ifdef _ARM_DS5_C_S32K1XX_
  1055. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1056. #endif
  1057. }
  1058. }
  1059. reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId]++;
  1060. }
  1061. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_23(void)
  1062. {
  1063. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1064. reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId]--;
  1065. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_23[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId])) /*if interrupts were enabled*/
  1066. {
  1067. OsIf_ResumeAllInterrupts();
  1068. #ifdef _ARM_DS5_C_S32K1XX_
  1069. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1070. #endif
  1071. }
  1072. }
  1073. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_24(void)
  1074. {
  1075. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1076. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId])
  1077. {
  1078. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1079. msr_ICU_EXCLUSIVE_AREA_24[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1080. #else
  1081. msr_ICU_EXCLUSIVE_AREA_24[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1082. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1083. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_24[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1084. {
  1085. OsIf_SuspendAllInterrupts();
  1086. #ifdef _ARM_DS5_C_S32K1XX_
  1087. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1088. #endif
  1089. }
  1090. }
  1091. reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId]++;
  1092. }
  1093. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_24(void)
  1094. {
  1095. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1096. reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId]--;
  1097. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_24[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId])) /*if interrupts were enabled*/
  1098. {
  1099. OsIf_ResumeAllInterrupts();
  1100. #ifdef _ARM_DS5_C_S32K1XX_
  1101. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1102. #endif
  1103. }
  1104. }
  1105. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_25(void)
  1106. {
  1107. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1108. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId])
  1109. {
  1110. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1111. msr_ICU_EXCLUSIVE_AREA_25[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1112. #else
  1113. msr_ICU_EXCLUSIVE_AREA_25[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1114. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1115. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_25[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1116. {
  1117. OsIf_SuspendAllInterrupts();
  1118. #ifdef _ARM_DS5_C_S32K1XX_
  1119. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1120. #endif
  1121. }
  1122. }
  1123. reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId]++;
  1124. }
  1125. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_25(void)
  1126. {
  1127. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1128. reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId]--;
  1129. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_25[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId])) /*if interrupts were enabled*/
  1130. {
  1131. OsIf_ResumeAllInterrupts();
  1132. #ifdef _ARM_DS5_C_S32K1XX_
  1133. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1134. #endif
  1135. }
  1136. }
  1137. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_26(void)
  1138. {
  1139. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1140. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId])
  1141. {
  1142. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1143. msr_ICU_EXCLUSIVE_AREA_26[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1144. #else
  1145. msr_ICU_EXCLUSIVE_AREA_26[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1146. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1147. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_26[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1148. {
  1149. OsIf_SuspendAllInterrupts();
  1150. #ifdef _ARM_DS5_C_S32K1XX_
  1151. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1152. #endif
  1153. }
  1154. }
  1155. reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId]++;
  1156. }
  1157. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_26(void)
  1158. {
  1159. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1160. reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId]--;
  1161. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_26[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId])) /*if interrupts were enabled*/
  1162. {
  1163. OsIf_ResumeAllInterrupts();
  1164. #ifdef _ARM_DS5_C_S32K1XX_
  1165. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1166. #endif
  1167. }
  1168. }
  1169. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_27(void)
  1170. {
  1171. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1172. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId])
  1173. {
  1174. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1175. msr_ICU_EXCLUSIVE_AREA_27[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1176. #else
  1177. msr_ICU_EXCLUSIVE_AREA_27[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1178. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1179. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_27[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1180. {
  1181. OsIf_SuspendAllInterrupts();
  1182. #ifdef _ARM_DS5_C_S32K1XX_
  1183. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1184. #endif
  1185. }
  1186. }
  1187. reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId]++;
  1188. }
  1189. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_27(void)
  1190. {
  1191. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1192. reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId]--;
  1193. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_27[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId])) /*if interrupts were enabled*/
  1194. {
  1195. OsIf_ResumeAllInterrupts();
  1196. #ifdef _ARM_DS5_C_S32K1XX_
  1197. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1198. #endif
  1199. }
  1200. }
  1201. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_28(void)
  1202. {
  1203. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1204. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId])
  1205. {
  1206. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1207. msr_ICU_EXCLUSIVE_AREA_28[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1208. #else
  1209. msr_ICU_EXCLUSIVE_AREA_28[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1210. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1211. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_28[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1212. {
  1213. OsIf_SuspendAllInterrupts();
  1214. #ifdef _ARM_DS5_C_S32K1XX_
  1215. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1216. #endif
  1217. }
  1218. }
  1219. reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId]++;
  1220. }
  1221. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_28(void)
  1222. {
  1223. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1224. reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId]--;
  1225. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_28[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId])) /*if interrupts were enabled*/
  1226. {
  1227. OsIf_ResumeAllInterrupts();
  1228. #ifdef _ARM_DS5_C_S32K1XX_
  1229. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1230. #endif
  1231. }
  1232. }
  1233. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_29(void)
  1234. {
  1235. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1236. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId])
  1237. {
  1238. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1239. msr_ICU_EXCLUSIVE_AREA_29[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1240. #else
  1241. msr_ICU_EXCLUSIVE_AREA_29[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1242. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1243. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_29[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1244. {
  1245. OsIf_SuspendAllInterrupts();
  1246. #ifdef _ARM_DS5_C_S32K1XX_
  1247. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1248. #endif
  1249. }
  1250. }
  1251. reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId]++;
  1252. }
  1253. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_29(void)
  1254. {
  1255. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1256. reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId]--;
  1257. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_29[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId])) /*if interrupts were enabled*/
  1258. {
  1259. OsIf_ResumeAllInterrupts();
  1260. #ifdef _ARM_DS5_C_S32K1XX_
  1261. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1262. #endif
  1263. }
  1264. }
  1265. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_30(void)
  1266. {
  1267. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1268. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId])
  1269. {
  1270. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1271. msr_ICU_EXCLUSIVE_AREA_30[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1272. #else
  1273. msr_ICU_EXCLUSIVE_AREA_30[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1274. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1275. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_30[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1276. {
  1277. OsIf_SuspendAllInterrupts();
  1278. #ifdef _ARM_DS5_C_S32K1XX_
  1279. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1280. #endif
  1281. }
  1282. }
  1283. reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId]++;
  1284. }
  1285. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_30(void)
  1286. {
  1287. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1288. reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId]--;
  1289. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_30[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId])) /*if interrupts were enabled*/
  1290. {
  1291. OsIf_ResumeAllInterrupts();
  1292. #ifdef _ARM_DS5_C_S32K1XX_
  1293. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1294. #endif
  1295. }
  1296. }
  1297. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_31(void)
  1298. {
  1299. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1300. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId])
  1301. {
  1302. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1303. msr_ICU_EXCLUSIVE_AREA_31[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1304. #else
  1305. msr_ICU_EXCLUSIVE_AREA_31[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1306. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1307. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_31[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1308. {
  1309. OsIf_SuspendAllInterrupts();
  1310. #ifdef _ARM_DS5_C_S32K1XX_
  1311. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1312. #endif
  1313. }
  1314. }
  1315. reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId]++;
  1316. }
  1317. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_31(void)
  1318. {
  1319. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1320. reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId]--;
  1321. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_31[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId])) /*if interrupts were enabled*/
  1322. {
  1323. OsIf_ResumeAllInterrupts();
  1324. #ifdef _ARM_DS5_C_S32K1XX_
  1325. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1326. #endif
  1327. }
  1328. }
  1329. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_32(void)
  1330. {
  1331. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1332. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId])
  1333. {
  1334. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1335. msr_ICU_EXCLUSIVE_AREA_32[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1336. #else
  1337. msr_ICU_EXCLUSIVE_AREA_32[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1338. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1339. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_32[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1340. {
  1341. OsIf_SuspendAllInterrupts();
  1342. #ifdef _ARM_DS5_C_S32K1XX_
  1343. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1344. #endif
  1345. }
  1346. }
  1347. reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId]++;
  1348. }
  1349. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_32(void)
  1350. {
  1351. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1352. reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId]--;
  1353. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_32[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId])) /*if interrupts were enabled*/
  1354. {
  1355. OsIf_ResumeAllInterrupts();
  1356. #ifdef _ARM_DS5_C_S32K1XX_
  1357. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1358. #endif
  1359. }
  1360. }
  1361. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_33(void)
  1362. {
  1363. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1364. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId])
  1365. {
  1366. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1367. msr_ICU_EXCLUSIVE_AREA_33[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1368. #else
  1369. msr_ICU_EXCLUSIVE_AREA_33[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1370. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1371. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_33[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1372. {
  1373. OsIf_SuspendAllInterrupts();
  1374. #ifdef _ARM_DS5_C_S32K1XX_
  1375. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1376. #endif
  1377. }
  1378. }
  1379. reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId]++;
  1380. }
  1381. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_33(void)
  1382. {
  1383. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1384. reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId]--;
  1385. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_33[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId])) /*if interrupts were enabled*/
  1386. {
  1387. OsIf_ResumeAllInterrupts();
  1388. #ifdef _ARM_DS5_C_S32K1XX_
  1389. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1390. #endif
  1391. }
  1392. }
  1393. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_44(void)
  1394. {
  1395. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1396. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId])
  1397. {
  1398. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1399. msr_ICU_EXCLUSIVE_AREA_44[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1400. #else
  1401. msr_ICU_EXCLUSIVE_AREA_44[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1402. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1403. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_44[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1404. {
  1405. OsIf_SuspendAllInterrupts();
  1406. #ifdef _ARM_DS5_C_S32K1XX_
  1407. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1408. #endif
  1409. }
  1410. }
  1411. reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId]++;
  1412. }
  1413. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_44(void)
  1414. {
  1415. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1416. reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId]--;
  1417. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_44[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId])) /*if interrupts were enabled*/
  1418. {
  1419. OsIf_ResumeAllInterrupts();
  1420. #ifdef _ARM_DS5_C_S32K1XX_
  1421. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1422. #endif
  1423. }
  1424. }
  1425. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_45(void)
  1426. {
  1427. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1428. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId])
  1429. {
  1430. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1431. msr_ICU_EXCLUSIVE_AREA_45[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1432. #else
  1433. msr_ICU_EXCLUSIVE_AREA_45[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1434. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1435. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_45[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1436. {
  1437. OsIf_SuspendAllInterrupts();
  1438. #ifdef _ARM_DS5_C_S32K1XX_
  1439. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1440. #endif
  1441. }
  1442. }
  1443. reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId]++;
  1444. }
  1445. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_45(void)
  1446. {
  1447. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1448. reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId]--;
  1449. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_45[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId])) /*if interrupts were enabled*/
  1450. {
  1451. OsIf_ResumeAllInterrupts();
  1452. #ifdef _ARM_DS5_C_S32K1XX_
  1453. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1454. #endif
  1455. }
  1456. }
  1457. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_46(void)
  1458. {
  1459. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1460. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId])
  1461. {
  1462. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1463. msr_ICU_EXCLUSIVE_AREA_46[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1464. #else
  1465. msr_ICU_EXCLUSIVE_AREA_46[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1466. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1467. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_46[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1468. {
  1469. OsIf_SuspendAllInterrupts();
  1470. #ifdef _ARM_DS5_C_S32K1XX_
  1471. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1472. #endif
  1473. }
  1474. }
  1475. reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId]++;
  1476. }
  1477. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_46(void)
  1478. {
  1479. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1480. reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId]--;
  1481. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_46[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId])) /*if interrupts were enabled*/
  1482. {
  1483. OsIf_ResumeAllInterrupts();
  1484. #ifdef _ARM_DS5_C_S32K1XX_
  1485. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1486. #endif
  1487. }
  1488. }
  1489. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_47(void)
  1490. {
  1491. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1492. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId])
  1493. {
  1494. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1495. msr_ICU_EXCLUSIVE_AREA_47[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1496. #else
  1497. msr_ICU_EXCLUSIVE_AREA_47[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1498. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1499. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_47[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1500. {
  1501. OsIf_SuspendAllInterrupts();
  1502. #ifdef _ARM_DS5_C_S32K1XX_
  1503. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1504. #endif
  1505. }
  1506. }
  1507. reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId]++;
  1508. }
  1509. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_47(void)
  1510. {
  1511. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1512. reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId]--;
  1513. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_47[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId])) /*if interrupts were enabled*/
  1514. {
  1515. OsIf_ResumeAllInterrupts();
  1516. #ifdef _ARM_DS5_C_S32K1XX_
  1517. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1518. #endif
  1519. }
  1520. }
  1521. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_48(void)
  1522. {
  1523. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1524. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId])
  1525. {
  1526. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1527. msr_ICU_EXCLUSIVE_AREA_48[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1528. #else
  1529. msr_ICU_EXCLUSIVE_AREA_48[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1530. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1531. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_48[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1532. {
  1533. OsIf_SuspendAllInterrupts();
  1534. #ifdef _ARM_DS5_C_S32K1XX_
  1535. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1536. #endif
  1537. }
  1538. }
  1539. reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId]++;
  1540. }
  1541. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_48(void)
  1542. {
  1543. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1544. reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId]--;
  1545. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_48[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId])) /*if interrupts were enabled*/
  1546. {
  1547. OsIf_ResumeAllInterrupts();
  1548. #ifdef _ARM_DS5_C_S32K1XX_
  1549. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1550. #endif
  1551. }
  1552. }
  1553. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_49(void)
  1554. {
  1555. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1556. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId])
  1557. {
  1558. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1559. msr_ICU_EXCLUSIVE_AREA_49[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1560. #else
  1561. msr_ICU_EXCLUSIVE_AREA_49[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1562. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1563. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_49[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1564. {
  1565. OsIf_SuspendAllInterrupts();
  1566. #ifdef _ARM_DS5_C_S32K1XX_
  1567. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1568. #endif
  1569. }
  1570. }
  1571. reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId]++;
  1572. }
  1573. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_49(void)
  1574. {
  1575. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1576. reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId]--;
  1577. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_49[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId])) /*if interrupts were enabled*/
  1578. {
  1579. OsIf_ResumeAllInterrupts();
  1580. #ifdef _ARM_DS5_C_S32K1XX_
  1581. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1582. #endif
  1583. }
  1584. }
  1585. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_50(void)
  1586. {
  1587. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1588. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId])
  1589. {
  1590. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1591. msr_ICU_EXCLUSIVE_AREA_50[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1592. #else
  1593. msr_ICU_EXCLUSIVE_AREA_50[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1594. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1595. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_50[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1596. {
  1597. OsIf_SuspendAllInterrupts();
  1598. #ifdef _ARM_DS5_C_S32K1XX_
  1599. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1600. #endif
  1601. }
  1602. }
  1603. reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId]++;
  1604. }
  1605. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_50(void)
  1606. {
  1607. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1608. reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId]--;
  1609. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_50[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId])) /*if interrupts were enabled*/
  1610. {
  1611. OsIf_ResumeAllInterrupts();
  1612. #ifdef _ARM_DS5_C_S32K1XX_
  1613. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1614. #endif
  1615. }
  1616. }
  1617. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_51(void)
  1618. {
  1619. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1620. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId])
  1621. {
  1622. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1623. msr_ICU_EXCLUSIVE_AREA_51[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1624. #else
  1625. msr_ICU_EXCLUSIVE_AREA_51[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1626. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1627. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_51[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1628. {
  1629. OsIf_SuspendAllInterrupts();
  1630. #ifdef _ARM_DS5_C_S32K1XX_
  1631. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1632. #endif
  1633. }
  1634. }
  1635. reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId]++;
  1636. }
  1637. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_51(void)
  1638. {
  1639. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1640. reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId]--;
  1641. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_51[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId])) /*if interrupts were enabled*/
  1642. {
  1643. OsIf_ResumeAllInterrupts();
  1644. #ifdef _ARM_DS5_C_S32K1XX_
  1645. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1646. #endif
  1647. }
  1648. }
  1649. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_52(void)
  1650. {
  1651. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1652. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId])
  1653. {
  1654. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1655. msr_ICU_EXCLUSIVE_AREA_52[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1656. #else
  1657. msr_ICU_EXCLUSIVE_AREA_52[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1658. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1659. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_52[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1660. {
  1661. OsIf_SuspendAllInterrupts();
  1662. #ifdef _ARM_DS5_C_S32K1XX_
  1663. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1664. #endif
  1665. }
  1666. }
  1667. reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId]++;
  1668. }
  1669. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_52(void)
  1670. {
  1671. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1672. reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId]--;
  1673. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_52[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId])) /*if interrupts were enabled*/
  1674. {
  1675. OsIf_ResumeAllInterrupts();
  1676. #ifdef _ARM_DS5_C_S32K1XX_
  1677. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1678. #endif
  1679. }
  1680. }
  1681. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_53(void)
  1682. {
  1683. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1684. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId])
  1685. {
  1686. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1687. msr_ICU_EXCLUSIVE_AREA_53[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1688. #else
  1689. msr_ICU_EXCLUSIVE_AREA_53[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1690. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1691. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_53[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1692. {
  1693. OsIf_SuspendAllInterrupts();
  1694. #ifdef _ARM_DS5_C_S32K1XX_
  1695. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1696. #endif
  1697. }
  1698. }
  1699. reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId]++;
  1700. }
  1701. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_53(void)
  1702. {
  1703. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1704. reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId]--;
  1705. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_53[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId])) /*if interrupts were enabled*/
  1706. {
  1707. OsIf_ResumeAllInterrupts();
  1708. #ifdef _ARM_DS5_C_S32K1XX_
  1709. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1710. #endif
  1711. }
  1712. }
  1713. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_57(void)
  1714. {
  1715. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1716. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId])
  1717. {
  1718. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1719. msr_ICU_EXCLUSIVE_AREA_57[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1720. #else
  1721. msr_ICU_EXCLUSIVE_AREA_57[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1722. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1723. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_57[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1724. {
  1725. OsIf_SuspendAllInterrupts();
  1726. #ifdef _ARM_DS5_C_S32K1XX_
  1727. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1728. #endif
  1729. }
  1730. }
  1731. reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId]++;
  1732. }
  1733. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_57(void)
  1734. {
  1735. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1736. reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId]--;
  1737. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_57[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId])) /*if interrupts were enabled*/
  1738. {
  1739. OsIf_ResumeAllInterrupts();
  1740. #ifdef _ARM_DS5_C_S32K1XX_
  1741. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1742. #endif
  1743. }
  1744. }
  1745. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_58(void)
  1746. {
  1747. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1748. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId])
  1749. {
  1750. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1751. msr_ICU_EXCLUSIVE_AREA_58[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1752. #else
  1753. msr_ICU_EXCLUSIVE_AREA_58[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1754. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1755. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_58[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1756. {
  1757. OsIf_SuspendAllInterrupts();
  1758. #ifdef _ARM_DS5_C_S32K1XX_
  1759. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1760. #endif
  1761. }
  1762. }
  1763. reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId]++;
  1764. }
  1765. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_58(void)
  1766. {
  1767. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1768. reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId]--;
  1769. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_58[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId])) /*if interrupts were enabled*/
  1770. {
  1771. OsIf_ResumeAllInterrupts();
  1772. #ifdef _ARM_DS5_C_S32K1XX_
  1773. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1774. #endif
  1775. }
  1776. }
  1777. void SchM_Enter_Icu_ICU_EXCLUSIVE_AREA_59(void)
  1778. {
  1779. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1780. if(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId])
  1781. {
  1782. #if ((defined MCAL_ENABLE_USER_MODE_SUPPORT)&&(!defined MCAL_PLATFORM_ARM_M0PLUS))
  1783. msr_ICU_EXCLUSIVE_AREA_59[u32CoreId] = OsIf_Trusted_Call_Return(Icu_schm_read_msr);
  1784. #else
  1785. msr_ICU_EXCLUSIVE_AREA_59[u32CoreId] = Icu_schm_read_msr(); /*read MSR (to store interrupts state)*/
  1786. #endif /* MCAL_ENABLE_USER_MODE_SUPPORT */
  1787. if (ISR_ON(msr_ICU_EXCLUSIVE_AREA_59[u32CoreId])) /*if MSR[EE] = 0, skip calling Suspend/Resume AllInterrupts*/
  1788. {
  1789. OsIf_SuspendAllInterrupts();
  1790. #ifdef _ARM_DS5_C_S32K1XX_
  1791. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1792. #endif
  1793. }
  1794. }
  1795. reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId]++;
  1796. }
  1797. void SchM_Exit_Icu_ICU_EXCLUSIVE_AREA_59(void)
  1798. {
  1799. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1800. reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId]--;
  1801. if ((ISR_ON(msr_ICU_EXCLUSIVE_AREA_59[u32CoreId]))&&(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId])) /*if interrupts were enabled*/
  1802. {
  1803. OsIf_ResumeAllInterrupts();
  1804. #ifdef _ARM_DS5_C_S32K1XX_
  1805. ASM_KEYWORD(" nop ");/* Compiler fix - forces the CSPID instruction to be generated with -02, -Ospace are selected*/
  1806. #endif
  1807. }
  1808. }
  1809. #ifdef MCAL_TESTING_ENVIRONMENT
  1810. /**
  1811. @brief This function checks that all entered exclusive areas were also exited.
  1812. @details This function checks that all entered exclusive areas were also exited. The check
  1813. is done by verifying that all reentry_guard_* static variables are back to the
  1814. zero value.
  1815. @param[in] void No input parameters
  1816. @return void This function does not return a value. Test asserts are used instead.
  1817. @pre None
  1818. @post None
  1819. @remarks Covers
  1820. @remarks Implements
  1821. */
  1822. void SchM_Check_icu(void)
  1823. {
  1824. uint32 u32CoreId = (uint32)OsIf_GetCoreID();
  1825. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId]);
  1826. reentry_guard_ICU_EXCLUSIVE_AREA_00[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_00 for the next test in the suite*/
  1827. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId]);
  1828. reentry_guard_ICU_EXCLUSIVE_AREA_01[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_01 for the next test in the suite*/
  1829. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId]);
  1830. reentry_guard_ICU_EXCLUSIVE_AREA_02[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_02 for the next test in the suite*/
  1831. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId]);
  1832. reentry_guard_ICU_EXCLUSIVE_AREA_03[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_03 for the next test in the suite*/
  1833. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId]);
  1834. reentry_guard_ICU_EXCLUSIVE_AREA_04[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_04 for the next test in the suite*/
  1835. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId]);
  1836. reentry_guard_ICU_EXCLUSIVE_AREA_05[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_05 for the next test in the suite*/
  1837. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId]);
  1838. reentry_guard_ICU_EXCLUSIVE_AREA_06[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_06 for the next test in the suite*/
  1839. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId]);
  1840. reentry_guard_ICU_EXCLUSIVE_AREA_07[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_07 for the next test in the suite*/
  1841. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId]);
  1842. reentry_guard_ICU_EXCLUSIVE_AREA_08[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_08 for the next test in the suite*/
  1843. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId]);
  1844. reentry_guard_ICU_EXCLUSIVE_AREA_09[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_09 for the next test in the suite*/
  1845. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId]);
  1846. reentry_guard_ICU_EXCLUSIVE_AREA_11[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_11 for the next test in the suite*/
  1847. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId]);
  1848. reentry_guard_ICU_EXCLUSIVE_AREA_15[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_15 for the next test in the suite*/
  1849. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId]);
  1850. reentry_guard_ICU_EXCLUSIVE_AREA_16[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_16 for the next test in the suite*/
  1851. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId]);
  1852. reentry_guard_ICU_EXCLUSIVE_AREA_17[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_17 for the next test in the suite*/
  1853. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId]);
  1854. reentry_guard_ICU_EXCLUSIVE_AREA_18[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_18 for the next test in the suite*/
  1855. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId]);
  1856. reentry_guard_ICU_EXCLUSIVE_AREA_19[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_19 for the next test in the suite*/
  1857. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId]);
  1858. reentry_guard_ICU_EXCLUSIVE_AREA_20[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_20 for the next test in the suite*/
  1859. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId]);
  1860. reentry_guard_ICU_EXCLUSIVE_AREA_21[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_21 for the next test in the suite*/
  1861. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId]);
  1862. reentry_guard_ICU_EXCLUSIVE_AREA_22[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_22 for the next test in the suite*/
  1863. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId]);
  1864. reentry_guard_ICU_EXCLUSIVE_AREA_23[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_23 for the next test in the suite*/
  1865. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId]);
  1866. reentry_guard_ICU_EXCLUSIVE_AREA_24[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_24 for the next test in the suite*/
  1867. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId]);
  1868. reentry_guard_ICU_EXCLUSIVE_AREA_25[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_25 for the next test in the suite*/
  1869. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId]);
  1870. reentry_guard_ICU_EXCLUSIVE_AREA_26[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_26 for the next test in the suite*/
  1871. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId]);
  1872. reentry_guard_ICU_EXCLUSIVE_AREA_27[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_27 for the next test in the suite*/
  1873. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId]);
  1874. reentry_guard_ICU_EXCLUSIVE_AREA_28[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_28 for the next test in the suite*/
  1875. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId]);
  1876. reentry_guard_ICU_EXCLUSIVE_AREA_29[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_29 for the next test in the suite*/
  1877. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId]);
  1878. reentry_guard_ICU_EXCLUSIVE_AREA_30[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_30 for the next test in the suite*/
  1879. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId]);
  1880. reentry_guard_ICU_EXCLUSIVE_AREA_31[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_31 for the next test in the suite*/
  1881. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId]);
  1882. reentry_guard_ICU_EXCLUSIVE_AREA_32[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_32 for the next test in the suite*/
  1883. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId]);
  1884. reentry_guard_ICU_EXCLUSIVE_AREA_33[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_33 for the next test in the suite*/
  1885. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId]);
  1886. reentry_guard_ICU_EXCLUSIVE_AREA_44[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_44 for the next test in the suite*/
  1887. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId]);
  1888. reentry_guard_ICU_EXCLUSIVE_AREA_45[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_45 for the next test in the suite*/
  1889. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId]);
  1890. reentry_guard_ICU_EXCLUSIVE_AREA_46[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_46 for the next test in the suite*/
  1891. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId]);
  1892. reentry_guard_ICU_EXCLUSIVE_AREA_47[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_47 for the next test in the suite*/
  1893. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId]);
  1894. reentry_guard_ICU_EXCLUSIVE_AREA_48[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_48 for the next test in the suite*/
  1895. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId]);
  1896. reentry_guard_ICU_EXCLUSIVE_AREA_49[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_49 for the next test in the suite*/
  1897. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId]);
  1898. reentry_guard_ICU_EXCLUSIVE_AREA_50[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_50 for the next test in the suite*/
  1899. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId]);
  1900. reentry_guard_ICU_EXCLUSIVE_AREA_51[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_51 for the next test in the suite*/
  1901. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId]);
  1902. reentry_guard_ICU_EXCLUSIVE_AREA_52[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_52 for the next test in the suite*/
  1903. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId]);
  1904. reentry_guard_ICU_EXCLUSIVE_AREA_53[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_53 for the next test in the suite*/
  1905. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId]);
  1906. reentry_guard_ICU_EXCLUSIVE_AREA_57[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_57 for the next test in the suite*/
  1907. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId]);
  1908. reentry_guard_ICU_EXCLUSIVE_AREA_58[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_58 for the next test in the suite*/
  1909. EU_ASSERT(0UL == reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId]);
  1910. reentry_guard_ICU_EXCLUSIVE_AREA_59[u32CoreId] = 0UL; /*reset reentry_guard_ICU_EXCLUSIVE_AREA_59 for the next test in the suite*/
  1911. }
  1912. #endif /*MCAL_TESTING_ENVIRONMENT*/
  1913. #define RTE_STOP_SEC_CODE
  1914. #include "Rte_MemMap.h"
  1915. #ifdef __cplusplus
  1916. }
  1917. #endif
  1918. /** @} */