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_SPINLOCK_H 13 #define __ASM_SPINLOCK_H 14 15 #if __LINUX_ARM_ARCH__ < 6 16 #error SMP not supported on pre-ARMv6 CPUs 17 #endif 18 19 #define __raw_spin_is_locked(x) ((x)->lock != 0) 20 #define __raw_spin_unlock_wait(lock) do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) 21 22 #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 23 24 #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) 25 #define __raw_write_can_lock(x) ((x)->lock == 0x80000000) 26 #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) 27 #endif 28