X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ndk%2Fandroid-ndk-r4%2Flinux%2Fplatforms%2Fandroid-3%2Farch-arm%2Fusr%2Finclude%2Flinux%2Fspinlock_types.h;fp=ndk%2Fandroid-ndk-r4%2Flinux%2Fplatforms%2Fandroid-3%2Farch-arm%2Fusr%2Finclude%2Flinux%2Fspinlock_types.h;h=0938b51c7c49ea667fd561356f8fd3d6cbfba4ba;hb=72eddb87bfc38a2f6fae40566ec6380eb838489a;hp=0000000000000000000000000000000000000000;hpb=e19e12d257815bef7bfe4f3d81056a5b2464c464;p=android-x86%2Fprebuilt.git diff --git a/ndk/android-ndk-r4/linux/platforms/android-3/arch-arm/usr/include/linux/spinlock_types.h b/ndk/android-ndk-r4/linux/platforms/android-3/arch-arm/usr/include/linux/spinlock_types.h new file mode 100644 index 0000000..0938b51 --- /dev/null +++ b/ndk/android-ndk-r4/linux/platforms/android-3/arch-arm/usr/include/linux/spinlock_types.h @@ -0,0 +1,46 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + **************************************************************************** + ****************************************************************************/ +#ifndef __LINUX_SPINLOCK_TYPES_H +#define __LINUX_SPINLOCK_TYPES_H + +#include + +#include + +typedef struct { + raw_spinlock_t raw_lock; +} spinlock_t; + +#define SPINLOCK_MAGIC 0xdead4ead + +typedef struct { + raw_rwlock_t raw_lock; +} rwlock_t; + +#define RWLOCK_MAGIC 0xdeaf1eed + +#define SPINLOCK_OWNER_INIT ((void *)-1L) + +#define SPIN_DEP_MAP_INIT(lockname) + +#define RW_DEP_MAP_INIT(lockname) + +#define __SPIN_LOCK_UNLOCKED(lockname) (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, SPIN_DEP_MAP_INIT(lockname) } +#define __RW_LOCK_UNLOCKED(lockname) (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, RW_DEP_MAP_INIT(lockname) } + +#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) +#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) + +#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) +#define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) + +#endif