diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-26 04:39:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:12 -0500 |
commit | 2875aef8bd0e42367a66a78ef7abe10f3bba27b5 (patch) | |
tree | 44f81fa0e5c3f5bcf90eb1d6326c1eff9915dfbd /include/asm-ia64/bitops.h | |
parent | 1cc2b9943b7b3a8d526aa8be5450d3ec083c3de4 (diff) |
[PATCH] bitops: ia64: use generic bitops
- remove generic_fls64()
- remove find_{next,first}{,_zero}_bit()
- remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit()
- remove minix_{test,set,test_and_clear,test,find_first_zero}_bit()
- remove sched_find_first_bit()
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ia64/bitops.h')
-rw-r--r-- | include/asm-ia64/bitops.h | 67 |
1 files changed, 17 insertions, 50 deletions
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h index eccb01c79c1a..90921e162793 100644 --- a/include/asm-ia64/bitops.h +++ b/include/asm-ia64/bitops.h | |||
@@ -5,8 +5,8 @@ | |||
5 | * Copyright (C) 1998-2003 Hewlett-Packard Co | 5 | * Copyright (C) 1998-2003 Hewlett-Packard Co |
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | 6 | * David Mosberger-Tang <davidm@hpl.hp.com> |
7 | * | 7 | * |
8 | * 02/06/02 find_next_bit() and find_first_bit() added from Erich Focht's ia64 O(1) | 8 | * 02/06/02 find_next_bit() and find_first_bit() added from Erich Focht's ia64 |
9 | * scheduler patch | 9 | * O(1) scheduler patch |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
@@ -25,9 +25,9 @@ | |||
25 | * restricted to acting on a single-word quantity. | 25 | * restricted to acting on a single-word quantity. |
26 | * | 26 | * |
27 | * The address must be (at least) "long" aligned. | 27 | * The address must be (at least) "long" aligned. |
28 | * Note that there are driver (e.g., eepro100) which use these operations to operate on | 28 | * Note that there are driver (e.g., eepro100) which use these operations to |
29 | * hw-defined data-structures, so we can't easily change these operations to force a | 29 | * operate on hw-defined data-structures, so we can't easily change these |
30 | * bigger alignment. | 30 | * operations to force a bigger alignment. |
31 | * | 31 | * |
32 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). | 32 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). |
33 | */ | 33 | */ |
@@ -284,8 +284,8 @@ test_bit (int nr, const volatile void *addr) | |||
284 | * ffz - find the first zero bit in a long word | 284 | * ffz - find the first zero bit in a long word |
285 | * @x: The long word to find the bit in | 285 | * @x: The long word to find the bit in |
286 | * | 286 | * |
287 | * Returns the bit-number (0..63) of the first (least significant) zero bit. Undefined if | 287 | * Returns the bit-number (0..63) of the first (least significant) zero bit. |
288 | * no zero exists, so code should check against ~0UL first... | 288 | * Undefined if no zero exists, so code should check against ~0UL first... |
289 | */ | 289 | */ |
290 | static inline unsigned long | 290 | static inline unsigned long |
291 | ffz (unsigned long x) | 291 | ffz (unsigned long x) |
@@ -345,13 +345,14 @@ fls (int t) | |||
345 | x |= x >> 16; | 345 | x |= x >> 16; |
346 | return ia64_popcnt(x); | 346 | return ia64_popcnt(x); |
347 | } | 347 | } |
348 | #define fls64(x) generic_fls64(x) | 348 | |
349 | #include <asm-generic/bitops/fls64.h> | ||
349 | 350 | ||
350 | /* | 351 | /* |
351 | * ffs: find first bit set. This is defined the same way as the libc and compiler builtin | 352 | * ffs: find first bit set. This is defined the same way as the libc and |
352 | * ffs routines, therefore differs in spirit from the above ffz (man ffs): it operates on | 353 | * compiler builtin ffs routines, therefore differs in spirit from the above |
353 | * "int" values only and the result value is the bit number + 1. ffs(0) is defined to | 354 | * ffz (man ffs): it operates on "int" values only and the result value is the |
354 | * return zero. | 355 | * bit number + 1. ffs(0) is defined to return zero. |
355 | */ | 356 | */ |
356 | #define ffs(x) __builtin_ffs(x) | 357 | #define ffs(x) __builtin_ffs(x) |
357 | 358 | ||
@@ -373,51 +374,17 @@ hweight64 (unsigned long x) | |||
373 | 374 | ||
374 | #endif /* __KERNEL__ */ | 375 | #endif /* __KERNEL__ */ |
375 | 376 | ||
376 | extern int __find_next_zero_bit (const void *addr, unsigned long size, | 377 | #include <asm-generic/bitops/find.h> |
377 | unsigned long offset); | ||
378 | extern int __find_next_bit(const void *addr, unsigned long size, | ||
379 | unsigned long offset); | ||
380 | |||
381 | #define find_next_zero_bit(addr, size, offset) \ | ||
382 | __find_next_zero_bit((addr), (size), (offset)) | ||
383 | #define find_next_bit(addr, size, offset) \ | ||
384 | __find_next_bit((addr), (size), (offset)) | ||
385 | |||
386 | /* | ||
387 | * The optimizer actually does good code for this case.. | ||
388 | */ | ||
389 | #define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) | ||
390 | |||
391 | #define find_first_bit(addr, size) find_next_bit((addr), (size), 0) | ||
392 | 378 | ||
393 | #ifdef __KERNEL__ | 379 | #ifdef __KERNEL__ |
394 | 380 | ||
395 | #define __clear_bit(nr, addr) clear_bit(nr, addr) | 381 | #include <asm-generic/bitops/ext2-non-atomic.h> |
396 | 382 | ||
397 | #define ext2_set_bit __test_and_set_bit | ||
398 | #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) | 383 | #define ext2_set_bit_atomic(l,n,a) test_and_set_bit(n,a) |
399 | #define ext2_clear_bit __test_and_clear_bit | ||
400 | #define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) | 384 | #define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a) |
401 | #define ext2_test_bit test_bit | ||
402 | #define ext2_find_first_zero_bit find_first_zero_bit | ||
403 | #define ext2_find_next_zero_bit find_next_zero_bit | ||
404 | |||
405 | /* Bitmap functions for the minix filesystem. */ | ||
406 | #define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr) | ||
407 | #define minix_set_bit(nr,addr) __set_bit(nr,addr) | ||
408 | #define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr) | ||
409 | #define minix_test_bit(nr,addr) test_bit(nr,addr) | ||
410 | #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) | ||
411 | 385 | ||
412 | static inline int | 386 | #include <asm-generic/bitops/minix.h> |
413 | sched_find_first_bit (unsigned long *b) | 387 | #include <asm-generic/bitops/sched.h> |
414 | { | ||
415 | if (unlikely(b[0])) | ||
416 | return __ffs(b[0]); | ||
417 | if (unlikely(b[1])) | ||
418 | return 64 + __ffs(b[1]); | ||
419 | return __ffs(b[2]) + 128; | ||
420 | } | ||
421 | 388 | ||
422 | #endif /* __KERNEL__ */ | 389 | #endif /* __KERNEL__ */ |
423 | 390 | ||