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>
This commit is contained in:
Philippe Mathieu-Daudé
2026-02-13 14:50:36 +01:00
parent 4b75d19e36
commit 2dc8c9cf72
2 changed files with 12 additions and 0 deletions

View File

@@ -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

View File

@@ -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;
}