patch-2.1.34 linux/include/asm-sparc64/bitops.h

Next file: linux/include/asm-sparc64/checksum.h
Previous file: linux/include/asm-sparc64/atomic.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.7 1997/03/14 21:05:38 jj Exp $
+/* $Id: bitops.h,v 1.11 1997/04/10 23:32:42 davem Exp $
  * bitops.h: Bit string operations on the V9.
  *
  * Copyright 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -26,18 +26,19 @@
 	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__("
-	lduw		[%2], %0
+	lduw		[%4], %0
 1:
-	andcc		%0, %4, %3
+	andcc		%0, %3, %2
 	bne,pn		%%icc, 2f
-	 xor		%0, %4, %1
-	cas 		[%2], %0, %1
+	 xor		%0, %3, %1
+	cas 		[%4], %0, %1
 	cmp		%0, %1
 	bne,a,pn	%%icc, 1b
-	 lduw		[%2], %0
+	 lduw		[%4], %0
 2:
-"	: "=&r" (temp0), "=&r" (temp1), "=r" (m), "=&r" (oldbit)
-	: "ir" (1UL << (nr & 31)), "r" (m));
+"	: "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit)
+	: "HIr" (1UL << (nr & 31)), "r" (m)
+	: "cc");
 	return oldbit != 0;
 }
 
@@ -48,18 +49,19 @@
 	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__("
-	lduw		[%2], %0
+	lduw		[%4], %0
 1:
-	andcc		%0, %4, %3
+	andcc		%0, %3, %2
 	be,pn		%%icc, 2f
-	 xor		%0, %4, %1
-	cas 		[%2], %0, %1
+	 xor		%0, %3, %1
+	cas 		[%4], %0, %1
 	cmp		%0, %1
 	bne,a,pn	%%icc, 1b
-	 lduw		[%2], %0
+	 lduw		[%4], %0
 2:
-"	: "=&r" (temp0), "=&r" (temp1), "=r" (m), "=&r" (oldbit)
-	: "ir" (1UL << (nr & 31)), "r" (m));
+"	: "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit)
+	: "HIr" (1UL << (nr & 31)), "r" (m)
+	: "cc");
 	return oldbit != 0;
 }
 
@@ -70,16 +72,17 @@
 	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__("
-	lduw		[%2], %0
+	lduw		[%4], %0
 1:
-	andcc		%0, %4, %3
-	xor		%0, %4, %1
-	cas 		[%2], %0, %1
+	and		%0, %3, %2
+	xor		%0, %3, %1
+	cas 		[%4], %0, %1
 	cmp		%0, %1
 	bne,a,pn	%%icc, 1b
-	 lduw		[%2], %0
-"	: "=&r" (temp0), "=&r" (temp1), "=r" (m), "=&r" (oldbit)
-	: "ir" (1UL << (nr & 31)), "r" (m));
+	 lduw		[%4], %0
+"	: "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit)
+	: "HIr" (1UL << (nr & 31)), "r" (m)
+	: "cc");
 	return oldbit != 0;
 }
 
@@ -154,18 +157,19 @@
 	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__("
-	lduwa		[%2] %6, %0
+	lduwa		[%4] %5, %0
 1:
-	andcc		%0, %4, %3
+	andcc		%0, %3, %2
 	bne,pn		%%icc, 2f
-	 xor		%0, %4, %1
-	casa 		[%2] %6, %0, %1
+	 xor		%0, %3, %1
+	casa 		[%4] %5, %0, %1
 	cmp		%0, %1
 	bne,a,pn	%%icc, 1b
-	 lduwa		[%2] %6, %0
+	 lduwa		[%4] %5, %0
 2:
-"	: "=&r" (temp0), "=&r" (temp1), "=r" (m), "=&r" (oldbit)
-	: "ir" (1UL << (nr & 31)), "2" (m), "i" (ASI_PL));
+"	: "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit)
+	: "HIr" (1UL << (nr & 31)), "r" (m), "i" (ASI_PL)
+	: "cc");
 	return oldbit != 0;
 }
 
@@ -176,18 +180,19 @@
 	unsigned int * m = ((unsigned int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__("
-	lduwa		[%2] %6, %0
+	lduwa		[%4] %5, %0
 1:
-	andcc		%0, %4, %3
+	andcc		%0, %3, %2
 	be,pn		%%icc, 2f
-	 xor		%0, %4, %1
-	casa 		[%2] %6, %0, %1
+	 xor		%0, %3, %1
+	casa 		[%4] %5, %0, %1
 	cmp		%0, %1
 	bne,a,pn	%%icc, 1b
-	 lduwa		[%2] %6, %0
+	 lduwa		[%4] %5, %0
 2:
-"	: "=&r" (temp0), "=&r" (temp1), "=r" (m), "=&r" (oldbit)
-	: "ir" (1UL << (nr & 31)), "2" (m), "i" (ASI_PL));
+"	: "=&r" (temp0), "=&r" (temp1), "=&r" (oldbit)
+	: "HIr" (1UL << (nr & 31)), "r" (m), "i" (ASI_PL)
+	: "cc");
 	return oldbit != 0;
 }
 
@@ -259,6 +264,12 @@
 #define ext2_test_bit  			test_le_bit
 #define ext2_find_first_zero_bit	find_first_zero_le_bit
 #define ext2_find_next_zero_bit		find_next_zero_le_bit
+
+/* Bitmap functions for the minix filesystem.  */
+#define minix_set_bit(nr,addr) set_bit(nr,addr)
+#define minix_clear_bit(nr,addr) clear_bit(nr,addr)
+#define minix_test_bit(nr,addr) test_bit(nr,addr)
+#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
 
 #endif /* __KERNEL__ */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov