summary refs log tree commit diff stats
path: root/hw/core
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@xilinx.com>2016-09-22 18:13:08 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-22 18:13:08 +0100
commitd6ac342a48d50bdceaa43abe2e57854230101d90 (patch)
tree4aab9c3dd8759606d7b3e7fbc73780aff28d6ddd /hw/core
parent8cf6e9daca19e08216cf09e523d1dcdf3cfdaec7 (diff)
downloadfocaccia-qemu-d6ac342a48d50bdceaa43abe2e57854230101d90.tar.gz
focaccia-qemu-d6ac342a48d50bdceaa43abe2e57854230101d90.zip
loader: Use the specified MemoryRegion
Prevously the specified MemoryRegion was ignored during the rom register
reset. This patch uses the rom MemoryRegion is avaliable.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: d63fef5524deeb88e0068ca9d3fd4c8344f54dd4.1474331683.git.alistair.francis@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/loader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 53e0e41554..6b61f290c3 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -1045,7 +1045,8 @@ int rom_check_and_register_reset(void)
         }
         addr  = rom->addr;
         addr += rom->romsize;
-        section = memory_region_find(get_system_memory(), rom->addr, 1);
+        section = memory_region_find(rom->mr ? rom->mr : get_system_memory(),
+                                     rom->addr, 1);
         rom->isrom = int128_nz(section.size) && memory_region_is_rom(section.mr);
         memory_region_unref(section.mr);
     }