aboutsummaryrefslogtreecommitdiff
path: root/hw/loader.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-12-08 16:12:18 +0200
committerAvi Kivity <avi@redhat.com>2011-12-20 14:14:07 +0200
commitdcc5cd33d27ab5612e0212b5399ad6ac0bc4886e (patch)
treef8335020266b70a44e75165142f674f6efb9e230 /hw/loader.c
parent75c9d6c2f88f5713345b545beec10f0444ebd551 (diff)
loader: remove calls to cpu_get_physical_page_desc()
cpu_get_physical_page_desc() is tied into the memory core's innards, replace it with uses of the API. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/loader.c')
-rw-r--r--hw/loader.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/loader.c b/hw/loader.c
index 9bbcddd424..446b62874e 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -49,6 +49,8 @@
#include "uboot_image.h"
#include "loader.h"
#include "fw_cfg.h"
+#include "memory.h"
+#include "exec-memory.h"
#include <zlib.h>
@@ -674,7 +676,7 @@ static void rom_reset(void *unused)
int rom_load_all(void)
{
target_phys_addr_t addr = 0;
- int memtype;
+ MemoryRegionSection section;
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
@@ -690,9 +692,8 @@ int rom_load_all(void)
}
addr = rom->addr;
addr += rom->romsize;
- memtype = cpu_get_physical_page_desc(rom->addr) & (3 << IO_MEM_SHIFT);
- if (memtype == IO_MEM_ROM)
- rom->isrom = 1;
+ section = memory_region_find(get_system_memory(), rom->addr, 1);
+ rom->isrom = section.size && memory_region_is_rom(section.mr);
}
qemu_register_reset(rom_reset, NULL);
roms_loaded = 1;