[PATCH v4 2/5] qemu/target_info: Add target_s390x() helper

Philippe Mathieu-Daudé posted 5 patches 1 month, 3 weeks ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>
[PATCH v4 2/5] qemu/target_info: Add target_s390x() helper
Posted by Philippe Mathieu-Daudé 1 month, 3 weeks ago
Add a helper to distinct whether the binary is targetting
S390x or not.

Signed-off-by: Philippe Mathieu-Daudé <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 e3287334304..23c997de541 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 a26532f660f..28c458fc7a7 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;
+}
-- 
2.52.0


Re: [PATCH v4 2/5] qemu/target_info: Add target_s390x() helper
Posted by Pierrick Bouvier 1 month, 3 weeks ago
On 2/13/26 9:50 AM, Philippe Mathieu-Daudé wrote:
> Add a helper to distinct whether the binary is targetting
> S390x or not.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/qemu/target-info.h | 7 +++++++
>   target-info.c              | 5 +++++
>   2 files changed, 12 insertions(+)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>