Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/workqueue.h
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
struct work_struct { | struct work_struct { | ||||
struct task work_task; | struct task work_task; | ||||
struct workqueue_struct *work_queue; | struct workqueue_struct *work_queue; | ||||
work_func_t func; | work_func_t func; | ||||
atomic_t state; | atomic_t state; | ||||
}; | }; | ||||
struct rcu_work { | |||||
struct work_struct work; | |||||
struct rcu_head rcu; | |||||
struct workqueue_struct *wq; | |||||
}; | |||||
#define DECLARE_WORK(name, fn) \ | #define DECLARE_WORK(name, fn) \ | ||||
struct work_struct name; \ | struct work_struct name; \ | ||||
static void name##_init(void *arg) \ | static void name##_init(void *arg) \ | ||||
{ \ | { \ | ||||
INIT_WORK(&name, fn); \ | INIT_WORK(&name, fn); \ | ||||
} \ | } \ | ||||
SYSINIT(name, SI_SUB_LOCK, SI_ORDER_SECOND, name##_init, NULL) | SYSINIT(name, SI_SUB_LOCK, SI_ORDER_SECOND, name##_init, NULL) | ||||
Show All 24 Lines | |||||
#define INIT_WORK(work, fn) \ | #define INIT_WORK(work, fn) \ | ||||
do { \ | do { \ | ||||
(work)->func = (fn); \ | (work)->func = (fn); \ | ||||
(work)->work_queue = NULL; \ | (work)->work_queue = NULL; \ | ||||
atomic_set(&(work)->state, 0); \ | atomic_set(&(work)->state, 0); \ | ||||
TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ | TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ | ||||
} while (0) | } while (0) | ||||
#define INIT_RCU_WORK(_work, _fn) \ | |||||
INIT_WORK(&(_work)->work, (_fn)) | |||||
#define INIT_WORK_ONSTACK(work, fn) \ | #define INIT_WORK_ONSTACK(work, fn) \ | ||||
INIT_WORK(work, fn) | INIT_WORK(work, fn) | ||||
#define INIT_DELAYED_WORK(dwork, fn) \ | #define INIT_DELAYED_WORK(dwork, fn) \ | ||||
linux_init_delayed_work(dwork, fn) | linux_init_delayed_work(dwork, fn) | ||||
#define INIT_DELAYED_WORK_ONSTACK(dwork, fn) \ | #define INIT_DELAYED_WORK_ONSTACK(dwork, fn) \ | ||||
linux_init_delayed_work(dwork, fn) | linux_init_delayed_work(dwork, fn) | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | #define cancel_work_sync(work) \ | ||||
linux_cancel_work_sync(work) | linux_cancel_work_sync(work) | ||||
#define cancel_delayed_work_sync(dwork) \ | #define cancel_delayed_work_sync(dwork) \ | ||||
linux_cancel_delayed_work_sync(dwork) | linux_cancel_delayed_work_sync(dwork) | ||||
#define flush_work(work) \ | #define flush_work(work) \ | ||||
linux_flush_work(work) | linux_flush_work(work) | ||||
#define queue_rcu_work(wq, rwork) \ | |||||
linux_queue_rcu_work(wq, rwork) | |||||
#define flush_rcu_work(rwork) \ | |||||
linux_flush_rcu_work(rwork) | |||||
#define flush_delayed_work(dwork) \ | #define flush_delayed_work(dwork) \ | ||||
linux_flush_delayed_work(dwork) | linux_flush_delayed_work(dwork) | ||||
#define work_pending(work) \ | #define work_pending(work) \ | ||||
linux_work_pending(work) | linux_work_pending(work) | ||||
#define work_busy(work) \ | #define work_busy(work) \ | ||||
linux_work_busy(work) | linux_work_busy(work) | ||||
Show All 29 Lines | |||||
extern bool linux_cancel_delayed_work(struct delayed_work *); | extern bool linux_cancel_delayed_work(struct delayed_work *); | ||||
extern bool linux_cancel_work_sync(struct work_struct *); | extern bool linux_cancel_work_sync(struct work_struct *); | ||||
extern bool linux_cancel_delayed_work_sync(struct delayed_work *); | extern bool linux_cancel_delayed_work_sync(struct delayed_work *); | ||||
extern bool linux_flush_work(struct work_struct *); | extern bool linux_flush_work(struct work_struct *); | ||||
extern bool linux_flush_delayed_work(struct delayed_work *); | extern bool linux_flush_delayed_work(struct delayed_work *); | ||||
extern bool linux_work_pending(struct work_struct *); | extern bool linux_work_pending(struct work_struct *); | ||||
extern bool linux_work_busy(struct work_struct *); | extern bool linux_work_busy(struct work_struct *); | ||||
extern struct work_struct *linux_current_work(void); | extern struct work_struct *linux_current_work(void); | ||||
extern bool linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork); | |||||
extern bool linux_flush_rcu_work(struct rcu_work *rwork); | |||||
#endif /* _LINUX_WORKQUEUE_H_ */ | #endif /* _LINUX_WORKQUEUE_H_ */ |