ARM cortex: mutex using bit banding
- by Jeff V
Given that, on the ARM Cortex M3, I can:
atomically read a single bit
atomically set a single bit
atomically clear a single bit
How can I combine these for a mutex style set of operations:
try lock
take lock
release lock
It seems that try_lock or take_lock would require two operations that would not be atomic.
Do I need more control to accomplish this? Disable global interrupts would do it but it seems there should be a more surgical approach.