aboutsummaryrefslogtreecommitdiffstats
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-03 16:00:49 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-03 16:00:49 +0000
commit4157a662124c733ef94cb3b7fa3c849fdfb28c8e (patch)
tree80a9e8e3d22b5ef2d39b2d9d1fad310df485904c /hw/ppc_prep.c
parent0289b2c1df2a6e8347541bde30533898ac1d5553 (diff)
allow variable bios size
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1496 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 6b2bfd27b..148a08af5 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -526,7 +526,7 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
char buf[1024];
m48t59_t *nvram;
int PPC_io_memory;
- int ret, linux_boot, i, nb_nics1;
+ int linux_boot, i, nb_nics1, bios_size;
unsigned long bios_offset;
uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
ppc_def_t *def;
@@ -544,13 +544,14 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
/* allocate and load BIOS */
bios_offset = ram_size + vga_ram_size;
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
- ret = load_image(buf, phys_ram_base + bios_offset);
- if (ret != BIOS_SIZE) {
+ bios_size = load_image(buf, phys_ram_base + bios_offset);
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf);
exit(1);
}
- cpu_register_physical_memory((uint32_t)(-BIOS_SIZE),
- BIOS_SIZE, bios_offset | IO_MEM_ROM);
+ bios_size = (bios_size + 0xfff) & ~0xfff;
+ cpu_register_physical_memory((uint32_t)(-bios_size),
+ bios_size, bios_offset | IO_MEM_ROM);
if (linux_boot) {
kernel_base = KERNEL_LOAD_ADDR;