Skip to contentSkip to conversation

macio: Fix timer endianness

PATCH Mark Cave-Ayland 1 participant 1 message Jun 5, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mark Cave-Ayland

author Tested-by
#1 lore raw
Quoted 15 lines · Alexander Graf

The timer registers on our KeyLargo macio emulation are read as byte reversed from the big endian guest, so we better expose them endian reversed as well.

This fixes initial hickups of booting Mac OS X with -M mac99 for me.

---
  hw/misc/macio/macio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/misc/macio/macio.c +0 -0
index 7f99aa0..47f45f5 100644

hw/misc/macio/macio.c static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size) · line 265

Quoted 8 lines
hw/misc/macio/macio.c +1 -1
@@ -259,7 +259,7 @@ static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size)
  static const MemoryRegionOps timer_ops = {
      .read = timer_read,
      .write = timer_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
  };
 
  static int macio_newworld_initfn(PCIDevice *d)

Amazing! This patch appears to fix booting my Darwin 8.01 test ISO with -M mac99 so it now gets to the installer - nice work!

ATB,

Mark.