[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for master 2/3] pci_host: remove PCIHostState::busde
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH for master 2/3] pci_host: remove PCIHostState::busdev. |
Date: |
Tue, 27 Jul 2010 15:23:23 +0900 |
It is mostly unused expcet i440fx and bonito.
So remove the member.
Cc: Huacai Chen <address@hidden>
Cc: Aurelien Jarno <address@hidden>
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/bonito.c | 11 +++++++----
hw/pci_host.h | 1 -
hw/piix_pci.c | 11 +++++++----
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/hw/bonito.c b/hw/bonito.c
index dcf0311..41dfb70 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -176,12 +176,15 @@
#define PCI_ADDR(busno,devno,funno,regno) \
((((busno)<<16)&0xff0000) + (((devno)<<11)&0xf800) + (((funno)<<8)&0x700)
+ (regno))
-typedef PCIHostState BonitoState;
+typedef struct {
+ SysBusDevice busdev;
+ PCIHostState pci;
+} BonitoState;
typedef struct PCIBonitoState
{
PCIDevice dev;
- BonitoState *pcihost;
+ PCIHostState *pcihost;
uint32_t regs[BONITO_REGS];
struct bonldma {
@@ -773,12 +776,12 @@ PCIBus *bonito_init(qemu_irq *pic)
pcihost = FROM_SYSBUS(BonitoState, sysbus_from_qdev(dev));
b = pci_register_bus(&pcihost->busdev.qdev, "pci", pci_bonito_set_irq,
pci_bonito_map_irq, pic, 0x28, 32);
- pcihost->bus = b;
+ pcihost->pci.bus = b;
qdev_init_nofail(dev);
d = pci_create_simple(b, PCI_DEVFN(0, 0), "Bonito");
s = DO_UPCAST(PCIBonitoState, dev, d);
- s->pcihost = pcihost;
+ s->pcihost = &pcihost->pci;
bonito_state = s;
return b;
diff --git a/hw/pci_host.h b/hw/pci_host.h
index bd8ede8..46d1379 100644
--- a/hw/pci_host.h
+++ b/hw/pci_host.h
@@ -32,7 +32,6 @@
#include "rwhandler.h"
struct PCIHostState {
- SysBusDevice busdev;
ReadWriteHandler conf_noswap_handler;
ReadWriteHandler conf_handler;
ReadWriteHandler data_noswap_handler;
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index f152a0f..e0f67e5 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -34,7 +34,10 @@
* http://download.intel.com/design/chipsets/datashts/29054901.pdf
*/
-typedef PCIHostState I440FXState;
+typedef struct {
+ SysBusDevice busdev;
+ PCIHostState pci;
+} I440FXState;
typedef struct PIIX3State {
PCIDevice dev;
@@ -194,9 +197,9 @@ static int i440fx_pcihost_initfn(SysBusDevice *dev)
{
I440FXState *s = FROM_SYSBUS(I440FXState, dev);
- pci_host_conf_register_ioport(0xcf8, s);
+ pci_host_conf_register_ioport(0xcf8, &s->pci);
- pci_host_data_register_ioport(0xcfc, s);
+ pci_host_data_register_ioport(0xcfc, &s->pci);
return 0;
}
@@ -226,7 +229,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int
*piix3_devfn, qemu_irq *
dev = qdev_create(NULL, "i440FX-pcihost");
s = FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev));
b = pci_bus_new(&s->busdev.qdev, NULL, 0);
- s->bus = b;
+ s->pci.bus = b;
qdev_init_nofail(dev);
d = pci_create_simple(b, 0, "i440FX");
--
1.7.1.1
- [Qemu-devel] [PATCH 0/3] pci, pcihost: pci host bus clean up, Isaku Yamahata, 2010/07/26
- [Qemu-devel] [PATCH 2/3] pci/pci_host: pci host bus initialization clean up., Isaku Yamahata, 2010/07/26
- Re: [Qemu-devel] [PATCH 0/3] pci, pcihost: pci host bus clean up, Aurelien Jarno, 2010/07/26
- Re: [Qemu-devel] [PATCH 0/3] pci, pcihost: pci host bus clean up, Isaku Yamahata, 2010/07/27
- [Qemu-devel] [PATCH for master 0/3] pci, pcihost: pci host bus clean up, Isaku Yamahata, 2010/07/27
- [Qemu-devel] [PATCH for master 2/3] pci_host: remove PCIHostState::busdev.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH for master 1/3] pci: move out pci internal structures, PCIBus, PCIBridge, and pci_bus_info., Isaku Yamahata, 2010/07/27
- [Qemu-devel] [PATCH for master 3/3] pci/pci_host: pci host bus initialization clean up., Isaku Yamahata, 2010/07/27
- Re: [Qemu-devel] [PATCH for master 0/3] pci, pcihost: pci host bus clean up, Aurelien Jarno, 2010/07/30