From: Gabe Black Date: Mon, 19 Sep 2011 12:19:45 +0000 (-0700) Subject: Endianness: Make it easier to check the compiled in guest endianness. X-Git-Tag: stable_2012_02_02~74 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3eca0a2bc9d8679a05dd92b5aec6e6358aab3681;p=gem5.git Endianness: Make it easier to check the compiled in guest endianness. It was technically possible but clumsy to determine what endianness a guest was configured with using the state in byteswap.hh. This change makes that information available more directly. Also get rid of unused (and mildly redundant) ByteOrderDiffers constant. --- diff --git a/src/sim/byteswap.hh b/src/sim/byteswap.hh index fc36bdf33..3a0f7ce8a 100644 --- a/src/sim/byteswap.hh +++ b/src/sim/byteswap.hh @@ -167,7 +167,7 @@ template inline T betoh(T value) {return swap_byte(value);} namespace BigEndianGuest { - const bool ByteOrderDiffers = (HostByteOrder != BigEndianByteOrder); + const ByteOrder GuestByteOrder = BigEndianByteOrder; template inline T gtole(T value) {return betole(value);} template @@ -184,7 +184,7 @@ namespace BigEndianGuest namespace LittleEndianGuest { - const bool ByteOrderDiffers = (HostByteOrder != LittleEndianByteOrder); + const ByteOrder GuestByteOrder = LittleEndianByteOrder; template inline T gtole(T value) {return value;} template