mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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>
This commit is contained in:
parent
51a92333f8
commit
68f799944b
6 changed files with 177 additions and 83 deletions
|
@ -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 */
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue