[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 5/7] adb: fix read reg 3 byte ordering
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCH 5/7] adb: fix read reg 3 byte ordering |
Date: |
Tue, 12 Jun 2018 17:44:00 +0100 |
According to the Apple ADB documentation, register 3 is a 2-byte register
with the device address in the first byte, and the handler ID in the second
byte.
This is currently the opposite away to which QEMU returns them so switch the
order around.
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/input/adb-kbd.c | 4 ++--
hw/input/adb-mouse.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/input/adb-kbd.c b/hw/input/adb-kbd.c
index 50b62712c8..0ad384dc89 100644
--- a/hw/input/adb-kbd.c
+++ b/hw/input/adb-kbd.c
@@ -290,8 +290,8 @@ static int adb_kbd_request(ADBDevice *d, uint8_t *obuf,
olen = 2;
break;
case 3:
- obuf[0] = d->handler;
- obuf[1] = d->devaddr;
+ obuf[0] = d->devaddr;
+ obuf[1] = d->handler;
olen = 2;
break;
}
diff --git a/hw/input/adb-mouse.c b/hw/input/adb-mouse.c
index 3ba6027d33..473045fbac 100644
--- a/hw/input/adb-mouse.c
+++ b/hw/input/adb-mouse.c
@@ -172,8 +172,8 @@ static int adb_mouse_request(ADBDevice *d, uint8_t *obuf,
case 1:
break;
case 3:
- obuf[0] = d->handler;
- obuf[1] = d->devaddr;
+ obuf[0] = d->devaddr;
+ obuf[1] = d->handler;
olen = 2;
break;
}
--
2.11.0
- [Qemu-ppc] [PATCH 0/7] mac99: add via-pmu support, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 5/7] adb: fix read reg 3 byte ordering,
Mark Cave-Ayland <=
- [Qemu-ppc] [PATCH 1/7] ppc: introduce Core99MachinesState for the mac99 machine, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 4/7] mac_newworld: wire up programmer switch to NMI handler, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 2/7] mac_newworld: add via machine option to control mac99 VIA/ADB configuration, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 6/7] adb: add property to disable direct reg 3 writes, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 3/7] mac_newworld: add gpios to macio devices with PMU enabled, Mark Cave-Ayland, 2018/06/12
- [Qemu-ppc] [PATCH 7/7] mac_newworld: add PMU device, Mark Cave-Ayland, 2018/06/12
- Re: [Qemu-ppc] [PATCH 0/7] mac99: add via-pmu support, David Gibson, 2018/06/12