target-info: add target_base_ppc, target_ppc and target_ppc64

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20260131020100.1115203-2-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
Pierrick Bouvier
2026-01-30 18:00:55 -08:00
committed by Philippe Mathieu-Daudé
parent b377abc220
commit f2ac221cc5
2 changed files with 42 additions and 0 deletions

View File

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

View File

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