diff options
| author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 12:17:29 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 12:17:29 -0400 |
| commit | adf6d34e460387ee3e8f1e1875d52bff51212c7d (patch) | |
| tree | 88ef100143e6184103a608f82dfd232bf6376eaf /include/linux/bitops.h | |
| parent | d1964dab60ce7c104dd21590e987a8787db18051 (diff) | |
| parent | 3760d31f11bfbd0ead9eaeb8573e0602437a9d7c (diff) | |
Merge branch 'omap2-upstream' into devel
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 69c1edb9fe54..40d54731de7e 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -65,6 +65,46 @@ static inline __u32 ror32(__u32 word, unsigned int shift) | |||
| 65 | return (word >> shift) | (word << (32 - shift)); | 65 | return (word >> shift) | (word << (32 - shift)); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | /** | ||
| 69 | * rol16 - rotate a 16-bit value left | ||
| 70 | * @word: value to rotate | ||
| 71 | * @shift: bits to roll | ||
| 72 | */ | ||
| 73 | static inline __u16 rol16(__u16 word, unsigned int shift) | ||
| 74 | { | ||
| 75 | return (word << shift) | (word >> (16 - shift)); | ||
| 76 | } | ||
| 77 | |||
| 78 | /** | ||
| 79 | * ror16 - rotate a 16-bit value right | ||
| 80 | * @word: value to rotate | ||
| 81 | * @shift: bits to roll | ||
| 82 | */ | ||
| 83 | static inline __u16 ror16(__u16 word, unsigned int shift) | ||
| 84 | { | ||
| 85 | return (word >> shift) | (word << (16 - shift)); | ||
| 86 | } | ||
| 87 | |||
| 88 | /** | ||
| 89 | * rol8 - rotate an 8-bit value left | ||
| 90 | * @word: value to rotate | ||
| 91 | * @shift: bits to roll | ||
| 92 | */ | ||
| 93 | static inline __u8 rol8(__u8 word, unsigned int shift) | ||
| 94 | { | ||
| 95 | return (word << shift) | (word >> (8 - shift)); | ||
| 96 | } | ||
| 97 | |||
| 98 | /** | ||
| 99 | * ror8 - rotate an 8-bit value right | ||
| 100 | * @word: value to rotate | ||
| 101 | * @shift: bits to roll | ||
| 102 | */ | ||
| 103 | static inline __u8 ror8(__u8 word, unsigned int shift) | ||
| 104 | { | ||
| 105 | return (word >> shift) | (word << (8 - shift)); | ||
| 106 | } | ||
| 107 | |||
| 68 | static inline unsigned fls_long(unsigned long l) | 108 | static inline unsigned fls_long(unsigned long l) |
| 69 | { | 109 | { |
| 70 | if (sizeof(l) == 4) | 110 | if (sizeof(l) == 4) |
