patch-1.3.45 linux/include/asm-i386/bitops.h

Next file: linux/include/asm-ppc/a.out.h
Previous file: linux/include/asm-alpha/bitops.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.44/linux/include/asm-i386/bitops.h linux/include/asm-i386/bitops.h
@@ -60,17 +60,11 @@
 }
 
 /*
- * This routine doesn't need to be atomic, but it's faster to code it
- * this way.
+ * This routine doesn't need to be atomic.
  */
 extern __inline__ int test_bit(int nr, const void * addr)
 {
-	int oldbit;
-
-	__asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
-		:"=r" (oldbit)
-		:"m" (CONST_ADDR),"ir" (nr));
-	return oldbit;
+	return 1UL & (((unsigned int *) addr)[nr >> 5] >> (nr & 31));
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this