From 4306fc0f8304c78bd9b74544177ac24a56d80653 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 5 Apr 2025 00:41:48 +0200 Subject: [PATCH] qemu/target_info: Add target_aarch64() helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add a helper to distinct whether the binary is targetting Aarch64 or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Acked-by: Peter Maydell Message-Id: <20251021210144.58108-2-philmd@linaro.org> --- include/qemu/target-info.h | 7 +++++++ target-info.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 984fba3f42..e8fbdf19d5 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -57,4 +57,11 @@ bool target_big_endian(void); */ bool target_arm(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 40716bf405..e567cb4c40 100644 --- a/target-info.c +++ b/target-info.c @@ -57,3 +57,8 @@ bool target_arm(void) { return target_arch() == SYS_EMU_TARGET_ARM; } + +bool target_aarch64(void) +{ + return target_arch() == SYS_EMU_TARGET_AARCH64; +} -- 2.47.3