1 /****************************************************************************
2 ****************************************************************************
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.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_SPINLOCK_TYPES_H
13 #define __LINUX_SPINLOCK_TYPES_H
15 #include <linux/lockdep.h>
17 #include <linux/spinlock_types_up.h>
20 raw_spinlock_t raw_lock;
23 #define SPINLOCK_MAGIC 0xdead4ead
26 raw_rwlock_t raw_lock;
29 #define RWLOCK_MAGIC 0xdeaf1eed
31 #define SPINLOCK_OWNER_INIT ((void *)-1L)
33 #define SPIN_DEP_MAP_INIT(lockname)
35 #define RW_DEP_MAP_INIT(lockname)
37 #define __SPIN_LOCK_UNLOCKED(lockname) (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED, SPIN_DEP_MAP_INIT(lockname) }
38 #define __RW_LOCK_UNLOCKED(lockname) (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED, RW_DEP_MAP_INIT(lockname) }
40 #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init)
41 #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init)
43 #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
44 #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x)