From de2aff17a31c47e28757d426fb3384eed20eb2e5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 26 Oct 2009 12:18:25 +0100 Subject: rom loader: make vga+rom loading configurable. The rom_add_vga() and rom_add_option() macros are transformed into functions. They look at the new rom_enable_driver_roms variable and only do something if it is set to non-zero, making vga+option rom loading runtime option. pc_init() sets rom_enable_driver_roms to 1. With this in place we can move the rom loading calls from pc.c to the individual drivers. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/loader.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'hw/loader.c') 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; -- cgit 1.4.1