blob: ee18211815da1582cd9859f5119efdff555a14b3 [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_COMPLETION_H
13#define __LINUX_COMPLETION_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/wait.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080016
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017struct completion {
18 unsigned int done;
19 wait_queue_head_t wait;
20};
Ben Cheng4b29af02012-03-07 16:14:53 -080021
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080022#define COMPLETION_INITIALIZER(work) { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
Ben Cheng4b29af02012-03-07 16:14:53 -080023
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#define COMPLETION_INITIALIZER_ONSTACK(work) ({ init_completion(&work); work; })
Ben Cheng4b29af02012-03-07 16:14:53 -080025
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080026#define DECLARE_COMPLETION(work) struct completion work = COMPLETION_INITIALIZER(work)
Ben Cheng4b29af02012-03-07 16:14:53 -080027
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080028#define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
Ben Cheng4b29af02012-03-07 16:14:53 -080029
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080030#define INIT_COMPLETION(x) ((x).done = 0)
Ben Cheng4b29af02012-03-07 16:14:53 -080031
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032#endif