blob: b466939bdccec9a6cab48b3178dfb2ceb0617bee [file] [log] [blame]
Harald Welte9f240b62016-03-18 10:32:56 +01001#pragma once
2
3#include "linuxlist.h"
4
5static inline void llist_add_tail_irqsafe(struct llist_head *_new,
6 struct llist_head *head)
7{
8 __disable_irq();
9 llist_add_tail(_new, head);
10 __enable_irq();
11}
12
13static inline struct llist_head *llist_head_dequeue_irqsafe(struct llist_head *head)
14{
15 struct llist_head *lh;
16
17 __disable_irq();
18 if (llist_empty(head)) {
19 lh = NULL;
20 } else {
21 lh = head->next;
22 llist_del(lh);
23 }
24 __enable_irq();
25
26 return lh;
27}