SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
The Cortex-M4F instruction set includes pairs of synchronization primitives. These primitives provide a nonblocking mechanism that a thread or process can use to obtain exclusive access to a memory location. Software can use these primitives to perform an ensured read-modify-write memory update sequence or for a semaphore mechanism.
NOTE
The available pairs of synchronization primitives are available only for single processor use and should not be used with multiprocessor systems.
A pair of synchronization primitives consists of:
The pairs of Load-Exclusive and Store-Exclusive instructions are:
Software must use a Load-Exclusive instruction with the corresponding Store-Exclusive instruction.
To perform an exclusive read-modify-write of a memory location, software must:
If the status bit is clear, the read-modify-write completed successfully. If the status bit is set, no write was performed, which indicates that the value returned at step 1 might be out of date. The software must retry the entire read-modify-write sequence.
Software can use the synchronization primitives to implement a semaphore as follows:
The Cortex-M4F includes an exclusive access monitor that tags the fact that the processor has executed a Load-Exclusive instruction. The processor removes its exclusive access tag if:
For more information about the synchronization primitive instructions, see the Cortex-M4 instruction set chapter in the Arm Cortex-M4 Devices Generic User Guide.