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)
14 .globl ___test_and_set_bit
15 ___test_and_set_bit: /* %o0=nr, %o1=addr */
23 1: andcc %g7, %g5, %o0
31 membar #StoreLoad | #StoreStore
33 .globl ___test_and_clear_bit
34 ___test_and_clear_bit: /* %o0=nr, %o1=addr */
42 1: andcc %g7, %g5, %o0
50 membar #StoreLoad | #StoreStore
52 .globl ___test_and_change_bit
53 ___test_and_change_bit: /* %o0=nr, %o1=addr */
68 membar #StoreLoad | #StoreStore
71 .globl ___test_and_set_le_bit
72 ___test_and_set_le_bit: /* %o0=nr, %o1=addr */
79 lduwa [%o1] ASI_PL, %g7
80 1: andcc %g7, %g5, %o0
83 casa [%o1] ASI_PL, %g7, %g1
86 lduwa [%o1] ASI_PL, %g7
88 membar #StoreLoad | #StoreStore
90 .globl ___test_and_clear_le_bit
91 ___test_and_clear_le_bit: /* %o0=nr, %o1=addr */
98 lduwa [%o1] ASI_PL, %g7
99 1: andcc %g7, %g5, %o0
102 casa [%o1] ASI_PL, %g7, %g1
105 lduwa [%o1] ASI_PL, %g7
107 membar #StoreLoad | #StoreStore