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