hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions
The scripts/coccinelle/memory-region-housekeeping.cocci reported: * TODO [[view:./hw/ppc/ppc405_boards.c::face=ovl-face1::linb=195::colb=8::cole=30][potential use of memory_region_init_rom*() in ./hw/ppc/ppc405_boards.c::195]] * TODO [[view:./hw/ppc/ppc405_boards.c::face=ovl-face1::linb=464::colb=8::cole=30][potential use of memory_region_init_rom*() in ./hw/ppc/ppc405_boards.c::464]] We can indeed replace the memory_region_init_ram() and memory_region_set_readonly() calls by memory_region_init_rom(). Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
30ade0c416
commit
34b7645880
@ -199,7 +199,7 @@ static void ref405ep_init(MachineState *machine)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
bios = g_new(MemoryRegion, 1);
|
bios = g_new(MemoryRegion, 1);
|
||||||
memory_region_init_ram(bios, NULL, "ef405ep.bios", BIOS_SIZE,
|
memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE,
|
||||||
&error_fatal);
|
&error_fatal);
|
||||||
|
|
||||||
if (bios_name == NULL)
|
if (bios_name == NULL)
|
||||||
@ -223,7 +223,6 @@ static void ref405ep_init(MachineState *machine)
|
|||||||
/* Avoid an uninitialized variable warning */
|
/* Avoid an uninitialized variable warning */
|
||||||
bios_size = -1;
|
bios_size = -1;
|
||||||
}
|
}
|
||||||
memory_region_set_readonly(bios, true);
|
|
||||||
}
|
}
|
||||||
/* Register FPGA */
|
/* Register FPGA */
|
||||||
ref405ep_fpga_init(sysmem, 0xF0300000);
|
ref405ep_fpga_init(sysmem, 0xF0300000);
|
||||||
@ -471,7 +470,7 @@ static void taihu_405ep_init(MachineState *machine)
|
|||||||
if (bios_name == NULL)
|
if (bios_name == NULL)
|
||||||
bios_name = BIOS_FILENAME;
|
bios_name = BIOS_FILENAME;
|
||||||
bios = g_new(MemoryRegion, 1);
|
bios = g_new(MemoryRegion, 1);
|
||||||
memory_region_init_ram(bios, NULL, "taihu_405ep.bios", BIOS_SIZE,
|
memory_region_init_rom(bios, NULL, "taihu_405ep.bios", BIOS_SIZE,
|
||||||
&error_fatal);
|
&error_fatal);
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
|
||||||
if (filename) {
|
if (filename) {
|
||||||
@ -489,7 +488,6 @@ static void taihu_405ep_init(MachineState *machine)
|
|||||||
error_report("Could not load PowerPC BIOS '%s'", bios_name);
|
error_report("Could not load PowerPC BIOS '%s'", bios_name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
memory_region_set_readonly(bios, true);
|
|
||||||
}
|
}
|
||||||
/* Register Linux flash */
|
/* Register Linux flash */
|
||||||
dinfo = drive_get(IF_PFLASH, 0, fl_idx);
|
dinfo = drive_get(IF_PFLASH, 0, fl_idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user