[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 4/7] mac_newworld: wire up programmer switch to NMI ha
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCH 4/7] mac_newworld: wire up programmer switch to NMI handler |
Date: |
Tue, 12 Jun 2018 17:43:59 +0100 |
The programmer switch is wired up via an external GPIO pin and can be used
to aid debugging Mac guests.
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/misc/macio/gpio.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c
index 5630afdf18..9317df759c 100644
--- a/hw/misc/macio/gpio.c
+++ b/hw/misc/macio/gpio.c
@@ -28,6 +28,7 @@
#include "hw/ppc/mac.h"
#include "hw/misc/macio/macio.h"
#include "hw/misc/macio/gpio.h"
+#include "hw/nmi.h"
#include "qemu/log.h"
#include "trace.h"
@@ -193,13 +194,21 @@ static void macio_gpio_reset(DeviceState *dev)
macio_set_gpio(s, 1, true);
}
+static void macio_gpio_nmi(NMIState *n, int cpu_index, Error **errp)
+{
+ macio_set_gpio(MACIO_GPIO(n), 9, true);
+ macio_set_gpio(MACIO_GPIO(n), 9, false);
+}
+
static void macio_gpio_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
+ NMIClass *nc = NMI_CLASS(oc);
dc->realize = macio_gpio_realize;
dc->reset = macio_gpio_reset;
dc->vmsd = &vmstate_macio_gpio;
+ nc->nmi_monitor_handler = macio_gpio_nmi;
}
static const TypeInfo macio_gpio_init_info = {
@@ -208,6 +217,10 @@ static const TypeInfo macio_gpio_init_info = {
.instance_size = sizeof(MacIOGPIOState),
.instance_init = macio_gpio_init,
.class_init = macio_gpio_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_NMI },
+ { }
+ },
};
static void macio_gpio_register_types(void)
--
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, 2018/06/12
- [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 <=
- [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