From: Pierrick Bouvier Date: Sat, 31 Jan 2026 02:00:55 +0000 (-0800) Subject: target-info: add target_base_ppc, target_ppc and target_ppc64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2ac221cc5e5af023b899bc2afe0d7bbe1f65ba3;p=thirdparty%2Fqemu.git target-info: add target_base_ppc, target_ppc and target_ppc64 Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20260131020100.1115203-2-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 6235962223..e328733430 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -71,4 +71,25 @@ bool target_arm(void); */ bool target_aarch64(void); +/** + * target_base_ppc: + * + * Returns whether the target architecture is PowerPC 32-bit or 64-bit. + */ +bool target_base_ppc(void); + +/** + * target_ppc: + * + * Returns whether the target architecture is PowerPC 32-bit. + */ +bool target_ppc(void); + +/** + * target_ppc64: + * + * Returns whether the target architecture is PowerPC 64-bit. + */ +bool target_ppc64(void); + #endif diff --git a/target-info.c b/target-info.c index 24696ff411..5a6d728252 100644 --- a/target-info.c +++ b/target-info.c @@ -73,3 +73,24 @@ bool target_aarch64(void) { return target_arch() == SYS_EMU_TARGET_AARCH64; } + +bool target_base_ppc(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_PPC: + case SYS_EMU_TARGET_PPC64: + return true; + default: + return false; + } +} + +bool target_ppc(void) +{ + return target_arch() == SYS_EMU_TARGET_PPC; +} + +bool target_ppc64(void) +{ + return target_arch() == SYS_EMU_TARGET_PPC64; +}