From cbb21eed186647716b9e8404a9e90d3fc5c6c467 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 12 Aug 2011 19:57:41 +0200 Subject: linux-user: fix abi_(u)long, target_ulong mismatch abi_(u)long might be different from target_ulong, so don't use tswapl but introduce a new tswapal Signed-off-by: Matthias Braun Signed-off-by: Riku Voipio --- linux-user/qemu-types.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'linux-user/qemu-types.h') diff --git a/linux-user/qemu-types.h b/linux-user/qemu-types.h index 1adda9fbdb..fe7f6624f9 100644 --- a/linux-user/qemu-types.h +++ b/linux-user/qemu-types.h @@ -9,6 +9,12 @@ typedef int32_t abi_long; #define TARGET_ABI_FMT_ld "%d" #define TARGET_ABI_FMT_lu "%u" #define TARGET_ABI_BITS 32 + +static inline abi_ulong tswapal(abi_ulong v) +{ + return tswap32(v); +} + #else typedef target_ulong abi_ulong; typedef target_long abi_long; @@ -20,5 +26,11 @@ typedef target_long abi_long; #if TARGET_ABI_BITS == 32 #define TARGET_ABI32 1 #endif + +static inline abi_ulong tswapal(abi_ulong v) +{ + return tswapl(v); +} + #endif #endif -- cgit v1.2.1