Skip to content

Commit

Permalink
Add volatile modifier for CP15 accessors
Browse files Browse the repository at this point in the history
Add volatile modifier to prevent ARM compiler to remove inline function calls for __set_CP and __get_CP.
  • Loading branch information
toyowata committed Jun 7, 2018
1 parent 4fcaa56 commit c37875c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmsis/TARGET_CORTEX_A/cmsis_armcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ __STATIC_INLINE void __set_FPEXC(uint32_t fpexc)
* Include common core functions to access Coprocessor 15 registers
*/

#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)
#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)
#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)
#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)
#define __get_CP64(cp, op1, Rt, CRm) \
do { \
uint32_t ltmp, htmp; \
Expand Down

0 comments on commit c37875c

Please sign in to comment.