blob: 6a9e8f5399e2ab137b3c251eb49349fdc6b333ac [file] [log] [blame]
Peter Zijlstrae360adb2010-10-14 14:01:34 +08001#ifndef _LINUX_IRQ_WORK_H
2#define _LINUX_IRQ_WORK_H
3
Huang Ying38aaf802011-09-08 14:00:46 +08004#include <linux/llist.h>
5
Peter Zijlstrae360adb2010-10-14 14:01:34 +08006struct irq_work {
Huang Ying38aaf802011-09-08 14:00:46 +08007 unsigned long flags;
8 struct llist_node llnode;
Peter Zijlstrae360adb2010-10-14 14:01:34 +08009 void (*func)(struct irq_work *);
10};
11
12static inline
Huang Ying38aaf802011-09-08 14:00:46 +080013void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
Peter Zijlstrae360adb2010-10-14 14:01:34 +080014{
Huang Ying38aaf802011-09-08 14:00:46 +080015 work->flags = 0;
16 work->func = func;
Peter Zijlstrae360adb2010-10-14 14:01:34 +080017}
18
Huang Ying38aaf802011-09-08 14:00:46 +080019bool irq_work_queue(struct irq_work *work);
Peter Zijlstrae360adb2010-10-14 14:01:34 +080020void irq_work_run(void);
Huang Ying38aaf802011-09-08 14:00:46 +080021void irq_work_sync(struct irq_work *work);
Peter Zijlstrae360adb2010-10-14 14:01:34 +080022
23#endif /* _LINUX_IRQ_WORK_H */