spinlock
include/sync/spinlock.h View source View on GitHubStructs
Section titled “Structs”spinlock
Section titled “spinlock”struct spinlock {
_Atomic uint8_t state;
}; Functions
Section titled “Functions”spinlock_init
Section titled “spinlock_init”void spinlock_init(struct spinlock *lock); spin_trylock_raw
Section titled “spin_trylock_raw”bool spin_trylock_raw(struct spinlock *lock); spin_raw
Section titled “spin_raw”void spin_raw(struct spinlock *lock); spin_lock_raw
Section titled “spin_lock_raw”void spin_lock_raw(struct spinlock *lock); spin_unlock_raw
Section titled “spin_unlock_raw”void spin_unlock_raw(struct spinlock *lock); spin_unlock
Section titled “spin_unlock”void spin_unlock(struct spinlock *lock, enum irql old); spin_lock
Section titled “spin_lock”enum irql spin_lock(struct spinlock *lock); spin_lock_irq_disable
Section titled “spin_lock_irq_disable”enum irql spin_lock_irq_disable(struct spinlock *lock); spin_trylock
Section titled “spin_trylock”bool spin_trylock(struct spinlock *lock, enum irql *out); spin_trylock_irq_disable
Section titled “spin_trylock_irq_disable”bool spin_trylock_irq_disable(struct spinlock *lock, enum irql *out); spinlock_held
Section titled “spinlock_held”bool spinlock_held(struct spinlock *lock); Macros
Section titled “Macros”SPINLOCK_COOKIE_MAGIC
Section titled “SPINLOCK_COOKIE_MAGIC”#define SPINLOCK_COOKIE_MAGIC 0xBEEB00 SPINLOCK_INIT
Section titled “SPINLOCK_INIT”#define SPINLOCK_INIT \
{.state = ATOMIC_VAR_INIT(0), \
.acquired_high = false, \
.initialized_magic = SPINLOCK_COOKIE_MAGIC} SPINLOCK_INIT
Section titled “SPINLOCK_INIT”#define SPINLOCK_INIT {ATOMIC_VAR_INIT(0)} SPINLOCK_ASSERT_HELD
Section titled “SPINLOCK_ASSERT_HELD”#define SPINLOCK_ASSERT_HELD(l) kassert(spinlock_held(l))