blob: cc5abd739699b877b396f5eee5adaf53df76c4fa [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Mike Dunn0dd9c7a92013-04-12 11:59:17 -07002/*
Mike Dunn0dd9c7a92013-04-12 11:59:17 -07003 * 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
11extern u8 const byte_rev_table[256];
12
13static inline u8 bitrev8(u8 byte)
14{
15 return byte_rev_table[byte];
16}
17
18u16 bitrev16(u16 in);
19u32 bitrev32(u32 in);
20
21#endif /* _LINUX_BITREV_H */