diff --git a/arch/arm/src/armv7-m/nvic.h b/arch/arm/src/armv7-m/nvic.h index 265292ff0d0..2615599b36f 100644 --- a/arch/arm/src/armv7-m/nvic.h +++ b/arch/arm/src/armv7-m/nvic.h @@ -632,6 +632,14 @@ #define NVIC_CSSELR_LEVEL_MASK (7 << NVIC_CSSELR_LEVEL_SHIFT) #define NVIC_CSSELR_LEVEL_1 (0 << NVIC_CSSELR_LEVEL_SHIFT) +/* Coprocessor Access Control Register (CPACR) */ + +#define NVIC_CPACR_CP_SHIFT(n) (2 * (n)) +#define NVIC_CPACR_CP_MASK(n) (3 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_DENY(n) (0 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_PRIV(n) (1 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_FULL(n) (3 << NVIC_CPACR_CP_SHIFT(n)) + /* Debug Exception and Monitor Control Register (DEMCR) */ #define NVIC_DEMCR_VCCORERESET (1 << 0) /* Bit 0: Reset Vector Catch */ diff --git a/arch/arm/src/armv8-m/nvic.h b/arch/arm/src/armv8-m/nvic.h index fb350e0d1ff..1c20d68fd0d 100644 --- a/arch/arm/src/armv8-m/nvic.h +++ b/arch/arm/src/armv8-m/nvic.h @@ -651,6 +651,14 @@ #define NVIC_CSSELR_LEVEL_MASK (7 << NVIC_CSSELR_LEVEL_SHIFT) #define NVIC_CSSELR_LEVEL_1 (0 << NVIC_CSSELR_LEVEL_SHIFT) +/* Coprocessor Access Control Register (CPACR) */ + +#define NVIC_CPACR_CP_SHIFT(n) (2 * (n)) +#define NVIC_CPACR_CP_MASK(n) (3 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_DENY(n) (0 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_PRIV(n) (1 << NVIC_CPACR_CP_SHIFT(n)) +# define NVIC_CPACR_CP_FULL(n) (3 << NVIC_CPACR_CP_SHIFT(n)) + /* Debug Exception and Monitor Control Register (DEMCR) */ #define NVIC_DEMCR_VCCORERESET (1 << 0) /* Bit 0: Reset Vector Catch */ diff --git a/arch/arm/src/cxd56xx/cxd56_start.c b/arch/arm/src/cxd56xx/cxd56_start.c index 3ac0b136136..8376f71f6db 100644 --- a/arch/arm/src/cxd56xx/cxd56_start.c +++ b/arch/arm/src/cxd56xx/cxd56_start.c @@ -162,7 +162,7 @@ void fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -192,7 +192,7 @@ void fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/efm32/efm32_start.c b/arch/arm/src/efm32/efm32_start.c index 1accb748597..3740ddbe136 100644 --- a/arch/arm/src/efm32/efm32_start.c +++ b/arch/arm/src/efm32/efm32_start.c @@ -154,7 +154,7 @@ static inline void efm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -184,7 +184,7 @@ static inline void efm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/eoss3/eoss3_start.c b/arch/arm/src/eoss3/eoss3_start.c index cc7fecb1f8b..35af0c7f4b2 100644 --- a/arch/arm/src/eoss3/eoss3_start.c +++ b/arch/arm/src/eoss3/eoss3_start.c @@ -152,7 +152,7 @@ static inline void eoss3_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -182,7 +182,7 @@ static inline void eoss3_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/imxrt/imxrt_start.c b/arch/arm/src/imxrt/imxrt_start.c index 8dc93e796f2..54e9e5c410b 100644 --- a/arch/arm/src/imxrt/imxrt_start.c +++ b/arch/arm/src/imxrt/imxrt_start.c @@ -136,7 +136,7 @@ static inline void imxrt_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -166,7 +166,7 @@ static inline void imxrt_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/kinetis/kinetis_start.c b/arch/arm/src/kinetis/kinetis_start.c index 5ee6c7f4a1f..7e70b952c56 100644 --- a/arch/arm/src/kinetis/kinetis_start.c +++ b/arch/arm/src/kinetis/kinetis_start.c @@ -148,7 +148,7 @@ static inline void kinetis_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -178,7 +178,7 @@ static inline void kinetis_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_start.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_start.c index c0599b4b06c..2a56ad55a28 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_start.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_start.c @@ -137,7 +137,7 @@ static inline void lpc17_40_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -167,7 +167,7 @@ static inline void lpc17_40_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/lpc43xx/lpc43_start.c b/arch/arm/src/lpc43xx/lpc43_start.c index 12dddcb9271..26c351547cf 100644 --- a/arch/arm/src/lpc43xx/lpc43_start.c +++ b/arch/arm/src/lpc43xx/lpc43_start.c @@ -205,7 +205,7 @@ static inline void lpc43_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -235,7 +235,7 @@ static inline void lpc43_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/lpc54xx/lpc54_start.c b/arch/arm/src/lpc54xx/lpc54_start.c index ed4c7d85415..768b9e1d114 100644 --- a/arch/arm/src/lpc54xx/lpc54_start.c +++ b/arch/arm/src/lpc54xx/lpc54_start.c @@ -135,7 +135,7 @@ static inline void lpc54_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #else @@ -163,7 +163,7 @@ static inline void lpc54_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #endif diff --git a/arch/arm/src/max326xx/common/max326_start.c b/arch/arm/src/max326xx/common/max326_start.c index 6533fc5844a..24766c7ee21 100644 --- a/arch/arm/src/max326xx/common/max326_start.c +++ b/arch/arm/src/max326xx/common/max326_start.c @@ -135,7 +135,7 @@ static inline void max326_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #else @@ -163,7 +163,7 @@ static inline void max326_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #endif diff --git a/arch/arm/src/nrf52/nrf52_start.c b/arch/arm/src/nrf52/nrf52_start.c index ae8dc168a8f..fd63acde7b1 100644 --- a/arch/arm/src/nrf52/nrf52_start.c +++ b/arch/arm/src/nrf52/nrf52_start.c @@ -122,7 +122,7 @@ static inline void nrf52_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #else @@ -150,7 +150,7 @@ static inline void nrf52_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #endif diff --git a/arch/arm/src/s32k1xx/s32k1xx_start.c b/arch/arm/src/s32k1xx/s32k1xx_start.c index fb10c1b5d93..08f3d31d4f4 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_start.c +++ b/arch/arm/src/s32k1xx/s32k1xx_start.c @@ -175,7 +175,7 @@ static inline void s32k1xx_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #else @@ -203,7 +203,7 @@ static inline void s32k1xx_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } #endif diff --git a/arch/arm/src/sam34/sam_start.c b/arch/arm/src/sam34/sam_start.c index 00742626b79..7d792a3f651 100644 --- a/arch/arm/src/sam34/sam_start.c +++ b/arch/arm/src/sam34/sam_start.c @@ -150,7 +150,7 @@ static inline void sam_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -180,7 +180,7 @@ static inline void sam_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/samd5e5/sam_start.c b/arch/arm/src/samd5e5/sam_start.c index 6844378405c..891a3d3cbb2 100644 --- a/arch/arm/src/samd5e5/sam_start.c +++ b/arch/arm/src/samd5e5/sam_start.c @@ -152,7 +152,7 @@ static inline void sam_fpu_configure(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -182,7 +182,7 @@ static inline void sam_fpu_configure(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/samv7/sam_start.c b/arch/arm/src/samv7/sam_start.c index 8541e230a3c..e065df7facd 100644 --- a/arch/arm/src/samv7/sam_start.c +++ b/arch/arm/src/samv7/sam_start.c @@ -147,7 +147,7 @@ static inline void sam_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -177,7 +177,7 @@ static inline void sam_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/stm32/stm32_start.c b/arch/arm/src/stm32/stm32_start.c index 78ff941d7f3..0d92a97cc41 100644 --- a/arch/arm/src/stm32/stm32_start.c +++ b/arch/arm/src/stm32/stm32_start.c @@ -153,7 +153,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -183,7 +183,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/stm32f7/stm32_start.c b/arch/arm/src/stm32f7/stm32_start.c index 4f06731367d..859f43284f5 100644 --- a/arch/arm/src/stm32f7/stm32_start.c +++ b/arch/arm/src/stm32f7/stm32_start.c @@ -147,7 +147,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -177,7 +177,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/stm32h7/stm32_start.c b/arch/arm/src/stm32h7/stm32_start.c index 0f7b7623599..77d6e3f75d1 100644 --- a/arch/arm/src/stm32h7/stm32_start.c +++ b/arch/arm/src/stm32h7/stm32_start.c @@ -162,7 +162,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -192,7 +192,7 @@ static inline void stm32_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/stm32l4/stm32l4_start.c b/arch/arm/src/stm32l4/stm32l4_start.c index cfec8507d6e..ce47de9088f 100644 --- a/arch/arm/src/stm32l4/stm32l4_start.c +++ b/arch/arm/src/stm32l4/stm32l4_start.c @@ -162,7 +162,7 @@ static inline void stm32l4_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -192,7 +192,7 @@ static inline void stm32l4_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/stm32l5/stm32l5_start.c b/arch/arm/src/stm32l5/stm32l5_start.c index 0a903bd12d8..cb78d2488a0 100644 --- a/arch/arm/src/stm32l5/stm32l5_start.c +++ b/arch/arm/src/stm32l5/stm32l5_start.c @@ -165,7 +165,7 @@ static inline void stm32l5_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -195,7 +195,7 @@ static inline void stm32l5_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/tiva/cc13xx/cc13xx_start.c b/arch/arm/src/tiva/cc13xx/cc13xx_start.c index 6df9cdb6470..45855384221 100644 --- a/arch/arm/src/tiva/cc13xx/cc13xx_start.c +++ b/arch/arm/src/tiva/cc13xx/cc13xx_start.c @@ -149,7 +149,7 @@ static inline void tiva_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -179,7 +179,7 @@ static inline void tiva_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/tiva/common/lmxx_tm4c_start.c b/arch/arm/src/tiva/common/lmxx_tm4c_start.c index bda364e2cf6..014e08e8912 100644 --- a/arch/arm/src/tiva/common/lmxx_tm4c_start.c +++ b/arch/arm/src/tiva/common/lmxx_tm4c_start.c @@ -140,7 +140,7 @@ static inline void tiva_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -170,7 +170,7 @@ static inline void tiva_fpuconfig(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } diff --git a/arch/arm/src/xmc4/xmc4_start.c b/arch/arm/src/xmc4/xmc4_start.c index 17a044da7ff..b573ba8469c 100644 --- a/arch/arm/src/xmc4/xmc4_start.c +++ b/arch/arm/src/xmc4/xmc4_start.c @@ -171,7 +171,7 @@ static inline void xmc4_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); } @@ -201,7 +201,7 @@ static inline void xmc4_fpu_config(void) /* Enable full access to CP10 and CP11 */ regval = getreg32(NVIC_CPACR); - regval |= ((3 << (2 * 10)) | (3 << (2 * 11))); + regval |= NVIC_CPACR_CP_FULL(10) | NVIC_CPACR_CP_FULL(11); putreg32(regval, NVIC_CPACR); }