On 4/3/25 16:49, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
include/qemu/target_info-impl.h | 3 +++
include/qemu/target_info.h | 2 ++
target_info-stub.c | 2 ++
target_info.c | 5 +++++
4 files changed, 12 insertions(+)
diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-impl.h
index 8fa585f8138..d6d671a03c0 100644
--- a/include/qemu/target_info-impl.h
+++ b/include/qemu/target_info-impl.h
@@ -30,6 +30,9 @@ struct BinaryTargetInfo {
/* runtime equivalent of TARGET_LONG_BITS definition */
unsigned long_bits;
+ /* runtime equivalent of CPU_RESOLVING_TYPE definition */
+ const char *const cpu_resolving_type;
+
};
#endif
diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h
index 66c43b329cc..407ce328e85 100644
--- a/include/qemu/target_info.h
+++ b/include/qemu/target_info.h
@@ -34,4 +34,6 @@ bool target_words_bigendian(void);
unsigned target_long_bits(void);
+const char *target_cpu_type(void);
+
#endif
diff --git a/target_info-stub.c b/target_info-stub.c
index a5374caed6c..7d21675d4c0 100644
--- a/target_info-stub.c
+++ b/target_info-stub.c
@@ -8,6 +8,7 @@
#include "qemu/osdep.h"
#include "qemu/target_info-impl.h"
+#include "cpu.h"
#ifdef TARGET_INFO_STUB_NEEDED
@@ -17,6 +18,7 @@ static const BinaryTargetInfo target_info_stub = {
.system_arch = -1,
.endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
.long_bits = TARGET_LONG_BITS,
+ .cpu_resolving_type = CPU_RESOLVING_TYPE,
};
const BinaryTargetInfo *target_info(void)
diff --git a/target_info.c b/target_info.c
index 2fd32931e13..4ad205636c2 100644
--- a/target_info.c
+++ b/target_info.c
@@ -41,3 +41,8 @@ unsigned target_long_bits(void)
{
return target_info()->long_bits;
}
+
+const char *target_cpu_type(void)
+{
+ return target_info()->cpu_resolving_type;
+}
Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>