diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2010-07-13 13:01:42 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2010-09-07 20:01:27 +0300 |
commit | 68f799944b72387c0ef9535612a212a5ea492059 (patch) | |
tree | 06be7d56583e07a9b7a3cc3db0d0f54b4332a142 /hw/pci_bridge.h | |
parent | 51a92333f8eb6d0fe685544f20ad56fc9af702f5 (diff) |
pci_bridge: introduce pci bridge library.
introduce pci bridge library.
convert apb bridge and dec p2p bridge to use new pci bridge library.
save/restore is supported as a side effect.
This is also preparation for pci express root/upstream/downstream port.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci_bridge.h')
-rw-r--r-- | hw/pci_bridge.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/hw/pci_bridge.h b/hw/pci_bridge.h index ddb2c82e25..63ada199a5 100644 --- a/hw/pci_bridge.h +++ b/hw/pci_bridge.h @@ -29,13 +29,27 @@ #include "pci.h" PCIDevice *pci_bridge_get_device(PCIBus *bus); +PCIBus *pci_bridge_get_sec_bus(PCIBridge *br); -pcibus_t pci_bridge_get_base(PCIDevice *bridge, uint8_t type); -pcibus_t pci_bridge_get_limit(PCIDevice *bridge, uint8_t type); +pcibus_t pci_bridge_get_base(const PCIDevice *bridge, uint8_t type); +pcibus_t pci_bridge_get_limit(const PCIDevice *bridge, uint8_t type); -PCIBus *pci_bridge_init(PCIBus *bus, int devfn, bool multifunction, - uint16_t vid, uint16_t did, - pci_map_irq_fn map_irq, const char *name); +void pci_bridge_write_config(PCIDevice *d, + uint32_t address, uint32_t val, int len); +void pci_bridge_reset_reg(PCIDevice *dev); +void pci_bridge_reset(DeviceState *qdev); + +int pci_bridge_initfn(PCIDevice *pci_dev); +int pci_bridge_exitfn(PCIDevice *pci_dev); + + +/* + * before qdev initialization(qdev_init()), this function sets bus_name and + * map_irq callback which are necessry for pci_bridge_initfn() to + * initialize bus. + */ +void pci_bridge_map_irq(PCIBridge *br, const char* bus_name, + pci_map_irq_fn map_irq); #endif /* QEMU_PCI_BRIDGE_H */ /* |