diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-01 17:56:37 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-01 17:56:37 +0000 |
commit | 74287114c98ecb969b7ce4b5c959da8a8a431d0f (patch) | |
tree | d82c33d09efeb9dff7a5b9b20324ee507f0458d1 /elf_ops.h | |
parent | 4f14e88c5991877085b1090508ee222d6f3ef088 (diff) | |
download | qemu-74287114c98ecb969b7ce4b5c959da8a8a431d0f.tar.gz qemu-74287114c98ecb969b7ce4b5c959da8a8a431d0f.tar.bz2 qemu-74287114c98ecb969b7ce4b5c959da8a8a431d0f.zip |
Improved initrd support for mips.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2574 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'elf_ops.h')
-rw-r--r-- | elf_ops.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -139,11 +139,13 @@ static int glue(load_symbols, SZ)(struct elfhdr *ehdr, int fd, int must_swab) } int glue(load_elf, SZ)(int fd, int64_t virt_to_phys_addend, - int must_swab, uint64_t *pentry) + int must_swab, uint64_t *pentry, + uint64_t *lowaddr, uint64_t *highaddr) { struct elfhdr ehdr; struct elf_phdr *phdr = NULL, *ph; int size, i, total_size; + elf_word low = 0, high = 0; elf_word mem_size, addr; uint8_t *data = NULL; @@ -193,12 +195,20 @@ int glue(load_elf, SZ)(int fd, int64_t virt_to_phys_addend, cpu_physical_memory_write_rom(addr, data, mem_size); total_size += mem_size; + if (!low || addr < low) + low = addr; + if (!high || (addr + mem_size) > high) + high = addr + mem_size; qemu_free(data); data = NULL; } } qemu_free(phdr); + if (lowaddr) + *lowaddr = (uint64_t)low; + if (highaddr) + *highaddr = (uint64_t)high; return total_size; fail: qemu_free(data); |