diff options
| author | Tony Lindgren <tony@atomide.com> | 2012-02-24 19:48:27 -0500 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2012-02-24 19:48:27 -0500 |
| commit | ffd76d8be36da09f8456c55569c008f5aa93095e (patch) | |
| tree | 4a5e537edcdd3be9197c5fb7af1b4f7e4780ef77 /include/linux/bitops.h | |
| parent | bfe9c8ae114009491f51452ec727667d516ee79f (diff) | |
| parent | f0e15e2b0c6b3e89daade25a1e9a2d80136c14c3 (diff) | |
Merge branch 'for_3.4/dts_updates' of git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt into dt
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 3c1063acb2ab..94300fe46cce 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -56,6 +56,26 @@ static inline unsigned long hweight_long(unsigned long w) | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | /** | 58 | /** |
| 59 | * rol64 - rotate a 64-bit value left | ||
| 60 | * @word: value to rotate | ||
| 61 | * @shift: bits to roll | ||
| 62 | */ | ||
| 63 | static inline __u64 rol64(__u64 word, unsigned int shift) | ||
| 64 | { | ||
| 65 | return (word << shift) | (word >> (64 - shift)); | ||
| 66 | } | ||
| 67 | |||
| 68 | /** | ||
| 69 | * ror64 - rotate a 64-bit value right | ||
| 70 | * @word: value to rotate | ||
| 71 | * @shift: bits to roll | ||
| 72 | */ | ||
| 73 | static inline __u64 ror64(__u64 word, unsigned int shift) | ||
| 74 | { | ||
| 75 | return (word >> shift) | (word << (64 - shift)); | ||
| 76 | } | ||
| 77 | |||
| 78 | /** | ||
| 59 | * rol32 - rotate a 32-bit value left | 79 | * rol32 - rotate a 32-bit value left |
| 60 | * @word: value to rotate | 80 | * @word: value to rotate |
| 61 | * @shift: bits to roll | 81 | * @shift: bits to roll |
