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 76fcd37c215..b0ce3d25970 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 7c0f0cd0ecc..7c256266c95 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 6bc384e9294..37cabf6b509 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 dd430d509e7..9ba9694f04a 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 ebeac411e9e..fb167f4dbd6 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 34d58791028..e4cc45b4529 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 4e67867c616..a09d621e8b7 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 05f6d32666c..d3be8b0c35e 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 49956c82599..c7a5f1d4f50 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 5a386474bcb..82f2ea4361c 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 f2c8526bb18..726df7e1915 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 58ce21a95d8..8c371be8ae4 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 2d8d292ce63..f82f671f13e 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 a2356ea4042..f2b2f96083a 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); }