summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authortschwinge <tschwinge>2008-01-30 20:18:57 +0000
committertschwinge <tschwinge>2008-01-30 20:18:57 +0000
commit41f0d6b455a2aabc7a77193deac88a165caa0112 (patch)
treeafadd771c6028499384c5d80a30fe34b47e87169 /platform
parent507c12974b6cf2ade7025693f48ad3635044ba6d (diff)
2008-01-30 Thomas Schwinge <tschwinge@gnu.org>
* amd64/bits/endian.h: New file, from today's glibc CVS HEAD. * amd64/Makefile.am (noinst_HEADERS): Add it. * ia32/bits/endian.h: New file, from today's glibc CVS HEAD. * ia32/Makefile.am (noinst_HEADERS): Add it. * endian.h: New file, from today's glibc CVS HEAD. * Makefile.am (noinst_HEADERS): Add it. * headers.m4: Link them. * README: Document them.
Diffstat (limited to 'platform')
-rw-r--r--platform/ChangeLog9
-rw-r--r--platform/Makefile.am4
-rw-r--r--platform/README4
-rw-r--r--platform/amd64/Makefile.am1
-rw-r--r--platform/amd64/bits/endian.h7
-rw-r--r--platform/endian.h58
-rw-r--r--platform/headers.m42
-rw-r--r--platform/ia32/Makefile.am1
-rw-r--r--platform/ia32/bits/endian.h7
9 files changed, 92 insertions, 1 deletions
diff --git a/platform/ChangeLog b/platform/ChangeLog
index 926b4f5..edfebef 100644
--- a/platform/ChangeLog
+++ b/platform/ChangeLog
@@ -1,5 +1,14 @@
2008-01-30 Thomas Schwinge <tschwinge@gnu.org>
+ * amd64/bits/endian.h: New file, from today's glibc CVS HEAD.
+ * amd64/Makefile.am (noinst_HEADERS): Add it.
+ * ia32/bits/endian.h: New file, from today's glibc CVS HEAD.
+ * ia32/Makefile.am (noinst_HEADERS): Add it.
+ * endian.h: New file, from today's glibc CVS HEAD.
+ * Makefile.am (noinst_HEADERS): Add it.
+ * headers.m4: Link them.
+ * README: Document them.
+
* amd64/bits/wordsize.h: New file, from today's glibc CVS HEAD.
* amd64/Makefile.am (noinst_HEADERS): Add it.
* ia32/bits/wordsize.h: New file, from today's glibc CVS HEAD.
diff --git a/platform/Makefile.am b/platform/Makefile.am
index 27197e5..3d2b052 100644
--- a/platform/Makefile.am
+++ b/platform/Makefile.am
@@ -39,4 +39,6 @@ endif
SUBDIRS = $(ARCH_SUBDIR)
# Main platform header files.
-noinst_HEADERS = atomic.h
+noinst_HEADERS = \
+ atomic.h \
+ endian.h
diff --git a/platform/README b/platform/README
index 561e9c9..8eef954 100644
--- a/platform/README
+++ b/platform/README
@@ -19,4 +19,8 @@ CVS snapshot from 2008-01-30:
${glibc}/sysdeps/wordsize-32/bits/wordsize.h ia32/bits/wordsize.h
${glibc}/sysdeps/x86_64/bits/wordsize.h amd64/bits/wordsize.h
+${glibc}/string/endian.h endian.h
+${glibc}/sysdeps/i386/bits/endian.h ia32/bits/endian.h
+${glibc}/sysdeps/x86_64/bits/endian.h amd64/bits/endian.h
+
Other architectures not supported for now.
diff --git a/platform/amd64/Makefile.am b/platform/amd64/Makefile.am
index 7ed7bc5..4d9b943 100644
--- a/platform/amd64/Makefile.am
+++ b/platform/amd64/Makefile.am
@@ -20,4 +20,5 @@
noinst_HEADERS = \
bits/atomic.h \
+ bits/endian.h \
bits/wordsize.h
diff --git a/platform/amd64/bits/endian.h b/platform/amd64/bits/endian.h
new file mode 100644
index 0000000..2f59ead
--- /dev/null
+++ b/platform/amd64/bits/endian.h
@@ -0,0 +1,7 @@
+/* x86_64 is little-endian. */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/platform/endian.h b/platform/endian.h
new file mode 100644
index 0000000..2f7bce1
--- /dev/null
+++ b/platform/endian.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _ENDIAN_H
+#define _ENDIAN_H 1
+
+#include <features.h>
+
+/* Definitions for byte order, according to significance of bytes,
+ from low addresses to high addresses. The value is what you get by
+ putting '4' in the most significant byte, '3' in the second most
+ significant byte, '2' in the second least significant byte, and '1'
+ in the least significant byte, and then writing down one digit for
+ each byte, starting with the byte at the lowest address at the left,
+ and proceeding to the byte with the highest address at the right. */
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __PDP_ENDIAN 3412
+
+/* This file defines `__BYTE_ORDER' for the particular machine. */
+#include <bits/endian.h>
+
+/* Some machines may need to use a different endianness for floating point
+ values. */
+#ifndef __FLOAT_WORD_ORDER
+# define __FLOAT_WORD_ORDER __BYTE_ORDER
+#endif
+
+#ifdef __USE_BSD
+# define LITTLE_ENDIAN __LITTLE_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# define PDP_ENDIAN __PDP_ENDIAN
+# define BYTE_ORDER __BYTE_ORDER
+#endif
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) LO, HI
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define __LONG_LONG_PAIR(HI, LO) HI, LO
+#endif
+
+#endif /* endian.h */
diff --git a/platform/headers.m4 b/platform/headers.m4
index 8c859e7..7ec39af 100644
--- a/platform/headers.m4
+++ b/platform/headers.m4
@@ -17,4 +17,6 @@ AC_CONFIG_LINKS([
include/bits/atomic.h:platform/${arch}/bits/atomic.h
include/bits/wordsize.h:platform/${arch}/bits/wordsize.h
include/compiler.h:platform/compiler.h
+ include/endian.h:platform/endian.h
+ include/bits/endian.h:platform/${arch}/bits/endian.h
])
diff --git a/platform/ia32/Makefile.am b/platform/ia32/Makefile.am
index 86952be..7226be1 100644
--- a/platform/ia32/Makefile.am
+++ b/platform/ia32/Makefile.am
@@ -20,4 +20,5 @@
noinst_HEADERS = \
bits/atomic.h \
+ bits/endian.h \
bits/wordsize.h
diff --git a/platform/ia32/bits/endian.h b/platform/ia32/bits/endian.h
new file mode 100644
index 0000000..54bd9d1
--- /dev/null
+++ b/platform/ia32/bits/endian.h
@@ -0,0 +1,7 @@
+/* i386 is little-endian. */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN