summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/com32/include/klibc/endian.h
diff options
context:
space:
mode:
authorSebastian Schmelzer2010-10-25 16:53:54 +0200
committerSebastian Schmelzer2010-10-25 16:53:54 +0200
commit3050a9253437f4a4b5ad4bf3b3efdc3c660a5137 (patch)
tree91ac22153e416aac7ca20916b314b5e2ffa871b1 /contrib/syslinux-4.02/com32/include/klibc/endian.h
downloadpreboot-3050a9253437f4a4b5ad4bf3b3efdc3c660a5137.tar.gz
preboot-3050a9253437f4a4b5ad4bf3b3efdc3c660a5137.tar.xz
preboot-3050a9253437f4a4b5ad4bf3b3efdc3c660a5137.zip
initial import of sc2010 scripts ..HEADmaster
Diffstat (limited to 'contrib/syslinux-4.02/com32/include/klibc/endian.h')
-rw-r--r--contrib/syslinux-4.02/com32/include/klibc/endian.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/include/klibc/endian.h b/contrib/syslinux-4.02/com32/include/klibc/endian.h
new file mode 100644
index 0000000..9466421
--- /dev/null
+++ b/contrib/syslinux-4.02/com32/include/klibc/endian.h
@@ -0,0 +1,38 @@
+/*
+ * klibc/endian.h
+ *
+ * Like <endian.h>, but export only double-underscore symbols
+ */
+
+#ifndef _KLIBC_ENDIAN_H
+#define _KLIBC_ENDIAN_H
+
+#define __LITTLE_ENDIAN /* we're on i386, littleendian */
+
+/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
+ __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
+ defined with __BYTE_ORDER defining which is actually used... */
+
+#if defined(__LITTLE_ENDIAN)
+# undef __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#elif defined(__BIG_ENDIAN)
+# undef __BIG_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(__PDP_ENDIAN)
+# undef __PDP_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __PDP_ENDIAN
+#else
+# error "Unknown byte order!"
+#endif
+
+#endif /* _KLIBC_ENDIAN_H */