spinlock
struct spinlock { uint8_t state;};void spinlock_init(struct spinlock *lock);spinlock_init referenced types:
bool spin_trylock_raw(struct spinlock *lock);spin_trylock_raw referenced types:
void spin_raw(struct spinlock *lock);spin_raw referenced types:
void spin_lock_raw(struct spinlock *lock);spin_lock_raw referenced types:
void spin_unlock_raw(struct spinlock *lock);spin_unlock_raw referenced types:
void spin_unlock(struct spinlock *lock, enum irql old);spin_unlock referenced types:
enum irql spin_lock(struct spinlock *lock);spin_lock referenced types:
enum irql spin_lock_irq_disable(struct spinlock *lock);spin_lock_irq_disable referenced types:
bool spin_trylock(struct spinlock *lock, enum irql *out);spin_trylock referenced types:
bool spin_trylock_irq_disable(struct spinlock *lock, enum irql *out);spin_trylock_irq_disable referenced types:
bool spinlock_held(struct spinlock *lock);spinlock_held referenced types:
Defines
Section titled “Defines”#define SPINLOCK_INIT {ATOMIC_VAR_INIT(0)}#define SPINLOCK_ASSERT_HELD(l) kassert(spinlock_held(l))SPINLOCK_GENERATE_LOCK_UNLOCK_FOR_STRUCT(type, member)
Section titled “SPINLOCK_GENERATE_LOCK_UNLOCK_FOR_STRUCT(type, member)”#define SPINLOCK_GENERATE_LOCK_UNLOCK_FOR_STRUCT(type, member) \ static inline enum irql type##_lock(struct type *obj) { \ return spin_lock(&obj->member); \ } \ \ static inline enum irql type##_lock_irq_disable(struct type *obj) { \ return spin_lock_irq_disable(&obj->member); \ } \ \ static inline void type##_unlock(struct type *obj, enum irql irql) { \ spin_unlock(&obj->member, irql); \ } \ \ static inline bool type##_trylock(struct type *obj, enum irql *out) { \ return spin_trylock(&obj->member, out); \ }