bitrev.c (5ce001b0e56638c726270d4f9e05d46d4250dfbb) | bitrev.c (556d2f055bf6d79ce81587dfe774d4dd10da473f) |
---|---|
1#ifndef CONFIG_HAVE_ARCH_BITREVERSE |
|
1#include <linux/types.h> 2#include <linux/module.h> 3#include <linux/bitrev.h> 4 5MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>"); 6MODULE_DESCRIPTION("Bit ordering reversal functions"); 7MODULE_LICENSE("GPL"); 8 --- 28 unchanged lines hidden (view full) --- 37 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 38 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 39 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 40 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 41 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, 42}; 43EXPORT_SYMBOL_GPL(byte_rev_table); 44 | 2#include <linux/types.h> 3#include <linux/module.h> 4#include <linux/bitrev.h> 5 6MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>"); 7MODULE_DESCRIPTION("Bit ordering reversal functions"); 8MODULE_LICENSE("GPL"); 9 --- 28 unchanged lines hidden (view full) --- 38 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 39 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 40 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 41 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 42 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, 43}; 44EXPORT_SYMBOL_GPL(byte_rev_table); 45 |
45u16 bitrev16(u16 x) 46{ 47 return (bitrev8(x & 0xff) << 8) | bitrev8(x >> 8); 48} 49EXPORT_SYMBOL(bitrev16); 50 51/** 52 * bitrev32 - reverse the order of bits in a u32 value 53 * @x: value to be bit-reversed 54 */ 55u32 bitrev32(u32 x) 56{ 57 return (bitrev16(x & 0xffff) << 16) | bitrev16(x >> 16); 58} 59EXPORT_SYMBOL(bitrev32); | 46#endif /* CONFIG_HAVE_ARCH_BITREVERSE */ |