aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/riscv/boot.c9
-rw-r--r--include/hw/riscv/boot.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/hw/riscv/boot.c b/hw/riscv/boot.c
index fa69930..5dea644 100644
--- a/hw/riscv/boot.c
+++ b/hw/riscv/boot.c
@@ -40,6 +40,15 @@
#define fw_dynamic_info_data(__val) cpu_to_le64(__val)
#endif
+bool riscv_is_32_bit(MachineState *machine)
+{
+ if (!strncmp(machine->cpu_type, "rv32", 4)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
target_ulong riscv_find_and_load_firmware(MachineState *machine,
const char *default_machine_firmware,
hwaddr firmware_load_addr,
diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 0acbd8a..2975ed1 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -23,6 +23,8 @@
#include "exec/cpu-defs.h"
#include "hw/loader.h"
+bool riscv_is_32_bit(MachineState *machine);
+
target_ulong riscv_find_and_load_firmware(MachineState *machine,
const char *default_machine_firmware,
hwaddr firmware_load_addr,