From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5763] uImage: return base load address (Hollis Blanchard)
Date: Thu, 20 Nov 2008 22:11:52 +0000 [thread overview]
Message-ID: <E1L3Hke-0003S2-Ip@cvs.savannah.gnu.org> (raw)
Revision: 5763
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5763
Author: aliguori
Date: 2008-11-20 22:11:52 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
uImage: return base load address (Hollis Blanchard)
Return the base address at which the image was loaded so that callers may keep
track of currently occupied guest memory.
This will be required by the PPC 440 embedded code to avoid hard coding a
device model/initrd location. Other users of this function could make use of
this parameter to avoid hard coding these locations in the future too.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/hw/an5206.c
trunk/hw/arm_boot.c
trunk/hw/dummy_m68k.c
trunk/hw/mcf5208.c
trunk/loader.c
trunk/sysemu.h
Modified: trunk/hw/an5206.c
===================================================================
--- trunk/hw/an5206.c 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/hw/an5206.c 2008-11-20 22:11:52 UTC (rev 5763)
@@ -68,7 +68,7 @@
kernel_size = load_elf(kernel_filename, 0, &elf_entry, NULL, NULL);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uboot(kernel_filename, &entry, NULL);
+ kernel_size = load_uboot(kernel_filename, &entry, NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image(kernel_filename,
Modified: trunk/hw/arm_boot.c
===================================================================
--- trunk/hw/arm_boot.c 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/hw/arm_boot.c 2008-11-20 22:11:52 UTC (rev 5763)
@@ -205,7 +205,8 @@
kernel_size = load_elf(info->kernel_filename, 0, &elf_entry, NULL, NULL);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uboot(info->kernel_filename, &entry, &is_linux);
+ kernel_size = load_uboot(info->kernel_filename, &entry, NULL,
+ &is_linux);
}
if (kernel_size < 0) {
kernel_size = load_image(info->kernel_filename,
Modified: trunk/hw/dummy_m68k.c
===================================================================
--- trunk/hw/dummy_m68k.c 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/hw/dummy_m68k.c 2008-11-20 22:11:52 UTC (rev 5763)
@@ -44,7 +44,7 @@
kernel_size = load_elf(kernel_filename, 0, &elf_entry, NULL, NULL);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uboot(kernel_filename, &entry, NULL);
+ kernel_size = load_uboot(kernel_filename, &entry, NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image(kernel_filename,
Modified: trunk/hw/mcf5208.c
===================================================================
--- trunk/hw/mcf5208.c 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/hw/mcf5208.c 2008-11-20 22:11:52 UTC (rev 5763)
@@ -290,7 +290,7 @@
kernel_size = load_elf(kernel_filename, 0, &elf_entry, NULL, NULL);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uboot(kernel_filename, &entry, NULL);
+ kernel_size = load_uboot(kernel_filename, &entry, NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image(kernel_filename, phys_ram_base);
Modified: trunk/loader.c
===================================================================
--- trunk/loader.c 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/loader.c 2008-11-20 22:11:52 UTC (rev 5763)
@@ -456,7 +456,8 @@
}
/* Load a U-Boot image. */
-int load_uboot(const char *filename, target_ulong *ep, int *is_linux)
+int load_uboot(const char *filename, target_ulong *ep, target_ulong *loadaddr,
+ int *is_linux)
{
int fd;
int size;
@@ -533,6 +534,9 @@
cpu_physical_memory_write_rom(hdr->ih_load, data, hdr->ih_size);
+ if (loadaddr)
+ *loadaddr = hdr->ih_load;
+
ret = hdr->ih_size;
out:
Modified: trunk/sysemu.h
===================================================================
--- trunk/sysemu.h 2008-11-20 22:04:01 UTC (rev 5762)
+++ trunk/sysemu.h 2008-11-20 22:11:52 UTC (rev 5763)
@@ -165,7 +165,8 @@
int load_elf(const char *filename, int64_t address_offset,
uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr);
int load_aout(const char *filename, target_phys_addr_t addr, int max_sz);
-int load_uboot(const char *filename, target_ulong *ep, int *is_linux);
+int load_uboot(const char *filename, target_ulong *ep, target_ulong *loadaddr,
+ int *is_linux);
int fread_targphys(target_phys_addr_t dst_addr, size_t nbytes, FILE *f);
int fread_targphys_ok(target_phys_addr_t dst_addr, size_t nbytes, FILE *f);
reply other threads:[~2008-11-20 22:11 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=E1L3Hke-0003S2-Ip@cvs.savannah.gnu.org \
--to=anthony@codemonkey.ws \
--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).