1 /* SPDX-License-Identifier: GPL-2.0 */
9 #include "int_typedefs.h"
11 #include <linux/types.h>
13 /* Stub workqueue implementation. */
16 typedef void (*work_func_t)(struct work_struct *work);
17 void delayed_work_timer_fn(unsigned long __data);
20 /* atomic_long_t data; */
23 struct list_head entry;
26 struct lockdep_map lockdep_map;
31 struct hlist_node entry;
32 unsigned long expires;
33 void (*function)(unsigned long);
40 struct work_struct work;
41 struct timer_list timer;
43 /* target workqueue and CPU ->timer uses to queue ->work */
44 struct workqueue_struct *wq;
49 static inline bool schedule_work(struct work_struct *work)
55 static inline bool schedule_work_on(int cpu, struct work_struct *work)
61 static inline bool queue_work(struct workqueue_struct *wq,
62 struct work_struct *work)
68 static inline bool queue_delayed_work(struct workqueue_struct *wq,
69 struct delayed_work *dwork,
76 #define INIT_WORK(w, f) \
82 #define INIT_DELAYED_WORK(w, f) INIT_WORK(&(w)->work, (f))
84 #define __WORK_INITIALIZER(n, f) { \
86 .entry = { &(n).entry, &(n).entry }, \
90 /* Don't bother initializing timer. */
91 #define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
92 .work = __WORK_INITIALIZER((n).work, (f)), \
95 #define DECLARE_WORK(n, f) \
96 struct workqueue_struct n = __WORK_INITIALIZER
98 #define DECLARE_DELAYED_WORK(n, f) \
99 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f, 0)
101 #define system_power_efficient_wq ((struct workqueue_struct *) NULL)