]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-info: Add target_riscv64()
authorAnton Johansson <anjo@rev.ng>
Wed, 7 May 2025 10:46:51 +0000 (12:46 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 27 May 2026 06:50:37 +0000 (08:50 +0200)
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>
include/qemu/target-info.h
target-info.c

index 23c997de5417ea900fa33760e81ef30aa3e855c3..6c5b714288ed63116160f2dbb3789ed4c068beb1 100644 (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
index 28c458fc7a7c7a31b20a88f4ac37ba51eba9b1b4..04c69c41f8ab8311f1387b5ae119dff51a573e57 100644 (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;
+}