Module spinlock

Source
Expand description

Reading from a spinlock address will:

  • Return 0 if lock is already locked
  • Otherwise return nonzero, and simultaneously claim the lock

Writing (any value) releases the lock.
If core 0 and core 1 attempt to claim the same lock simultaneously, core 0 wins.
The value returned on success is 0x1 << lock number.

Structs§

SPINLOCK_SPEC
Reading from a spinlock address will:

Type Aliases§

R
Register SPINLOCK%s reader
W
Register SPINLOCK%s writer