Report whether the selected target architecture is LoongArch.
Signed-off-by: Yonggang Luo <[email protected]>
---
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 2cd4cc5671b..6c4e2809ad3 100644
--- a/include/qemu/target-info.h
+++ b/include/qemu/target-info.h
@@ -92,6 +92,13 @@ bool target_hexagon(void);
*/
bool target_or1k(void);
+/**
+ * target_loongarch:
+ *
+ * Returns whether the target architecture is LoongArch.
+ */
+bool target_loongarch(void);
+
/**
* target_base_ppc:
*
diff --git a/target-info.c b/target-info.c
index e67d7bed520..b6d9cd8d97c 100644
--- a/target-info.c
+++ b/target-info.c
@@ -84,6 +84,11 @@ bool target_or1k(void)
return target_arch() == SYS_EMU_TARGET_OR1K;
}
+bool target_loongarch(void)
+{
+ return target_arch() == SYS_EMU_TARGET_LOONGARCH64;
+}
+
bool target_base_ppc(void)
{
switch (target_arch()) {
--
2.55.0.windows.3