mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch of parameters. Also adds config_read and config_write callbacks to PCIDeviceInfo, so drivers needing these can be converted to the qdev device API too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
e2b19c85ea
commit
0aab0d3a4a
10 changed files with 103 additions and 36 deletions
10
hw/pci.h
10
hw/pci.h
|
@ -314,7 +314,15 @@ pci_config_set_class(uint8_t *pci_config, uint16_t val)
|
|||
}
|
||||
|
||||
typedef void (*pci_qdev_initfn)(PCIDevice *dev);
|
||||
void pci_qdev_register(const char *name, int size, pci_qdev_initfn init);
|
||||
typedef struct {
|
||||
DeviceInfo qdev;
|
||||
pci_qdev_initfn init;
|
||||
PCIConfigReadFunc *config_read;
|
||||
PCIConfigWriteFunc *config_write;
|
||||
} PCIDeviceInfo;
|
||||
|
||||
void pci_qdev_register(PCIDeviceInfo *info);
|
||||
void pci_qdev_register_many(PCIDeviceInfo *info);
|
||||
|
||||
PCIDevice *pci_create(const char *name, const char *devaddr);
|
||||
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue