Add a helper to distinct whether the binary is targetting
S390x or not.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Pierrick Bouvier <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-Id: <[email protected]>
---
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