Add comment about constraints on locking primitives.
This commit is contained in:
@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
#include <libopencm3/cm3/sync.h>
|
#include <libopencm3/cm3/sync.h>
|
||||||
|
|
||||||
|
/* Primitives for implementing locking.
|
||||||
|
*
|
||||||
|
* Must always be used in a pair, with a call to load_exclusive being
|
||||||
|
* followed immediately or near-immediately by a call to store_exclusive().
|
||||||
|
* Failure to observe this rule may lead to undefined results. */
|
||||||
|
|
||||||
// Use ldrex and strex directly if available.
|
// Use ldrex and strex directly if available.
|
||||||
// Otherwise, disable interrupts to ensure exclusivity.
|
// Otherwise, disable interrupts to ensure exclusivity.
|
||||||
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
|
||||||
|
Reference in New Issue
Block a user