spinlock
include/sync/spinlock.h View source View on GitHubStructs
Section titled “Structs”spinlock_acq_scope
Section titled “spinlock_acq_scope” struct spinlock_acq_scope (3 fields) source
spinlock_rel_scope
Section titled “spinlock_rel_scope” struct spinlock_rel_scope (3 fields) source
spinlock_acq_scope
Section titled “spinlock_acq_scope”spinlock_rel_scope
Section titled “spinlock_rel_scope”spinlock_guard
Section titled “spinlock_guard” struct spinlock_guard (2 fields) source
Functions
Section titled “Functions”spinlock_init_chk_full
Section titled “spinlock_init_chk_full”void spinlock_init_chk_full(
struct spinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source spinlock_policy_init_internal
Section titled “spinlock_policy_init_internal”void spinlock_policy_init_internal(
struct spinlock *lock,
enum lock_chk_flags flags
) source spinlock_shallow_init_internal
Section titled “spinlock_shallow_init_internal”spinlock_map_init_internal
Section titled “spinlock_map_init_internal”void spinlock_map_init_internal(
struct spinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source spinlock_note_use
Section titled “spinlock_note_use”void spinlock_note_use(
struct spinlock *lock,
enum lock_op_flags flags
) source spinlock_order_checked
Section titled “spinlock_order_checked”spinlock_stamp
Section titled “spinlock_stamp”spinlock_classify
Section titled “spinlock_classify”void spinlock_classify(
struct spinlock *lock,
enum lock_op_flags usage,
const struct lock_chk_site *site
) source spinlock_deep_checked
Section titled “spinlock_deep_checked”spinlock_chk_acq_req
Section titled “spinlock_chk_acq_req”struct lock_chk_acq_req spinlock_chk_acq_req(
struct spinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source spinlock_chk_rel_req
Section titled “spinlock_chk_rel_req”struct lock_chk_rel_req spinlock_chk_rel_req(
struct spinlock *lock,
const struct lock_chk_site *site
) source spinlock_acq_begin
Section titled “spinlock_acq_begin”void spinlock_acq_begin(
struct spinlock_acq_scope *scope,
struct spinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source spinlock_acq_commit
Section titled “spinlock_acq_commit”void spinlock_acq_commit(struct spinlock_acq_scope *scope) source spinlock_acq_abort
Section titled “spinlock_acq_abort”void spinlock_acq_abort(struct spinlock_acq_scope *scope) source spinlock_rel_begin
Section titled “spinlock_rel_begin”void spinlock_rel_begin(
struct spinlock_rel_scope *scope,
struct spinlock *lock,
const struct lock_chk_site *site
) source spinlock_rel_commit
Section titled “spinlock_rel_commit”void spinlock_rel_commit(struct spinlock_rel_scope *scope) source spinlock_shallow_push
Section titled “spinlock_shallow_push”void spinlock_shallow_push(
struct spinlock *lock,
enum irql irql,
const struct lock_chk_site *site
) source spinlock_shallow_validate_top
Section titled “spinlock_shallow_validate_top”void spinlock_shallow_validate_top(
struct spinlock *lock,
enum irql old,
const struct lock_chk_site *site
) source spinlock_shallow_pop
Section titled “spinlock_shallow_pop”spinlock_assert_held_deep
Section titled “spinlock_assert_held_deep”bool spinlock_assert_held_deep(
struct spinlock *lock,
bool want_held,
const struct lock_chk_site *site
) source spinlock_assert_initialized
Section titled “spinlock_assert_initialized”spinlock_policy_set_internal
Section titled “spinlock_policy_set_internal”void spinlock_policy_set_internal(
struct spinlock *lock,
enum lock_chk_flags flags
) source spinlock_policy_init_internal
Section titled “spinlock_policy_init_internal”void spinlock_policy_init_internal(
struct spinlock *lock,
enum lock_chk_flags flags
) source spinlock_shallow_init_internal
Section titled “spinlock_shallow_init_internal”spinlock_map_init_internal
Section titled “spinlock_map_init_internal”void spinlock_map_init_internal(
struct spinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source spinlock_note_use
Section titled “spinlock_note_use”void spinlock_note_use(
struct spinlock *lock,
enum lock_op_flags flags
) source spinlock_order_checked
Section titled “spinlock_order_checked”spinlock_classify
Section titled “spinlock_classify”void spinlock_classify(
struct spinlock *lock,
enum lock_op_flags usage,
const struct lock_chk_site *site
) source spinlock_deep_checked
Section titled “spinlock_deep_checked”spinlock_acq_begin
Section titled “spinlock_acq_begin”void spinlock_acq_begin(
struct spinlock_acq_scope *scope,
struct spinlock *lock,
const struct lock_chk_site *site,
enum lock_subclass subclass,
enum lock_op_flags flags
) source spinlock_acq_commit
Section titled “spinlock_acq_commit”void spinlock_acq_commit(struct spinlock_acq_scope *scope) source spinlock_acq_abort
Section titled “spinlock_acq_abort”void spinlock_acq_abort(struct spinlock_acq_scope *scope) source spinlock_rel_begin
Section titled “spinlock_rel_begin”void spinlock_rel_begin(
struct spinlock_rel_scope *scope,
struct spinlock *lock,
const struct lock_chk_site *site
) source spinlock_rel_commit
Section titled “spinlock_rel_commit”void spinlock_rel_commit(struct spinlock_rel_scope *scope) source spinlock_shallow_push
Section titled “spinlock_shallow_push”void spinlock_shallow_push(
struct spinlock *lock,
enum irql irql,
const struct lock_chk_site *site
) source spinlock_shallow_validate_top
Section titled “spinlock_shallow_validate_top”void spinlock_shallow_validate_top(
struct spinlock *lock,
enum irql old,
const struct lock_chk_site *site
) source spinlock_shallow_pop
Section titled “spinlock_shallow_pop”spinlock_assert_held_deep
Section titled “spinlock_assert_held_deep”bool spinlock_assert_held_deep(
struct spinlock *lock,
bool want_held,
const struct lock_chk_site *site
) source spinlock_assert_initialized
Section titled “spinlock_assert_initialized”spinlock_policy_set_internal
Section titled “spinlock_policy_set_internal”void spinlock_policy_set_internal(
struct spinlock *lock,
enum lock_chk_flags flags
) source spin_trylock_physical
Section titled “spin_trylock_physical”cc_warn_unused_result bool spin_trylock_physical(struct spinlock *lock) source spin_lock_physical
Section titled “spin_lock_physical”spin_unlock_physical
Section titled “spin_unlock_physical”spinlock_init_chk_full
Section titled “spinlock_init_chk_full”void spinlock_init_chk_full(
struct spinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source spinlock_restore_interrupts
Section titled “spinlock_restore_interrupts”void spinlock_restore_interrupts(bool enabled) source spin_trylock_raw_full
Section titled “spin_trylock_raw_full”cc_warn_unused_result bool spin_trylock_raw_full(
struct spinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spin_lock_raw_full
Section titled “spin_lock_raw_full”void spin_lock_raw_full(
struct spinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spin_unlock_raw_full
Section titled “spin_unlock_raw_full”void spin_unlock_raw_full(
struct spinlock *lock,
const struct lock_chk_site *site
) source spin_unlock_full
Section titled “spin_unlock_full”void spin_unlock_full(
struct spinlock *lock,
enum irql old,
const struct lock_chk_site *site
) source spin_lock_full
Section titled “spin_lock_full”irql spin_lock_full(
struct spinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spin_lock_high_full
Section titled “spin_lock_high_full”irql spin_lock_high_full(
struct spinlock *lock,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spin_trylock_full
Section titled “spin_trylock_full”cc_warn_unused_result bool spin_trylock_full(
struct spinlock *lock,
enum irql *out,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spin_trylock_high_full
Section titled “spin_trylock_high_full”cc_warn_unused_result bool spin_trylock_high_full(
struct spinlock *lock,
enum irql *out,
enum lock_subclass sc,
const struct lock_chk_site *site
) source spinlock_locked
Section titled “spinlock_locked”spinlock_set_chk_flags
Section titled “spinlock_set_chk_flags”void spinlock_set_chk_flags(
struct spinlock *lock,
enum lock_chk_flags flags
) source spinlock_reinit_chk
Section titled “spinlock_reinit_chk”void spinlock_reinit_chk(
struct spinlock *lock,
const struct lock_chk_class *class,
enum lock_chk_flags flags
) source spinlock_assert_held_full
Section titled “spinlock_assert_held_full”void spinlock_assert_held_full(
struct spinlock *lock,
const struct lock_chk_site *site
) source spinlock_assert_not_held_full
Section titled “spinlock_assert_not_held_full”void spinlock_assert_not_held_full(
struct spinlock *lock,
const struct lock_chk_site *site
) source spinlock_guard_assume
Section titled “spinlock_guard_assume”spinlock_guard_exit
Section titled “spinlock_guard_exit”void spinlock_guard_exit(struct spinlock_guard *g) source spin_guard_enter
Section titled “spin_guard_enter”struct spinlock_guard spin_guard_enter(struct spinlock *lock) source spin_guard_high_enter
Section titled “spin_guard_high_enter”struct spinlock_guard spin_guard_high_enter(struct spinlock *lock) source spin_guard_high_subclass_enter
Section titled “spin_guard_high_subclass_enter”struct spinlock_guard spin_guard_high_subclass_enter(
struct spinlock *lock,
enum lock_subclass sc
) source spin_guard_subclass_enter
Section titled “spin_guard_subclass_enter”struct spinlock_guard spin_guard_subclass_enter(
struct spinlock *lock,
enum lock_subclass sc
) source Variables
Section titled “Variables”struct raw_spinlock raw source struct lock_chk_lock chk source irq_usage
Section titled “irq_usage”atomic(enum lock_op_flags) irq_usage source Macros
Section titled “Macros”SPINLOCK_INIT
Section titled “SPINLOCK_INIT”#define SPINLOCK_INIT SPINLOCK_INIT_CHK(NULL, LOCK_CHKD_FULL) source SPINLOCK_DEFINE
Section titled “SPINLOCK_DEFINE”#define SPINLOCK_DEFINE(id) source Expansion
#define SPINLOCK_DEFINE(id) struct spinlock id = SPINLOCK_INIT SPINLOCK_DEFINE_CHK
Section titled “SPINLOCK_DEFINE_CHK”#define SPINLOCK_DEFINE_CHK(id, class_, flags_) source Expansion
#define SPINLOCK_DEFINE_CHK(id, class_, flags_) \
struct spinlock id = SPINLOCK_INIT_CHK((class_), (flags_)) spinlock_init_1
Section titled “spinlock_init_1”#define spinlock_init_1(lock_) source Expansion
#define spinlock_init_1(lock_) spinlock_init_2(lock_, LOCK_CHKD_FULL) spinlock_init_2
Section titled “spinlock_init_2”#define spinlock_init_2(lock_, flags_) source Expansion
#define spinlock_init_2(lock_, flags_) \
spinlock_init_auto_internal((lock_), (flags_)) spinlock_init
Section titled “spinlock_init”#define spinlock_init(...) source Expansion
#define spinlock_init(...) PP_CALL(spinlock_init, __VA_ARGS__) __SPINLOCK_SHALLOW_VALUE_INIT
Section titled “__SPINLOCK_SHALLOW_VALUE_INIT”#define __SPINLOCK_SHALLOW_VALUE_INIT source Expansion
#define __SPINLOCK_SHALLOW_VALUE_INIT \
, .irq_usage = ATOMIC_VAR_INIT(LOCK_OP_IRQ_NONE) __SPINLOCK_LOCK_CHK_VALUE_INIT
Section titled “__SPINLOCK_LOCK_CHK_VALUE_INIT”#define __SPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) source Expansion
#define __SPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) \
, .chk = LOCK_CHK_LOCK_VALUE_INIT((class_), (flags_)) SPINLOCK_INIT_CHK
Section titled “SPINLOCK_INIT_CHK”#define SPINLOCK_INIT_CHK(class_, flags_) source Expansion
#define SPINLOCK_INIT_CHK(class_, flags_) \
((struct spinlock) { \
.raw = RAW_SPINLOCK_INIT __SPINLOCK_LOCK_CHK_VALUE_INIT( \
(class_), (flags_)) __SPINLOCK_SHALLOW_VALUE_INIT}) spinlock_init_chk
Section titled “spinlock_init_chk”#define spinlock_init_chk(lock_, class_, flags_) source Expansion
#define spinlock_init_chk(lock_, class_, flags_) \
spinlock_init_chk_full((lock_), (class_), (flags_)) spinlock_init_auto_internal
Section titled “spinlock_init_auto_internal”#define spinlock_init_auto_internal(lock_, flags_) source Expansion
#define spinlock_init_auto_internal(lock_, flags_) \
do { \
static const struct lock_chk_class __auto_class = { \
.name = #lock_, \
.file = __RELFILE__, \
.line = __LINE__, \
}; \
spinlock_init_chk_full((lock_), &__auto_class, (flags_)); \
} while (0) __SPINLOCK_SHALLOW_VALUE_INIT
Section titled “__SPINLOCK_SHALLOW_VALUE_INIT”#define __SPINLOCK_SHALLOW_VALUE_INIT source __SPINLOCK_LOCK_CHK_VALUE_INIT
Section titled “__SPINLOCK_LOCK_CHK_VALUE_INIT”#define __SPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) source Expansion
#define __SPINLOCK_LOCK_CHK_VALUE_INIT(class_, flags_) SPINLOCK_INIT_CHK
Section titled “SPINLOCK_INIT_CHK”#define SPINLOCK_INIT_CHK(class_, flags_) source Expansion
#define SPINLOCK_INIT_CHK(class_, flags_) \
((struct spinlock) {.raw = RAW_SPINLOCK_INIT}) spinlock_init_chk
Section titled “spinlock_init_chk”#define spinlock_init_chk(lock_, class_, flags_) source Expansion
#define spinlock_init_chk(lock_, class_, flags_) \
spinlock_init_chk_full((lock_), NULL, LOCK_UNCHKD) spinlock_init_auto_internal
Section titled “spinlock_init_auto_internal”#define spinlock_init_auto_internal(lock_, flags_) source Expansion
#define spinlock_init_auto_internal(lock_, flags_) \
spinlock_init_chk_full((lock_), NULL, LOCK_UNCHKD) spin_lock
Section titled “spin_lock”#define spin_lock(lock_) source Expansion
#define spin_lock(lock_) \
spin_lock_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) spin_lock_subclass
Section titled “spin_lock_subclass”#define spin_lock_subclass(lock_, subclass_) source Expansion
#define spin_lock_subclass(lock_, subclass_) \
spin_lock_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) spin_lock_high
Section titled “spin_lock_high”#define spin_lock_high(lock_) source Expansion
#define spin_lock_high(lock_) \
spin_lock_high_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) spin_lock_high_subclass
Section titled “spin_lock_high_subclass”#define spin_lock_high_subclass(lock_, subclass_) source Expansion
#define spin_lock_high_subclass(lock_, subclass_) \
spin_lock_high_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) spin_trylock
Section titled “spin_trylock”#define spin_trylock(lock_, out_) source Expansion
#define spin_trylock(lock_, out_) \
spin_trylock_full((lock_), (out_), LOCK_SUBCLASS_PRIMARY, \
LOCK_CHK_SITE_HERE()) spin_trylock_subclass
Section titled “spin_trylock_subclass”#define spin_trylock_subclass(lock_, out_, subclass_) source Expansion
#define spin_trylock_subclass(lock_, out_, subclass_) \
spin_trylock_full((lock_), (out_), (subclass_), LOCK_CHK_SITE_HERE()) spin_trylock_high
Section titled “spin_trylock_high”#define spin_trylock_high(lock_, out_) source Expansion
#define spin_trylock_high(lock_, out_) \
spin_trylock_high_full((lock_), (out_), LOCK_SUBCLASS_PRIMARY, \
LOCK_CHK_SITE_HERE()) spin_trylock_high_subclass
Section titled “spin_trylock_high_subclass”#define spin_trylock_high_subclass(lock_, out_, subclass_) source Expansion
#define spin_trylock_high_subclass(lock_, out_, subclass_) \
spin_trylock_high_full((lock_), (out_) (subclass_), LOCK_CHK_SITE_HERE()) spin_unlock
Section titled “spin_unlock”#define spin_unlock(lock_, old_) source Expansion
#define spin_unlock(lock_, old_) \
spin_unlock_full((lock_), (old_), LOCK_CHK_SITE_HERE()) spin_lock_raw
Section titled “spin_lock_raw”#define spin_lock_raw(lock_) source Expansion
#define spin_lock_raw(lock_) \
spin_lock_raw_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) spin_lock_raw_subclass
Section titled “spin_lock_raw_subclass”#define spin_lock_raw_subclass(lock_) source Expansion
#define spin_lock_raw_subclass(lock_) \
spin_lock_raw_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) spin_trylock_raw
Section titled “spin_trylock_raw”#define spin_trylock_raw(lock_) source Expansion
#define spin_trylock_raw(lock_) \
spin_trylock_raw_full((lock_), LOCK_SUBCLASS_PRIMARY, LOCK_CHK_SITE_HERE()) spin_trylock_raw_subclass
Section titled “spin_trylock_raw_subclass”#define spin_trylock_raw_subclass(lock_) source Expansion
#define spin_trylock_raw_subclass(lock_) \
spin_trylock_raw_full((lock_), (subclass_), LOCK_CHK_SITE_HERE()) spin_unlock_raw
Section titled “spin_unlock_raw”#define spin_unlock_raw(lock_) source Expansion
#define spin_unlock_raw(lock_) \
spin_unlock_raw_full((lock_), LOCK_CHK_SITE_HERE()) SPINLOCK_ASSERT_HELD_RAW
Section titled “SPINLOCK_ASSERT_HELD_RAW”#define SPINLOCK_ASSERT_HELD_RAW(l) source A raw check to make sure it is locked, but could be by anyone
Expansion
#define SPINLOCK_ASSERT_HELD_RAW(l) \
enforce(spinlock_locked(l), "spinlock not locked") SPINLOCK_ASSERT_HELD
Section titled “SPINLOCK_ASSERT_HELD”#define SPINLOCK_ASSERT_HELD(l) source Expansion
#define SPINLOCK_ASSERT_HELD(l) \
spinlock_assert_held_full((l), LOCK_CHK_SITE_HERE()) SPINLOCK_ASSERT_NOT_HELD
Section titled “SPINLOCK_ASSERT_NOT_HELD”#define SPINLOCK_ASSERT_NOT_HELD(l) source Expansion
#define SPINLOCK_ASSERT_NOT_HELD(l) \
spinlock_assert_not_held_full((l), LOCK_CHK_SITE_HERE()) spin_guard
Section titled “spin_guard”#define spin_guard(lock_) source Expansion
#define spin_guard(lock_) \
cc_cleanup(spinlock_guard_exit) struct spinlock_guard PP_CONCAT( \
spin_guard_, __COUNTER__) = \
(spinlock_guard_assume(lock_), spin_guard_enter(lock_)) spin_guard_subclass
Section titled “spin_guard_subclass”#define spin_guard_subclass(lock_, subclass_) source Expansion
#define spin_guard_subclass(lock_, subclass_) \
cc_cleanup(spinlock_guard_exit) struct spinlock_guard PP_CONCAT( \
spin_guard_, __COUNTER__) = \
(spinlock_guard_assume(lock_), \
spin_guard_subclass_enter((lock_), (subclass_))) spin_guard_high
Section titled “spin_guard_high”#define spin_guard_high(lock_) source Expansion
#define spin_guard_high(lock_) \
cc_cleanup(spinlock_guard_exit) struct spinlock_guard PP_CONCAT( \
spin_guard_high_, __COUNTER__) = \
(spinlock_guard_assume(lock_), spin_guard_high_enter(lock_)) spin_guard_high_subclass
Section titled “spin_guard_high_subclass”#define spin_guard_high_subclass(lock_, subclass_) source Expansion
#define spin_guard_high_subclass(lock_, subclass_) \
cc_cleanup(spinlock_guard_exit) struct spinlock_guard PP_CONCAT( \
spin_guard_high_, __COUNTER__) = \
(spinlock_guard_assume(lock_), \
spin_guard_high_enter((lock_), (subclass_)))