]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu/target_info: Add target_arm() helper
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 20 Oct 2025 20:21:57 +0000 (22:21 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 30 Oct 2025 13:48:26 +0000 (14:48 +0100)
Add a helper to distinct whether the binary is targetting
ARM (32-bit only) or not.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20251021210144.58108-1-philmd@linaro.org>

include/qemu/target-info.h
target-info.c

index abcf25db6fae89ae6c4f0b5e0ac9939fd1c41cc2..984fba3f42d0c8df7bbd67c0a0d031d7640714b8 100644 (file)
@@ -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
index 3110ab32f753f0a3f3653fb2bad3a10b5e5a952b..40716bf40513e3242f6c442ae8531f7a71dafa40 100644 (file)
@@ -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;
+}