Skip to content

Commit 4723eb9

Browse files
committed
fix[arm][cortex-m4]: clarify MPU permission expressions
1 parent 14ef29a commit 4723eb9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • libcpu/arm/cortex-m4

libcpu/arm/cortex-m4/mpu.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
* These are identical to Cortex-M7 because both cores implement the
2323
* ARMv7-M MPU with the same AP/XN bit layout in the RASR register. */
2424
/* Privileged No Access, Unprivileged No Access */
25-
#define P_NA_U_NA ((0x0 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
25+
#define P_NA_U_NA (((0x0 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
2626
/* Privileged Read Write, Unprivileged No Access */
27-
#define P_RW_U_NA ((0x1 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
27+
#define P_RW_U_NA (((0x1 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
2828
/* Privileged Read Write, Unprivileged Read Only */
29-
#define P_RW_U_RO ((0x2 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
29+
#define P_RW_U_RO (((0x2 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
3030
/* Privileged Read Write, Unprivileged Read Write */
31-
#define P_RW_U_RW ((0x3 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
31+
#define P_RW_U_RW (((0x3 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
3232
/* Privileged Read Only, Unprivileged No Access */
33-
#define P_RO_U_NA ((0x5 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
33+
#define P_RO_U_NA (((0x5 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
3434
/* Privileged Read Only, Unprivileged Read Only */
35-
#define P_RO_U_RO ((0x6 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk | MPU_RASR_XN_Msk)
35+
#define P_RO_U_RO (((0x6 << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | MPU_RASR_XN_Msk)
3636

3737
/* MPU attributes for configuring code region permission */
3838
/* Privileged Read Write Execute, Unprivileged Read Write Execute */

0 commit comments

Comments
 (0)