Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252074
b: refs/heads/master
c: 19de85e
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed May 27, 2011
1 parent 39ab65c commit 22124dd
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2812e178321132811a53f7be40fe7e9bbffd9e0
refs/heads/master: 19de85ef574c3a2182e3ccad9581805052f14946
4 changes: 4 additions & 0 deletions trunk/include/asm-generic/bitops/find.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_

#ifndef find_next_bit
/**
* find_next_bit - find the next set bit in a memory region
* @addr: The address to base the search on
Expand All @@ -9,7 +10,9 @@
*/
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
size, unsigned long offset);
#endif

#ifndef find_next_zero_bit
/**
* find_next_zero_bit - find the next cleared bit in a memory region
* @addr: The address to base the search on
Expand All @@ -18,6 +21,7 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
*/
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
long size, unsigned long offset);
#endif

#ifdef CONFIG_GENERIC_FIND_FIRST_BIT

Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-generic/bitops/le.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ static inline unsigned long find_first_zero_bit_le(const void *addr,

#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)

#ifndef find_next_zero_bit_le
extern unsigned long find_next_zero_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif

#ifndef find_next_bit_le
extern unsigned long find_next_bit_le(const void *addr,
unsigned long size, unsigned long offset);
#endif

#ifndef find_first_zero_bit_le
#define find_first_zero_bit_le(addr, size) \
find_next_zero_bit_le((addr), (size), 0)
#endif

#else
#error "Please fix <asm/byteorder.h>"
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ static inline unsigned long __ffs64(u64 word)
#ifdef __KERNEL__

#ifdef CONFIG_GENERIC_FIND_LAST_BIT
#ifndef find_last_bit
/**
* find_last_bit - find the last set bit in a memory region
* @addr: The address to start the search at
Expand All @@ -158,6 +159,7 @@ static inline unsigned long __ffs64(u64 word)
*/
extern unsigned long find_last_bit(const unsigned long *addr,
unsigned long size);
#endif
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */

#endif /* __KERNEL__ */
Expand Down
4 changes: 4 additions & 0 deletions trunk/lib/find_last_bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <asm/types.h>
#include <asm/byteorder.h>

#ifndef find_last_bit

unsigned long find_last_bit(const unsigned long *addr, unsigned long size)
{
unsigned long words;
Expand Down Expand Up @@ -43,3 +45,5 @@ unsigned long find_last_bit(const unsigned long *addr, unsigned long size)
return size;
}
EXPORT_SYMBOL(find_last_bit);

#endif
12 changes: 12 additions & 0 deletions trunk/lib/find_next_bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)

#ifdef CONFIG_GENERIC_FIND_NEXT_BIT
#ifndef find_next_bit
/*
* Find the next set bit in a memory region.
*/
Expand Down Expand Up @@ -59,7 +60,9 @@ unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_next_bit);
#endif

#ifndef find_next_zero_bit
/*
* This implementation of find_{first,next}_zero_bit was stolen from
* Linus' asm-alpha/bitops.h.
Expand Down Expand Up @@ -103,9 +106,11 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_next_zero_bit);
#endif
#endif /* CONFIG_GENERIC_FIND_NEXT_BIT */

#ifdef CONFIG_GENERIC_FIND_FIRST_BIT
#ifndef find_first_bit
/*
* Find the first set bit in a memory region.
*/
Expand All @@ -131,7 +136,9 @@ unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
return result + __ffs(tmp);
}
EXPORT_SYMBOL(find_first_bit);
#endif

#ifndef find_first_zero_bit
/*
* Find the first cleared bit in a memory region.
*/
Expand All @@ -157,6 +164,7 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size)
return result + ffz(tmp);
}
EXPORT_SYMBOL(find_first_zero_bit);
#endif
#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */

#ifdef __BIG_ENDIAN
Expand Down Expand Up @@ -186,6 +194,7 @@ static inline unsigned long ext2_swab(const unsigned long y)
#endif
}

#ifndef find_next_zero_bit_le
unsigned long find_next_zero_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
Expand Down Expand Up @@ -229,7 +238,9 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned
return result + ffz(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_zero_bit_le);
#endif

#ifndef find_next_bit_le
unsigned long find_next_bit_le(const void *addr, unsigned
long size, unsigned long offset)
{
Expand Down Expand Up @@ -274,6 +285,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned
return result + __ffs(ext2_swab(tmp));
}
EXPORT_SYMBOL(find_next_bit_le);
#endif

#endif /* CONFIG_GENERIC_FIND_BIT_LE */
#endif /* __BIG_ENDIAN */

0 comments on commit 22124dd

Please sign in to comment.