Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Mike Dunn | 0dd9c7a9 | 2013-04-12 11:59:17 -0700 | [diff] [blame] | 2 | /* |
Mike Dunn | 0dd9c7a9 | 2013-04-12 11:59:17 -0700 | [diff] [blame] | 3 | * Based on bitrev from the Linux kernel, by Akinobu Mita |
| 4 | */ |
| 5 | |
| 6 | #ifndef _LINUX_BITREV_H |
| 7 | #define _LINUX_BITREV_H |
| 8 | |
| 9 | #include <linux/types.h> |
| 10 | |
| 11 | extern u8 const byte_rev_table[256]; |
| 12 | |
| 13 | static inline u8 bitrev8(u8 byte) |
| 14 | { |
| 15 | return byte_rev_table[byte]; |
| 16 | } |
| 17 | |
| 18 | u16 bitrev16(u16 in); |
| 19 | u32 bitrev32(u32 in); |
| 20 | |
| 21 | #endif /* _LINUX_BITREV_H */ |