Build: Fix IAR build when TFM_EXCEPTION_INFO_DUMP=ON
IAR build fails if TFM_EXCEPTION_INFO_DUMP=ON is
defined. Added the missing IAR specific pragma
which solved the issue.
Signed-off-by: Dávid Házi <david.hazi@arm.com>
Change-Id: I1e92f05d6e9d7fecaedcb2b762ead09eb9a4ef99
diff --git a/platform/ext/common/exception_info.c b/platform/ext/common/exception_info.c
index 25e7e7c..f4fc17c 100644
--- a/platform/ext/common/exception_info.c
+++ b/platform/ext/common/exception_info.c
@@ -6,8 +6,9 @@
#include <string.h>
#include "tfm_arch.h"
-#include "exception_info.h"
#include "tfm_spm_log.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
+#include "exception_info.h"
struct exception_info_t {
uint32_t EXC_RETURN; /* EXC_RETURN value in LR. */
diff --git a/platform/ext/common/faults.c b/platform/ext/common/faults.c
index d9f1595..148b302 100644
--- a/platform/ext/common/faults.c
+++ b/platform/ext/common/faults.c
@@ -5,8 +5,9 @@
*
*/
#include "cmsis.h"
-#include "exception_info.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
+#include "exception_info.h"
void C_HardFault_Handler(void)
{
diff --git a/platform/ext/common/mpc_ppc_faults.c b/platform/ext/common/mpc_ppc_faults.c
index e1cd118..95c7d78 100644
--- a/platform/ext/common/mpc_ppc_faults.c
+++ b/platform/ext/common/mpc_ppc_faults.c
@@ -8,6 +8,7 @@
#include "cmsis.h"
#include "common_target_cfg.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
void C_MPC_Handler(void)
diff --git a/platform/ext/target/arm/mps2/an519/faults.c b/platform/ext/target/arm/mps2/an519/faults.c
index f148e21..3f663d1 100644
--- a/platform/ext/target/arm/mps2/an519/faults.c
+++ b/platform/ext/target/arm/mps2/an519/faults.c
@@ -9,6 +9,7 @@
#include "target_cfg.h"
#include "Driver_MPC.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
/* Import MPC driver */
diff --git a/platform/ext/target/arm/mps2/an521/faults.c b/platform/ext/target/arm/mps2/an521/faults.c
index f148e21..3f663d1 100644
--- a/platform/ext/target/arm/mps2/an521/faults.c
+++ b/platform/ext/target/arm/mps2/an521/faults.c
@@ -9,6 +9,7 @@
#include "target_cfg.h"
#include "Driver_MPC.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
/* Import MPC driver */
diff --git a/platform/ext/target/arm/musca_b1/faults.c b/platform/ext/target/arm/musca_b1/faults.c
index a0daad4..8f5e5d1 100644
--- a/platform/ext/target/arm/musca_b1/faults.c
+++ b/platform/ext/target/arm/musca_b1/faults.c
@@ -9,8 +9,9 @@
#include "target_cfg.h"
#include "Driver_MPC.h"
#include "utilities.h"
-#include "exception_info.h"
#include "tfm_hal_platform.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
+#include "exception_info.h"
/* Import MPC driver */
extern ARM_DRIVER_MPC Driver_EFLASH0_MPC;
diff --git a/platform/ext/target/arm/musca_s1/faults.c b/platform/ext/target/arm/musca_s1/faults.c
index 40f3a15..f2658e6 100644
--- a/platform/ext/target/arm/musca_s1/faults.c
+++ b/platform/ext/target/arm/musca_s1/faults.c
@@ -9,6 +9,7 @@
#include "target_cfg.h"
#include "Driver_MPC.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
/* Import MPC driver */
diff --git a/platform/ext/target/arm/rss/common/faults.c b/platform/ext/target/arm/rss/common/faults.c
index 6f01795..17ba26a 100644
--- a/platform/ext/target/arm/rss/common/faults.c
+++ b/platform/ext/target/arm/rss/common/faults.c
@@ -8,6 +8,7 @@
#include "cmsis.h"
#include "target_cfg.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
void C_MPC_Handler(void)
diff --git a/platform/ext/target/nordic_nrf/common/core/faults.c b/platform/ext/target/nordic_nrf/common/core/faults.c
index 593cf68..37ff846 100644
--- a/platform/ext/target/nordic_nrf/common/core/faults.c
+++ b/platform/ext/target/nordic_nrf/common/core/faults.c
@@ -10,8 +10,9 @@
#include "cmsis.h"
#include "tfm_spm_log.h"
#include "spu.h"
-#include "exception_info.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
+#include "exception_info.h"
static void spu_dump_context(void)
{
diff --git a/platform/ext/target/nuvoton/common/faults.c b/platform/ext/target/nuvoton/common/faults.c
index 759e4ad..d243e55 100644
--- a/platform/ext/target/nuvoton/common/faults.c
+++ b/platform/ext/target/nuvoton/common/faults.c
@@ -9,6 +9,7 @@
#include "cmsis.h"
#include "target_cfg.h"
#include "utilities.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
#include "exception_info.h"
void C_SCU_Handler(void)
diff --git a/platform/ext/target/nxp/common/mpc_ppc_faults.c b/platform/ext/target/nxp/common/mpc_ppc_faults.c
index 5dbc409..e118f8f 100644
--- a/platform/ext/target/nxp/common/mpc_ppc_faults.c
+++ b/platform/ext/target/nxp/common/mpc_ppc_faults.c
@@ -8,8 +8,9 @@
#include "cmsis.h"
#include "utilities.h"
-#include "exception_info.h"
#include "target_cfg.h"
+/* "exception_info.h" must be the last include because of the IAR pragma */
+#include "exception_info.h"
void C_SEC_VIO_IRQHandler(void)
{