aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m68k/bitops.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-m68k/bitops.h')
-rw-r--r--include/asm-m68k/bitops.h42
1 files changed, 8 insertions, 34 deletions
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index 13f4c0048463..1a61fdb56aaf 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -310,36 +310,10 @@ static inline int fls(int x)
310 310
311 return 32 - cnt; 311 return 32 - cnt;
312} 312}
313#define fls64(x) generic_fls64(x)
314 313
315/* 314#include <asm-generic/bitops/fls64.h>
316 * Every architecture must define this function. It's the fastest 315#include <asm-generic/bitops/sched.h>
317 * way of searching a 140-bit bitmap where the first 100 bits are 316#include <asm-generic/bitops/hweight.h>
318 * unlikely to be set. It's guaranteed that at least one of the 140
319 * bits is cleared.
320 */
321static inline int sched_find_first_bit(const unsigned long *b)
322{
323 if (unlikely(b[0]))
324 return __ffs(b[0]);
325 if (unlikely(b[1]))
326 return __ffs(b[1]) + 32;
327 if (unlikely(b[2]))
328 return __ffs(b[2]) + 64;
329 if (b[3])
330 return __ffs(b[3]) + 96;
331 return __ffs(b[4]) + 128;
332}
333
334
335/*
336 * hweightN: returns the hamming weight (i.e. the number
337 * of bits set) of a N-bit word
338 */
339
340#define hweight32(x) generic_hweight32(x)
341#define hweight16(x) generic_hweight16(x)
342#define hweight8(x) generic_hweight8(x)
343 317
344/* Bitmap functions for the minix filesystem */ 318/* Bitmap functions for the minix filesystem */
345 319
@@ -365,9 +339,9 @@ static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
365 return ((p - addr) << 4) + (res ^ 31); 339 return ((p - addr) << 4) + (res ^ 31);
366} 340}
367 341
368#define minix_test_and_set_bit(nr, addr) test_and_set_bit((nr) ^ 16, (unsigned long *)(addr)) 342#define minix_test_and_set_bit(nr, addr) __test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
369#define minix_set_bit(nr,addr) set_bit((nr) ^ 16, (unsigned long *)(addr)) 343#define minix_set_bit(nr,addr) __set_bit((nr) ^ 16, (unsigned long *)(addr))
370#define minix_test_and_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr)) 344#define minix_test_and_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
371 345
372static inline int minix_test_bit(int nr, const void *vaddr) 346static inline int minix_test_bit(int nr, const void *vaddr)
373{ 347{
@@ -377,9 +351,9 @@ static inline int minix_test_bit(int nr, const void *vaddr)
377 351
378/* Bitmap functions for the ext2 filesystem. */ 352/* Bitmap functions for the ext2 filesystem. */
379 353
380#define ext2_set_bit(nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) 354#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
381#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) 355#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
382#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) 356#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
383#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) 357#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
384 358
385static inline int ext2_test_bit(int nr, const void *vaddr) 359static inline int ext2_test_bit(int nr, const void *vaddr)