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>
13 #include <asm/export.h>
18 /* Read/writer locks, as usual this is overly clever to make it
19 * as fast as possible.
23 ___rw_read_enter_spin_on_wlock:
27 b ___rw_read_enter_spin_on_wlock
29 ___rw_read_try_spin_on_wlock:
33 xnorcc %g2, 0x0, %o0 /* if g2 is ~0, set o0 to 0 and bugger off */
34 bne,a ___rw_read_enter_spin_on_wlock
38 ___rw_read_exit_spin_on_wlock:
42 b ___rw_read_exit_spin_on_wlock
44 ___rw_write_enter_spin_on_wlock:
46 be,a ___rw_write_enter
48 b ___rw_write_enter_spin_on_wlock
51 .globl ___rw_read_enter
52 EXPORT_SYMBOL(___rw_read_enter)
55 bne,a ___rw_read_enter_spin_on_wlock
63 .globl ___rw_read_exit
64 EXPORT_SYMBOL(___rw_read_exit)
67 bne,a ___rw_read_exit_spin_on_wlock
76 EXPORT_SYMBOL(___rw_read_try)
79 bne ___rw_read_try_spin_on_wlock
87 .globl ___rw_write_enter
88 EXPORT_SYMBOL(___rw_write_enter)
91 bne ___rw_write_enter_spin_on_wlock
94 bne,a ___rw_write_enter_spin_on_wlock