1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_WORKQUEUE_H
13 #define _LINUX_WORKQUEUE_H
15 #include <linux/timer.h>
16 #include <linux/linkage.h>
17 #include <linux/bitops.h>
19 struct workqueue_struct;
22 unsigned long pending;
23 struct list_head entry;
27 struct timer_list timer;
31 struct work_struct work;
34 #define __WORK_INITIALIZER(n, f, d) { .entry = { &(n).entry, &(n).entry }, .func = (f), .data = (d), .timer = TIMER_INITIALIZER(NULL, 0, 0), }
36 #define DECLARE_WORK(n, f, d) struct work_struct n = __WORK_INITIALIZER(n, f, d)
38 #define PREPARE_WORK(_work, _func, _data) do { (_work)->func = _func; (_work)->data = _data; } while (0)
40 #define INIT_WORK(_work, _func, _data) do { INIT_LIST_HEAD(&(_work)->entry); (_work)->pending = 0; PREPARE_WORK((_work), (_func), (_data)); init_timer(&(_work)->timer); } while (0)
42 #define create_workqueue(name) __create_workqueue((name), 0)
43 #define create_singlethread_workqueue(name) __create_workqueue((name), 1)