diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-10-11 11:13:31 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2007-10-11 11:13:31 +0200 |
commit | 6d1f5420f0d4bd6f391295bb632ae65920983162 (patch) | |
tree | fe2f9b2a7e6382e6ee526cbec6b1c30598fa8c26 /arch/i386/lib/bitops.c | |
parent | 81f52936d34570f7db3f09bf5e01339b640438ef (diff) | |
download | kernel-crypto-6d1f5420f0d4bd6f391295bb632ae65920983162.tar.gz kernel-crypto-6d1f5420f0d4bd6f391295bb632ae65920983162.tar.xz kernel-crypto-6d1f5420f0d4bd6f391295bb632ae65920983162.zip |
i386: prepare shared lib/bitops.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/i386/lib/bitops.c')
-rw-r--r-- | arch/i386/lib/bitops.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/arch/i386/lib/bitops.c b/arch/i386/lib/bitops.c deleted file mode 100644 index afd0045595d..00000000000 --- a/arch/i386/lib/bitops.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <linux/bitops.h> -#include <linux/module.h> - -/** - * find_next_bit - find the first set bit in a memory region - * @addr: The address to base the search on - * @offset: The bitnumber to start searching at - * @size: The maximum size to search - */ -int find_next_bit(const unsigned long *addr, int size, int offset) -{ - const unsigned long *p = addr + (offset >> 5); - int set = 0, bit = offset & 31, res; - - if (bit) { - /* - * Look for nonzero in the first 32 bits: - */ - __asm__("bsfl %1,%0\n\t" - "jne 1f\n\t" - "movl $32, %0\n" - "1:" - : "=r" (set) - : "r" (*p >> bit)); - if (set < (32 - bit)) - return set + offset; - set = 32 - bit; - p++; - } - /* - * No set bit yet, search remaining full words for a bit - */ - res = find_first_bit (p, size - 32 * (p - addr)); - return (offset + set + res); -} -EXPORT_SYMBOL(find_next_bit); - -/** - * find_next_zero_bit - find the first zero bit in a memory region - * @addr: The address to base the search on - * @offset: The bitnumber to start searching at - * @size: The maximum size to search - */ -int find_next_zero_bit(const unsigned long *addr, int size, int offset) -{ - const unsigned long *p = addr + (offset >> 5); - int set = 0, bit = offset & 31, res; - - if (bit) { - /* - * Look for zero in the first 32 bits. - */ - __asm__("bsfl %1,%0\n\t" - "jne 1f\n\t" - "movl $32, %0\n" - "1:" - : "=r" (set) - : "r" (~(*p >> bit))); - if (set < (32 - bit)) - return set + offset; - set = 32 - bit; - p++; - } - /* - * No zero yet, search remaining full bytes for a zero - */ - res = find_first_zero_bit(p, size - 32 * (p - addr)); - return (offset + set + res); -} -EXPORT_SYMBOL(find_next_zero_bit); |