From 17f477814adb144f3a485c31989b2a33cf432650 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sun, 1 May 2011 16:31:54 +0000 Subject: [PATCH] merged SVN patch Fix CopyHost*WordLittleEndian macros --- bochs/CHANGES | 1 + bochs/bochs.h | 35 +++++++---------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/bochs/CHANGES b/bochs/CHANGES index 2b95500d0..545710bab 100644 --- a/bochs/CHANGES +++ b/bochs/CHANGES @@ -48,6 +48,7 @@ Bochs repository moved to the SVN version control ! - VBE: added HDTV resolutions (patch by Tristan Schmelcher) - SF patches applied + [3295737] Fix CopyHost*WordLittleEndian macros by Heikki Lindholm [3289448] optimized powerpc byte swapping by Heikki Lindholm [3292581] Core Audio first aid by Heikki Lindholm [3205979] Compilation fixes for OpenBSD by Brad Smith diff --git a/bochs/bochs.h b/bochs/bochs.h index 87361d38b..58a51e675 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -556,13 +556,6 @@ BX_CPP_INLINE Bit64u bx_bswap64(Bit64u val64) #define ReadHostQWordFromLittleEndian(hostPtr, nativeVar64) \ (nativeVar64) = *((Bit64u*)(hostPtr)) -#define CopyHostWordLittleEndian(hostAddrDst, hostAddrSrc) \ - (* (Bit16u *)(hostAddrDst)) = (* (Bit16u *)(hostAddrSrc)); -#define CopyHostDWordLittleEndian(hostAddrDst, hostAddrSrc) \ - (* (Bit32u *)(hostAddrDst)) = (* (Bit32u *)(hostAddrSrc)); -#define CopyHostQWordLittleEndian(hostAddrDst, hostAddrSrc) \ - (* (Bit64u *)(hostAddrDst)) = (* (Bit64u *)(hostAddrSrc)); - #else #define WriteHostWordToLittleEndian(hostPtr, nativeVar16) { \ @@ -585,27 +578,13 @@ BX_CPP_INLINE Bit64u bx_bswap64(Bit64u val64) (nativeVar64) = bx_bswap64(*(Bit64u *)(hostPtr)); \ } -#define CopyHostWordLittleEndian(hostAddrDst, hostAddrSrc) { \ - ((Bit8u *)(hostAddrDst))[0] = ((Bit8u *)(hostAddrSrc))[0]; \ - ((Bit8u *)(hostAddrDst))[1] = ((Bit8u *)(hostAddrSrc))[1]; \ -} -#define CopyHostDWordLittleEndian(hostAddrDst, hostAddrSrc) { \ - ((Bit8u *)(hostAddrDst))[0] = ((Bit8u *)(hostAddrSrc))[0]; \ - ((Bit8u *)(hostAddrDst))[1] = ((Bit8u *)(hostAddrSrc))[1]; \ - ((Bit8u *)(hostAddrDst))[2] = ((Bit8u *)(hostAddrSrc))[2]; \ - ((Bit8u *)(hostAddrDst))[3] = ((Bit8u *)(hostAddrSrc))[3]; \ -} -#define CopyHostQWordLittleEndian(hostAddrDst, hostAddrSrc) { \ - ((Bit8u *)(hostAddrDst))[0] = ((Bit8u *)(hostAddrSrc))[0]; \ - ((Bit8u *)(hostAddrDst))[1] = ((Bit8u *)(hostAddrSrc))[1]; \ - ((Bit8u *)(hostAddrDst))[2] = ((Bit8u *)(hostAddrSrc))[2]; \ - ((Bit8u *)(hostAddrDst))[3] = ((Bit8u *)(hostAddrSrc))[3]; \ - ((Bit8u *)(hostAddrDst))[4] = ((Bit8u *)(hostAddrSrc))[4]; \ - ((Bit8u *)(hostAddrDst))[5] = ((Bit8u *)(hostAddrSrc))[5]; \ - ((Bit8u *)(hostAddrDst))[6] = ((Bit8u *)(hostAddrSrc))[6]; \ - ((Bit8u *)(hostAddrDst))[7] = ((Bit8u *)(hostAddrSrc))[7]; \ -} - #endif +#define CopyHostWordLittleEndian(hostAddrDst, hostAddrSrc) \ + (* (Bit16u *)(hostAddrDst)) = (* (Bit16u *)(hostAddrSrc)); +#define CopyHostDWordLittleEndian(hostAddrDst, hostAddrSrc) \ + (* (Bit32u *)(hostAddrDst)) = (* (Bit32u *)(hostAddrSrc)); +#define CopyHostQWordLittleEndian(hostAddrDst, hostAddrSrc) \ + (* (Bit64u *)(hostAddrDst)) = (* (Bit64u *)(hostAddrSrc)); + #endif /* BX_BOCHS_H */