Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 1 | #ifndef _LINUX_IRQ_WORK_H |
| 2 | #define _LINUX_IRQ_WORK_H |
| 3 | |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 4 | #include <linux/llist.h> |
| 5 | |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 6 | struct irq_work { |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 7 | unsigned long flags; |
| 8 | struct llist_node llnode; |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 9 | void (*func)(struct irq_work *); |
| 10 | }; |
| 11 | |
| 12 | static inline |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 13 | void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *)) |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 14 | { |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 15 | work->flags = 0; |
| 16 | work->func = func; |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 17 | } |
| 18 | |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 19 | bool irq_work_queue(struct irq_work *work); |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 20 | void irq_work_run(void); |
Huang Ying | 38aaf80 | 2011-09-08 14:00:46 +0800 | [diff] [blame] | 21 | void irq_work_sync(struct irq_work *work); |
Peter Zijlstra | e360adb | 2010-10-14 14:01:34 +0800 | [diff] [blame] | 22 | |
| 23 | #endif /* _LINUX_IRQ_WORK_H */ |