diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-23 13:20:24 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-04-30 12:51:51 -0700 |
commit | c1be135ad5b124b08715ca836b95b738c6b9d7d4 (patch) | |
tree | 07026164948adda25e6ba7467c523015159aa7a0 | |
parent | b113dfa081a6a7e061551a70e6ede7af0941a845 (diff) | |
download | qemu-c1be135ad5b124b08715ca836b95b738c6b9d7d4.zip qemu-c1be135ad5b124b08715ca836b95b738c6b9d7d4.tar.gz qemu-c1be135ad5b124b08715ca836b95b738c6b9d7d4.tar.bz2 |
qemu: Introduce target_long_bits()
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
-rw-r--r-- | include/qemu/target-info-impl.h | 2 | ||||
-rw-r--r-- | include/qemu/target-info.h | 7 | ||||
-rw-r--r-- | target-info-stub.c | 1 | ||||
-rw-r--r-- | target-info.c | 5 |
4 files changed, 15 insertions, 0 deletions
diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-impl.h index 76766ee..1b51cbc 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -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 */ diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 2b6ccab..850a295 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -17,6 +17,13 @@ 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: * * Returns: Name of the QOM interface implemented by machines diff --git a/target-info-stub.c b/target-info-stub.c index 86da297..fecc0e7 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -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, }; diff --git a/target-info.c b/target-info.c index 5f5ef1f..16fdca7 100644 --- a/target-info.c +++ b/target-info.c @@ -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; |