1 /* $Id: bitops.S,v 1.3 2001/11/18 00:12:56 davem Exp $
2 * bitops.S: Sparc64 atomic bit operations.
4 * Copyright (C) 2000 David S. Miller (davem@redhat.com)
11 .globl ___test_and_set_bit
12 ___test_and_set_bit: /* %o0=nr, %o1=addr */
20 1: andcc %g7, %g5, %o0
28 membar #StoreLoad | #StoreStore
30 .globl ___test_and_clear_bit
31 ___test_and_clear_bit: /* %o0=nr, %o1=addr */
39 1: andcc %g7, %g5, %o0
47 membar #StoreLoad | #StoreStore
49 .globl ___test_and_change_bit
50 ___test_and_change_bit: /* %o0=nr, %o1=addr */
65 membar #StoreLoad | #StoreStore
68 .globl ___test_and_set_le_bit
69 ___test_and_set_le_bit: /* %o0=nr, %o1=addr */
76 lduwa [%o1] ASI_PL, %g7
77 1: andcc %g7, %g5, %o0
80 casa [%o1] ASI_PL, %g7, %g1
83 lduwa [%o1] ASI_PL, %g7
85 membar #StoreLoad | #StoreStore
87 .globl ___test_and_clear_le_bit
88 ___test_and_clear_le_bit: /* %o0=nr, %o1=addr */
95 lduwa [%o1] ASI_PL, %g7
96 1: andcc %g7, %g5, %o0
99 casa [%o1] ASI_PL, %g7, %g1
102 lduwa [%o1] ASI_PL, %g7
104 membar #StoreLoad | #StoreStore