From 2dc8c9cf72fd6c255a5c466e300f63059ddcfd17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 13 Feb 2026 14:50:36 +0100 Subject: [PATCH] qemu/target_info: Add target_s390x() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a helper to distinct whether the binary is targetting S390x or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Thomas Huth Message-Id: <20260213175032.32121-3-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 e328733430..23c997de54 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -92,4 +92,11 @@ bool target_ppc(void); */ bool target_ppc64(void); +/** + * target_s390x: + * + * Returns whether the target architecture is S390x. + */ +bool target_s390x(void); + #endif diff --git a/target-info.c b/target-info.c index a26532f660..28c458fc7a 100644 --- a/target-info.c +++ b/target-info.c @@ -88,3 +88,8 @@ bool target_ppc64(void) { return target_arch() == SYS_EMU_TARGET_PPC64; } + +bool target_s390x(void) +{ + return target_arch() == SYS_EMU_TARGET_S390X; +}