fenugrec ad5ec6af08 Cortex-M defines : fix potential issue where PRIMASK and FAULTMASK operations could be optimized out by gcc.
This adds the "volatile" keyword to all the inline assembly. gcc docs say "You can prevent an asm instruction from being deleted by writing the keyword volatile after the asm.". Testing (see comments of github issue #475) shows that indeed gcc can remove some inline asm, in at least this situation:
-multiple calls to cm_is_masked_interrupts() in the same scope/context
- -Os or -O2 optimization
This is problem because the value of PRIMASK could change between two calls to cm_is_masked_interrupts().
Adding the volatile keyword fixes this, and probably costs less than adding a full barrier (like adding "memory" to the clobber list).
2016-01-10 11:13:25 -05:00
..
2015-10-14 22:15:15 +00:00
2015-11-24 09:55:27 +00:00
2015-10-14 22:15:15 +00:00
2015-10-14 22:15:15 +00:00
2014-12-11 09:58:34 +00:00