Skip to content

Locked list

struct locked_list {
struct list_head list;
struct spinlock lock;
atomic_size_t num_elems;
bool lock_irq_disable;
};

struct locked_list referenced types:

enum irql locked_list_lock(struct locked_list *ll);

locked_list_lock referenced types:

void locked_list_unlock(struct locked_list *ll, enum irql irql);

locked_list_unlock referenced types:

bool locked_list_empty(struct locked_list *ll);

locked_list_empty referenced types:

void locked_list_add(struct locked_list *ll, struct list_head *lh);

locked_list_add referenced types:

void locked_list_del(struct locked_list *ll, struct list_head *lh);

locked_list_del referenced types:

void locked_list_del_locked(struct locked_list *ll, struct list_head *lh);

locked_list_del_locked referenced types:

struct list_head locked_list_pop_front(struct locked_list *ll);

locked_list_pop_front referenced types:

size_t locked_list_num_elems(struct locked_list *ll);

locked_list_num_elems referenced types:

void locked_list_init(struct locked_list *ll, bool irq_disable);

locked_list_init referenced types:

#define LOCKED_LIST_INIT_IRQ_DISABLE true
#define LOCKED_LIST_INIT_NORMAL false
#define LOCKED_LIST_SET_NUM_ELEMS(ll, c) atomic_store(&ll->num_elems, c)
#define LOCKED_LIST_GET_NUM_ELEMS(ll) atomic_load(&ll->num_elems)
#define LOCKED_LIST_INC_NUM_ELEMS(ll) atomic_fetch_add(&ll->num_elems, 1)
#define LOCKED_LIST_DEC_NUM_ELEMS(ll) atomic_fetch_sub(&ll->num_elems, 1)
#define LOCKED_LIST_DO(ll, action) \ enum irql __macro_irql = locked_list_lock(ll); \ action; \ locked_list_unlock(ll, __macro_irql);