target-info: add target_base_riscv

Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Link: https://lore.kernel.org/qemu-devel/20261024061616.27381-2-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
This commit is contained in:
Pierrick Bouvier committed 2026-10-24 17:36:09 +00:00
1 parent 9150060720
commit eccd982eb5
2 files changed
+18

No files matched your search

+7
View File
@@ -120,6 +120,13 @@ bool target_ppc64(void);
*/
bool target_s390x(void);
/**
* target_base_riscv:
*
* Returns whether the target architecture is RISC-V 32-bit or 64-bit.
*/
bool target_base_riscv(void);
/**
* target_riscv64:
*
+11
View File
@@ -110,6 +110,17 @@ bool target_s390x(void)
return target_arch() == SYS_EMU_TARGET_S390X;
}
bool target_base_riscv(void)
{
switch (target_arch()) {
case SYS_EMU_TARGET_RISCV32:
case SYS_EMU_TARGET_RISCV64:
return true;
default:
return false;
}
}
bool target_riscv64(void)
{
return target_arch() == SYS_EMU_TARGET_RISCV64;