diff --git a/xen/common/lib.c b/xen/common/lib.c index c3e77d3cfa..2f1a005ca4 100644 --- a/xen/common/lib.c +++ b/xen/common/lib.c @@ -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. */