Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125711
b: refs/heads/master
c: ee38e51
h: refs/heads/master
i:
  125709: 845f1a6
  125707: af3ad69
  125703: 53da3b8
  125695: 66381b6
v: v3
  • Loading branch information
Rusty Russell committed Jan 3, 2009
1 parent e4a712e commit 4926cc2
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 0999769e6cad9b0e5abb7c513c0c3f16821f0884
refs/heads/master: ee38e5140bafbf40e1bd25ab917ac8db54a27799
13 changes: 13 additions & 0 deletions trunk/include/asm-frv/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,19 @@ int __ffs(unsigned long x)
return 31 - bit;
}

/**
* __fls - find last (most-significant) set bit in a long word
* @word: the word to search
*
* Undefined if no set bit exists, so code should check against 0 first.
*/
static inline unsigned long __fls(unsigned long word)
{
unsigned long bit;
asm("scan %1,gr0,%0" : "=r"(bit) : "r"(word));
return bit;
}

/*
* special slimline version of fls() for calculating ilog2_u32()
* - note: no protection against n == 0
Expand Down

0 comments on commit 4926cc2

Please sign in to comment.