2 * locks.S: SMP low-level lock primitives on Sparc.
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
6 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
9 #include <asm/ptrace.h>
12 #include <asm/spinlock.h>
17 /* Read/writer locks, as usual this is overly clever to make it
18 * as fast as possible.
22 ___rw_read_enter_spin_on_wlock:
26 b ___rw_read_enter_spin_on_wlock
28 ___rw_read_try_spin_on_wlock:
32 xnorcc %g2, 0x0, %o0 /* if g2 is ~0, set o0 to 0 and bugger off */
33 bne,a ___rw_read_enter_spin_on_wlock
37 ___rw_read_exit_spin_on_wlock:
41 b ___rw_read_exit_spin_on_wlock
43 ___rw_write_enter_spin_on_wlock:
45 be,a ___rw_write_enter
47 b ___rw_write_enter_spin_on_wlock
50 .globl ___rw_read_enter
53 bne,a ___rw_read_enter_spin_on_wlock
61 .globl ___rw_read_exit
64 bne,a ___rw_read_exit_spin_on_wlock
75 bne ___rw_read_try_spin_on_wlock
83 .globl ___rw_write_enter
86 bne ___rw_write_enter_spin_on_wlock
89 bne,a ___rw_write_enter_spin_on_wlock