diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2014-07-11 15:26:11 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-03-20 11:26:41 -0400 |
commit | 58fe57efcc0f98c6b13e4323eb6f043a89e2ae8d (patch) | |
tree | 9825df116ba542d1b799d5a0a4299e9bdfbb865d /include | |
parent | 08dc7bde72d57a85b274e4dabd54330b30dddfb2 (diff) |
work-simple: Simple work queue implemenation
Provides a framework for enqueuing callbacks from irq context
PREEMPT_RT_FULL safe. The callbacks are executed in kthread context.
Bases on wait-simple.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/work-simple.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/work-simple.h b/include/linux/work-simple.h new file mode 100644 index 000000000000..f175fa9a6016 --- /dev/null +++ b/include/linux/work-simple.h @@ -0,0 +1,24 @@ +#ifndef _LINUX_SWORK_H +#define _LINUX_SWORK_H + +#include <linux/list.h> + +struct swork_event { + struct list_head item; + unsigned long flags; + void (*func)(struct swork_event *); +}; + +static inline void INIT_SWORK(struct swork_event *event, + void (*func)(struct swork_event *)) +{ + event->flags = 0; + event->func = func; +} + +bool swork_queue(struct swork_event *sev); + +int swork_get(void); +void swork_put(void); + +#endif /* _LINUX_SWORK_H */ |