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

Next file: linux/include/asm-sparc64/byteorder.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.43/linux/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.16 1997/05/28 13:48:56 jj Exp $
+/* $Id: bitops.h,v 1.18 1997/06/30 12:36:18 davem Exp $
  * bitops.h: Bit string operations on the V9.
  *
  * Copyright 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -121,7 +121,7 @@
 	  : "0" (word)
 	  : "g1", "g2");
 #else
-#ifdef EASY_CHEESE_VERSION
+#if 1 /* def EASY_CHEESE_VERSION */
 	result = 0;
 	while(word & 1) {
 		result++;
@@ -177,13 +177,11 @@
 		size -= 64;
 		result += 64;
 	}
-	offset = size >> 6;
-	size &= 63UL;
-	while (offset) {
+	while (size & ~63UL) {
 		if (~(tmp = *(p++)))
 			goto found_middle;
 		result += 64;
-		offset--;
+		size -= 64;
 	}
 	if (!size)
 		return result;
@@ -260,22 +258,12 @@
 #define find_first_zero_le_bit(addr, size) \
         find_next_zero_le_bit((addr), (size), 0)
 
-extern __inline__ unsigned long __swab64(unsigned long value)
-{
-	return (((value>>56) & 0x00000000000000ff) |
-		((value>>40) & 0x000000000000ff00) |
-		((value>>24) & 0x0000000000ff0000) |
-		((value>>8)  & 0x00000000ff000000) |
-		((value<<8)  & 0x000000ff00000000) |
-		((value<<24) & 0x0000ff0000000000) |
-		((value<<40) & 0x00ff000000000000) |
-		((value<<56) & 0xff00000000000000));
-}     
-
 extern __inline__ unsigned long __swab64p(unsigned long *addr)
 {
 	unsigned long ret;
-	__asm__ __volatile__ ("ldxa [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL));
+	__asm__ __volatile__ ("ldxa [%1] %2, %0"
+			      : "=r" (ret)
+			      : "r" (addr), "i" (ASI_PL));
 	return ret;
 }
 
@@ -299,13 +287,11 @@
 		size -= 64;
 		result += 64;
 	}
-	offset = size >> 6;
-	size &= 63UL;
-	while(offset) {
+	while(size & ~63) {
 		if(~(tmp = __swab64p(p++)))
 			goto found_middle;
 		result += 64;
-		offset--;
+		size -= 64;
 	}
 	if(!size)
 		return result;

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