hw/riscv: Add a riscv_is_32_bit() function
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com> Reviewed-by: Bin Meng <bin.meng@windriver.com> Tested-by: Bin Meng <bin.meng@windriver.com> Message-id: 4c6a85dfb6dd470aa79356ebc1b02f479c2758e0.1602634524.git.alistair.francis@wdc.com
This commit is contained in:
parent
e66c531e13
commit
c407784291
|
@ -40,6 +40,15 @@
|
||||||
#define fw_dynamic_info_data(__val) cpu_to_le64(__val)
|
#define fw_dynamic_info_data(__val) cpu_to_le64(__val)
|
||||||
#endif
|
#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,
|
target_ulong riscv_find_and_load_firmware(MachineState *machine,
|
||||||
const char *default_machine_firmware,
|
const char *default_machine_firmware,
|
||||||
hwaddr firmware_load_addr,
|
hwaddr firmware_load_addr,
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#include "exec/cpu-defs.h"
|
#include "exec/cpu-defs.h"
|
||||||
#include "hw/loader.h"
|
#include "hw/loader.h"
|
||||||
|
|
||||||
|
bool riscv_is_32_bit(MachineState *machine);
|
||||||
|
|
||||||
target_ulong riscv_find_and_load_firmware(MachineState *machine,
|
target_ulong riscv_find_and_load_firmware(MachineState *machine,
|
||||||
const char *default_machine_firmware,
|
const char *default_machine_firmware,
|
||||||
hwaddr firmware_load_addr,
|
hwaddr firmware_load_addr,
|
||||||
|
|
Loading…
Reference in a new issue