From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlwRx-0006uN-2R for qemu-devel@nongnu.org; Wed, 05 Nov 2014 04:00:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlwRs-0002vY-CM for qemu-devel@nongnu.org; Wed, 05 Nov 2014 04:00:20 -0500 Received: from [59.151.112.132] (port=13487 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlwRr-0002uJ-Rc for qemu-devel@nongnu.org; Wed, 05 Nov 2014 04:00:16 -0500 Date: Wed, 5 Nov 2014 15:58:43 +0800 From: Hu Tao Message-ID: <20141105075843.GD15840@localhost.localdomain> References: <1415108675.2327.46.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <1415108675.2327.46.camel@localhost.localdomain> Subject: Re: [Qemu-devel] [PATCH 2/5] pc: define PC_PCI_CONFIG_ADDR and PC_PCI_CONFIG_DATA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Tue, Nov 04, 2014 at 03:44:35PM +0200, Marcel Apfelbaum wrote: > On Tue, 2014-11-04 at 17:12 +0800, Hu Tao wrote: > > PC_PCI_CONFIG_ADDR and PC_PCI_CONFIG_DATA are defined in PCI > > specification, so move them to common place. > > > > Signed-off-by: Hu Tao > > --- > > hw/pci-host/piix.c | 8 ++++---- > > hw/pci-host/q35.c | 8 ++++---- > > include/hw/pci-host/q35.h | 3 --- > > include/hw/pci/pci.h | 5 +++++ > > tests/libqos/pci-pc.c | 24 ++++++++++++------------ > > 5 files changed, 25 insertions(+), 23 deletions(-) > > > > diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c > > index 1530038..eb92bde 100644 > > --- a/hw/pci-host/piix.c > > +++ b/hw/pci-host/piix.c > > @@ -288,11 +288,11 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) > > PCIHostState *s = PCI_HOST_BRIDGE(dev); > > SysBusDevice *sbd = SYS_BUS_DEVICE(dev); > > > > - sysbus_add_io(sbd, 0xcf8, &s->conf_mem); > > - sysbus_init_ioports(sbd, 0xcf8, 4); > > + sysbus_add_io(sbd, PC_PCI_CONFIG_ADDR, &s->conf_mem); > > + sysbus_init_ioports(sbd, PC_PCI_CONFIG_ADDR, 4); > > > > - sysbus_add_io(sbd, 0xcfc, &s->data_mem); > > - sysbus_init_ioports(sbd, 0xcfc, 4); > > + sysbus_add_io(sbd, PC_PCI_CONFIG_DATA, &s->data_mem); > > + sysbus_init_ioports(sbd, PC_PCI_CONFIG_DATA, 4); > > } > > > > static int i440fx_initfn(PCIDevice *dev) > > diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c > > index b20bad8..9e66835 100644 > > --- a/hw/pci-host/q35.c > > +++ b/hw/pci-host/q35.c > > @@ -41,11 +41,11 @@ static void q35_host_realize(DeviceState *dev, Error **errp) > > Q35PCIHost *s = Q35_HOST_DEVICE(dev); > > SysBusDevice *sbd = SYS_BUS_DEVICE(dev); > > > > - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, &pci->conf_mem); > > - sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_ADDR, 4); > > + sysbus_add_io(sbd, PC_PCI_CONFIG_ADDR, &pci->conf_mem); > > + sysbus_init_ioports(sbd, PC_PCI_CONFIG_ADDR, 4); > > > > - sysbus_add_io(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, &pci->data_mem); > > - sysbus_init_ioports(sbd, MCH_HOST_BRIDGE_CONFIG_DATA, 4); > > + sysbus_add_io(sbd, PC_PCI_CONFIG_DATA, &pci->data_mem); > > + sysbus_init_ioports(sbd, PC_PCI_CONFIG_DATA, 4); > > > > pci->bus = pci_bus_new(DEVICE(s), "pcie.0", > > s->mch.pci_address_space, s->mch.address_space_io, > > diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h > > index 025d6e6..3a026b0 100644 > > --- a/include/hw/pci-host/q35.h > > +++ b/include/hw/pci-host/q35.h > > @@ -82,9 +82,6 @@ typedef struct Q35PCIHost { > > /* PCI configuration */ > > #define MCH_HOST_BRIDGE "MCH" > > > > -#define MCH_HOST_BRIDGE_CONFIG_ADDR 0xcf8 > > -#define MCH_HOST_BRIDGE_CONFIG_DATA 0xcfc > > - > > /* D0:F0 configuration space */ > > #define MCH_HOST_BRIDGE_REVISION_DEFAULT 0x0 > > > > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > > index 3d42d7f..e42589a 100644 > > --- a/include/hw/pci/pci.h > > +++ b/include/hw/pci/pci.h > > @@ -13,6 +13,11 @@ > > > > #include "hw/pci/pcie.h" > > > > +/* PCI configuration */ > > + > > +#define PC_PCI_CONFIG_ADDR 0xcf8 > > +#define PC_PCI_CONFIG_DATA 0xcfc > I would move the macros also to hw/pci/pci_host.h, > and only personal opinion, change them to > PCI_HOST_BRIDGE_... Done. Regards, Hu