blob: 12fab2cea7f36ef6f68a56885a22a8e728423a9b [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/timer.h>
16#include <linux/linkage.h>
17#include <linux/bitops.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080018
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019struct workqueue_struct;
Ben Cheng4b29af02012-03-07 16:14:53 -080020
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021struct 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080029
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080030struct execute_work {
31 struct work_struct work;
32};
Ben Cheng4b29af02012-03-07 16:14:53 -080033
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#define __WORK_INITIALIZER(n, f, d) { .entry = { &(n).entry, &(n).entry }, .func = (f), .data = (d), .timer = TIMER_INITIALIZER(NULL, 0, 0), }
Ben Cheng4b29af02012-03-07 16:14:53 -080035
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036#define DECLARE_WORK(n, f, d) struct work_struct n = __WORK_INITIALIZER(n, f, d)
Ben Cheng4b29af02012-03-07 16:14:53 -080037
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080038#define PREPARE_WORK(_work, _func, _data) do { (_work)->func = _func; (_work)->data = _data; } while (0)
Ben Cheng4b29af02012-03-07 16:14:53 -080039
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#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)
Ben Cheng4b29af02012-03-07 16:14:53 -080041
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042#define create_workqueue(name) __create_workqueue((name), 0)
43#define create_singlethread_workqueue(name) __create_workqueue((name), 1)
Ben Cheng4b29af02012-03-07 16:14:53 -080044
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045#endif