Currently all ppc targets rely on fallback code in monitor.c to implement the "irq" and "pic" hmp commands, by calling into the i8259 code. For the PReP machine type, which does usually have an ISA bridge and legacy IO, including an i8259, this patch correctly sets the MachineClass callbacks to implement those commands properly without the fallback.
In fact PReP is the only ppc machine for which the i8259 implementation of those hmp commands makes sense. The other machine types won't typically have an i8259 at all. So we can remove the fallback case from the monitor meaning that other ppc targets will correctly implement those commands as no-ops. Signed-off-by: David Gibson <da...@gibson.dropbear.id.au> --- hw/ppc/prep.c | 2 ++ monitor.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index dfc8689..b99e87d 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -572,6 +572,8 @@ static void prep_machine_class_init(ObjectClass *oc, void *data) mc->init = ppc_prep_init; mc->max_cpus = MAX_CPUS; mc->default_boot_order = "cad"; + mc->hmp_info_irq = i8259_hmp_info_irq; + mc->hmp_info_pic = i8259_hmp_info_pic; } static const TypeInfo prep_machine_info = { diff --git a/monitor.c b/monitor.c index 30da438..3165539 100644 --- a/monitor.c +++ b/monitor.c @@ -1078,7 +1078,7 @@ static void hmp_info_pic(Monitor *mon, const QDict *qdict) sun4m_hmp_info_pic(mon, qdict); #elif defined(TARGET_LM32) lm32_hmp_info_pic(mon, qdict); -#elif defined(TARGET_PPC) || defined(TARGET_MIPS) +#elif defined(TARGET_MIPS) i8259_hmp_info_pic(mon, qdict); #endif } @@ -1100,7 +1100,7 @@ static void hmp_info_irq(Monitor *mon, const QDict *qdict) sun4m_hmp_info_irq(mon, qdict); #elif defined(TARGET_LM32) lm32_hmp_info_irq(mon, qdict); -#elif defined(TARGET_PPC) || defined(TARGET_MIPS) +#elif defined(TARGET_MIPS) i8259_hmp_info_irq(mon, qdict); #endif } -- 2.1.0