aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv/boot.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-08-16 06:09:36 -0700
committerPalmer Dabbelt <palmer@sifive.com>2019-09-17 08:42:43 -0700
commit49dd180e4f3e0af8ab8a54fec5058b6cd89e5942 (patch)
tree32b4ca83cecd9a7a902d37279eb7f315df017c21 /hw/riscv/boot.c
parent751f8f41331951077f3fc17dd245c23b5a18b595 (diff)
downloadqemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.zip
qemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.tar.gz
qemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.tar.bz2
riscv: Resolve full path of the given bios image
At present when "-bios image" is supplied, we just use the straight path without searching for the configured data directories. Like "-bios default", we add the same logic so that "-L" actually works. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'hw/riscv/boot.c')
-rw-r--r--hw/riscv/boot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index 10f7991..2e92fb0 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -72,14 +72,14 @@ void riscv_find_and_load_firmware(MachineState *machine,
firmware_filename = riscv_find_firmware(default_machine_firmware);
} else {
firmware_filename = machine->firmware;
+ if (strcmp(firmware_filename, "none")) {
+ firmware_filename = riscv_find_firmware(firmware_filename);
+ }
}
if (strcmp(firmware_filename, "none")) {
/* If not "none" load the firmware */
riscv_load_firmware(firmware_filename, firmware_load_addr);
- }
-
- if (!strcmp(machine->firmware, "default")) {
g_free(firmware_filename);
}
}