Add a helper to distinct the binary is targetting Aarch64 or not. Start with a dump strcmp() implementation, leaving room for future optimizations.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> --- include/qemu/target_info.h | 7 +++++++ target_info.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index c67b97d66f3..9b7575ce632 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -24,4 +24,11 @@ const char *target_name(void); */ const char *target_machine_typename(void); +/** + * target_aarch64: + * + * Returns whether the target architecture is Aarch64. + */ +bool target_aarch64(void); + #endif diff --git a/target_info.c b/target_info.c index 1de4334ecc5..87dd1d51778 100644 --- a/target_info.c +++ b/target_info.c @@ -19,3 +19,8 @@ const char *target_machine_typename(void) { return target_info()->machine_typename; } + +bool target_aarch64(void) +{ + return !strcmp(target_name(), "aarch64"); +} -- 2.47.1