* [Qemu-devel] [7054] Use load_image_targphys.
@ 2009-04-09 17:30 Paul Brook
0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2009-04-09 17:30 UTC (permalink / raw)
To: qemu-devel
Revision: 7054
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7054
Author: pbrook
Date: 2009-04-09 17:30:32 +0000 (Thu, 09 Apr 2009)
Log Message:
-----------
Use load_image_targphys.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Modified Paths:
--------------
trunk/hw/arm_boot.c
Modified: trunk/hw/arm_boot.c
===================================================================
--- trunk/hw/arm_boot.c 2009-04-09 17:19:47 UTC (rev 7053)
+++ trunk/hw/arm_boot.c 2009-04-09 17:30:32 UTC (rev 7054)
@@ -192,8 +192,6 @@
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 @@
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 @@
&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 @@
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-09 17:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-09 17:30 [Qemu-devel] [7054] Use load_image_targphys Paul Brook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).