aboutsummaryrefslogtreecommitdiff
path: root/hw/arm_boot.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-09 17:30:32 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-09 17:30:32 +0000
commit3b760e046b54a362bdcc39c45b339dafb61d82dd (patch)
tree5fcabd2544b4238be54be59c67bebfa91a0d5ade /hw/arm_boot.c
parent52b437377fdf2749bed30243e921974cef3c422b (diff)
Use load_image_targphys.
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7054 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/arm_boot.c')
-rw-r--r--hw/arm_boot.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/hw/arm_boot.c b/hw/arm_boot.c
index b0456fbe57..35f0130db1 100644
--- a/hw/arm_boot.c
+++ b/hw/arm_boot.c
@@ -192,8 +192,6 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
int is_linux = 0;
uint64_t elf_entry;
target_ulong entry;
- uint32_t pd;
- void *loader_phys;
/* Load the kernel. */
if (!info->kernel_filename) {
@@ -208,11 +206,6 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
qemu_register_reset(main_cpu_reset, env);
}
- /* FIXME: We should make load_image take a guest physical address. */
- pd = cpu_get_physical_page_desc(info->loader_start);
- loader_phys = phys_ram_base + (pd & TARGET_PAGE_MASK) +
- (info->loader_start & ~TARGET_PAGE_MASK);
-
/* Assume that raw images are linux kernels, and ELF images are not. */
kernel_size = load_elf(info->kernel_filename, 0, &elf_entry, NULL, NULL);
entry = elf_entry;
@@ -221,9 +214,9 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
&is_linux);
}
if (kernel_size < 0) {
- kernel_size = load_image(info->kernel_filename,
- loader_phys + KERNEL_LOAD_ADDR);
entry = info->loader_start + KERNEL_LOAD_ADDR;
+ kernel_size = load_image_targphys(info->kernel_filename, entry,
+ ram_size - KERNEL_LOAD_ADDR);
is_linux = 1;
}
if (kernel_size < 0) {
@@ -237,8 +230,10 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
env->thumb = entry & 1;
} else {
if (info->initrd_filename) {
- initrd_size = load_image(info->initrd_filename,
- loader_phys + INITRD_LOAD_ADDR);
+ initrd_size = load_image_targphys(info->initrd_filename,
+ info->loader_start
+ + INITRD_LOAD_ADDR,
+ ram_size - INITRD_LOAD_ADDR);
if (initrd_size < 0) {
fprintf(stderr, "qemu: could not load initrd '%s'\n",
info->initrd_filename);