|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 03/20] piix4: Add a i8259 Interrupt Controller as specified in datasheet
On 10/22/19 10:48 AM, Esteban Bosse wrote: El vie, 18-10-2019 a las 15:47 +0200, Philippe Mathieu-Daudé escribió:From: Hervé Poussineau <hpoussin@xxxxxxxxxxx> Add ISA irqs as piix4 gpio in, and CPU interrupt request as piix4 gpio out. Remove i8259 instanciated in malta board, to not have it twice. We can also remove the now unused piix4_init() function. Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx> Acked-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> Signed-off-by: Hervé Poussineau <hpoussin@xxxxxxxxxxx> Message-Id: <20171216090228.28505-8-hpoussin@xxxxxxxxxxx> Reviewed-by: Aleksandar Markovic <amarkovic@xxxxxxxxxxxx> [PMD: rebased, updated includes, use ISA_NUM_IRQS in for loop] Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> --- hw/isa/piix4.c | 43 ++++++++++++++++++++++++++++++++-------- --- hw/mips/mips_malta.c | 32 +++++++++++++------------------- include/hw/i386/pc.h | 1 - 3 files changed, 45 insertions(+), 31 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index d0b18e0586..9c37c85ae2 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -24,6 +24,7 @@ */#include "qemu/osdep.h"+#include "hw/irq.h" #include "hw/i386/pc.h" #include "hw/pci/pci.h" #include "hw/isa/isa.h" @@ -36,6 +37,8 @@ PCIDevice *piix4_dev;typedef struct PIIX4State {
I guess you mean:
#define PIIX4_PCI_DEVICE(obj) \
OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE)
IIUC the OBJECT_CHECK(STATE, OBJ, TYPE) macro verify the QEMU Object
OBJ is of the correct type TYPE, then cast it as a pointer to STATE.
This has some runtime cost.
This is useful when you deal with some child Object which is not TYPE
but inheritate TYPE from a parent, or if the object is an abstract
parent and you want to use its children TYPE implementations.
In piix4_realize(), the function piix4_request_i8259_irq() is registered
by qemu_allocate_irqs() as a handler with 's' as opaque pointer, and we
already know 's' is of type PIIX4State, so using OBJECT_CHECK() is not necessary.
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |