Go to the documentation of this file.
6 #ifndef __SPARC64_SPINLOCK_H
7 #define __SPARC64_SPINLOCK_H
24 #define arch_spin_is_locked(lp) ((lp)->lock != 0)
26 #define arch_spin_unlock_wait(lp) \
35 "1: ldstub [%1], %0\n"
42 " ba,a,pt %%xcc, 1b\n"
59 return (result == 0
UL);
73 unsigned long tmp1, tmp2;
76 "1: ldstub [%2], %0\n"
88 :
"=&r" (tmp1),
"=&r" (tmp2)
89 :
"r"(lock),
"r"(flags)
97 unsigned long tmp1, tmp2;
103 " cas [%2], %0, %1\n"
105 " bne,pn %%icc, 1b\n"
111 " ba,a,pt %%xcc, 4b\n"
113 :
"=&r" (tmp1),
"=&r" (tmp2)
124 " brlz,a,pn %0, 2f\n"
127 " cas [%2], %0, %1\n"
129 " bne,pn %%icc, 1b\n"
132 :
"=&r" (tmp1),
"=&r" (tmp2)
141 unsigned long tmp1, tmp2;
146 " cas [%2], %0, %1\n"
148 " bne,pn %%xcc, 1b\n"
150 :
"=&r" (tmp1),
"=&r" (tmp2)
165 " cas [%2], %0, %1\n"
167 " bne,pn %%icc, 1b\n"
173 " ba,a,pt %%xcc, 4b\n"
175 :
"=&r" (tmp1),
"=&r" (tmp2)
176 :
"r" (lock),
"r" (mask)
200 " cas [%3], %0, %1\n"
202 " bne,pn %%icc, 1b\n"
206 :
"=&r" (tmp1),
"=&r" (tmp2),
"=&r" (result)
207 :
"r" (lock),
"r" (mask)
213 #define arch_read_lock_flags(p, f) arch_read_lock(p)
214 #define arch_write_lock_flags(p, f) arch_write_lock(p)
216 #define arch_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
217 #define arch_write_can_lock(rw) (!(rw)->lock)
219 #define arch_spin_relax(lock) cpu_relax()
220 #define arch_read_relax(lock) cpu_relax()
221 #define arch_write_relax(lock) cpu_relax()