[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/11] apb: QOMify sabre PCI host bridge
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 05/11] apb: QOMify sabre PCI host bridge |
Date: |
Sun, 14 Jan 2018 10:13:47 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
Hi Mark,
On 01/14/2018 07:47 AM, Mark Cave-Ayland wrote:
> Signed-off-by: Mark Cave-Ayland <address@hidden>
This device is already QOM'ified, but now the QOM abstract inheritance
is clearer, so:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/pci-host/apb.c | 6 +++---
> include/hw/pci-host/apb.h | 14 +++++++++++---
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index 98c5f344f7..36c6251816 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -407,7 +407,7 @@ static void sabre_realize(DeviceState *dev, Error **errp)
> &s->pci_ioport,
> 0, 32, TYPE_PCI_BUS);
>
> - pci_create_simple(phb->bus, 0, "pbm-pci");
> + pci_create_simple(phb->bus, 0, TYPE_SABRE_PCI_DEVICE);
>
> /* IOMMU */
> memory_region_add_subregion_overlap(&s->apb_config, 0x200,
> @@ -498,9 +498,9 @@ static void sabre_pci_class_init(ObjectClass *klass, void
> *data)
> }
>
> static const TypeInfo sabre_pci_info = {
> - .name = "pbm-pci",
> + .name = TYPE_SABRE_PCI_DEVICE,
> .parent = TYPE_PCI_DEVICE,
> - .instance_size = sizeof(PCIDevice),
> + .instance_size = sizeof(SabrePCIState),
> .class_init = sabre_pci_class_init,
> .interfaces = (InterfaceInfo[]) {
> { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> diff --git a/include/hw/pci-host/apb.h b/include/hw/pci-host/apb.h
> index 41de012396..470863639a 100644
> --- a/include/hw/pci-host/apb.h
> +++ b/include/hw/pci-host/apb.h
> @@ -14,9 +14,13 @@
> #define OBIO_MSE_IRQ 0x2a
> #define OBIO_SER_IRQ 0x2b
>
> -#define TYPE_APB "pbm"
> -#define APB_DEVICE(obj) \
> - OBJECT_CHECK(APBState, (obj), TYPE_APB)
> +typedef struct SabrePCIState {
> + PCIDevice parent_obj;
> +} SabrePCIState;
> +
> +#define TYPE_SABRE_PCI_DEVICE "sabre-pci"
> +#define SABRE_PCI_DEVICE(obj) \
> + OBJECT_CHECK(SabrePCIState, (obj), TYPE_SABRE_PCI_DEVICE)
>
> typedef struct APBState {
> PCIHostState parent_obj;
> @@ -41,4 +45,8 @@ typedef struct APBState {
> unsigned int nr_resets;
> } APBState;
>
> +#define TYPE_APB "apb"
> +#define APB_DEVICE(obj) \
> + OBJECT_CHECK(APBState, (obj), TYPE_APB)
> +
> #endif
>
- [Qemu-devel] [PATCH 00/11] sun4u: APB tidy-up/rename and tracepoint conversions, Mark Cave-Ayland, 2018/01/14
- [Qemu-devel] [PATCH 05/11] apb: QOMify sabre PCI host bridge, Mark Cave-Ayland, 2018/01/14
- Re: [Qemu-devel] [PATCH 05/11] apb: QOMify sabre PCI host bridge,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 01/11] apb: split simba PCI bridge into hw/pci-bridge/simba.c, Mark Cave-Ayland, 2018/01/14
- [Qemu-devel] [PATCH 06/11] apb: rename QOM type from TYPE_APB to TYPE_SABRE, Mark Cave-Ayland, 2018/01/14
- [Qemu-devel] [PATCH 04/11] apb: change pbm_pci_host prefix functions to use sabre_pci prefix, Mark Cave-Ayland, 2018/01/14
- [Qemu-devel] [PATCH 07/11] sun4u: rename apb variables and constants, Mark Cave-Ayland, 2018/01/14
- [Qemu-devel] [PATCH 02/11] simba: rename PBMPCIBridge and QOM types to reflect simba naming, Mark Cave-Ayland, 2018/01/14