diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-03-13 14:20:46 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-13 14:21:04 +0100 |
commit | 56544d29c3a0e383c0d819fefc9570b2803db193 (patch) | |
tree | 4366fc0ba3f5115b8c1c9d171fa245d86e5415d0 /arch/arm/include/asm/bitrev.h | |
parent | 9261dc1de11e158a5f6b4b92c8bf1ef4a02dbf0d (diff) | |
parent | 9eccca0843205f87c00404b663188b88eb248051 (diff) | |
download | talos-op-linux-56544d29c3a0e383c0d819fefc9570b2803db193.tar.gz talos-op-linux-56544d29c3a0e383c0d819fefc9570b2803db193.zip |
Merge tag 'v4.0-rc3' into x86/build, to refresh an older tree before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/arm/include/asm/bitrev.h')
-rw-r--r-- | arch/arm/include/asm/bitrev.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/include/asm/bitrev.h b/arch/arm/include/asm/bitrev.h new file mode 100644 index 000000000000..ec291c350ea3 --- /dev/null +++ b/arch/arm/include/asm/bitrev.h @@ -0,0 +1,20 @@ +#ifndef __ASM_BITREV_H +#define __ASM_BITREV_H + +static __always_inline __attribute_const__ u32 __arch_bitrev32(u32 x) +{ + __asm__ ("rbit %0, %1" : "=r" (x) : "r" (x)); + return x; +} + +static __always_inline __attribute_const__ u16 __arch_bitrev16(u16 x) +{ + return __arch_bitrev32((u32)x) >> 16; +} + +static __always_inline __attribute_const__ u8 __arch_bitrev8(u8 x) +{ + return __arch_bitrev32((u32)x) >> 24; +} + +#endif |