target-info: Add target_riscv64()

Adds a helper function to tell if the binary is targeting riscv64 or
not.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20260520-hw-riscv-cpu-int-v3-7-d1123ea63d9c@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Anton Johansson
2025-05-07 12:46:51 +02:00
committed by Philippe Mathieu-Daudé
parent 750d25fc66
commit 9067113cdf
2 changed files with 12 additions and 0 deletions

View File

@@ -99,4 +99,11 @@ bool target_ppc64(void);
*/
bool target_s390x(void);
/**
* target_riscv64:
*
* Returns whether the target architecture is riscv64
*/
bool target_riscv64(void);
#endif

View File

@@ -93,3 +93,8 @@ bool target_s390x(void)
{
return target_arch() == SYS_EMU_TARGET_S390X;
}
bool target_riscv64(void)
{
return target_arch() == SYS_EMU_TARGET_RISCV64;
}