[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/37] hw/riscv/boot.c: make riscv_find_firmware() static
From: |
Alistair Francis |
Subject: |
[PULL 09/37] hw/riscv/boot.c: make riscv_find_firmware() static |
Date: |
Fri, 20 Jan 2023 17:38:45 +1000 |
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
The only caller is riscv_find_and_load_firmware(), which is in the same
file.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Message-Id: <20221221182300.307900-5-dbarboza@ventanamicro.com>
Message-Id: <20221229091828.1945072-10-bmeng@tinylab.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
include/hw/riscv/boot.h | 1 -
hw/riscv/boot.c | 44 ++++++++++++++++++++---------------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 93e5f8760d..c03e4e74c5 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -37,7 +37,6 @@ target_ulong riscv_find_and_load_firmware(MachineState
*machine,
const char *default_machine_firmware,
hwaddr firmware_load_addr,
symbol_fn_t sym_cb);
-char *riscv_find_firmware(const char *firmware_filename);
target_ulong riscv_load_firmware(const char *firmware_filename,
hwaddr firmware_load_addr,
symbol_fn_t sym_cb);
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index ebd351c840..7361d5c0d8 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -75,6 +75,28 @@ target_ulong
riscv_calc_kernel_start_addr(RISCVHartArrayState *harts,
}
}
+static char *riscv_find_firmware(const char *firmware_filename)
+{
+ char *filename;
+
+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware_filename);
+ if (filename == NULL) {
+ if (!qtest_enabled()) {
+ /*
+ * We only ship OpenSBI binary bios images in the QEMU source.
+ * For machines that use images other than the default bios,
+ * running QEMU test will complain hence let's suppress the error
+ * report for QEMU testing.
+ */
+ error_report("Unable to load the RISC-V firmware \"%s\"",
+ firmware_filename);
+ exit(1);
+ }
+ }
+
+ return filename;
+}
+
target_ulong riscv_find_and_load_firmware(MachineState *machine,
const char *default_machine_firmware,
hwaddr firmware_load_addr,
@@ -104,28 +126,6 @@ target_ulong riscv_find_and_load_firmware(MachineState
*machine,
return firmware_end_addr;
}
-char *riscv_find_firmware(const char *firmware_filename)
-{
- char *filename;
-
- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware_filename);
- if (filename == NULL) {
- if (!qtest_enabled()) {
- /*
- * We only ship OpenSBI binary bios images in the QEMU source.
- * For machines that use images other than the default bios,
- * running QEMU test will complain hence let's suppress the error
- * report for QEMU testing.
- */
- error_report("Unable to load the RISC-V firmware \"%s\"",
- firmware_filename);
- exit(1);
- }
- }
-
- return filename;
-}
-
target_ulong riscv_load_firmware(const char *firmware_filename,
hwaddr firmware_load_addr,
symbol_fn_t sym_cb)
--
2.39.0
- [PULL 00/37] riscv-to-apply queue, Alistair Francis, 2023/01/20
- [PULL 02/37] hw/char: riscv_htif: Drop {to, from}host_size in HTIFState, Alistair Francis, 2023/01/20
- [PULL 01/37] hw/char: riscv_htif: Avoid using magic numbers, Alistair Francis, 2023/01/20
- [PULL 09/37] hw/riscv/boot.c: make riscv_find_firmware() static,
Alistair Francis <=
- [PULL 06/37] hw/char: riscv_htif: Remove forward declarations for non-existent variables, Alistair Francis, 2023/01/20
- [PULL 10/37] hw/riscv/boot.c: introduce riscv_default_firmware_name(), Alistair Francis, 2023/01/20
- [PULL 03/37] hw/char: riscv_htif: Drop useless assignment of memory region, Alistair Francis, 2023/01/20
- [PULL 04/37] hw/char: riscv_htif: Use conventional 's' for HTIFState, Alistair Francis, 2023/01/20
- [PULL 05/37] hw/char: riscv_htif: Move registers from CPUArchState to HTIFState, Alistair Francis, 2023/01/20
- [PULL 07/37] hw/char: riscv_htif: Support console output via proxy syscall, Alistair Francis, 2023/01/20
- [PULL 08/37] hw/riscv: spike: Remove the out-of-date comments, Alistair Francis, 2023/01/20
- [PULL 11/37] hw/riscv/boot.c: Introduce riscv_find_firmware(), Alistair Francis, 2023/01/20
- [PULL 12/37] hw/riscv: spike: Decouple create_fdt() dependency to ELF loading, Alistair Francis, 2023/01/20
- [PULL 13/37] target/riscv/cpu.c: Fix elen check, Alistair Francis, 2023/01/20