diff options
| author | Thomas Huth <thuth@redhat.com> | 2023-04-11 20:34:18 +0200 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2023-04-20 11:25:32 +0200 |
| commit | 09637edb84556e08dac10a13e7801918e4666d93 (patch) | |
| tree | a041912327f2b5a09d625f559e2926736ce7ed12 /softmmu/qtest.c | |
| parent | 24be3369ad63c3882be42dd510a45bad52816fd1 (diff) | |
| download | focaccia-qemu-09637edb84556e08dac10a13e7801918e4666d93.tar.gz focaccia-qemu-09637edb84556e08dac10a13e7801918e4666d93.zip | |
softmmu: Make qtest.c target independent
The code in this file is not performance critical, so we can use the target independent endianess functions to only compile this file once for all targets. Message-Id: <20230411183418.1640500-4-thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to '')
| -rw-r--r-- | softmmu/qtest.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/softmmu/qtest.c b/softmmu/qtest.c index 09126df38a..f8d764b719 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -13,12 +13,12 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "cpu.h" #include "sysemu/qtest.h" #include "sysemu/runstate.h" #include "chardev/char-fe.h" #include "exec/ioport.h" #include "exec/memory.h" +#include "exec/tswap.h" #include "hw/qdev-core.h" #include "hw/irq.h" #include "qemu/accel.h" @@ -717,11 +717,11 @@ static void qtest_process_command(CharBackend *chr, gchar **words) qtest_send(chr, "OK\n"); } else if (strcmp(words[0], "endianness") == 0) { qtest_send_prefix(chr); -#if TARGET_BIG_ENDIAN - qtest_sendf(chr, "OK big\n"); -#else - qtest_sendf(chr, "OK little\n"); -#endif + if (target_words_bigendian()) { + qtest_sendf(chr, "OK big\n"); + } else { + qtest_sendf(chr, "OK little\n"); + } } else if (qtest_enabled() && strcmp(words[0], "clock_step") == 0) { int64_t ns; |