Message ID | 20250403234914.9154-6-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | qemu: Introduce TargetInfo API (for single binary) | expand |
On 4/3/25 16:49, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > include/qemu/target_info-impl.h | 3 +++ > include/qemu/target_info.h | 2 ++ > target_info-stub.c | 1 + > target_info.c | 5 +++++ > 4 files changed, 11 insertions(+) > Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-impl.h index 14566e4a913..8fa585f8138 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -27,6 +27,9 @@ struct BinaryTargetInfo { /* related to TARGET_BIG_ENDIAN definition */ EndianMode endianness; + /* runtime equivalent of TARGET_LONG_BITS definition */ + unsigned long_bits; + }; #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index e84f16d1034..66c43b329cc 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -32,4 +32,6 @@ SysEmuTarget target_system_arch(void); */ bool target_words_bigendian(void); +unsigned target_long_bits(void); + #endif diff --git a/target_info-stub.c b/target_info-stub.c index c1a15f5cc12..a5374caed6c 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -16,6 +16,7 @@ static const BinaryTargetInfo target_info_stub = { .name = TARGET_NAME, .system_arch = -1, .endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE, + .long_bits = TARGET_LONG_BITS, }; const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index 22796dda543..2fd32931e13 100644 --- a/target_info.c +++ b/target_info.c @@ -36,3 +36,8 @@ bool target_words_bigendian(void) { return target_info()->endianness == ENDIAN_MODE_BIG; } + +unsigned target_long_bits(void) +{ + return target_info()->long_bits; +}
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/qemu/target_info-impl.h | 3 +++ include/qemu/target_info.h | 2 ++ target_info-stub.c | 1 + target_info.c | 5 +++++ 4 files changed, 11 insertions(+)