mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23: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
|
@ -153,13 +153,18 @@ static void versatile_pci_host_init(PCIDevice *d)
|
|||
d->config[0x0D] = 0x10; // latency_timer
|
||||
}
|
||||
|
||||
static PCIDeviceInfo versatile_pci_host_info = {
|
||||
.qdev.name = "versatile_pci_host",
|
||||
.qdev.size = sizeof(PCIDevice),
|
||||
.init = versatile_pci_host_init,
|
||||
};
|
||||
|
||||
static void versatile_pci_register_devices(void)
|
||||
{
|
||||
sysbus_register_dev("versatile_pci", sizeof(PCIVPBState), pci_vpb_init);
|
||||
sysbus_register_dev("realview_pci", sizeof(PCIVPBState),
|
||||
pci_realview_init);
|
||||
pci_qdev_register("versatile_pci_host", sizeof(PCIDevice),
|
||||
versatile_pci_host_init);
|
||||
pci_qdev_register(&versatile_pci_host_info);
|
||||
}
|
||||
|
||||
device_init(versatile_pci_register_devices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue