diff mbox

macio: Fix timer endianness

Message ID 1401148882-5838-1-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf May 27, 2014, 12:01 a.m. UTC
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.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/misc/macio/macio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Cave-Ayland June 5, 2014, 8:43 p.m. UTC | #1
On 27/05/14 01:01, Alexander Graf wrote:

> 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.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>   hw/misc/macio/macio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 7f99aa0..47f45f5 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -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!

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.
diff mbox

Patch

diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 7f99aa0..47f45f5 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -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)