qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@nowt.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [7054] Use load_image_targphys.
Date: Thu, 09 Apr 2009 17:30:35 +0000	[thread overview]
Message-ID: <E1Lry5D-0006WK-1j@cvs.savannah.gnu.org> (raw)

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);

                 reply	other threads:[~2009-04-09 17:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Lry5D-0006WK-1j@cvs.savannah.gnu.org \
    --to=paul@nowt.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).