Add target_is_microblaze() and target_microblaze(). The first reports SYS_EMU_TARGET_MICROBLAZE. The second checks the current TargetInfo.
Signed-off-by: Yonggang Luo <[email protected]> --- include/qemu/target-info.h | 15 +++++++++++++++ target-info.c | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 812e4b04a7b..17fafa0888e 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -210,6 +210,21 @@ bool target_is_s390x(const TargetInfo *ti); */ bool target_s390x(void); +/** + * target_is_microblaze: + * @ti: TargetInfo to inspect + * + * Returns whether @ti is Microblaze. + */ +bool target_is_microblaze(const TargetInfo *ti); + +/** + * target_microblaze: + * + * Returns whether the target architecture is Microblaze. + */ +bool target_microblaze(void); + /** * target_is_base_riscv: * @ti: TargetInfo to inspect diff --git a/target-info.c b/target-info.c index b25e2ada438..0716e2021b8 100644 --- a/target-info.c +++ b/target-info.c @@ -204,6 +204,16 @@ bool target_s390x(void) return target_is_s390x(target_info()); } +bool target_is_microblaze(const TargetInfo *ti) +{ + return ti->target_arch == SYS_EMU_TARGET_MICROBLAZE; +} + +bool target_microblaze(void) +{ + return target_is_microblaze(target_info()); +} + bool target_is_base_riscv(const TargetInfo *ti) { switch (ti->target_arch) { -- 2.52.0.windows.1
