1 /* SPDX-License-Identifier: GPL-2.0 */
3 * locks.S: SMP low-level lock primitives on Sparc.
5 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
6 * Copyright (C) 1998 Anton Blanchard (anton@progsoc.uts.edu.au)
7 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
10 #include <asm/ptrace.h>
13 #include <asm/spinlock.h>
14 #include <asm/export.h>
19 /* Read/writer locks, as usual this is overly clever to make it
20 * as fast as possible.
24 ___rw_read_enter_spin_on_wlock:
28 b ___rw_read_enter_spin_on_wlock
30 ___rw_read_try_spin_on_wlock:
34 xnorcc %g2, 0x0, %o0 /* if g2 is ~0, set o0 to 0 and bugger off */
35 bne,a ___rw_read_enter_spin_on_wlock
39 ___rw_read_exit_spin_on_wlock:
43 b ___rw_read_exit_spin_on_wlock
45 ___rw_write_enter_spin_on_wlock:
47 be,a ___rw_write_enter
49 b ___rw_write_enter_spin_on_wlock
52 .globl ___rw_read_enter
53 EXPORT_SYMBOL(___rw_read_enter)
56 bne,a ___rw_read_enter_spin_on_wlock
64 .globl ___rw_read_exit
65 EXPORT_SYMBOL(___rw_read_exit)
68 bne,a ___rw_read_exit_spin_on_wlock
77 EXPORT_SYMBOL(___rw_read_try)
80 bne ___rw_read_try_spin_on_wlock
88 .globl ___rw_write_enter
89 EXPORT_SYMBOL(___rw_write_enter)
92 bne ___rw_write_enter_spin_on_wlock
95 bne,a ___rw_write_enter_spin_on_wlock