aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/swab.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2009-05-13 22:56:27 +0000
committerArnd Bergmann <arnd@klappe2.(none)>2009-06-11 21:02:15 +0200
commit6103ec56c65c33774c7c38652c8204120c3c7519 (patch)
tree5d510da8f5aeb46b796a27192b04eec99d375886 /include/asm-generic/swab.h
parentasm-generic: add generic sysv ipc headers (diff)
downloadlinux-dev-6103ec56c65c33774c7c38652c8204120c3c7519.tar.xz
linux-dev-6103ec56c65c33774c7c38652c8204120c3c7519.zip
asm-generic: add generic ABI headers
These header files are typically copied from an existing architecture into any new one, slightly modified and then remain untouched until the end of time in the name of ABI stability. To make it easier for future architectures, provide a sane generic version here. In cases where multiple architectures already use identical code, I used the most common version. In cases like stat.h that are more or less broken everywhere, I provide a version that is meant to be ideal for new architectures. Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/asm-generic/swab.h')
-rw-r--r--include/asm-generic/swab.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/asm-generic/swab.h b/include/asm-generic/swab.h
new file mode 100644
index 000000000000..a8e9029d9eba
--- /dev/null
+++ b/include/asm-generic/swab.h
@@ -0,0 +1,18 @@
+#ifndef _ASM_GENERIC_SWAB_H
+#define _ASM_GENERIC_SWAB_H
+
+#include <asm/bitsperlong.h>
+
+/*
+ * 32 bit architectures typically (but not always) want to
+ * set __SWAB_64_THRU_32__. In user space, this is only
+ * valid if the compiler supports 64 bit data types.
+ */
+
+#if __BITS_PER_LONG == 32
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#define __SWAB_64_THRU_32__
+#endif
+#endif
+
+#endif /* _ASM_GENERIC_SWAB_H */