1 /* rwsem.S: RW semaphore assembler.
3 * Written by David S. Miller (davem@redhat.com), 2001.
4 * Derived from asm-i386/rwsem.h
7 #include <asm/rwsem-const.h>
21 membar #StoreLoad | #StoreStore
27 call rwsem_down_read_failed
31 .size __down_read, .-__down_read
33 .globl __down_read_trylock
44 membar #StoreLoad | #StoreStore
47 .size __down_read_trylock, .-__down_read_trylock
51 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
52 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
61 membar #StoreLoad | #StoreStore
66 call rwsem_down_write_failed
70 .size __down_write, .-__down_write
72 .globl __down_write_trylock
74 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
75 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
86 membar #StoreLoad | #StoreStore
89 .size __down_write_trylock, .-__down_write_trylock
101 membar #StoreLoad | #StoreStore
104 3: sethi %hi(RWSEM_ACTIVE_MASK), %g1
106 or %g1, %lo(RWSEM_ACTIVE_MASK), %g1
115 .size __up_read, .-__up_read
119 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
120 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
130 membar #StoreLoad | #StoreStore
140 .size __up_write, .-__up_write
142 .globl __downgrade_write
144 sethi %hi(RWSEM_WAITING_BIAS), %g1
145 or %g1, %lo(RWSEM_WAITING_BIAS), %g1
155 membar #StoreLoad | #StoreStore
161 call rwsem_downgrade_wake
165 .size __downgrade_write, .-__downgrade_write