diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-20 22:11:52 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-20 22:11:52 +0000 |
commit | 21cafd08a6a56f70a3d943df654d90c9d9e6f38a (patch) | |
tree | b5e3ab5e1bc76d3ee5fddbd8566d8496f1b23e8d /loader.c | |
parent | 5a1235779ebbf089dea70098c5432749a919b150 (diff) | |
download | qemu-21cafd08a6a56f70a3d943df654d90c9d9e6f38a.zip qemu-21cafd08a6a56f70a3d943df654d90c9d9e6f38a.tar.gz qemu-21cafd08a6a56f70a3d943df654d90c9d9e6f38a.tar.bz2 |
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>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5763 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'loader.c')
-rw-r--r-- | loader.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -456,7 +456,8 @@ static ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src, } /* 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 @@ int load_uboot(const char *filename, target_ulong *ep, int *is_linux) cpu_physical_memory_write_rom(hdr->ih_load, data, hdr->ih_size); + if (loadaddr) + *loadaddr = hdr->ih_load; + ret = hdr->ih_size; out: |