i386: pc_sysfw: load bios using rom API
PATCH 1/1 i386: pc_sysfw: load bios using rom API
As the bios is a ROM, just using rom API.
AFAICS no functionality changed.
Signed-off-by Li Qiang <[email protected]>
--- hw/i386/pc_sysfw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
hw/i386/pc_sysfw.c +5 -5
@@ -209,9 +209,9 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) goto bios_error; } bios =g_malloc (sizeof (*bios)); -memory_region_init_ram (bios,NULL ,"pc.bios" , bios_size, &error_fatal); -if (!isapc_ram_fw) { -memory_region_set_readonly (bios, true); +memory_region_init_rom (bios,NULL ,"pc.bios" , bios_size, &error_fatal); +if (isapc_ram_fw) { +memory_region_set_readonly (bios, false); } ret =rom_add_file_fixed (bios_name, (uint32_t )(-bios_size),-1 );if (ret !=0 ) {
@@ -230,8 +230,8 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw)0x100000 - isa_bios_size, isa_bios, 1); -if (!isapc_ram_fw) { -memory_region_set_readonly (isa_bios, true); +if (isapc_ram_fw) { +memory_region_set_readonly (isa_bios, false); }/* map all the bios at the top of memory */
Signature · 1 line
2.11.0
Quoted 5 lines · Li Qiang
As the bios is a ROM, just using rom API.
AFAICS no functionality changed.Signed-off-by Li Qiang <[email protected]>---
ROM and RAM are just the same, with the readonly flag defaulting to either true or false.
Because the alias here:
memory_region_init_alias(isa_bios, NULL, "isa-bios", bios,
bios_size - isa_bios_size, isa_bios_size);
if (!isapc_ram_fw) {
memory_region_set_readonly(isa_bios, true);
}defaults to read-write (and your patch is wrong in changing the direction of the if), it makes sense to do the same for the bios memory region.
Thanks,
Paolo