mirror of https://gitlab.com/qemu-project/qemu
mac_newworld: wire up programmer switch to NMI handler
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 <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
7c4166a971
commit
8f55ac1304
|
@ -28,6 +28,7 @@
|
||||||
#include "hw/ppc/mac.h"
|
#include "hw/ppc/mac.h"
|
||||||
#include "hw/misc/macio/macio.h"
|
#include "hw/misc/macio/macio.h"
|
||||||
#include "hw/misc/macio/gpio.h"
|
#include "hw/misc/macio/gpio.h"
|
||||||
|
#include "hw/nmi.h"
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
|
@ -193,13 +194,21 @@ static void macio_gpio_reset(DeviceState *dev)
|
||||||
macio_set_gpio(s, 1, true);
|
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)
|
static void macio_gpio_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(oc);
|
DeviceClass *dc = DEVICE_CLASS(oc);
|
||||||
|
NMIClass *nc = NMI_CLASS(oc);
|
||||||
|
|
||||||
dc->realize = macio_gpio_realize;
|
dc->realize = macio_gpio_realize;
|
||||||
dc->reset = macio_gpio_reset;
|
dc->reset = macio_gpio_reset;
|
||||||
dc->vmsd = &vmstate_macio_gpio;
|
dc->vmsd = &vmstate_macio_gpio;
|
||||||
|
nc->nmi_monitor_handler = macio_gpio_nmi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo macio_gpio_init_info = {
|
static const TypeInfo macio_gpio_init_info = {
|
||||||
|
@ -208,6 +217,10 @@ static const TypeInfo macio_gpio_init_info = {
|
||||||
.instance_size = sizeof(MacIOGPIOState),
|
.instance_size = sizeof(MacIOGPIOState),
|
||||||
.instance_init = macio_gpio_init,
|
.instance_init = macio_gpio_init,
|
||||||
.class_init = macio_gpio_class_init,
|
.class_init = macio_gpio_class_init,
|
||||||
|
.interfaces = (InterfaceInfo[]) {
|
||||||
|
{ TYPE_NMI },
|
||||||
|
{ }
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void macio_gpio_register_types(void)
|
static void macio_gpio_register_types(void)
|
||||||
|
|
Loading…
Reference in New Issue