aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/loader.c15
-rw-r--r--hw/loader.h7
-rw-r--r--hw/pc.c1
3 files changed, 19 insertions, 4 deletions
diff --git a/hw/loader.c b/hw/loader.c
index 6baafa88bc..a08585b040 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -534,6 +534,7 @@ struct Rom {
};
static QTAILQ_HEAD(, Rom) roms = QTAILQ_HEAD_INITIALIZER(roms);
+int rom_enable_driver_roms;
static void rom_insert(Rom *rom)
{
@@ -612,6 +613,20 @@ int rom_add_blob(const char *name, const void *blob, size_t len,
return 0;
}
+int rom_add_vga(const char *file)
+{
+ if (!rom_enable_driver_roms)
+ return 0;
+ return rom_add_file(file, PC_ROM_MIN_VGA, PC_ROM_MAX, PC_ROM_ALIGN);
+}
+
+int rom_add_option(const char *file)
+{
+ if (!rom_enable_driver_roms)
+ return 0;
+ return rom_add_file(file, PC_ROM_MIN_OPTION, PC_ROM_MAX, PC_ROM_ALIGN);
+}
+
static void rom_reset(void *unused)
{
Rom *rom;
diff --git a/hw/loader.h b/hw/loader.h
index 945c662cc4..67dae571c3 100644
--- a/hw/loader.h
+++ b/hw/loader.h
@@ -38,9 +38,8 @@ void do_info_roms(Monitor *mon);
#define PC_ROM_ALIGN 0x800
#define PC_ROM_SIZE (PC_ROM_MAX - PC_ROM_MIN_VGA)
-#define rom_add_vga(_f) \
- rom_add_file(_f, PC_ROM_MIN_VGA, PC_ROM_MAX, PC_ROM_ALIGN)
-#define rom_add_option(_f) \
- rom_add_file(_f, PC_ROM_MIN_OPTION, PC_ROM_MAX, PC_ROM_ALIGN)
+extern int rom_enable_driver_roms;
+int rom_add_vga(const char *file);
+int rom_add_option(const char *file);
#endif
diff --git a/hw/pc.c b/hw/pc.c
index 4cd8ec65db..c7b8c50190 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1137,6 +1137,7 @@ static void pc_init1(ram_addr_t ram_size,
+ rom_enable_driver_roms = 1;
option_rom_offset = qemu_ram_alloc(PC_ROM_SIZE);
cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, option_rom_offset);