Commit 2aba6925 authored by Alexander van Heukelum's avatar Alexander van Heukelum Committed by Ingo Molnar

x86: switch 64-bit to generic find_first_bit

Switch x86_64 to generic find_first_bit. The x86_64-specific
implementation is not removed.
Signed-off-by: default avatarAlexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 77b9bd9c
...@@ -78,7 +78,7 @@ config GENERIC_BUG ...@@ -78,7 +78,7 @@ config GENERIC_BUG
depends on BUG depends on BUG
config GENERIC_FIND_FIRST_BIT config GENERIC_FIND_FIRST_BIT
def_bool X86_32 def_bool y
config GENERIC_FIND_NEXT_BIT config GENERIC_FIND_NEXT_BIT
def_bool y def_bool y
......
#ifndef CONFIG_GENERIC_FIND_FIRST_BIT
#include <linux/bitops.h> #include <linux/bitops.h>
#undef find_first_zero_bit #undef find_first_zero_bit
...@@ -105,3 +106,4 @@ long find_first_bit(const unsigned long * addr, unsigned long size) ...@@ -105,3 +106,4 @@ long find_first_bit(const unsigned long * addr, unsigned long size)
EXPORT_SYMBOL(find_first_bit); EXPORT_SYMBOL(find_first_bit);
EXPORT_SYMBOL(find_first_zero_bit); EXPORT_SYMBOL(find_first_zero_bit);
#endif
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright 1992, Linus Torvalds. * Copyright 1992, Linus Torvalds.
*/ */
#ifndef CONFIG_GENERIC_FIND_FIRST_BIT
extern long find_first_zero_bit(const unsigned long *addr, unsigned long size); extern long find_first_zero_bit(const unsigned long *addr, unsigned long size);
extern long find_first_bit(const unsigned long *addr, unsigned long size); extern long find_first_bit(const unsigned long *addr, unsigned long size);
...@@ -24,6 +25,7 @@ static inline long __scanbit(unsigned long val, unsigned long max) ...@@ -24,6 +25,7 @@ static inline long __scanbit(unsigned long val, unsigned long max)
((__builtin_constant_p((size)) && (size) <= BITS_PER_LONG \ ((__builtin_constant_p((size)) && (size) <= BITS_PER_LONG \
? (__scanbit(~*(unsigned long *)(addr), (size))) \ ? (__scanbit(~*(unsigned long *)(addr), (size))) \
: find_first_zero_bit((addr), (size)))) : find_first_zero_bit((addr), (size))))
#endif
static inline void set_bit_string(unsigned long *bitmap, unsigned long i, static inline void set_bit_string(unsigned long *bitmap, unsigned long i,
int len) int len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment