1 #ifndef _ASM_X86_RWLOCK_H
2 #define _ASM_X86_RWLOCK_H
6 #if CONFIG_NR_CPUS <= 2048
15 #define RW_LOCK_BIAS 0x00100000
16 #define READ_LOCK_SIZE(insn) __ASM_FORM(insn##l)
17 #define READ_LOCK_ATOMIC(n) atomic_##n
18 #define WRITE_LOCK_ADD(n) __ASM_FORM_COMMA(addl n)
19 #define WRITE_LOCK_SUB(n) __ASM_FORM_COMMA(subl n)
20 #define WRITE_LOCK_CMP RW_LOCK_BIAS
22 #else /* CONFIG_NR_CPUS > 2048 */
24 #include <linux/const.h>
36 #define RW_LOCK_BIAS (_AC(1,L) << 32)
37 #define READ_LOCK_SIZE(insn) __ASM_FORM(insn##q)
38 #define READ_LOCK_ATOMIC(n) atomic64_##n
39 #define WRITE_LOCK_ADD(n) __ASM_FORM(incl)
40 #define WRITE_LOCK_SUB(n) __ASM_FORM(decl)
41 #define WRITE_LOCK_CMP 1
43 #endif /* CONFIG_NR_CPUS */
45 #define __ARCH_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
47 /* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */
49 #endif /* _ASM_X86_RWLOCK_H */