Signed-off-by: Olivia Yin <hong-hua....@freescale.com> --- hw/cirrus_vga.c | 6 +++++- hw/pc.c | 6 +++++- hw/pc_sysfw.c | 14 +++++++------- hw/pci.c | 10 ++++++++-- hw/sga.c | 6 +++++- hw/vga-isa.c | 6 +++++- 6 files changed, 35 insertions(+), 13 deletions(-)
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index a101329..b98662d 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -2906,7 +2906,11 @@ static int vga_initfn(ISADevice *dev) s->ds = graphic_console_init(s->update, s->invalidate, s->screen_dump, s->text_update, s); - rom_add_vga(VGABIOS_CIRRUS_FILENAME); + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(VGABIOS_CIRRUS_FILENAME); + image->addr = 0; + qemu_register_reset(image_file_reset, image); /* XXX ISA-LFB support */ /* FIXME not qdev yet */ return 0; diff --git a/hw/pc.c b/hw/pc.c index c5f14e1..a620905 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -979,7 +979,11 @@ void *pc_memory_init(MemoryRegion *system_memory, } for (i = 0; i < nb_option_roms; i++) { - rom_add_option(option_rom[i].name, option_rom[i].bootindex); + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(option_rom[i].name); + image->addr = 0; + qemu_register_reset(image_file_reset, image); } return fw_cfg; } diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index b45f0ac..4e9b999 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -151,18 +151,18 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory) } if (bios_size <= 0 || (bios_size % 65536) != 0) { - goto bios_error; + fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name); + exit(1); } bios = g_malloc(sizeof(*bios)); memory_region_init_ram(bios, "pc.bios", bios_size); vmstate_register_ram_global(bios); memory_region_set_readonly(bios, true); - ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1); - if (ret != 0) { - bios_error: - fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name); - exit(1); - } + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(filename); + image->addr = (uint32_t)(-bios_size); + qemu_register_reset(image_file_reset, image); if (filename) { g_free(filename); } diff --git a/hw/pci.c b/hw/pci.c index 2ca6ff6..0c7cfe9 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -33,6 +33,7 @@ #include "qmp-commands.h" #include "msi.h" #include "msix.h" +#include "loader.h" //#define DEBUG_PCI #ifdef DEBUG_PCI @@ -1769,12 +1770,17 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom) * Load rom via fw_cfg instead of creating a rom bar, * for 0.11 compatibility. */ + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(pdev->romfile); + image->addr = 0; int class = pci_get_word(pdev->config + PCI_CLASS_DEVICE); if (class == 0x0300) { - rom_add_vga(pdev->romfile); + image->dir = g_strdup("vgaroms"); } else { - rom_add_option(pdev->romfile, -1); + image->dir = g_strdup("genroms"); } + qemu_register_reset(image_file_reset, image); return 0; } diff --git a/hw/sga.c b/hw/sga.c index a666349..25c002a 100644 --- a/hw/sga.c +++ b/hw/sga.c @@ -37,7 +37,11 @@ typedef struct ISAGAState { static int sga_initfn(ISADevice *dev) { - rom_add_vga(SGABIOS_FILENAME); + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(SGABIOS_FILENAME); + image->addr = 0; + qemu_register_reset(image_file_reset, image); return 0; } static void sga_class_initfn(ObjectClass *klass, void *data) diff --git a/hw/vga-isa.c b/hw/vga-isa.c index d290473..5fe9f46 100644 --- a/hw/vga-isa.c +++ b/hw/vga-isa.c @@ -65,7 +65,11 @@ static int vga_initfn(ISADevice *dev) vga_init_vbe(s, isa_address_space(dev)); /* ROM BIOS */ - rom_add_vga(VGABIOS_FILENAME); + ImageFile *image; + image = g_malloc(sizeof(*image)); + image->name = g_strdup(VGABIOS_FILENAME); + image->addr = 0; + qemu_register_reset(image_file_reset, image); return 0; } -- 1.7.1