Commit 4157a662124c733ef94cb3b7fa3c849fdfb28c8e
1 parent
0289b2c1
allow variable bios size
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1496 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
5 deletions
hw/ppc_prep.c
... | ... | @@ -526,7 +526,7 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device, |
526 | 526 | char buf[1024]; |
527 | 527 | m48t59_t *nvram; |
528 | 528 | int PPC_io_memory; |
529 | - int ret, linux_boot, i, nb_nics1; | |
529 | + int linux_boot, i, nb_nics1, bios_size; | |
530 | 530 | unsigned long bios_offset; |
531 | 531 | uint32_t kernel_base, kernel_size, initrd_base, initrd_size; |
532 | 532 | ppc_def_t *def; |
... | ... | @@ -544,13 +544,14 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device, |
544 | 544 | /* allocate and load BIOS */ |
545 | 545 | bios_offset = ram_size + vga_ram_size; |
546 | 546 | snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); |
547 | - ret = load_image(buf, phys_ram_base + bios_offset); | |
548 | - if (ret != BIOS_SIZE) { | |
547 | + bios_size = load_image(buf, phys_ram_base + bios_offset); | |
548 | + if (bios_size < 0 || bios_size > BIOS_SIZE) { | |
549 | 549 | fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf); |
550 | 550 | exit(1); |
551 | 551 | } |
552 | - cpu_register_physical_memory((uint32_t)(-BIOS_SIZE), | |
553 | - BIOS_SIZE, bios_offset | IO_MEM_ROM); | |
552 | + bios_size = (bios_size + 0xfff) & ~0xfff; | |
553 | + cpu_register_physical_memory((uint32_t)(-bios_size), | |
554 | + bios_size, bios_offset | IO_MEM_ROM); | |
554 | 555 | |
555 | 556 | if (linux_boot) { |
556 | 557 | kernel_base = KERNEL_LOAD_ADDR; | ... | ... |