Go to the documentation of this file.
32 #ifndef _ASM_X86_RWSEM_H
33 #define _ASM_X86_RWSEM_H
35 #ifndef _LINUX_RWSEM_H
36 #error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
49 # define RWSEM_ACTIVE_MASK 0xffffffffL
51 # define RWSEM_ACTIVE_MASK 0x0000ffffL
54 #define RWSEM_UNLOCKED_VALUE 0x00000000L
55 #define RWSEM_ACTIVE_BIAS 0x00000001L
56 #define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
57 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
58 #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
65 asm volatile(
"# beginning down_read\n\t"
69 " call call_rwsem_down_read_failed\n"
71 "# ending down_read\n\t"
83 asm volatile(
"# beginning __down_read_trylock\n\t"
92 "# ending __down_read_trylock\n\t"
93 :
"+m" (sem->
count),
"=&a" (result),
"=&r" (
tmp)
96 return result >= 0 ? 1 : 0;
105 asm volatile(
"# beginning down_write\n\t"
111 " call call_rwsem_down_write_failed\n"
113 "# ending down_write"
114 :
"+m" (sem->
count),
"=d" (tmp)
142 asm volatile(
"# beginning __up_read\n\t"
146 " call call_rwsem_wake\n"
148 "# ending __up_read\n"
149 :
"+m" (sem->
count),
"=d" (tmp)
160 asm volatile(
"# beginning __up_write\n\t"
164 " call call_rwsem_wake\n"
166 "# ending __up_write\n"
167 :
"+m" (sem->
count),
"=d" (tmp)
177 asm volatile(
"# beginning __downgrade_write\n\t"
184 " call call_rwsem_downgrade_wake\n"
186 "# ending __downgrade_write\n"