qemu/target_info: Add target_s390x() helper
Add a helper to distinct whether the binary is targetting S390x or not. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20260213175032.32121-3-philmd@linaro.org>
Philippe Mathieu-Daudé committed
Feb 13, 2026 at 14:50 UTC
2dc8c9cf72fd6c255a5c466e300f63059ddcfd17
2 files changed
+12
include/qemu/target-info.h
+7
@@ -92,4 +92,11 @@ bool target_ppc(void);
92
*/
93
bool target_ppc64(void);
94
95
+/**
96
+ * target_s390x:
97
+ *
98
+ * Returns whether the target architecture is S390x.
99
+ */
100
+bool target_s390x(void);
101
+
102
#endif
target-info.c
+5
@@ -88,3 +88,8 @@ bool target_ppc64(void)
88
{
89
return target_arch() == SYS_EMU_TARGET_PPC64;
90
}
91
+
92
+bool target_s390x(void)
93
+{
94
+ return target_arch() == SYS_EMU_TARGET_S390X;
95
+}