From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrUuU-0005LK-46 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:07:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrUuN-0005GI-Uc for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:07:26 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60058 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrUuN-0005GD-K8 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:07:19 -0400 Message-ID: <5006C311.8040405@suse.de> Date: Wed, 18 Jul 2012 16:07:13 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1342617545-9261-1-git-send-email-liwanp@linux.vnet.ibm.com> <1342617545-9261-4-git-send-email-liwanp@linux.vnet.ibm.com> In-Reply-To: <1342617545-9261-4-git-send-email-liwanp@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 3/5] convert pci-host to QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: Anthony Liguori , Gavin Shan , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel@nongnu.org, Ram Pai , Blue Swirl , Stefan Weil , Liu Ping Fan , Paolo Bonzini , Avi Kivity Am 18.07.2012 15:19, schrieb Wanpeng Li: > [CCing ML] >=20 > From: Anthony Liguori >=20 > Signed-off-by: Anthony Liguori > Signed-off-by: Wanpeng Li > --- > 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 soo= n. Thanks, Andreas >=20 > 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 =3D { > .endianness =3D DEVICE_BIG_ENDIAN, > }; > =20 > +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 =3D PCI_HOST(obj); > + > + object_property_add_link(obj, "mmio", TYPE_MEMORY_REGION, > + (Object **)&s->address_space, NULL); > +} > + > +static TypeInfo pci_host_type_info =3D { > + .name =3D TYPE_PCI_HOST, > + .parent =3D TYPE_SYS_BUS_DEVICE, > + .instance_size =3D sizeof(PCIHostState), > + .instance_init =3D pci_host_initfn, > +}; > + > +static void register_devices(void) > +{ > + type_register_static(&pci_host_type_info); > +} > + > +type_init(register_devices) > =20 > 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 @@ > =20 > #include "sysbus.h" > =20 > +#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_d= ev, 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); > =20 > +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; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg