1 /*
2  * Copyright (c) 2018-2023, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include "cmsis.h"
9 #include "common_target_cfg.h"
10 #include "utilities.h"
11 /* "exception_info.h" must be the last include because of the IAR pragma */
12 #include "exception_info.h"
13 
C_MPC_Handler(void)14 void C_MPC_Handler(void)
15 {
16     /* Clear MPC interrupt flag and pending MPC IRQ */
17     mpc_clear_irq();
18     NVIC_ClearPendingIRQ(MPC_IRQn);
19 
20     /* Print fault message and block execution */
21     ERROR_MSG("Platform Exception: MPC fault!!!");
22 
23     tfm_core_panic();
24 }
25 
MPC_Handler(void)26 __attribute__((naked)) void MPC_Handler(void)
27 {
28     EXCEPTION_INFO(EXCEPTION_TYPE_PLATFORM);
29 
30     __ASM volatile(
31         "BL        C_MPC_Handler           \n"
32         "B         .                       \n"
33     );
34 }
35 
C_PPC_Handler(void)36 void C_PPC_Handler(void)
37 {
38     /* Clear PPC interrupt flag and pending PPC IRQ */
39     ppc_clear_irq();
40     NVIC_ClearPendingIRQ(PPC_IRQn);
41 
42     /* Print fault message*/
43     ERROR_MSG("Platform Exception: PPC fault!!!");
44 
45     tfm_core_panic();
46 }
47 
PPC_Handler(void)48 __attribute__((naked)) void PPC_Handler(void)
49 {
50     EXCEPTION_INFO(EXCEPTION_TYPE_PLATFORM);
51 
52     __ASM volatile(
53         "BL        C_PPC_Handler           \n"
54         "B         .                       \n"
55     );
56 }
57