summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'hw/loader.c')
-rw-r--r--hw/loader.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/hw/loader.c b/hw/loader.c
index 49d4839b1..2ceb8eba4 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -636,8 +636,6 @@ static void rom_reset(void *unused)
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
- if (rom->addr == 0)
- continue;
if (rom->data == NULL)
continue;
cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
@@ -656,8 +654,6 @@ int rom_load_all(void)
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
- if (rom->addr == 0)
- continue;
if (addr > rom->addr) {
fprintf(stderr, "rom: requested regions overlap "
"(rom %s. free=0x" TARGET_FMT_plx
@@ -693,8 +689,6 @@ static Rom *find_rom(target_phys_addr_t addr)
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
- if (rom->addr == 0)
- continue;
if (rom->addr > addr)
continue;
if (rom->addr + rom->romsize < addr)
@@ -704,6 +698,11 @@ static Rom *find_rom(target_phys_addr_t addr)
return NULL;
}
+/*
+ * Copies memory from registered ROMs to dest. Any memory that is contained in
+ * a ROM between addr and addr + size is copied. Note that this can involve
+ * multiple ROMs, which need not start at addr and need not end at addr + size.
+ */
int rom_copy(uint8_t *dest, target_phys_addr_t addr, size_t size)
{
target_phys_addr_t end = addr + size;
@@ -712,10 +711,6 @@ int rom_copy(uint8_t *dest, target_phys_addr_t addr, size_t size)
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
- if (rom->addr == 0)
- continue;
- if (rom->addr > addr)
- continue;
if (rom->addr + rom->romsize < addr)
continue;
if (rom->addr > end)