Lock Validation Layout Types
include/sync/lock_chk_types.h View source View on GitHubStructs
Section titled “Structs”lock_chk_map
Section titled “lock_chk_map” struct lock_chk_map (3 fields) source
§
const struct lock_chk_class *class §
struct lock_chk_class instance_class §
atomic(struct lock_chk_node *) base_node lock_chk_lock
Section titled “lock_chk_lock” struct lock_chk_lock (8 fields) source
§
atomic_bool used §
struct lock_chk_map map §
void *instance §
enum lock_chk_type type : 4 §
enum lock_chk_flags flags : 4 §
bool initialized : 1 §
bool manages_irql : 1 §
bool raw_operation : 1 lock_chk_id
Section titled “lock_chk_id” struct lock_chk_id (3 fields) source
lock_chk_held
Section titled “lock_chk_held” struct lock_chk_held (10 fields) source
§
struct lock_chk_node *node §
struct lock_chk_id lock §
const struct lock_chk_site *acquire_site §
uint64_t acquire_tsc §
enum lock_chk_mode mode §
enum lock_subclass subclass §
bool trylock §
bool raw_operation lock_chk_thread_data
Section titled “lock_chk_thread_data” struct lock_chk_thread_data (4 fields) source
§
struct lock_chk_held held[LOCK_CHK_MAX_HELD_LOCKS] §
uint8_t depth §
uint8_t thread_checked_depth §
uint8_t thread_checked_spin_depth lock_chk_acq_req
Section titled “lock_chk_acq_req” struct lock_chk_acq_req (10 fields) source
§
struct lock_chk_map *map §
struct lock_chk_id lock §
const struct lock_chk_site *site §
enum lock_chk_mode mode §
enum lock_subclass subclass §
enum lock_op_flags op_flags §
bool irqs_enabled : 1 §
bool in_irq : 1 §
bool in_nmi : 1 lock_chk_acq_token
Section titled “lock_chk_acq_token” struct lock_chk_acq_token (5 fields) source
§
struct lock_chk_node *node §
struct lock_chk_node *context_node §
const struct lock_chk_acq_req *request §
struct lock_chk_thread_data *thread_data §
bool active lock_chk_rel_req
Section titled “lock_chk_rel_req” struct lock_chk_rel_req (4 fields) source
§
struct lock_chk_map *map §
struct lock_chk_id lock §
const struct lock_chk_site *site §
enum lock_chk_mode mode lock_chk_rel_token
Section titled “lock_chk_rel_token” struct lock_chk_rel_token (4 fields) source
lock_chk_context_bits
Section titled “lock_chk_context_bits” enum lock_chk_context_bits : uint8_t (4 variants) source
Functions
Section titled “Functions”lock_chk_id_of
Section titled “lock_chk_id_of”struct lock_chk_id lock_chk_id_of(const struct lock_chk_lock *lock) source lock_chk_before_acq
Section titled “lock_chk_before_acq”void lock_chk_before_acq(
struct lock_chk_acq_token *token,
const struct lock_chk_acq_req *request
) source lock_chk_acqd
Section titled “lock_chk_acqd”void lock_chk_acqd(struct lock_chk_acq_token *token) source lock_chk_cancel
Section titled “lock_chk_cancel”void lock_chk_cancel(struct lock_chk_acq_token *token) source lock_chk_before_rel
Section titled “lock_chk_before_rel”void lock_chk_before_rel(
struct lock_chk_rel_token *token,
const struct lock_chk_rel_req *request
) source lock_chk_reld
Section titled “lock_chk_reld”void lock_chk_reld(struct lock_chk_rel_token *token) source lock_chk_assert_held_deep
Section titled “lock_chk_assert_held_deep”bool lock_chk_assert_held_deep(
struct lock_chk_lock *lock,
enum lock_chk_mode mode,
bool want_held,
const struct lock_chk_site *site
) source LOCK_CHK_ASSERT_HELD/NOT_HELD and whatnot use this, which returns true if the engine could evaluate the assertion, and otherwise will return false, and panic if a violation is found
lock_chk_map_runtime_init
Section titled “lock_chk_map_runtime_init”void lock_chk_map_runtime_init(
struct lock_chk_map *map,
const struct lock_chk_class *class
) source lock_chk_acq_req_make
Section titled “lock_chk_acq_req_make”struct lock_chk_acq_req lock_chk_acq_req_make(
struct lock_chk_lock *lock,
const struct lock_chk_site *site,
enum lock_chk_mode mode,
enum lock_subclass subclass,
enum lock_op_flags flags
) source lock_chk_rel_req_make
Section titled “lock_chk_rel_req_make”struct lock_chk_rel_req lock_chk_rel_req_make(
struct lock_chk_lock *lock,
const struct lock_chk_site *site,
enum lock_chk_mode mode
) source Macros
Section titled “Macros”LOCK_CHK_MAX_NODES
Section titled “LOCK_CHK_MAX_NODES”#define LOCK_CHK_MAX_NODES 1024 source LOCK_CHK_MAX_EDGES
Section titled “LOCK_CHK_MAX_EDGES”#define LOCK_CHK_MAX_EDGES 8192 source LOCK_CHK_HASH_BUCKETS
Section titled “LOCK_CHK_HASH_BUCKETS”#define LOCK_CHK_HASH_BUCKETS 1024 source LOCK_CHK_MAX_HELD_LOCKS
Section titled “LOCK_CHK_MAX_HELD_LOCKS”#define LOCK_CHK_MAX_HELD_LOCKS 32 source LOCK_CHK_MAX_SPIN_DEPTH
Section titled “LOCK_CHK_MAX_SPIN_DEPTH”#define LOCK_CHK_MAX_SPIN_DEPTH 32 source LOCK_CHK_MAX_SUBCLASSES
Section titled “LOCK_CHK_MAX_SUBCLASSES”#define LOCK_CHK_MAX_SUBCLASSES 8 source LOCK_CHK_MODE_STATE_COUNT
Section titled “LOCK_CHK_MODE_STATE_COUNT”#define LOCK_CHK_MODE_STATE_COUNT (LOCK_CHK_MAX_NODES * 2) source LOCK_CHK_MAP_VALUE_INIT
Section titled “LOCK_CHK_MAP_VALUE_INIT”#define LOCK_CHK_MAP_VALUE_INIT(class_) source Expansion
#define LOCK_CHK_MAP_VALUE_INIT(class_) \
((struct lock_chk_map) { \
.class = (class_), \
.instance_class = \
{ \
.name = "<instance>", \
.file = __RELFILE__, \
.line = __LINE__, \
}, \
.base_node = ATOMIC_VAR_INIT(NULL), \
}) LOCK_CHK_LOCK_VALUE_INIT
Section titled “LOCK_CHK_LOCK_VALUE_INIT”#define LOCK_CHK_LOCK_VALUE_INIT(class_, flags_) source Expansion
#define LOCK_CHK_LOCK_VALUE_INIT(class_, flags_) \
((struct lock_chk_lock) { \
.flags = (flags_), \
.initialized = true, \
.used = ATOMIC_VAR_INIT(false), \
.map = LOCK_CHK_MAP_VALUE_INIT(class_), \
})