qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 3/5] convert pci-host to QOM


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v4 3/5] convert pci-host to QOM
Date: Wed, 18 Jul 2012 16:07:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120601 Thunderbird/13.0

Am 18.07.2012 15:19, schrieb Wanpeng Li:
> [CCing ML]
> 
> From: Anthony Liguori <address@hidden>
> 
> Signed-off-by: Anthony Liguori <address@hidden>
> Signed-off-by: Wanpeng Li <address@hidden>
> ---
>  hw/pci_host.c |   26 ++++++++++++++++++++++++++
>  hw/pci_host.h |    5 +++++
>  2 files changed, 31 insertions(+), 0 deletions(-)

Note: This is a resend of an old patch that conflicts with my more
recent pci_host series and does not take recent review comments into
account (e.g., PCI_HOST_BRIDGE() was requested). Please take a look at
those patches and participate in the review, so that we can get it in soon.

Thanks,
Andreas

> 
> diff --git a/hw/pci_host.c b/hw/pci_host.c
> index 8041778..095bfe3 100644
> --- a/hw/pci_host.c
> +++ b/hw/pci_host.c
> @@ -165,4 +165,30 @@ const MemoryRegionOps pci_host_data_be_ops = {
>      .endianness = DEVICE_BIG_ENDIAN,
>  };
>  
> +void pci_host_set_mmio(PCIHostState *s, MemoryRegion *value)
> +{
> +    object_property_set_link(OBJECT(s), OBJECT(value), "mmio", NULL);
> +}
> +
> +static void pci_host_initfn(Object *obj)
> +{
> +    PCIHostState *s = PCI_HOST(obj);
> +
> +    object_property_add_link(obj, "mmio", TYPE_MEMORY_REGION,
> +                            (Object **)&s->address_space, NULL);
> +}
> +
> +static TypeInfo pci_host_type_info = {
> +    .name = TYPE_PCI_HOST,
> +    .parent = TYPE_SYS_BUS_DEVICE,
> +    .instance_size = sizeof(PCIHostState),
> +    .instance_init = pci_host_initfn,
> +};
> +
> +static void register_devices(void)
> +{
> +    type_register_static(&pci_host_type_info);
> +}
> +
> +type_init(register_devices)
>  
> diff --git a/hw/pci_host.h b/hw/pci_host.h
> index 359e38f..084e15c 100644
> --- a/hw/pci_host.h
> +++ b/hw/pci_host.h
> @@ -30,6 +30,9 @@
>  
>  #include "sysbus.h"
>  
> +#define TYPE_PCI_HOST "pci-host"
> +#define PCI_HOST(obj) OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST)
> +
>  struct PCIHostState {
>      SysBusDevice busdev;
>      MemoryRegion conf_mem;
> @@ -49,6 +52,8 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, 
> uint32_t addr,
>  void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
>  uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
>  
> +void pci_host_set_mmio(PCIHostState *s, MemoryRegion *value);
> +
>  extern const MemoryRegionOps pci_host_conf_le_ops;
>  extern const MemoryRegionOps pci_host_conf_be_ops;
>  extern const MemoryRegionOps pci_host_data_le_ops;
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg





reply via email to

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