diff options
Diffstat (limited to 'hw/core/loader.c')
-rw-r--r-- | hw/core/loader.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c index 052a0fd719..19edb928e9 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1164,9 +1164,13 @@ static void rom_reset(void *unused) if (rom->mr) { void *host = memory_region_get_ram_ptr(rom->mr); memcpy(host, rom->data, rom->datasize); + memset(host + rom->datasize, 0, rom->romsize - rom->datasize); } else { address_space_write_rom(rom->as, rom->addr, MEMTXATTRS_UNSPECIFIED, rom->data, rom->datasize); + address_space_set(rom->as, rom->addr + rom->datasize, 0, + rom->romsize - rom->datasize, + MEMTXATTRS_UNSPECIFIED); } if (rom->isrom) { /* rom needs to be written only once */ |