Skip to content

Commit c37875c

Browse files
committed
Add volatile modifier for CP15 accessors
Add volatile modifier to prevent ARM compiler to remove inline function calls for __set_CP and __get_CP.
1 parent 4fcaa56 commit c37875c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmsis/TARGET_CORTEX_A/cmsis_armcc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ __STATIC_INLINE void __set_FPEXC(uint32_t fpexc)
451451
* Include common core functions to access Coprocessor 15 registers
452452
*/
453453

454-
#define __get_CP(cp, op1, Rt, CRn, CRm, op2) do { register uint32_t tmp __ASM("cp" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2); (Rt) = tmp; } while(0)
455-
#define __set_CP(cp, op1, Rt, CRn, CRm, op2) do { register uint32_t tmp __ASM("cp" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2); tmp = (Rt); } while(0)
454+
#define __get_CP(cp, op1, Rt, CRn, CRm, op2) do { register volatile uint32_t tmp __ASM("cp" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2); (Rt) = tmp; } while(0)
455+
#define __set_CP(cp, op1, Rt, CRn, CRm, op2) do { register volatile uint32_t tmp __ASM("cp" # cp ":" # op1 ":c" # CRn ":c" # CRm ":" # op2); tmp = (Rt); } while(0)
456456
#define __get_CP64(cp, op1, Rt, CRm) \
457457
do { \
458458
uint32_t ltmp, htmp; \

0 commit comments

Comments
 (0)