From: Philippe Mathieu-Daudé Date: Fri, 4 Apr 2025 22:41:48 +0000 (+0200) Subject: qemu/target_info: Add target_aarch64() helper X-Git-Tag: v10.2.0-rc1~35^2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4306fc0f8304c78bd9b74544177ac24a56d80653;p=thirdparty%2Fqemu.git qemu/target_info: Add target_aarch64() helper 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> --- 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; +}