From: Philippe Mathieu-Daudé Date: Mon, 20 Oct 2025 20:21:57 +0000 (+0200) Subject: qemu/target_info: Add target_arm() helper X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc08d4d1c31e8ff5ee3c70f33be989b2175137b7;p=thirdparty%2Fqemu.git qemu/target_info: Add target_arm() helper Add a helper to distinct whether the binary is targetting ARM (32-bit only) or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Acked-by: Peter Maydell Message-Id: <20251021210144.58108-1-philmd@linaro.org> --- diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index abcf25db6f..984fba3f42 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -50,4 +50,11 @@ const char *target_cpu_type(void); */ bool target_big_endian(void); +/** + * target_arm: + * + * Returns whether the target architecture is ARM (32-bit, not Aarch64). + */ +bool target_arm(void); + #endif diff --git a/target-info.c b/target-info.c index 3110ab32f7..40716bf405 100644 --- a/target-info.c +++ b/target-info.c @@ -52,3 +52,8 @@ bool target_big_endian(void) { return target_endian_mode() == ENDIAN_MODE_BIG; } + +bool target_arm(void) +{ + return target_arch() == SYS_EMU_TARGET_ARM; +}