]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/linux/bitrev.h
lib: import bitrev library from the linux kernel
[karo-tx-uboot.git] / include / linux / bitrev.h
1 /*
2  * This file is released under the terms of GPL v2 and any later version.
3  * See the file COPYING in the root directory of the source tree for details.
4  *
5  * Based on bitrev from the Linux kernel, by Akinobu Mita
6  */
7
8 #ifndef _LINUX_BITREV_H
9 #define _LINUX_BITREV_H
10
11 #include <linux/types.h>
12
13 extern u8 const byte_rev_table[256];
14
15 static inline u8 bitrev8(u8 byte)
16 {
17         return byte_rev_table[byte];
18 }
19
20 u16 bitrev16(u16 in);
21 u32 bitrev32(u32 in);
22
23 #endif /* _LINUX_BITREV_H */