Locked list
include/structures/locked_list.h View source View on GitHubDoubly linked list with a lock and counter for elements
Structs
Section titled “Structs”locked_list
Section titled “locked_list” struct locked_list (4 fields) source
Functions
Section titled “Functions”locked_list_lock
Section titled “locked_list_lock”enum irql locked_list_lock(struct locked_list *ll) source locked_list_unlock
Section titled “locked_list_unlock”void locked_list_unlock(struct locked_list *ll, enum irql irql) source locked_list_empty
Section titled “locked_list_empty”bool locked_list_empty(struct locked_list *ll) source locked_list_add
Section titled “locked_list_add”void locked_list_add(struct locked_list *ll, struct list_node *lh) source locked_list_del
Section titled “locked_list_del”void locked_list_del(struct locked_list *ll, struct list_node *lh) source locked_list_del_locked
Section titled “locked_list_del_locked”void locked_list_del_locked(
struct locked_list *ll,
struct list_node *lh
) source locked_list_pop_front
Section titled “locked_list_pop_front”struct list_node * locked_list_pop_front(struct locked_list *ll) source locked_list_num_elems
Section titled “locked_list_num_elems”size_t locked_list_num_elems(struct locked_list *ll) source locked_list_init
Section titled “locked_list_init”void locked_list_init(struct locked_list *ll, bool irq_disable) source Macros
Section titled “Macros”LOCKED_LIST_INIT
Section titled “LOCKED_LIST_INIT”#define LOCKED_LIST_INIT(ll, irq_disable) source Expansion
#define LOCKED_LIST_INIT(ll, irq_disable) \
(struct locked_list) { \
.list = LIST_HEAD_INIT(ll.list), .lock = SPINLOCK_INIT, \
.num_elems = ATOMIC_VAR_INIT(0), .lock_high = irq_disable \
} LOCKED_LIST_DEFINE
Section titled “LOCKED_LIST_DEFINE”#define LOCKED_LIST_DEFINE(name, irq_disable) source Expansion
#define LOCKED_LIST_DEFINE(name, irq_disable) \
struct locked_list name = LOCKED_LIST_INIT(name, irq_disable) LOCKED_LIST_INIT_IRQ_DISABLE
Section titled “LOCKED_LIST_INIT_IRQ_DISABLE”#define LOCKED_LIST_INIT_IRQ_DISABLE true source LOCKED_LIST_INIT_NORMAL
Section titled “LOCKED_LIST_INIT_NORMAL”#define LOCKED_LIST_INIT_NORMAL false source LOCKED_LIST_DO
Section titled “LOCKED_LIST_DO”Expansion
#define LOCKED_LIST_DO(ll, action) \
enum irql __macro_irql = locked_list_lock(ll); \
action; \
locked_list_unlock(ll, __macro_irql);