blob: 6876e1b2ec964772dfe039c05cc15bd20d05a4fe [file] [log] [blame]
Mike Dunn0dd9c7a92013-04-12 11:59:17 -07001/*
Wolfgang Denk1a459662013-07-08 09:37:19 +02002 * SPDX-License-Identifier: GPL-2.0+
Mike Dunn0dd9c7a92013-04-12 11:59:17 -07003 *
4 * Based on bitrev from the Linux kernel, by Akinobu Mita
5 */
6
7#ifndef _LINUX_BITREV_H
8#define _LINUX_BITREV_H
9
10#include <linux/types.h>
11
12extern u8 const byte_rev_table[256];
13
14static inline u8 bitrev8(u8 byte)
15{
16 return byte_rev_table[byte];
17}
18
19u16 bitrev16(u16 in);
20u32 bitrev32(u32 in);
21
22#endif /* _LINUX_BITREV_H */