diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2006-11-06 19:52:32 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2006-11-06 19:52:32 -0500 |
commit | 02abca6b9e4e21d8d89eb83eabab3be8ac10c9d8 (patch) | |
tree | 6c923510076654885f31d2328c4853c5974699a8 /src/sim/byteswap.hh | |
parent | dd14c86ec8afb3a98d55a58eaafd8b85dd651bd6 (diff) | |
parent | bf3223d7ce681db8ca59dac49c6b44b672012e5d (diff) | |
download | gem5-02abca6b9e4e21d8d89eb83eabab3be8ac10c9d8.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/newmem/
into zeep.eecs.umich.edu:/home/gblack/m5/newmemmemops
src/SConscript:
SCCS merged
--HG--
extra : convert_revision : f130c8a2d33f58d857e5d5a02bb9698c1bceb23b
Diffstat (limited to 'src/sim/byteswap.hh')
-rw-r--r-- | src/sim/byteswap.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh index 7648b8fcd..7b1ae701e 100644 --- a/src/sim/byteswap.hh +++ b/src/sim/byteswap.hh @@ -47,6 +47,8 @@ // If one doesn't exist, we pretty much get what is listed below, so it all // works out #include <byteswap.h> +#elif defined (__sun__) +#include <sys/isa_defs.h> #else #include <machine/endian.h> #endif @@ -128,12 +130,12 @@ template <typename T> static inline T letobe(T value) {return swap_byte(value);} //For conversions not involving the guest system, we can define the functions //conditionally based on the BYTE_ORDER macro and outside of the namespaces -#if BYTE_ORDER == BIG_ENDIAN +#if defined(_BIG_ENDIAN) || BYTE_ORDER == BIG_ENDIAN template <typename T> static inline T htole(T value) {return swap_byte(value);} template <typename T> static inline T letoh(T value) {return swap_byte(value);} template <typename T> static inline T htobe(T value) {return value;} template <typename T> static inline T betoh(T value) {return value;} -#elif BYTE_ORDER == LITTLE_ENDIAN +#elif defined(_LITTLE_ENDIAN) || BYTE_ORDER == LITTLE_ENDIAN template <typename T> static inline T htole(T value) {return value;} template <typename T> static inline T letoh(T value) {return value;} template <typename T> static inline T htobe(T value) {return swap_byte(value);} |