IntCtrl_Ip.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  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 IntCtrl_Ip
  28. * @{
  29. */
  30. /*==================================================================================================
  31. * INCLUDE FILES
  32. ==================================================================================================*/
  33. #include "IntCtrl_Ip.h"
  34. #include "Mcal.h"
  35. /*==================================================================================================
  36. * SOURCE FILE VERSION INFORMATION
  37. ==================================================================================================*/
  38. #define PLATFORM_INTCTRL_IP_VENDOR_ID_C 43
  39. #define PLATFORM_INTCTRL_IP_SW_MAJOR_VERSION_C 1
  40. #define PLATFORM_INTCTRL_IP_SW_MINOR_VERSION_C 0
  41. #define PLATFORM_INTCTRL_IP_SW_PATCH_VERSION_C 0
  42. /*==================================================================================================
  43. FILE VERSION CHECKS
  44. ==================================================================================================*/
  45. /* Check if current file and IntCtrl_Ip header file are of the same vendor */
  46. #if (PLATFORM_INTCTRL_IP_VENDOR_ID_C != PLATFORM_INTCTRL_IP_VENDOR_ID)
  47. #error "IntCtrl_Ip.c and IntCtrl_Ip.h have different vendor ids"
  48. #endif
  49. /* Check if current file and Fls header file are of the same Software version */
  50. #if ((PLATFORM_INTCTRL_IP_SW_MAJOR_VERSION_C != PLATFORM_INTCTRL_IP_SW_MAJOR_VERSION) || \
  51. (PLATFORM_INTCTRL_IP_SW_MINOR_VERSION_C != PLATFORM_INTCTRL_IP_SW_MINOR_VERSION) || \
  52. (PLATFORM_INTCTRL_IP_SW_PATCH_VERSION_C != PLATFORM_INTCTRL_IP_SW_PATCH_VERSION) \
  53. )
  54. #error "Software Version Numbers of IntCtrl_Ip.c and IntCtrl_Ip.h are different"
  55. #endif
  56. /*==================================================================================================
  57. * GLOBAL VARIABLES
  58. ==================================================================================================*/
  59. extern uint32 __INT_SRAM_START[1U];
  60. /*==================================================================================================
  61. * LOCAL FUNCTIONS
  62. ==================================================================================================*/
  63. #if ((STD_ON == INTCTRL_PLATFORM_ENABLE_USER_MODE_SUPPORT) && (defined (MCAL_ENABLE_USER_MODE_SUPPORT)))
  64. #define Call_IntCtrl_Ip_InstallHandlerPrivileged(eIrqNumber,pfNewHandler,pfOldHandler) \
  65. OsIf_Trusted_Call3params(IntCtrl_Ip_InstallHandlerPrivileged,(eIrqNumber),(pfNewHandler),(pfOldHandler))
  66. #define Call_IntCtrl_Ip_EnableIrqPrivileged(eIrqNumber) \
  67. OsIf_Trusted_Call1param(IntCtrl_Ip_EnableIrqPrivileged,(eIrqNumber))
  68. #define Call_IntCtrl_Ip_DisableIrqPrivileged(eIrqNumber) \
  69. OsIf_Trusted_Call1param(IntCtrl_Ip_DisableIrqPrivileged,(eIrqNumber))
  70. #define Call_IntCtrl_Ip_SetPriorityPrivileged(eIrqNumber,u8Priority) \
  71. OsIf_Trusted_Call2params(IntCtrl_Ip_SetPriorityPrivileged,(eIrqNumber),(u8Priority))
  72. #define Call_IntCtrl_Ip_GetPriorityPrivileged(eIrqNumber) \
  73. OsIf_Trusted_Call_Return1param(IntCtrl_Ip_GetPriorityPrivileged,(eIrqNumber))
  74. #define Call_IntCtrl_Ip_ClearPendingPrivileged(eIrqNumber) \
  75. OsIf_Trusted_Call1param(IntCtrl_Ip_ClearPendingPrivileged,(eIrqNumber))
  76. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  77. #define Call_IntCtrl_Ip_Group1Privileged(eIrqNumber) \
  78. OsIf_Trusted_Call1param(IntCtrl_Ip_Group1Privileged,(eIrqNumber))
  79. #define Call_IntCtrl_Ip_ConfigureSpiPrivileged(eIrqNumber,conf) \
  80. OsIf_Trusted_Call2params(IntCtrl_Ip_ConfigureSpiPrivileged,(eIrqNumber),(conf))
  81. #define Call_IntCtrl_Ip_SetIntTargetPrivileged(eIrqNumber, target) \
  82. OsIf_Trusted_Call2params(IntCtrl_Ip_SetIntTargetPrivileged,(eIrqNumber),(target))
  83. #endif /*INT_CTRL_IP_CORTEXR == STD_ON */
  84. #if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)
  85. #define Call_IntCtrl_Ip_SetPendingPrivileged(eIrqNumber) \
  86. OsIf_Trusted_Call1param(IntCtrl_Ip_SetPendingPrivileged,(eIrqNumber))
  87. #define Call_IntCtrl_Ip_GetPendingPrivileged(eIrqNumber) \
  88. OsIf_Trusted_Call_Return1param(IntCtrl_Ip_GetPendingPrivileged,(eIrqNumber))
  89. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  90. #define Call_IntCtrl_Ip_GetActivePrivileged(eIrqNumber) \
  91. OsIf_Trusted_Call_Return1param(IntCtrl_Ip_GetActivePrivileged,(eIrqNumber))
  92. #endif
  93. #endif
  94. #if ((INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON) && (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON))
  95. #define Call_IntCtrl_Ip_SetTargetCoresPrivileged(eIrqNumber,u8TargetCores) \
  96. OsIf_Trusted_Call2params(IntCtrl_Ip_SetTargetCoresPrivileged,(eIrqNumber),(u8TargetCores))
  97. #endif
  98. #if (INT_CTRL_IP_MSI_AVAILABLE == STD_ON)
  99. #define Call_IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged(eIrqNumber,eCpuTarget) \
  100. OsIf_Trusted_Call2params(IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged,(eIrqNumber),(eCpuTarget))
  101. #define Call_IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(eIrqNumber) \
  102. OsIf_Trusted_Call1param(IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged,(eIrqNumber))
  103. #define Call_IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(eIrqNumber) \
  104. OsIf_Trusted_Call_Return1param(IntCtrl_Ip_GetDirectedCpuInterruptPrivileged,(eIrqNumber))
  105. #endif
  106. #else /*STD_ON == INTCTRL_PLATFORM_ENABLE_USER_MODE_SUPPORT*/
  107. #define Call_IntCtrl_Ip_InstallHandlerPrivileged(eIrqNumber,pfNewHandler,pfOldHandler) \
  108. IntCtrl_Ip_InstallHandlerPrivileged((eIrqNumber),(pfNewHandler),(pfOldHandler))
  109. #define Call_IntCtrl_Ip_EnableIrqPrivileged(eIrqNumber) \
  110. IntCtrl_Ip_EnableIrqPrivileged((eIrqNumber))
  111. #define Call_IntCtrl_Ip_DisableIrqPrivileged(eIrqNumber) \
  112. IntCtrl_Ip_DisableIrqPrivileged((eIrqNumber))
  113. #define Call_IntCtrl_Ip_SetPriorityPrivileged(eIrqNumber,u8Priority) \
  114. IntCtrl_Ip_SetPriorityPrivileged((eIrqNumber),(u8Priority))
  115. #define Call_IntCtrl_Ip_GetPriorityPrivileged(eIrqNumber) \
  116. IntCtrl_Ip_GetPriorityPrivileged((eIrqNumber))
  117. #define Call_IntCtrl_Ip_ClearPendingPrivileged(eIrqNumber) \
  118. IntCtrl_Ip_ClearPendingPrivileged((eIrqNumber))
  119. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  120. #define Call_IntCtrl_Ip_Group1Privileged(eIrqNumber) \
  121. IntCtrl_Ip_Group1Privileged((eIrqNumber))
  122. #define Call_IntCtrl_Ip_ConfigureSpiPrivileged(eIrqNumber,conf) \
  123. IntCtrl_Ip_ConfigureSpiPrivileged((eIrqNumber),(conf))
  124. #define Call_IntCtrl_Ip_SetIntTargetPrivileged(eIrqNumber,target) \
  125. IntCtrl_Ip_SetIntTargetPrivileged((eIrqNumber),(target))
  126. #endif
  127. #if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)
  128. #define Call_IntCtrl_Ip_SetPendingPrivileged(eIrqNumber) \
  129. IntCtrl_Ip_SetPendingPrivileged((eIrqNumber))
  130. #define Call_IntCtrl_Ip_GetPendingPrivileged(eIrqNumber) \
  131. IntCtrl_Ip_GetPendingPrivileged((eIrqNumber))
  132. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  133. #define Call_IntCtrl_Ip_GetActivePrivileged(eIrqNumber) \
  134. IntCtrl_Ip_GetActivePrivileged((eIrqNumber))
  135. #endif
  136. #endif
  137. #if ((INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON) && (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON))
  138. #define Call_IntCtrl_Ip_SetTargetCoresPrivileged(eIrqNumber,u8TargetCores) \
  139. IntCtrl_Ip_SetTargetCoresPrivileged((eIrqNumber),(u8TargetCores))
  140. #endif
  141. #if (INT_CTRL_IP_MSI_AVAILABLE == STD_ON)
  142. #define Call_IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged(eIrqNumber,eCpuTarget) \
  143. IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged((eIrqNumber),(eCpuTarget))
  144. #define Call_IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(eIrqNumber) \
  145. IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(eIrqNumber)
  146. #define Call_IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(eIrqNumber) \
  147. IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(eIrqNumber)
  148. #endif
  149. #endif /*STD_ON == INTCTRL_PLATFORM_ENABLE_USER_MODE_SUPPORT*/
  150. #define PLATFORM_START_SEC_CODE
  151. #include "Platform_MemMap.h"
  152. static inline void IntCtrl_Ip_InstallHandlerPrivileged(IRQn_Type eIrqNumber,
  153. const IntCtrl_Ip_IrqHandlerType pfNewHandler,
  154. IntCtrl_Ip_IrqHandlerType* const pfOldHandler);
  155. static inline void IntCtrl_Ip_EnableIrqPrivileged(IRQn_Type eIrqNumber);
  156. static inline void IntCtrl_Ip_DisableIrqPrivileged(IRQn_Type eIrqNumber);
  157. static inline void IntCtrl_Ip_SetPriorityPrivileged(IRQn_Type eIrqNumber, uint8 u8Priority);
  158. static inline uint8 IntCtrl_Ip_GetPriorityPrivileged(IRQn_Type eIrqNumber);
  159. static inline void IntCtrl_Ip_ClearPendingPrivileged(IRQn_Type eIrqNumber);
  160. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  161. static inline void IntCtrl_Ip_Group1Privileged(IRQn_Type eIrqNumber);
  162. static inline void IntCtrl_Ip_ConfigureSpiPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_TriggerType conf);
  163. static inline void IntCtrl_Ip_SetIntTargetPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_Routing_ModeType target);
  164. #endif
  165. #if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)
  166. static inline void IntCtrl_Ip_SetPendingPrivileged(IRQn_Type eIrqNumber);
  167. static inline boolean IntCtrl_Ip_GetPendingPrivileged(IRQn_Type eIrqNumber);
  168. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  169. static inline boolean IntCtrl_Ip_GetActivePrivileged(IRQn_Type eIrqNumber);
  170. #endif
  171. #endif
  172. #if ((INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON) && (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON))
  173. static inline void IntCtrl_Ip_SetTargetCoresPrivileged(IRQn_Type eIrqNumber, uint8 u8TargetCores);
  174. #endif
  175. #if (INT_CTRL_IP_MSI_AVAILABLE == STD_ON)
  176. static inline void IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_IrqTargetType eCpuTarget);
  177. static inline void IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber);
  178. static inline boolean IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber);
  179. #endif
  180. static inline void IntCtrl_Ip_InstallHandlerPrivileged(IRQn_Type eIrqNumber,
  181. const IntCtrl_Ip_IrqHandlerType pfNewHandler,
  182. IntCtrl_Ip_IrqHandlerType* const pfOldHandler)
  183. {
  184. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  185. /* Check IRQ number - dev_irqNumber is used to avoid compiler warning */
  186. sint32 dev_irqNumber = (sint32)eIrqNumber;
  187. DevAssert(INT_CTRL_IP_IRQ_MIN <= dev_irqNumber);
  188. DevAssert(dev_irqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  189. DevAssert(S32_SCB->VTOR >= (uint32)__INT_SRAM_START);
  190. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  191. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  192. /* The 'irq_id' parameter is in r0 and the 'isr_handler' parameter is in r1 according to AAPCS */
  193. /* r2 = &VTABLE */
  194. ASM_KEYWORD("ldr r3,=VTABLE");
  195. /* r2 = &VTABLE[irq_id] */
  196. ASM_KEYWORD("add r3,r3,r0,lsl #2");
  197. /* Save the former handler pointer */
  198. if (pfOldHandler != NULL_PTR)
  199. {
  200. /* *pfOldHandler = */
  201. ASM_KEYWORD("ldr r4,[r3]");
  202. ASM_KEYWORD("str r4,[r2]");
  203. }
  204. /* VTABLE[irq_id] = isr_handler */
  205. ASM_KEYWORD("str r1,[r3]");
  206. (void)eIrqNumber;
  207. (void)pfNewHandler;
  208. #else
  209. uint32 * pVectorRam = (uint32 *)S32_SCB->VTOR;
  210. /* Save the former handler pointer */
  211. if (pfOldHandler != NULL_PTR)
  212. {
  213. *pfOldHandler = (IntCtrl_Ip_IrqHandlerType)pVectorRam[((sint32)eIrqNumber) + 16];
  214. }
  215. /* Set handler into vector table */
  216. pVectorRam[((sint32)eIrqNumber) + 16] = (uint32)pfNewHandler;
  217. #if (INT_CTRL_IP_INVALIDATE_CACHE == STD_ON)
  218. /* Invalidate ICache */
  219. S32_SCB->ICIALLU = 0UL;
  220. #endif
  221. #endif
  222. ASM_KEYWORD("dsb");
  223. ASM_KEYWORD("isb");
  224. MCAL_INSTRUCTION_SYNC_BARRIER();
  225. MCAL_DATA_SYNC_BARRIER();
  226. }
  227. static inline void IntCtrl_Ip_EnableIrqPrivileged(IRQn_Type eIrqNumber)
  228. {
  229. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  230. /* Check IRQ number - dev_irqNumber is used to avoid compiler warning */
  231. DevAssert(0 <= (sint32)eIrqNumber);
  232. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  233. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  234. /* Enable interrupt */
  235. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  236. S32_GICD->GICD_ISENABLER[((uint32)(eIrqNumber) >> 5U) - 1] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  237. #else
  238. S32_NVIC->ISER[(uint32)(eIrqNumber) >> 5U] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  239. #endif
  240. }
  241. static inline void IntCtrl_Ip_DisableIrqPrivileged(IRQn_Type eIrqNumber)
  242. {
  243. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  244. /* Check IRQ number - dev_irqNumber is used to avoid compiler warning */
  245. DevAssert(0 <= (sint32)eIrqNumber);
  246. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  247. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  248. /* Disable interrupt */
  249. #if(INT_CTRL_IP_CORTEXR == STD_ON)
  250. S32_GICD->GICD_ICENABLER[((uint32)(eIrqNumber) >> 5U)-1] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  251. #else
  252. S32_NVIC->ICER[(uint32)(eIrqNumber) >> 5U] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  253. #endif
  254. }
  255. static inline void IntCtrl_Ip_SetPriorityPrivileged(IRQn_Type eIrqNumber, uint8 u8Priority)
  256. {
  257. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  258. /* Check IRQ number and priority - dev_irqNumber is used to avoid compiler warning */
  259. DevAssert(INT_CTRL_IP_IRQ_MIN <= (sint32)eIrqNumber);
  260. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  261. DevAssert(u8Priority < (uint8)(1U << INT_CTRL_IP_NVIC_PRIO_BITS));
  262. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  263. uint8 shift = (uint8) (8U - INT_CTRL_IP_NVIC_PRIO_BITS);
  264. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  265. /* Set Priority for device specific Interrupts */
  266. S32_NVIC->IP[(uint32)(eIrqNumber)] = (uint8)((((uint32)u8Priority) << shift) & 0xFFUL);
  267. #elif (INT_CTRL_IP_CORTEXR == STD_ON)
  268. uint32_t iprVectorId = ((uint32_t)(eIrqNumber) >> 2U) - 8;
  269. uint8_t priByteShift = (uint8_t)((((uint8_t)eIrqNumber) & 0x3U) << 3U);
  270. /* Clear the old value from the register */
  271. S32_GICD->GICD_IPRIORITYR[iprVectorId] &= ~(0xFFUL << priByteShift);
  272. S32_GICD->GICD_IPRIORITYR[iprVectorId] |= ((uint32_t)(((((uint32_t)u8Priority) << shift)) & 0xFFUL)) << priByteShift;
  273. #else
  274. uint32_t iprVectorId = (uint32_t)(eIrqNumber) >> 2U;
  275. uint8_t priByteShift = (uint8_t)((((uint8_t)eIrqNumber) & 0x3U) << 3U);
  276. /* Clear the old value from the register */
  277. S32_NVIC->IP[iprVectorId] &= ~(0xFFUL << priByteShift);
  278. S32_NVIC->IP[iprVectorId] |= ((uint32_t)(((((uint32_t)u8Priority) << shift)) & 0xFFUL)) << priByteShift;
  279. #endif
  280. }
  281. static inline uint8 IntCtrl_Ip_GetPriorityPrivileged(IRQn_Type eIrqNumber)
  282. {
  283. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  284. /* Check IRQ number */
  285. DevAssert(INT_CTRL_IP_IRQ_MIN <= eIrqNumber);
  286. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  287. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  288. uint8 priority;
  289. uint8 shift = (uint8)(8U - INT_CTRL_IP_NVIC_PRIO_BITS);
  290. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  291. /* Get Priority for device specific Interrupts */
  292. priority = (uint8)(S32_NVIC->IP[(uint32)(eIrqNumber)] >> shift);
  293. #elif (INT_CTRL_IP_CORTEXR == STD_ON)
  294. uint32_t iprVectorId = ((uint32_t)(eIrqNumber) >> 2U) - 8;
  295. uint8_t priByteShift = (uint8_t)((((uint8_t)(eIrqNumber)) & 0x3U) << 3U);
  296. priority = ((uint8_t)(S32_GICD->GICD_IPRIORITYR[iprVectorId] >> priByteShift)) >> shift;
  297. #else
  298. uint32_t iprVectorId = (uint32_t)(eIrqNumber) >> 2U;
  299. uint8_t priByteShift = (uint8_t)((((uint8_t)(eIrqNumber)) & 0x3U) << 3U);
  300. priority = ((uint8_t)(S32_NVIC->IP[iprVectorId] >> priByteShift)) >> shift;
  301. #endif
  302. return priority;
  303. }
  304. static inline void IntCtrl_Ip_ClearPendingPrivileged(IRQn_Type eIrqNumber)
  305. {
  306. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  307. /* Check IRQ number */
  308. DevAssert(0 <= (sint32)eIrqNumber);
  309. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  310. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  311. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  312. /* Clear Pending Interrupt */
  313. S32_GICD->GICD_ICPENDR[((uint32)(eIrqNumber) >> 5U) - 1] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  314. #else
  315. /* Clear Pending Interrupt */
  316. S32_NVIC->ICPR[(uint32)(eIrqNumber) >> 5U] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  317. #endif
  318. }
  319. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  320. static inline void IntCtrl_Ip_Group1Privileged(IRQn_Type eIrqNumber)
  321. {
  322. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  323. /* Check IRQ number */
  324. DevAssert(0 <= (sint32)eIrqNumber);
  325. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  326. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  327. /* MAKE INT GROUP1 */
  328. S32_GICD->GICD_IGROUPR[((uint32)(eIrqNumber) >> 5U) - 1U] |= (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  329. }
  330. #endif
  331. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  332. static inline void IntCtrl_Ip_ConfigureSpiPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_TriggerType conf)
  333. {
  334. uint32 bank, tmp;
  335. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  336. /* Check IRQ number */
  337. DevAssert(0 <= (sint32)eIrqNumber);
  338. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  339. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  340. conf = conf & 0x3; /* Mask out unused bits */
  341. bank = (eIrqNumber / 16) - 2; /* There are 16 IDs per register, need to work out which register to access */
  342. eIrqNumber = eIrqNumber & 0xF; /* ... and which field within the register */
  343. eIrqNumber = eIrqNumber * 2; /* Convert from which field to a bit offset (2-bits per field) */
  344. conf = conf << eIrqNumber; /* Move configuration value into correct bit position */
  345. tmp = S32_GICD->GICD_ICFGR[bank]; /* Read current value */
  346. tmp = tmp & ~(0x3 << eIrqNumber); /* Clear the bits for the specified field */
  347. tmp = tmp | conf; /* OR in new configuration */
  348. S32_GICD->GICD_ICFGR[bank] = tmp; /* Write updated value back */
  349. }
  350. #endif
  351. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  352. static inline void IntCtrl_Ip_SetIntTargetPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_Routing_ModeType target)
  353. {
  354. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  355. /* Check IRQ number */
  356. DevAssert(0 <= (sint32)eIrqNumber);
  357. DevAssert((sint32)eIrqNumber <= (sint32)INT_CTRL_IP_IRQ_MAX);
  358. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  359. /* MAKE INT GROUP1 */
  360. S32_GICD->GICD_IROUTER[eIrqNumber - 32] = (uint64)target;
  361. }
  362. #endif /*INT_CTRL_IP_CORTEXR */
  363. #if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)
  364. static inline void IntCtrl_Ip_SetPendingPrivileged(IRQn_Type eIrqNumber)
  365. {
  366. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  367. /* Check IRQ number - dev_irqNumber is used to avoid compiler warning */
  368. DevAssert(0 <= (sint32)eIrqNumber);
  369. DevAssert(((sint32)eIrqNumber) <= (sint32)INT_CTRL_IP_IRQ_MAX);
  370. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  371. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  372. /* Set Pending Interrupt */
  373. S32_GICD->GICD_ISPENDR[((uint32)(eIrqNumber) >> 5U)-1] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  374. #else
  375. /* Set Pending Interrupt */
  376. S32_NVIC->ISPR[(uint32)(eIrqNumber) >> 5U] = (uint32)(1UL << ((uint32)(eIrqNumber) & (uint32)0x1FU));
  377. #endif
  378. }
  379. static inline boolean IntCtrl_Ip_GetPendingPrivileged(IRQn_Type eIrqNumber)
  380. {
  381. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  382. /* Check IRQ number */
  383. DevAssert(0 <= (sint32)eIrqNumber);
  384. DevAssert(((sint32)eIrqNumber) <= (sint32)INT_CTRL_IP_IRQ_MAX);
  385. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  386. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  387. /* Get Pending Interrupt */
  388. return ((((S32_GICD->GICD_ICPENDR[(((uint32)eIrqNumber) >> 5UL) - 1] & (1UL << (((uint32)eIrqNumber) & 0x1FUL))) != 0UL) ? TRUE : FALSE));
  389. #else
  390. /* Get Pending Interrupt */
  391. return ((((S32_NVIC->ISPR[(((uint32)eIrqNumber) >> 5UL)] & (1UL << (((uint32)eIrqNumber) & 0x1FUL))) != 0UL) ? TRUE : FALSE));
  392. #endif
  393. }
  394. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  395. static inline boolean IntCtrl_Ip_GetActivePrivileged(IRQn_Type eIrqNumber)
  396. {
  397. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  398. /* Check IRQ number */
  399. DevAssert(0 <= (sint32)eIrqNumber);
  400. DevAssert(((sint32)eIrqNumber) <= (sint32)INT_CTRL_IP_IRQ_MAX);
  401. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  402. /* Get Active Interrupt */
  403. return ((((S32_NVIC->IABR[(((uint32)eIrqNumber) >> 5UL)] & (1UL << (((uint32)eIrqNumber) & 0x1FUL))) != 0UL) ? TRUE : FALSE));
  404. }
  405. #endif
  406. #endif /*#if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)*/
  407. #if ((INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON) && (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON))
  408. /**
  409. * @internal
  410. * @brief Sets the target cores for an interrupt request.
  411. * @implements IntCtrl_Ip_SetTargetCores_Activity
  412. */
  413. static inline void IntCtrl_Ip_SetTargetCoresPrivileged(IRQn_Type eIrqNumber, uint8 u8TargetCores)
  414. {
  415. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  416. /* Check IRQ number */
  417. DevAssert(0 <= (sint32)eIrqNumber);
  418. DevAssert(((sint32)eIrqNumber) <= (sint32)INT_CTRL_IP_IRQ_MAX);
  419. /* Check interrupt routing is not locked for this IRQ */
  420. DevAssert((IP_MSCM->IRSPRC[eIrqNumber] & (uint16)(MSCM_IRSPRC_LOCK_MASK)) == (uint16)MSCM_IRSPRC_LOCK(0));
  421. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  422. DevAssert(((uint16)u8TargetCores) <= (uint16)INTCTRL_IP_CORE_MASK);
  423. IP_MSCM->IRSPRC[eIrqNumber] = (uint16)u8TargetCores & (uint16)INTCTRL_IP_CORE_MASK;
  424. }
  425. #endif
  426. #if (INT_CTRL_IP_MSI_AVAILABLE == STD_ON)
  427. static inline void IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber)
  428. {
  429. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  430. /* Check IRQ number */
  431. DevAssert(INTCTRL_IP_DIRECTED_CPU_INT_MIN <= eIrqNumber);
  432. DevAssert((sint32)eIrqNumber <= INTCTRL_IP_DIRECTED_CPU_INT_MAX);
  433. #endif /* (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  434. uint32 currentCpu;
  435. uint32 irqId;
  436. currentCpu = MSCM_CPXNUM_CPN_MASK & (IP_MSCM->CPXNUM);
  437. irqId = (uint32)eIrqNumber - (uint32)INTCTRL_IP_DIRECTED_CPU_INT_MIN;
  438. /* Clear Directed CPU Pending Interrupt */
  439. MSCM_IRCPnIRx->IRCPnIRx[currentCpu][irqId].IntStatusR = 0x7FU;
  440. }
  441. static inline boolean IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber)
  442. {
  443. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  444. /* Check IRQ number */
  445. DevAssert(INTCTRL_IP_DIRECTED_CPU_INT_MIN <= eIrqNumber);
  446. DevAssert(eIrqNumber <= INTCTRL_IP_DIRECTED_CPU_INT_MAX);
  447. #endif /*(INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON) */
  448. uint32 currentCpu;
  449. uint32 irqId;
  450. currentCpu = MSCM_CPXNUM_CPN_MASK & (IP_MSCM->CPXNUM);
  451. irqId = (uint32)eIrqNumber - (uint32)INTCTRL_IP_DIRECTED_CPU_INT_MIN;
  452. return ((MSCM_IRCPnIRx->IRCPnIRx[currentCpu][irqId].IntStatusR != 0U) ? TRUE : FALSE);
  453. }
  454. static inline void IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged(IRQn_Type eIrqNumber, IntCtrl_Ip_IrqTargetType eCpuTarget)
  455. {
  456. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  457. /* Check IRQ number */
  458. DevAssert(INTCTRL_IP_DIRECTED_CPU_INT_MIN <= (sint32)eIrqNumber);
  459. DevAssert((sint32)eIrqNumber <= INTCTRL_IP_DIRECTED_CPU_INT_MAX);
  460. #endif
  461. uint32 irqId = (uint32)eIrqNumber - (uint32)INTCTRL_IP_DIRECTED_CPU_INT_MIN;
  462. uint32 core;
  463. uint32 target;
  464. if (eCpuTarget == INTCTRL_IP_TARGET_OTHERS)
  465. {
  466. for (core = 0U; core < INTCTRL_IP_MSI_CORE_CNT; core++)
  467. {
  468. /* Generate a Directed CPU Interrupt to every other core */
  469. if (core != (MSCM_CPXNUM_CPN_MASK & (IP_MSCM->CPXNUM)))
  470. {
  471. MSCM_IRCPnIRx->IRCPnIRx[core][irqId].IGR = 0x1U;
  472. }
  473. }
  474. }
  475. else
  476. {
  477. if (eCpuTarget == INTCTRL_IP_TARGET_SELF)
  478. {
  479. target = MSCM_CPXNUM_CPN_MASK & (IP_MSCM->CPXNUM);
  480. }
  481. else
  482. {
  483. target = (uint32)eCpuTarget;
  484. }
  485. /* Generate Directed CPU Interrupt to target core */
  486. MSCM_IRCPnIRx->IRCPnIRx[target][irqId].IGR = 0x1U;
  487. }
  488. }
  489. #endif /* INT_CTRL_IP_MSI_AVAILABLE == STD_ON */
  490. /*==================================================================================================
  491. * GLOBAL FUNCTIONS
  492. ==================================================================================================*/
  493. /**
  494. * @internal
  495. * @brief Initializes the configured interrupts at interrupt controller level.
  496. * @implements IntCtrl_Ip_Init_Activity
  497. */
  498. IntCtrl_Ip_StatusType IntCtrl_Ip_Init(const IntCtrl_Ip_CtrlConfigType *pIntCtrlCtrlConfig)
  499. {
  500. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  501. DevAssert(pIntCtrlCtrlConfig != NULL_PTR);
  502. DevAssert(pIntCtrlCtrlConfig->u32ConfigIrqCount <= INT_CTRL_IP_IRQ_COUNT);
  503. #endif
  504. uint32 irqIdx;
  505. for (irqIdx = 0; irqIdx < pIntCtrlCtrlConfig->u32ConfigIrqCount; irqIdx++)
  506. {
  507. IntCtrl_Ip_SetPriority(pIntCtrlCtrlConfig->aIrqConfig[irqIdx].eIrqNumber,
  508. pIntCtrlCtrlConfig->aIrqConfig[irqIdx].u8IrqPriority);
  509. if (pIntCtrlCtrlConfig->aIrqConfig[irqIdx].bIrqEnabled)
  510. {
  511. IntCtrl_Ip_EnableIrq(pIntCtrlCtrlConfig->aIrqConfig[irqIdx].eIrqNumber);
  512. }
  513. else
  514. {
  515. IntCtrl_Ip_DisableIrq(pIntCtrlCtrlConfig->aIrqConfig[irqIdx].eIrqNumber);
  516. }
  517. }
  518. return INTCTRL_IP_STATUS_SUCCESS;
  519. }
  520. #if (INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON)
  521. /**
  522. * @internal
  523. * @brief Initializes the configured routing interrupts.
  524. * @implements IntCtrl_Ip_ConfigIrqRouting_Activity
  525. */
  526. IntCtrl_Ip_StatusType IntCtrl_Ip_ConfigIrqRouting(const IntCtrl_Ip_GlobalRouteConfigType *routeConfig)
  527. {
  528. #if (INT_CTRL_IP_DEV_ERROR_DETECT == STD_ON)
  529. DevAssert(routeConfig != NULL_PTR);
  530. DevAssert(routeConfig->u32ConfigIrqCount <= INT_CTRL_IP_IRQ_COUNT);
  531. #endif
  532. uint32 irqIdx;
  533. for (irqIdx = 0; irqIdx < routeConfig->u32ConfigIrqCount; irqIdx++)
  534. {
  535. #if (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON)
  536. /* Configure routing */
  537. IntCtrl_Ip_SetTargetCores(routeConfig->aIrqConfig[irqIdx].eIrqNumber,
  538. routeConfig->aIrqConfig[irqIdx].u8TargetCores);
  539. #endif
  540. /* Install the configured handler */
  541. IntCtrl_Ip_InstallHandler(routeConfig->aIrqConfig[irqIdx].eIrqNumber,
  542. routeConfig->aIrqConfig[irqIdx].pfHandler,
  543. NULL_PTR);
  544. }
  545. return INTCTRL_IP_STATUS_SUCCESS;
  546. }
  547. #endif
  548. /**
  549. * @internal
  550. * @brief Installs a handler for an IRQ.
  551. * @implements IntCtrl_Ip_InstallHandler_Activity
  552. */
  553. void IntCtrl_Ip_InstallHandler(IRQn_Type eIrqNumber,
  554. const IntCtrl_Ip_IrqHandlerType pfNewHandler,
  555. IntCtrl_Ip_IrqHandlerType* const pfOldHandler)
  556. {
  557. Call_IntCtrl_Ip_InstallHandlerPrivileged(eIrqNumber,pfNewHandler,pfOldHandler);
  558. }
  559. /**
  560. * @internal
  561. * @brief Enables an interrupt request.
  562. * @implements IntCtrl_Ip_EnableIrq_Activity
  563. */
  564. void IntCtrl_Ip_EnableIrq(IRQn_Type eIrqNumber)
  565. {
  566. Call_IntCtrl_Ip_EnableIrqPrivileged(eIrqNumber);
  567. }
  568. /**
  569. * @internal
  570. * @brief Disables an interrupt request.
  571. * @implements IntCtrl_Ip_DisableIrq_Activity
  572. */
  573. void IntCtrl_Ip_DisableIrq(IRQn_Type eIrqNumber)
  574. {
  575. Call_IntCtrl_Ip_DisableIrqPrivileged(eIrqNumber);
  576. }
  577. /**
  578. * @internal
  579. * @brief Sets the priority for an interrupt request.
  580. * @implements IntCtrl_Ip_SetPriority_Activity
  581. */
  582. void IntCtrl_Ip_SetPriority(IRQn_Type eIrqNumber, uint8 u8Priority)
  583. {
  584. Call_IntCtrl_Ip_SetPriorityPrivileged(eIrqNumber,u8Priority);
  585. }
  586. /**
  587. * @internal
  588. * @brief Gets the priority for an interrupt request.
  589. * @implements IntCtrl_Ip_GetPriority_Activity
  590. */
  591. uint8 IntCtrl_Ip_GetPriority(IRQn_Type eIrqNumber)
  592. {
  593. return (uint8)Call_IntCtrl_Ip_GetPriorityPrivileged(eIrqNumber);
  594. }
  595. /**
  596. * @internal
  597. * @brief Clears the pending flag for an interrupt request.
  598. * @implements IntCtrl_Ip_ClearPending_Activity
  599. */
  600. void IntCtrl_Ip_ClearPending(IRQn_Type eIrqNumber)
  601. {
  602. Call_IntCtrl_Ip_ClearPendingPrivileged(eIrqNumber);
  603. }
  604. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  605. void IntCtrl_Ip_Group1(IRQn_Type eIrqNumber)
  606. {
  607. Call_IntCtrl_Ip_Group1Privileged(eIrqNumber);
  608. }
  609. void IntCtrl_Ip_ConfigureSpi(IRQn_Type eIrqNumber, IntCtrl_Ip_TriggerType conf)
  610. {
  611. Call_IntCtrl_Ip_ConfigureSpiPrivileged(eIrqNumber, conf);
  612. }
  613. #endif
  614. #if (INT_CTRL_IP_CORTEXR == STD_ON)
  615. void IntCtrl_Ip_SetIntTarget(IRQn_Type eIrqNumber, IntCtrl_Ip_Routing_ModeType target)
  616. {
  617. Call_IntCtrl_Ip_SetIntTargetPrivileged(eIrqNumber, target);
  618. }
  619. #endif /* NT_CTRL_IP_CORTEXR == STD_ON */
  620. #if (INT_CTRL_IP_STANDALONE_APIS == STD_ON)
  621. /**
  622. * @internal
  623. * @brief Sets the pending flag for an interrupt request.
  624. * @implements IntCtrl_Ip_SetPending_Activity
  625. */
  626. void IntCtrl_Ip_SetPending(IRQn_Type eIrqNumber)
  627. {
  628. Call_IntCtrl_Ip_SetPendingPrivileged(eIrqNumber);
  629. }
  630. /**
  631. * @internal
  632. * @brief Gets the pending flag for an interrupt request.
  633. * @implements IntCtrl_Ip_GetPending_Activity
  634. */
  635. boolean IntCtrl_Ip_GetPending(IRQn_Type eIrqNumber)
  636. {
  637. return (boolean)Call_IntCtrl_Ip_GetPendingPrivileged(eIrqNumber);
  638. }
  639. /**
  640. * @internal
  641. * @brief Gets the active flag for an interrupt request.
  642. * @implements IntCtrl_Ip_GetActive_Activity
  643. */
  644. #if (INT_CTRL_IP_CORTEXM4 == STD_ON)
  645. boolean IntCtrl_Ip_GetActive(IRQn_Type eIrqNumber)
  646. {
  647. return (boolean)Call_IntCtrl_Ip_GetActivePrivileged(eIrqNumber);
  648. }
  649. #endif
  650. #endif /* INT_CTRL_IP_STANDALONE_APIS*/
  651. #if ((INT_CTRL_IP_MSCM_SYSTEM_INTERRUPT_ROUTER == STD_ON) && (INT_CTRL_IP_ROUTING_CONTROL_REGISTER == STD_ON))
  652. /**
  653. * @internal
  654. * @brief Sets the target cores for an interrupt request.
  655. * @implements IntCtrl_Ip_SetTargetCores_Activity
  656. */
  657. void IntCtrl_Ip_SetTargetCores(IRQn_Type eIrqNumber, uint8 u8TargetCores)
  658. {
  659. Call_IntCtrl_Ip_SetTargetCoresPrivileged(eIrqNumber,u8TargetCores);
  660. }
  661. #endif
  662. #if (INT_CTRL_IP_MSI_AVAILABLE == STD_ON)
  663. /**
  664. * @internal
  665. * @brief Clear directed cpu Interrupt interrupt flag.
  666. * @implements IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged_Activity
  667. */
  668. void IntCtrl_Ip_ClearDirectedCpuInterrupt(IRQn_Type eIrqNumber)
  669. {
  670. Call_IntCtrl_Ip_ClearDirectedCpuInterruptPrivileged(eIrqNumber);
  671. }
  672. /**
  673. * @internal
  674. * @brief Get directed cpu Interrupt interrupt flag.
  675. * @implements IntCtrl_Ip_GetDirectedCpuInterrupt_Activity
  676. */
  677. boolean IntCtrl_Ip_GetDirectedCpuInterrupt(IRQn_Type eIrqNumber)
  678. {
  679. return Call_IntCtrl_Ip_GetDirectedCpuInterruptPrivileged(eIrqNumber);
  680. }
  681. /**
  682. * @internal
  683. * @brief Generates an interrupt request to a CPU target.
  684. * @implements IntCtrl_Ip_GenerateDirectedCpuInterrupt_Activity
  685. */
  686. void IntCtrl_Ip_GenerateDirectedCpuInterrupt(IRQn_Type eIrqNumber, IntCtrl_Ip_IrqTargetType eCpuTarget)
  687. {
  688. Call_IntCtrl_Ip_GenerateDirectedCpuInterruptPrivileged(eIrqNumber,eCpuTarget);
  689. }
  690. #endif /* INT_CTRL_IP_MSI_AVAILABLE == STD_ON */
  691. #define PLATFORM_STOP_SEC_CODE
  692. #include "Platform_MemMap.h"
  693. /** @} */