summaryrefslogtreecommitdiff
path: root/include/linux/bitrev.h
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-10 22:06:03 (GMT)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-05-10 22:06:03 (GMT)
commite825b100d209a9d3c79b2998452cafa94eec986a (patch)
treee1654c4d745839eba8d37f67d15acde79382e23e /include/linux/bitrev.h
parentb03b25caea1ff3a501161f5bc1ad5e5b5b124e0c (diff)
parent66a62ce0dc48d2319938c72f34a562f519c5d5c2 (diff)
downloadu-boot-fsl-qoriq-e825b100d209a9d3c79b2998452cafa94eec986a.tar.xz
Merge branch 'u-boot-pxa/master' into 'u-boot-arm/master'
Diffstat (limited to 'include/linux/bitrev.h')
-rw-r--r--include/linux/bitrev.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h
new file mode 100644
index 0000000..a61d956
--- /dev/null
+++ b/include/linux/bitrev.h
@@ -0,0 +1,23 @@
+/*
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ *
+ * Based on bitrev from the Linux kernel, by Akinobu Mita
+ */
+
+#ifndef _LINUX_BITREV_H
+#define _LINUX_BITREV_H
+
+#include <linux/types.h>
+
+extern u8 const byte_rev_table[256];
+
+static inline u8 bitrev8(u8 byte)
+{
+ return byte_rev_table[byte];
+}
+
+u16 bitrev16(u16 in);
+u32 bitrev32(u32 in);
+
+#endif /* _LINUX_BITREV_H */