Revision ad9990ac
b/hw/ppc/ppc405_boards.c | ||
---|---|---|
27 | 27 |
#include "hw/timer/m48t59.h" |
28 | 28 |
#include "hw/block/flash.h" |
29 | 29 |
#include "sysemu/sysemu.h" |
30 |
#include "sysemu/qtest.h" |
|
30 | 31 |
#include "block/block.h" |
31 | 32 |
#include "hw/boards.h" |
32 | 33 |
#include "qemu/log.h" |
34 |
#include "qemu/error-report.h" |
|
33 | 35 |
#include "hw/loader.h" |
34 | 36 |
#include "sysemu/blockdev.h" |
35 | 37 |
#include "exec/address-spaces.h" |
... | ... | |
252 | 254 |
if (filename) { |
253 | 255 |
bios_size = load_image(filename, memory_region_get_ram_ptr(bios)); |
254 | 256 |
g_free(filename); |
257 |
if (bios_size < 0 || bios_size > BIOS_SIZE) { |
|
258 |
error_report("Could not load PowerPC BIOS '%s'", bios_name); |
|
259 |
exit(1); |
|
260 |
} |
|
261 |
bios_size = (bios_size + 0xfff) & ~0xfff; |
|
262 |
memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios); |
|
263 |
} else if (!qtest_enabled() || kernel_filename != NULL) { |
|
264 |
error_report("Could not load PowerPC BIOS '%s'", bios_name); |
|
265 |
exit(1); |
|
255 | 266 |
} else { |
267 |
/* Avoid an uninitialized variable warning */ |
|
256 | 268 |
bios_size = -1; |
257 | 269 |
} |
258 |
if (bios_size < 0 || bios_size > BIOS_SIZE) { |
|
259 |
fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", |
|
260 |
bios_name); |
|
261 |
exit(1); |
|
262 |
} |
|
263 |
bios_size = (bios_size + 0xfff) & ~0xfff; |
|
264 | 270 |
memory_region_set_readonly(bios, true); |
265 |
memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios); |
|
266 | 271 |
} |
267 | 272 |
/* Register FPGA */ |
268 | 273 |
#ifdef DEBUG_BOARD_INIT |
... | ... | |
569 | 574 |
if (filename) { |
570 | 575 |
bios_size = load_image(filename, memory_region_get_ram_ptr(bios)); |
571 | 576 |
g_free(filename); |
572 |
} else { |
|
573 |
bios_size = -1; |
|
574 |
} |
|
575 |
if (bios_size < 0 || bios_size > BIOS_SIZE) { |
|
576 |
fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n", |
|
577 |
bios_name); |
|
577 |
if (bios_size < 0 || bios_size > BIOS_SIZE) { |
|
578 |
error_report("Could not load PowerPC BIOS '%s'", bios_name); |
|
579 |
exit(1); |
|
580 |
} |
|
581 |
bios_size = (bios_size + 0xfff) & ~0xfff; |
|
582 |
memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios); |
|
583 |
} else if (!qtest_enabled()) { |
|
584 |
error_report("Could not load PowerPC BIOS '%s'", bios_name); |
|
578 | 585 |
exit(1); |
579 | 586 |
} |
580 |
bios_size = (bios_size + 0xfff) & ~0xfff; |
|
581 | 587 |
memory_region_set_readonly(bios, true); |
582 |
memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios); |
|
583 | 588 |
} |
584 | 589 |
/* Register Linux flash */ |
585 | 590 |
dinfo = drive_get(IF_PFLASH, 0, fl_idx); |
Also available in: Unified diff