diff mbox series

[RFC,v5,18/21] qemu/target_info: Add target_aarch64() helper

Message ID 20250424222112.36194-19-philmd@linaro.org
State New
Headers show
Series single-binary: Make hw/arm/ common | expand

Commit Message

Philippe Mathieu-Daudé April 24, 2025, 10:21 p.m. UTC
Add a helper to distinct the binary is targetting
Aarch64 or not.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 include/qemu/target-info.h | 7 +++++++
 target-info.c              | 5 +++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h
index 0224b35b166..395c009baf2 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -24,4 +24,11 @@  const char *target_name(void);
  */
 const char *target_machine_typename(void);
 
+/**
+ * target_aarch64:
+ *
+ * Returns whether the target architecture is Aarch64.
+ */
+bool target_aarch64(void);
+
 #endif
diff --git a/target-info.c b/target-info.c
index 0042769e3a2..7f1758ae34f 100644
--- a/target-info.c
+++ b/target-info.c
@@ -19,3 +19,8 @@  const char *target_machine_typename(void)
 {
     return target_info()->machine_typename;
 }
+
+bool target_aarch64(void)
+{
+    return target_info()->target_arch == SYS_EMU_TARGET_AARCH64;
+}