aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/bitops.h3
-rw-r--r--arch/avr32/include/asm/bitops.h15
-rw-r--r--arch/m68k/include/asm/bitops_mm.h8
-rw-r--r--arch/m68k/include/asm/bitops_no.h2
-rw-r--r--arch/s390/include/asm/bitops.h8
5 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 6b7403fd8f54..18a024b7b676 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -326,16 +326,19 @@ static inline int find_first_zero_bit_le(const void *p, unsigned size)
326{ 326{
327 return _find_first_zero_bit_le(p, size); 327 return _find_first_zero_bit_le(p, size);
328} 328}
329#define find_first_zero_bit_le find_first_zero_bit_le
329 330
330static inline int find_next_zero_bit_le(const void *p, int size, int offset) 331static inline int find_next_zero_bit_le(const void *p, int size, int offset)
331{ 332{
332 return _find_next_zero_bit_le(p, size, offset); 333 return _find_next_zero_bit_le(p, size, offset);
333} 334}
335#define find_next_zero_bit_le find_next_zero_bit_le
334 336
335static inline int find_next_bit_le(const void *p, int size, int offset) 337static inline int find_next_bit_le(const void *p, int size, int offset)
336{ 338{
337 return _find_next_bit_le(p, size, offset); 339 return _find_next_bit_le(p, size, offset);
338} 340}
341#define find_next_bit_le find_next_bit_le
339 342
340/* 343/*
341 * Ext2 is defined to use little-endian byte ordering. 344 * Ext2 is defined to use little-endian byte ordering.
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 72444d97f80c..b70c19bab63a 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -270,14 +270,21 @@ static inline int __fls(unsigned long word)
270 270
271unsigned long find_first_zero_bit(const unsigned long *addr, 271unsigned long find_first_zero_bit(const unsigned long *addr,
272 unsigned long size); 272 unsigned long size);
273#define find_first_zero_bit find_first_zero_bit
274
273unsigned long find_next_zero_bit(const unsigned long *addr, 275unsigned long find_next_zero_bit(const unsigned long *addr,
274 unsigned long size, 276 unsigned long size,
275 unsigned long offset); 277 unsigned long offset);
278#define find_next_zero_bit find_next_zero_bit
279
276unsigned long find_first_bit(const unsigned long *addr, 280unsigned long find_first_bit(const unsigned long *addr,
277 unsigned long size); 281 unsigned long size);
282#define find_first_bit find_first_bit
283
278unsigned long find_next_bit(const unsigned long *addr, 284unsigned long find_next_bit(const unsigned long *addr,
279 unsigned long size, 285 unsigned long size,
280 unsigned long offset); 286 unsigned long offset);
287#define find_next_bit find_next_bit
281 288
282/* 289/*
283 * ffs: find first bit set. This is defined the same way as 290 * ffs: find first bit set. This is defined the same way as
@@ -299,6 +306,14 @@ static inline int ffs(unsigned long word)
299#include <asm-generic/bitops/hweight.h> 306#include <asm-generic/bitops/hweight.h>
300#include <asm-generic/bitops/lock.h> 307#include <asm-generic/bitops/lock.h>
301 308
309extern unsigned long find_next_zero_bit_le(const void *addr,
310 unsigned long size, unsigned long offset);
311#define find_next_zero_bit_le find_next_zero_bit_le
312
313extern unsigned long find_next_bit_le(const void *addr,
314 unsigned long size, unsigned long offset);
315#define find_next_bit_le find_next_bit_le
316
302#include <asm-generic/bitops/le.h> 317#include <asm-generic/bitops/le.h>
303#include <asm-generic/bitops/ext2-atomic.h> 318#include <asm-generic/bitops/ext2-atomic.h>
304 319
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index e9020f88a748..89cf5b814a4d 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -200,6 +200,7 @@ out:
200 res += ((long)p - (long)vaddr - 4) * 8; 200 res += ((long)p - (long)vaddr - 4) * 8;
201 return res < size ? res : size; 201 return res < size ? res : size;
202} 202}
203#define find_first_zero_bit find_first_zero_bit
203 204
204static inline int find_next_zero_bit(const unsigned long *vaddr, int size, 205static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
205 int offset) 206 int offset)
@@ -229,6 +230,7 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
229 /* No zero yet, search remaining full bytes for a zero */ 230 /* No zero yet, search remaining full bytes for a zero */
230 return offset + find_first_zero_bit(p, size - offset); 231 return offset + find_first_zero_bit(p, size - offset);
231} 232}
233#define find_next_zero_bit find_next_zero_bit
232 234
233static inline int find_first_bit(const unsigned long *vaddr, unsigned size) 235static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
234{ 236{
@@ -253,6 +255,7 @@ out:
253 res += ((long)p - (long)vaddr - 4) * 8; 255 res += ((long)p - (long)vaddr - 4) * 8;
254 return res < size ? res : size; 256 return res < size ? res : size;
255} 257}
258#define find_first_bit find_first_bit
256 259
257static inline int find_next_bit(const unsigned long *vaddr, int size, 260static inline int find_next_bit(const unsigned long *vaddr, int size,
258 int offset) 261 int offset)
@@ -282,6 +285,7 @@ static inline int find_next_bit(const unsigned long *vaddr, int size,
282 /* No one yet, search remaining full bytes for a one */ 285 /* No one yet, search remaining full bytes for a one */
283 return offset + find_first_bit(p, size - offset); 286 return offset + find_first_bit(p, size - offset);
284} 287}
288#define find_next_bit find_next_bit
285 289
286/* 290/*
287 * ffz = Find First Zero in word. Undefined if no zero exists, 291 * ffz = Find First Zero in word. Undefined if no zero exists,
@@ -398,6 +402,7 @@ out:
398 res += (p - addr) * 32; 402 res += (p - addr) * 32;
399 return res < size ? res : size; 403 return res < size ? res : size;
400} 404}
405#define find_first_zero_bit_le find_first_zero_bit_le
401 406
402static inline unsigned long find_next_zero_bit_le(const void *addr, 407static inline unsigned long find_next_zero_bit_le(const void *addr,
403 unsigned long size, unsigned long offset) 408 unsigned long size, unsigned long offset)
@@ -427,6 +432,7 @@ static inline unsigned long find_next_zero_bit_le(const void *addr,
427 /* No zero yet, search remaining full bytes for a zero */ 432 /* No zero yet, search remaining full bytes for a zero */
428 return offset + find_first_zero_bit_le(p, size - offset); 433 return offset + find_first_zero_bit_le(p, size - offset);
429} 434}
435#define find_next_zero_bit_le find_next_zero_bit_le
430 436
431static inline int find_first_bit_le(const void *vaddr, unsigned size) 437static inline int find_first_bit_le(const void *vaddr, unsigned size)
432{ 438{
@@ -451,6 +457,7 @@ out:
451 res += (p - addr) * 32; 457 res += (p - addr) * 32;
452 return res < size ? res : size; 458 return res < size ? res : size;
453} 459}
460#define find_first_bit_le find_first_bit_le
454 461
455static inline unsigned long find_next_bit_le(const void *addr, 462static inline unsigned long find_next_bit_le(const void *addr,
456 unsigned long size, unsigned long offset) 463 unsigned long size, unsigned long offset)
@@ -480,6 +487,7 @@ static inline unsigned long find_next_bit_le(const void *addr,
480 /* No set bit yet, search remaining full bytes for a set bit */ 487 /* No set bit yet, search remaining full bytes for a set bit */
481 return offset + find_first_bit_le(p, size - offset); 488 return offset + find_first_bit_le(p, size - offset);
482} 489}
490#define find_next_bit_le find_next_bit_le
483 491
484/* Bitmap functions for the ext2 filesystem. */ 492/* Bitmap functions for the ext2 filesystem. */
485 493
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index b816299816ad..52793ebc4471 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -319,6 +319,7 @@ found_first:
319found_middle: 319found_middle:
320 return result + ffz(__swab32(tmp)); 320 return result + ffz(__swab32(tmp));
321} 321}
322#define find_next_zero_bit_le find_next_zero_bit_le
322 323
323static inline unsigned long find_next_bit_le(const void *addr, unsigned 324static inline unsigned long find_next_bit_le(const void *addr, unsigned
324 long size, unsigned long offset) 325 long size, unsigned long offset)
@@ -363,6 +364,7 @@ found_middle:
363found_middle_swap: 364found_middle_swap:
364 return result + __ffs(__swab32(tmp)); 365 return result + __ffs(__swab32(tmp));
365} 366}
367#define find_next_bit_le find_next_bit_le
366 368
367#endif /* __KERNEL__ */ 369#endif /* __KERNEL__ */
368 370
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index e1c8f3a49884..426c97459f68 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -621,6 +621,7 @@ static inline unsigned long find_first_zero_bit(const unsigned long *addr,
621 bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes)); 621 bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes));
622 return (bits < size) ? bits : size; 622 return (bits < size) ? bits : size;
623} 623}
624#define find_first_zero_bit find_first_zero_bit
624 625
625/** 626/**
626 * find_first_bit - find the first set bit in a memory region 627 * find_first_bit - find the first set bit in a memory region
@@ -641,6 +642,7 @@ static inline unsigned long find_first_bit(const unsigned long * addr,
641 bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes)); 642 bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes));
642 return (bits < size) ? bits : size; 643 return (bits < size) ? bits : size;
643} 644}
645#define find_first_bit find_first_bit
644 646
645/** 647/**
646 * find_next_zero_bit - find the first zero bit in a memory region 648 * find_next_zero_bit - find the first zero bit in a memory region
@@ -677,6 +679,7 @@ static inline int find_next_zero_bit (const unsigned long * addr,
677 } 679 }
678 return offset + find_first_zero_bit(p, size); 680 return offset + find_first_zero_bit(p, size);
679} 681}
682#define find_next_zero_bit find_next_zero_bit
680 683
681/** 684/**
682 * find_next_bit - find the first set bit in a memory region 685 * find_next_bit - find the first set bit in a memory region
@@ -713,6 +716,7 @@ static inline int find_next_bit (const unsigned long * addr,
713 } 716 }
714 return offset + find_first_bit(p, size); 717 return offset + find_first_bit(p, size);
715} 718}
719#define find_next_bit find_next_bit
716 720
717/* 721/*
718 * Every architecture must define this function. It's the fastest 722 * Every architecture must define this function. It's the fastest
@@ -787,6 +791,7 @@ static inline int find_first_zero_bit_le(void *vaddr, unsigned int size)
787 bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes)); 791 bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes));
788 return (bits < size) ? bits : size; 792 return (bits < size) ? bits : size;
789} 793}
794#define find_first_zero_bit_le find_first_zero_bit_le
790 795
791static inline int find_next_zero_bit_le(void *vaddr, unsigned long size, 796static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
792 unsigned long offset) 797 unsigned long offset)
@@ -816,6 +821,7 @@ static inline int find_next_zero_bit_le(void *vaddr, unsigned long size,
816 } 821 }
817 return offset + find_first_zero_bit_le(p, size); 822 return offset + find_first_zero_bit_le(p, size);
818} 823}
824#define find_next_zero_bit_le find_next_zero_bit_le
819 825
820static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size) 826static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
821{ 827{
@@ -827,6 +833,7 @@ static inline unsigned long find_first_bit_le(void *vaddr, unsigned long size)
827 bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes)); 833 bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes));
828 return (bits < size) ? bits : size; 834 return (bits < size) ? bits : size;
829} 835}
836#define find_first_bit_le find_first_bit_le
830 837
831static inline int find_next_bit_le(void *vaddr, unsigned long size, 838static inline int find_next_bit_le(void *vaddr, unsigned long size,
832 unsigned long offset) 839 unsigned long offset)
@@ -856,6 +863,7 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size,
856 } 863 }
857 return offset + find_first_bit_le(p, size); 864 return offset + find_first_bit_le(p, size);
858} 865}
866#define find_next_bit_le find_next_bit_le
859 867
860#define ext2_set_bit_atomic(lock, nr, addr) \ 868#define ext2_set_bit_atomic(lock, nr, addr) \
861 test_and_set_bit_le(nr, addr) 869 test_and_set_bit_le(nr, addr)