[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Remove little-endian assumption from library code.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1170090113 0
# Node ID e7ceed4ebcd9a60a9828121c68a15c7c62f9a8cb
# Parent  21d6135f522fb309b830f803c4b6d289f2b5e092
Remove little-endian assumption from library code.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/lib.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -r 21d6135f522f -r e7ceed4ebcd9 xen/common/lib.c
--- a/xen/common/lib.c  Mon Jan 29 16:50:22 2007 +0000
+++ b/xen/common/lib.c  Mon Jan 29 17:01:53 2007 +0000
@@ -2,6 +2,7 @@
 #include <xen/ctype.h>
 #include <xen/lib.h>
 #include <xen/types.h>
+#include <asm/byteorder.h>
 
 /* for ctype.h */
 unsigned char _ctype[] = {
@@ -80,9 +81,15 @@ union uu {
     long           sl[2];          /* as two signed longs */
     unsigned long  ul[2];          /* as two unsigned longs */
 };
-/* XXX RN: Yuck hardcoded endianess :) */
+
+#ifdef __BIG_ENDIAN
+#define _QUAD_HIGHWORD 0
+#define _QUAD_LOWWORD 1
+#else /* __LITTLE_ENDIAN */
 #define _QUAD_HIGHWORD 1
 #define _QUAD_LOWWORD 0
+#endif
+
 /*
  * Define high and low longwords.
  */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.