patch-2.4.4 linux/include/asm-sparc64/bitops.h
Next file: linux/include/asm-sparc64/chafsr.h
Previous file: linux/include/asm-sparc64/bbc.h
Back to the patch index
Back to the overall index
- Lines: 80
- Date:
Thu Apr 26 22:17:26 2001
- Orig file:
v2.4.3/linux/include/asm-sparc64/bitops.h
- Orig date:
Tue Oct 3 09:24:41 2000
diff -u --recursive --new-file v2.4.3/linux/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.31 2000/09/23 02:09:21 davem Exp $
+/* $Id: bitops.h,v 1.33 2001/04/24 01:09:12 davem Exp $
* bitops.h: Bit string operations on the V9.
*
* Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -9,16 +9,24 @@
#include <asm/byteorder.h>
-extern long __test_and_set_bit(unsigned long nr, volatile void *addr);
-extern long __test_and_clear_bit(unsigned long nr, volatile void *addr);
-extern long __test_and_change_bit(unsigned long nr, volatile void *addr);
-
-#define test_and_set_bit(nr,addr) (__test_and_set_bit(nr,addr)!=0)
-#define test_and_clear_bit(nr,addr) (__test_and_clear_bit(nr,addr)!=0)
-#define test_and_change_bit(nr,addr) (__test_and_change_bit(nr,addr)!=0)
-#define set_bit(nr,addr) ((void)__test_and_set_bit(nr,addr))
-#define clear_bit(nr,addr) ((void)__test_and_clear_bit(nr,addr))
-#define change_bit(nr,addr) ((void)__test_and_change_bit(nr,addr))
+extern long ___test_and_set_bit(unsigned long nr, volatile void *addr);
+extern long ___test_and_clear_bit(unsigned long nr, volatile void *addr);
+extern long ___test_and_change_bit(unsigned long nr, volatile void *addr);
+
+#define test_and_set_bit(nr,addr) (___test_and_set_bit(nr,addr)!=0)
+#define test_and_clear_bit(nr,addr) (___test_and_clear_bit(nr,addr)!=0)
+#define test_and_change_bit(nr,addr) (___test_and_change_bit(nr,addr)!=0)
+#define set_bit(nr,addr) ((void)___test_and_set_bit(nr,addr))
+#define clear_bit(nr,addr) ((void)___test_and_clear_bit(nr,addr))
+#define change_bit(nr,addr) ((void)___test_and_change_bit(nr,addr))
+
+/* "non-atomic" versions, nothing special for now... */
+#define __set_bit(X,Y) set_bit(X,Y)
+#define __clear_bit(X,Y) clear_bit(X,Y)
+#define __change_bit(X,Y) change_bit(X,Y)
+#define __test_and_set_bit(X,Y) test_and_set_bit(X,Y)
+#define __test_and_clear_bit(X,Y) test_and_clear_bit(X,Y)
+#define __test_and_change_bit(X,Y) test_and_change_bit(X,Y)
#define smp_mb__before_clear_bit() do { } while(0)
#define smp_mb__after_clear_bit() do { } while(0)
@@ -34,12 +42,12 @@
unsigned long result;
#ifdef ULTRA_HAS_POPULATION_COUNT /* Thanks for nothing Sun... */
- __asm__ __volatile__("
- brz,pn %0, 1f
- neg %0, %%g1
- xnor %0, %%g1, %%g2
- popc %%g2, %0
-1: " : "=&r" (result)
+ __asm__ __volatile__(
+" brz,pn %0, 1f\n"
+" neg %0, %%g1\n"
+" xnor %0, %%g1, %%g2\n"
+" popc %%g2, %0\n"
+"1: " : "=&r" (result)
: "0" (word)
: "g1", "g2");
#else
@@ -170,13 +178,13 @@
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
-extern long __test_and_set_le_bit(int nr, volatile void *addr);
-extern long __test_and_clear_le_bit(int nr, volatile void *addr);
+extern long ___test_and_set_le_bit(int nr, volatile void *addr);
+extern long ___test_and_clear_le_bit(int nr, volatile void *addr);
-#define test_and_set_le_bit(nr,addr) (__test_and_set_le_bit(nr,addr)!=0)
-#define test_and_clear_le_bit(nr,addr) (__test_and_clear_le_bit(nr,addr)!=0)
-#define set_le_bit(nr,addr) ((void)__test_and_set_le_bit(nr,addr))
-#define clear_le_bit(nr,addr) ((void)__test_and_clear_le_bit(nr,addr))
+#define test_and_set_le_bit(nr,addr) (___test_and_set_le_bit(nr,addr)!=0)
+#define test_and_clear_le_bit(nr,addr) (___test_and_clear_le_bit(nr,addr)!=0)
+#define set_le_bit(nr,addr) ((void)___test_and_set_le_bit(nr,addr))
+#define clear_le_bit(nr,addr) ((void)___test_and_clear_le_bit(nr,addr))
extern __inline__ int test_le_bit(int nr, __const__ void * addr)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)