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
This commit is contained in:
aliguori 2008-11-20 22:11:52 +00:00
parent 5a1235779e
commit 21cafd08a6
6 changed files with 12 additions and 6 deletions

View File

@ -68,7 +68,7 @@ static void an5206_init(ram_addr_t ram_size, int vga_ram_size,
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,

View File

@ -205,7 +205,8 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
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,

View File

@ -44,7 +44,7 @@ static void dummy_m68k_init(ram_addr_t ram_size, int vga_ram_size,
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,

View File

@ -290,7 +290,7 @@ static void mcf5208evb_init(ram_addr_t ram_size, int vga_ram_size,
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);

View File

@ -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:

View File

@ -165,7 +165,8 @@ int load_image_targphys(const char *filename, target_phys_addr_t, int max_sz);
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);