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>
9 .section .sched.text, "ax"
20 membar #StoreLoad | #StoreStore
28 call rwsem_down_read_failed
32 .size __down_read, .-__down_read
34 .globl __down_read_trylock
45 membar #StoreLoad | #StoreStore
48 .size __down_read_trylock, .-__down_read_trylock
52 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
53 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
61 membar #StoreLoad | #StoreStore
68 call rwsem_down_write_failed
72 .size __down_write, .-__down_write
74 .globl __down_write_trylock
76 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
77 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
88 membar #StoreLoad | #StoreStore
91 .size __down_write_trylock, .-__down_write_trylock
102 membar #StoreLoad | #StoreStore
107 3: sethi %hi(RWSEM_ACTIVE_MASK), %g1
109 or %g1, %lo(RWSEM_ACTIVE_MASK), %g1
118 .size __up_read, .-__up_read
122 sethi %hi(RWSEM_ACTIVE_WRITE_BIAS), %g1
123 or %g1, %lo(RWSEM_ACTIVE_WRITE_BIAS), %g1
132 membar #StoreLoad | #StoreStore
144 .size __up_write, .-__up_write
146 .globl __downgrade_write
148 sethi %hi(RWSEM_WAITING_BIAS), %g1
149 or %g1, %lo(RWSEM_WAITING_BIAS), %g1
158 membar #StoreLoad | #StoreStore
166 call rwsem_downgrade_wake
170 .size __downgrade_write, .-__downgrade_write