summaryrefslogtreecommitdiffstats
path: root/hw/riscv/boot.c
diff options
context:
space:
mode:
authorBin Meng2019-08-16 15:09:36 +0200
committerPalmer Dabbelt2019-09-17 17:42:43 +0200
commit49dd180e4f3e0af8ab8a54fec5058b6cd89e5942 (patch)
tree32b4ca83cecd9a7a902d37279eb7f315df017c21 /hw/riscv/boot.c
parentriscv: Add a helper routine for finding firmware (diff)
downloadqemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.tar.gz
qemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.tar.xz
qemu-49dd180e4f3e0af8ab8a54fec5058b6cd89e5942.zip
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 10f7991490..2e92fb0680 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);
}
}