patch-pre2.0.7 linux/include/asm-m68k/bitops.h
Next file: linux/include/asm-m68k/bootinfo.h
Previous file: linux/include/asm-m68k/atarikb.h
Back to the patch index
Back to the overall index
- Lines: 64
- Date:
Mon May 20 07:54:29 1996
- Orig file:
pre2.0.6/linux/include/asm-m68k/bitops.h
- Orig date:
Tue May 7 16:22:37 1996
diff -u --recursive --new-file pre2.0.6/linux/include/asm-m68k/bitops.h linux/include/asm-m68k/bitops.h
@@ -4,7 +4,7 @@
* Copyright 1992, Linus Torvalds.
*
* This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
+ * License. See the file COPYING in the main directory of this archive
* for more details.
*/
@@ -109,54 +109,6 @@
__asm__ __volatile__ ("bfffo %1{#0,#0},%0"
: "=d" (res) : "d" (~word & -~word));
return res ^ 31;
-}
-
-extern __inline__ int find_first_one_bit(void * vaddr, unsigned size)
-{
- unsigned long *p = vaddr, *addr = vaddr;
- int res;
- unsigned long num;
-
- if (!size)
- return 0;
-
- while (!*p++)
- {
- if (size <= 32)
- return (p - addr) << 5;
- size -= 32;
- }
-
- num = *--p;
- __asm__ __volatile__ ("bfffo %1{#0,#0},%0"
- : "=d" (res) : "d" (num & -num));
- return ((p - addr) << 5) + (res ^ 31);
-}
-
-extern __inline__ int find_next_one_bit (void *vaddr, int size,
- int offset)
-{
- unsigned long *addr = vaddr;
- unsigned long *p = addr + (offset >> 5);
- int set = 0, bit = offset & 31UL, res;
-
- if (offset >= size)
- return size;
-
- if (bit) {
- unsigned long num = *p & (~0UL << bit);
-
- /* Look for one in first longword */
- __asm__ __volatile__ ("bfffo %1{#0,#0},%0"
- : "=d" (res) : "d" (num & -num));
- if (res < 32)
- return (offset & ~31UL) + (res ^ 31);
- set = 32 - bit;
- p++;
- }
- /* No one yet, search remaining full bytes for a one */
- res = find_first_one_bit (p, size - 32 * (p - addr));
- return (offset + set + res);
}
/* Bitmap functions for the minix filesystem */
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