diff options
author | Alexander van Heukelum <heukelum@mailshack.com> | 2008-04-04 14:49:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-26 13:21:17 -0400 |
commit | d66462f5314b0e70ddad8032eb76099475ca5571 (patch) | |
tree | 473d34bf2662fb008495764dda774e00d563f01a /include/asm-x86 | |
parent | 5245698f665c4b7a533dcc47a5afdf33095d436a (diff) |
x86: finalize bitops unification
include/asm-x86/bitops_32.h and include/asm-x86/bitops_64.h are now
almost identical. The 64-bit version sets ARCH_HAS_FAST_MULTIPLIER
and has an extra inline function set_bit_string. The define currently
has no influence on the generated code, but it can be argued that
setting it on i386 is the right thing to do anyhow. The addition
of the extra inline function on i386 does not hurt either.
Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/bitops.h | 38 | ||||
-rw-r--r-- | include/asm-x86/bitops_32.h | 30 | ||||
-rw-r--r-- | include/asm-x86/bitops_64.h | 42 |
3 files changed, 33 insertions, 77 deletions
diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h index 1b6f547cb6bd..daf1a72bdc4b 100644 --- a/include/asm-x86/bitops.h +++ b/include/asm-x86/bitops.h | |||
@@ -403,10 +403,38 @@ static inline int fls(int x) | |||
403 | 403 | ||
404 | #undef ADDR | 404 | #undef ADDR |
405 | 405 | ||
406 | #ifdef CONFIG_X86_32 | 406 | static inline void set_bit_string(unsigned long *bitmap, |
407 | # include "bitops_32.h" | 407 | unsigned long i, int len) |
408 | #else | 408 | { |
409 | # include "bitops_64.h" | 409 | unsigned long end = i + len; |
410 | #endif | 410 | while (i < end) { |
411 | __set_bit(i, bitmap); | ||
412 | i++; | ||
413 | } | ||
414 | } | ||
415 | |||
416 | #ifdef __KERNEL__ | ||
417 | |||
418 | #include <asm-generic/bitops/sched.h> | ||
419 | |||
420 | #define ARCH_HAS_FAST_MULTIPLIER 1 | ||
421 | |||
422 | #include <asm-generic/bitops/hweight.h> | ||
411 | 423 | ||
424 | #endif /* __KERNEL__ */ | ||
425 | |||
426 | #include <asm-generic/bitops/fls64.h> | ||
427 | |||
428 | #ifdef __KERNEL__ | ||
429 | |||
430 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
431 | |||
432 | #define ext2_set_bit_atomic(lock, nr, addr) \ | ||
433 | test_and_set_bit((nr), (unsigned long *)(addr)) | ||
434 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | ||
435 | test_and_clear_bit((nr), (unsigned long *)(addr)) | ||
436 | |||
437 | #include <asm-generic/bitops/minix.h> | ||
438 | |||
439 | #endif /* __KERNEL__ */ | ||
412 | #endif /* _ASM_X86_BITOPS_H */ | 440 | #endif /* _ASM_X86_BITOPS_H */ |
diff --git a/include/asm-x86/bitops_32.h b/include/asm-x86/bitops_32.h deleted file mode 100644 index 2e863021bf81..000000000000 --- a/include/asm-x86/bitops_32.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #ifndef _I386_BITOPS_H | ||
2 | #define _I386_BITOPS_H | ||
3 | |||
4 | /* | ||
5 | * Copyright 1992, Linus Torvalds. | ||
6 | */ | ||
7 | #ifdef __KERNEL__ | ||
8 | |||
9 | #include <asm-generic/bitops/sched.h> | ||
10 | |||
11 | #include <asm-generic/bitops/hweight.h> | ||
12 | |||
13 | #endif /* __KERNEL__ */ | ||
14 | |||
15 | #include <asm-generic/bitops/fls64.h> | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
20 | |||
21 | #define ext2_set_bit_atomic(lock, nr, addr) \ | ||
22 | test_and_set_bit((nr), (unsigned long *)(addr)) | ||
23 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | ||
24 | test_and_clear_bit((nr), (unsigned long *)(addr)) | ||
25 | |||
26 | #include <asm-generic/bitops/minix.h> | ||
27 | |||
28 | #endif /* __KERNEL__ */ | ||
29 | |||
30 | #endif /* _I386_BITOPS_H */ | ||
diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h deleted file mode 100644 index cb23122d23f1..000000000000 --- a/include/asm-x86/bitops_64.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef _X86_64_BITOPS_H | ||
2 | #define _X86_64_BITOPS_H | ||
3 | |||
4 | /* | ||
5 | * Copyright 1992, Linus Torvalds. | ||
6 | */ | ||
7 | static inline void set_bit_string(unsigned long *bitmap, unsigned long i, | ||
8 | int len) | ||
9 | { | ||
10 | unsigned long end = i + len; | ||
11 | while (i < end) { | ||
12 | __set_bit(i, bitmap); | ||
13 | i++; | ||
14 | } | ||
15 | } | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <asm-generic/bitops/sched.h> | ||
20 | |||
21 | #define ARCH_HAS_FAST_MULTIPLIER 1 | ||
22 | |||
23 | #include <asm-generic/bitops/hweight.h> | ||
24 | |||
25 | #endif /* __KERNEL__ */ | ||
26 | |||
27 | #include <asm-generic/bitops/fls64.h> | ||
28 | |||
29 | #ifdef __KERNEL__ | ||
30 | |||
31 | #include <asm-generic/bitops/ext2-non-atomic.h> | ||
32 | |||
33 | #define ext2_set_bit_atomic(lock, nr, addr) \ | ||
34 | test_and_set_bit((nr), (unsigned long *)(addr)) | ||
35 | #define ext2_clear_bit_atomic(lock, nr, addr) \ | ||
36 | test_and_clear_bit((nr), (unsigned long *)(addr)) | ||
37 | |||
38 | #include <asm-generic/bitops/minix.h> | ||
39 | |||
40 | #endif /* __KERNEL__ */ | ||
41 | |||
42 | #endif /* _X86_64_BITOPS_H */ | ||