Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / platforms / android-16 / arch-arm / usr / include / asm / semaphore.h
blob7c5618a3a2e5377bccd163cceaca1ef6464cf24f
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 __ASM_ARM_SEMAPHORE_H
13 #define __ASM_ARM_SEMAPHORE_H
15 #include <linux/linkage.h>
16 #include <linux/spinlock.h>
17 #include <linux/wait.h>
18 #include <linux/rwsem.h>
20 #include <asm/atomic.h>
21 #include <asm/locks.h>
23 struct semaphore {
24 atomic_t count;
25 int sleepers;
26 wait_queue_head_t wait;
29 #define __SEMAPHORE_INIT(name, cnt) { .count = ATOMIC_INIT(cnt), .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), }
31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
33 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
34 #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
36 #endif