WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Remove little-endian assumption from libr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Remove little-endian assumption from library code.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jan 2007 06:00:25 -0800
Delivery-date: Tue, 30 Jan 2007 06:01:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Remove little-endian assumption from library code., Xen patchbot-unstable <=