patch-1.3.96 linux/include/asm-m68k/bitops.h

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

diff -u --recursive --new-file v1.3.95/linux/include/asm-m68k/bitops.h linux/include/asm-m68k/bitops.h
@@ -46,12 +46,7 @@
 
 extern __inline__ int test_bit(int nr, const void * vaddr)
 {
-	char retval;
-
-	__asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^31), "a" (vaddr));
-
-	return retval;
+	return ((1UL << (nr & 31)) & (((const unsigned int *) vaddr)[nr >> 5])) != 0;
 }
 
 extern __inline__ int find_first_zero_bit(void * vaddr, unsigned size)
@@ -166,12 +161,7 @@
 extern __inline__ int
 minix_test_bit (int nr, const void *vaddr)
 {
-	char retval;
-
-	__asm__ __volatile__ ("bftst %2{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^15), "m" (*(const char *) vaddr));
-
-	return retval;
+	return ((1U << (nr & 15)) & (((const unsigned short *) vaddr)[nr >> 4])) != 0;
 }
 
 /* Bitmap functions for the ext2 filesystem. */
@@ -201,12 +191,7 @@
 extern __inline__ int
 ext2_test_bit (int nr, const void *vaddr)
 {
-	char retval;
-
-	__asm__ __volatile__ ("bftst %2{%1,#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^7), "m" (*(const char *) vaddr));
-
-	return retval;
+	return ((1U << (nr & 7)) & (((const unsigned char *) vaddr)[nr >> 3])) != 0;
 }
 
 extern __inline__ int

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