[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 2/6] Remove monitor.c dependency on C
From: |
Peter Maydell |
Subject: |
Re: [Qemu-ppc] [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
[Qemu-ppc] [PATCH 1/6] Split serial-isa into its own config option, David Gibson, 2015/03/05
[Qemu-ppc] [PATCH 4/6] target-ppc: Convert PReP to machine class, David Gibson, 2015/03/05
[Qemu-ppc] [PATCH 3/6] pc: Use MachineClass callbacks for "irq" and "pic" hmp commands, David Gibson, 2015/03/05
Re: [Qemu-ppc] [PATCH 0/6] Clean up ISA dependencies so we make ISA optional to build, Alexander Graf, 2015/03/06
Re: [Qemu-ppc] [PATCH 0/6] Clean up ISA dependencies so we make ISA optional to build, Michael S. Tsirkin, 2015/03/10