irq: document requirement that irq_lock/unlock provides a memory barrier
Correct functioning of spinlocks requires that they be memory barriers.
With CONFIG_SMP=y this falls out as a consequence of using sequentially
consistent atomic operations to ensure all processors are locked out.
With CONFIG_SMP=n a spinlock uses arch_irq_lock/unlock(), so the barrier
behavior must come from that function.
As arch_irq_lock/unlock() delegates to irq_lock/unlock() for
documentation, document the barrier requirement there.
Signed-off-by:
Peter Bigot <peter.bigot@nordicsemi.no>
Loading
Please sign in to comment