# HG changeset patch # User kfraser@localhost.localdomain # Date 1170090113 0 # Node ID e7ceed4ebcd9a60a9828121c68a15c7c62f9a8cb # Parent 21d6135f522fb309b830f803c4b6d289f2b5e092 Remove little-endian assumption from library code. Signed-off-by: Keir Fraser 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 #include #include +#include /* 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. */