Patchwork [1/2] memory: Fix memory_region_wrong_endianness()

login
register
mail settings
Submitter Andreas Färber
Date Jan. 7, 2012, 8:45 a.m.
Message ID <1325925915-21477-2-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/134842/
State New
Headers show

Comments

Andreas Färber - Jan. 7, 2012, 8:45 a.m.
Since commit be675c972088eba210e18dc125613e9f205a6bfb (memory: move
endianness compensation to memory core) it was checking for
TARGET_BIG_ENDIAN instead of TARGET_WORDS_BIGENDIAN, thereby not
swapping correctly for Big Endian targets.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Avi Kivity <avi@redhat.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/memory.c b/memory.c
index 394cbab..5e55a90 100644
--- a/memory.c
+++ b/memory.c
@@ -843,7 +843,7 @@  static void memory_region_destructor_rom_device(MemoryRegion *mr)
 
 static bool memory_region_wrong_endianness(MemoryRegion *mr)
 {
-#ifdef TARGET_BIG_ENDIAN
+#ifdef TARGET_WORDS_BIGENDIAN
     return mr->ops->endianness == DEVICE_LITTLE_ENDIAN;
 #else
     return mr->ops->endianness == DEVICE_BIG_ENDIAN;