1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* bitops.S: Sparc64 atomic bit operations.
4 * Copyright (C) 2000, 2007 David S. Miller (davem@davemloft.net)
7 #include <linux/linkage.h>
9 #include <asm/backoff.h>
10 #include <asm/export.h>
14 ENTRY(test_and_set_bit) /* %o0=nr, %o1=addr */
26 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
32 2: BACKOFF_SPIN(%o3, %o4, 1b)
33 ENDPROC(test_and_set_bit)
34 EXPORT_SYMBOL(test_and_set_bit)
36 ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
48 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
54 2: BACKOFF_SPIN(%o3, %o4, 1b)
55 ENDPROC(test_and_clear_bit)
56 EXPORT_SYMBOL(test_and_clear_bit)
58 ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
70 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
76 2: BACKOFF_SPIN(%o3, %o4, 1b)
77 ENDPROC(test_and_change_bit)
78 EXPORT_SYMBOL(test_and_change_bit)
80 ENTRY(set_bit) /* %o0=nr, %o1=addr */
92 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
96 2: BACKOFF_SPIN(%o3, %o4, 1b)
98 EXPORT_SYMBOL(set_bit)
100 ENTRY(clear_bit) /* %o0=nr, %o1=addr */
112 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
116 2: BACKOFF_SPIN(%o3, %o4, 1b)
118 EXPORT_SYMBOL(clear_bit)
120 ENTRY(change_bit) /* %o0=nr, %o1=addr */
132 bne,pn %xcc, BACKOFF_LABEL(2f, 1b)
136 2: BACKOFF_SPIN(%o3, %o4, 1b)
138 EXPORT_SYMBOL(change_bit)