]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu: Introduce target_long_bits()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 23 Mar 2025 12:20:24 +0000 (13:20 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 30 Apr 2025 19:51:51 +0000 (12:51 -0700)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
include/qemu/target-info-impl.h
include/qemu/target-info.h
target-info-stub.c
target-info.c

index 76766eeaae3987d7a8705e76814b76b25f4167c5..1b51cbcfe1b0eb46e0c04528e900f005fa610cea 100644 (file)
@@ -14,6 +14,8 @@
 typedef struct TargetInfo {
     /* runtime equivalent of TARGET_NAME definition */
     const char *target_name;
+    /* runtime equivalent of TARGET_LONG_BITS definition */
+    unsigned long_bits;
     /* runtime equivalent of CPU_RESOLVING_TYPE definition */
     const char *cpu_type;
     /* QOM typename machines for this binary must implement */
index 2b6ccabb118b208779686abc88933f9999a65bfd..850a2958b9c543fe34b87d566d96a9ac002fc721 100644 (file)
  */
 const char *target_name(void);
 
+/**
+ * target_long_bits:
+ *
+ * Returns: number of bits in a long type for this target (i.e. 64).
+ */
+unsigned target_long_bits(void);
+
 /**
  * target_machine_typename:
  *
index 86da297277c838bbe225c65edbf0c24156cd93d1..fecc0e71286b19b9187093145c4ca836a3b400ee 100644 (file)
@@ -14,6 +14,7 @@
 
 static const TargetInfo target_info_stub = {
     .target_name = TARGET_NAME,
+    .long_bits = TARGET_LONG_BITS,
     .cpu_type = CPU_RESOLVING_TYPE,
     .machine_typename = TYPE_MACHINE,
 };
index 5f5ef1f93250631f2cdff326db0a16bd6d960393..16fdca7aaaf717bb4fea149e09a55b7c525d7621 100644 (file)
@@ -15,6 +15,11 @@ const char *target_name(void)
     return target_info()->target_name;
 }
 
+unsigned target_long_bits(void)
+{
+    return target_info()->long_bits;
+}
+
 const char *target_cpu_type(void)
 {
     return target_info()->cpu_type;