diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 17:01:53 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-29 17:01:53 +0000 |
commit | 1abb530930be6fffbdc13ec727e4512571ff95ea (patch) | |
tree | 3aad58972ab251c8e1ef0ce9f1b98870360c9ced /xen/common/lib.c | |
parent | e3d9342716374cbb202e8f696bb357cc15b5aeae (diff) | |
download | xen-1abb530930be6fffbdc13ec727e4512571ff95ea.tar.gz xen-1abb530930be6fffbdc13ec727e4512571ff95ea.tar.bz2 xen-1abb530930be6fffbdc13ec727e4512571ff95ea.zip |
Remove little-endian assumption from library code.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/lib.c')
-rw-r--r-- | xen/common/lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 <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. */ |