qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/6] Remove monitor.c dependency on CONFIG_I8259


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/6] Remove monitor.c dependency on CONFIG_I8259
Date: Tue, 31 Mar 2015 11:07:40 +0100

On 6 March 2015 at 04:18, David Gibson <address@hidden> wrote:
> The hmp commands "irq" and "pic" are a bit of a mess.  They're implemented
> on a number of targets, but not all.  On sparc32 and LM32 they do target
> specific things, but on the remainder (i386, ppc and mips) they call into
> the i8259 PIC code.
>
> But really, what these commands do shouldn't be dependent on the target
> arch, but on the specific machine that's in use.  On ppc, for example,
> the "prep" machine usually does have an ISA bridge with an i8259, but
> most of the other machine types have never had an i8259 at all.  Similarly
> the sparc specific target would stop working if we ever had a sparc32
> machine that wasn't sun4m.
>
> This patch cleans things up by implementing these hmp commands on all
> targets via a MachineClass callback.  If the callback is NULL, for now
> we fallback to target specific defaults that match the existing behaviour.
> The hope is we can remove those later with target specific cleanups.

I would rather we provided a function for "register a monitor command"
that devices could call. Then we could (for instance) move the CPU
architecture specific monitor commands out to target-* where they
belong, and generally chop down the amount of ifdeffery in monitor.c.
A per-machine hook seems insufficiently flexible.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]