diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-23 17:14:05 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-04-23 17:14:05 +0000 |
commit | b37837317fb3177755c592591d7f53826c6afae5 (patch) | |
tree | 19be2c8087a98430ea8e5edfd012a11c44e4939f /hw/sun4m.c | |
parent | 5fe141fd30d35516eac3674f7b62be51ba34543f (diff) |
use generic ELF loader
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1832 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/sun4m.c b/hw/sun4m.c index 435ac02bdc..014ed09264 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -26,6 +26,7 @@ #define KERNEL_LOAD_ADDR 0x00004000 #define CMDLINE_ADDR 0x007ff000 #define INITRD_LOAD_ADDR 0x00800000 +#define PROM_SIZE_MAX (256 * 1024) #define PROM_ADDR 0xffd00000 #define PROM_FILENAMEB "proll.bin" #define PROM_FILENAMEE "proll.elf" @@ -263,9 +264,12 @@ static void sun4m_init(int ram_size, int vga_ram_size, int boot_device, slavio_misc = slavio_misc_init(PHYS_JJ_SLAVIO, PHYS_JJ_ME_IRQ); prom_offset = ram_size + vram_size; + cpu_register_physical_memory(PROM_ADDR, + (PROM_SIZE_MAX + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK, + prom_offset | IO_MEM_ROM); snprintf(buf, sizeof(buf), "%s/%s", bios_dir, PROM_FILENAMEE); - ret = load_elf(buf, phys_ram_base + prom_offset); + ret = load_elf(buf, 0); if (ret < 0) { snprintf(buf, sizeof(buf), "%s/%s", bios_dir, PROM_FILENAMEB); ret = load_image(buf, phys_ram_base + prom_offset); @@ -275,12 +279,10 @@ static void sun4m_init(int ram_size, int vga_ram_size, int boot_device, buf); exit(1); } - cpu_register_physical_memory(PROM_ADDR, (ret + TARGET_PAGE_SIZE) & TARGET_PAGE_MASK, - prom_offset | IO_MEM_ROM); kernel_size = 0; if (linux_boot) { - kernel_size = load_elf(kernel_filename, phys_ram_base + KERNEL_LOAD_ADDR); + kernel_size = load_elf(kernel_filename, -0xf0000000); if (kernel_size < 0) kernel_size = load_aout(kernel_filename, phys_ram_base + KERNEL_LOAD_ADDR); if (kernel_size < 0) |