diff options
Diffstat (limited to 'hw/mips/mips_fulong2e.c')
-rw-r--r-- | hw/mips/mips_fulong2e.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 3f3cb32651..3532399a13 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -110,16 +110,19 @@ static int64_t load_kernel (CPUMIPSState *env) { int64_t kernel_entry, kernel_low, kernel_high; int index = 0; - long initrd_size; + long kernel_size, initrd_size; ram_addr_t initrd_offset; uint32_t *prom_buf; long prom_size; - if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL, - (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low, - (uint64_t *)&kernel_high, 0, EM_MIPS, 1, 0) < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - loaderparams.kernel_filename); + kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, + NULL, (uint64_t *)&kernel_entry, + (uint64_t *)&kernel_low, (uint64_t *)&kernel_high, + 0, EM_MIPS, 1, 0); + if (kernel_size < 0) { + error_report("qemu: could not load kernel '%s': %s", + loaderparams.kernel_filename, + load_elf_strerror(kernel_size)); exit(1); } |