.. | .. |
---|
3 | 3 | #define _LINUX_IRQ_WORK_H |
---|
4 | 4 | |
---|
5 | 5 | #include <linux/smp_types.h> |
---|
6 | | -#include <linux/rcuwait.h> |
---|
7 | 6 | |
---|
8 | 7 | /* |
---|
9 | 8 | * An entry can be in one of four states: |
---|
.. | .. |
---|
23 | 22 | }; |
---|
24 | 23 | }; |
---|
25 | 24 | void (*func)(struct irq_work *); |
---|
26 | | - struct rcuwait irqwait; |
---|
27 | 25 | }; |
---|
28 | 26 | |
---|
29 | 27 | static inline |
---|
.. | .. |
---|
31 | 29 | { |
---|
32 | 30 | atomic_set(&work->flags, 0); |
---|
33 | 31 | work->func = func; |
---|
34 | | - rcuwait_init(&work->irqwait); |
---|
35 | 32 | } |
---|
36 | 33 | |
---|
37 | 34 | #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { \ |
---|
38 | 35 | .flags = ATOMIC_INIT(0), \ |
---|
39 | | - .func = (_f), \ |
---|
40 | | - .irqwait = __RCUWAIT_INITIALIZER(irqwait), \ |
---|
| 36 | + .func = (_f) \ |
---|
41 | 37 | } |
---|
42 | 38 | |
---|
43 | | -#define __IRQ_WORK_INIT(_func, _flags) (struct irq_work){ \ |
---|
44 | | - .flags = ATOMIC_INIT(_flags), \ |
---|
45 | | - .func = (_func), \ |
---|
46 | | - .irqwait = __RCUWAIT_INITIALIZER(irqwait), \ |
---|
47 | | -} |
---|
48 | | - |
---|
49 | | -#define IRQ_WORK_INIT(_func) __IRQ_WORK_INIT(_func, 0) |
---|
50 | | -#define IRQ_WORK_INIT_LAZY(_func) __IRQ_WORK_INIT(_func, IRQ_WORK_LAZY) |
---|
51 | | -#define IRQ_WORK_INIT_HARD(_func) __IRQ_WORK_INIT(_func, IRQ_WORK_HARD_IRQ) |
---|
52 | | - |
---|
53 | | -static inline bool irq_work_is_busy(struct irq_work *work) |
---|
54 | | -{ |
---|
55 | | - return atomic_read(&work->flags) & IRQ_WORK_BUSY; |
---|
56 | | -} |
---|
57 | | - |
---|
58 | | -static inline bool irq_work_is_hard(struct irq_work *work) |
---|
59 | | -{ |
---|
60 | | - return atomic_read(&work->flags) & IRQ_WORK_HARD_IRQ; |
---|
61 | | -} |
---|
62 | 39 | |
---|
63 | 40 | bool irq_work_queue(struct irq_work *work); |
---|
64 | 41 | bool irq_work_queue_on(struct irq_work *work, int cpu); |
---|