From c2039bd0ffce8807e0eaac55254fde790825fa92 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 18 Dec 2009 12:01:07 +0100 Subject: Support PCI based option rom loading Currently, we preload option roms into the option rom space in memory. This prevents DDIM from functioning correctly which severely limits the number of roms we can support. This patch introduces a pci_add_option_rom() which registers the PCI_ROM_ADDRESS bar which points to our option rom. It also converts over the cirrus vga adapter, the rtl8139, virtio, and the e1000 to use this new mechanism. The result is that PXE boot functions even with three unique types of cards. Signed-off-by: Anthony Liguori Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/pci.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/pci.h') diff --git a/hw/pci.h b/hw/pci.h index dc9b860..d25fe50 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -242,6 +242,9 @@ struct PCIDevice { uint32_t msix_bar_size; /* Version id needed for VMState */ int32_t version_id; + + /* Location of option rom */ + ram_addr_t rom_offset; }; PCIDevice *pci_register_device(PCIBus *bus, const char *name, @@ -253,6 +256,8 @@ void pci_register_bar(PCIDevice *pci_dev, int region_num, pcibus_t size, int type, PCIMapIORegionFunc *map_func); +int pci_add_option_rom(PCIDevice *pdev, const char *name); + int pci_add_capability(PCIDevice *pci_dev, uint8_t cap_id, uint8_t cap_size); void pci_del_capability(PCIDevice *pci_dev, uint8_t cap_id, uint8_t cap_size); -- cgit v1.1