1/**************************************************************************** 2 **************************************************************************** 3 *** 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. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _LINUX_WORKQUEUE_H 13#define _LINUX_WORKQUEUE_H 14 15#include <linux/timer.h> 16#include <linux/linkage.h> 17#include <linux/bitops.h> 18 19struct workqueue_struct; 20 21struct work_struct { 22 unsigned long pending; 23 struct list_head entry; 24 void (*func)(void *); 25 void *data; 26 void *wq_data; 27 struct timer_list timer; 28}; 29 30struct execute_work { 31 struct work_struct work; 32}; 33 34#define __WORK_INITIALIZER(n, f, d) { .entry = { &(n).entry, &(n).entry }, .func = (f), .data = (d), .timer = TIMER_INITIALIZER(NULL, 0, 0), } 35 36#define DECLARE_WORK(n, f, d) struct work_struct n = __WORK_INITIALIZER(n, f, d) 37 38#define PREPARE_WORK(_work, _func, _data) do { (_work)->func = _func; (_work)->data = _data; } while (0) 39 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) 41 42#define create_workqueue(name) __create_workqueue((name), 0) 43#define create_singlethread_workqueue(name) __create_workqueue((name), 1) 44 45#endif 46