debuggers.hg
changeset 13708:e7ceed4ebcd9
Remove little-endian assumption from library code.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kfraser@localhost.localdomain |
---|---|
date | Mon Jan 29 17:01:53 2007 +0000 (2007-01-29) |
parents | 21d6135f522f |
children | effa38a30a5c |
files | xen/common/lib.c |
line diff
1.1 --- a/xen/common/lib.c Mon Jan 29 16:50:22 2007 +0000 1.2 +++ b/xen/common/lib.c Mon Jan 29 17:01:53 2007 +0000 1.3 @@ -2,6 +2,7 @@ 1.4 #include <xen/ctype.h> 1.5 #include <xen/lib.h> 1.6 #include <xen/types.h> 1.7 +#include <asm/byteorder.h> 1.8 1.9 /* for ctype.h */ 1.10 unsigned char _ctype[] = { 1.11 @@ -80,9 +81,15 @@ union uu { 1.12 long sl[2]; /* as two signed longs */ 1.13 unsigned long ul[2]; /* as two unsigned longs */ 1.14 }; 1.15 -/* XXX RN: Yuck hardcoded endianess :) */ 1.16 + 1.17 +#ifdef __BIG_ENDIAN 1.18 +#define _QUAD_HIGHWORD 0 1.19 +#define _QUAD_LOWWORD 1 1.20 +#else /* __LITTLE_ENDIAN */ 1.21 #define _QUAD_HIGHWORD 1 1.22 #define _QUAD_LOWWORD 0 1.23 +#endif 1.24 + 1.25 /* 1.26 * Define high and low longwords. 1.27 */