Browse Source

microblaze can be either big or little endian

Signed-off-by: Steve Bennett <steveb@workware.net.au>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Steve Bennett 12 years ago
parent
commit
c13e46c982
2 changed files with 8 additions and 2 deletions
  1. 0 1
      extra/Configs/Config.microblaze
  2. 8 1
      libc/sysdeps/linux/microblaze/bits/endian.h

+ 0 - 1
extra/Configs/Config.microblaze

@@ -10,5 +10,4 @@ config TARGET_ARCH
 config FORCE_OPTIONS_FOR_ARCH
 	bool
 	default y
-	select ARCH_BIG_ENDIAN
 	select ARCH_HAS_NO_MMU

+ 8 - 1
libc/sysdeps/linux/microblaze/bits/endian.h

@@ -17,4 +17,11 @@
 # error "Never use <bits/endian.h> directly; include <endian.h> instead."
 #endif
 
-#define __BYTE_ORDER __BIG_ENDIAN
+/* Note: Toolchain supplies _BIG_ENDIAN or _LITTLE_ENDIAN */
+#if defined(_BIG_ENDIAN)
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(_LITTLE_ENDIAN)
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# error "Endianness is unknown"
+#endif