summaryrefslogtreecommitdiff
path: root/sim/byteswap.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-02-11 00:55:36 -0500
committerAli Saidi <saidi@eecs.umich.edu>2006-02-11 00:55:36 -0500
commit96d6ac441cabdd9b089e2306e926c67891fdf9fa (patch)
tree6bc0f319e1c9b4daf928cd5085c74db57816ef2e /sim/byteswap.hh
parentf2e97427be8e0787301ac83b05a7cac2bf2424db (diff)
downloadgem5-96d6ac441cabdd9b089e2306e926c67891fdf9fa.tar.xz
hello world works on a BE host for a LE guest
arch/alpha/alpha_linux_process.cc: Add endian conversions to fstat sim/byteswap.hh: for some reason I don't understand g++ really wanted a long version defined even though int32_t should be the same. --HG-- extra : convert_revision : 5bfe9d3f0b31824fa5a7ae3f51fd0be5ed4d555d
Diffstat (limited to 'sim/byteswap.hh')
-rw-r--r--sim/byteswap.hh19
1 files changed, 10 insertions, 9 deletions
diff --git a/sim/byteswap.hh b/sim/byteswap.hh
index 12d63b6b6..6a98a987f 100644
--- a/sim/byteswap.hh
+++ b/sim/byteswap.hh
@@ -75,15 +75,16 @@ swap_byte16(uint16_t x)
//This lets the compiler figure out how to call the swap_byte functions above
//for different data types.
-static inline uint64_t swap_byte(uint64_t x) {return swap_byte64(x);} \
-static inline int64_t swap_byte(int64_t x) {return swap_byte64((uint64_t)x);} \
-static inline uint32_t swap_byte(uint32_t x) {return swap_byte32(x);} \
-static inline int32_t swap_byte(int32_t x) {return swap_byte32((uint32_t)x);} \
-static inline uint16_t swap_byte(uint16_t x) {return swap_byte32(x);} \
-static inline int16_t swap_byte(int16_t x) {return swap_byte16((uint16_t)x);} \
-static inline uint8_t swap_byte(uint8_t x) {return x;} \
-static inline int8_t swap_byte(int8_t x) {return x;} \
-static inline double swap_byte(double x) {return swap_byte64((uint64_t)x);} \
+static inline uint64_t swap_byte(uint64_t x) {return swap_byte64(x);}
+static inline int64_t swap_byte(int64_t x) {return swap_byte64((uint64_t)x);}
+static inline uint32_t swap_byte(uint32_t x) {return swap_byte32(x);}
+static inline int32_t swap_byte(int32_t x) {return swap_byte32((uint32_t)x);}
+static inline int32_t swap_byte(long x) {return swap_byte32((long)x);}
+static inline uint16_t swap_byte(uint16_t x) {return swap_byte32(x);}
+static inline int16_t swap_byte(int16_t x) {return swap_byte16((uint16_t)x);}
+static inline uint8_t swap_byte(uint8_t x) {return x;}
+static inline int8_t swap_byte(int8_t x) {return x;}
+static inline double swap_byte(double x) {return swap_byte64((uint64_t)x);}
static inline float swap_byte(float x) {return swap_byte32((uint32_t)x);}
//The conversion functions with fixed endianness on both ends don't need to