[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/23] softmmu: Make qtest.c target independent
From: |
Thomas Huth |
Subject: |
[PULL 14/23] softmmu: Make qtest.c target independent |
Date: |
Thu, 20 Apr 2023 12:12:07 +0200 |
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>
---
softmmu/qtest.c | 12 ++++++------
softmmu/meson.build | 2 +-
2 files changed, 7 insertions(+), 7 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;
diff --git a/softmmu/meson.build b/softmmu/meson.build
index 1a7c7ac089..b392f0bd35 100644
--- a/softmmu/meson.build
+++ b/softmmu/meson.build
@@ -3,7 +3,6 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files(
'ioport.c',
'memory.c',
'physmem.c',
- 'qtest.c',
'dirtylimit.c',
'watchpoint.c',
)])
@@ -23,6 +22,7 @@ softmmu_ss.add(files(
'globals.c',
'memory_mapping.c',
'qdev-monitor.c',
+ 'qtest.c',
'rtc.c',
'runstate-action.c',
'runstate-hmp-cmds.c',
--
2.31.1
- [PULL 00/23] First batch of testing and misc patches for 8.1, Thomas Huth, 2023/04/20
- [PULL 03/23] docs/cxl: Fix sentence, Thomas Huth, 2023/04/20
- [PULL 02/23] docs: Fix typo (wphx => whpx), Thomas Huth, 2023/04/20
- [PULL 01/23] hw: Add compat machines for 8.1, Thomas Huth, 2023/04/20
- [PULL 05/23] qtest: Don't assert on "-qtest chardev:myid", Thomas Huth, 2023/04/20
- [PULL 06/23] chardev: Allow setting file chardev input file on the command line, Thomas Huth, 2023/04/20
- [PULL 10/23] target/i386: Set family/model/stepping of the "max" CPU according to LM bit, Thomas Huth, 2023/04/20
- [PULL 08/23] travis.yml: Add missing 'flex', 'bison' packages to 'GCC (user)' job, Thomas Huth, 2023/04/20
- [PULL 14/23] softmmu: Make qtest.c target independent,
Thomas Huth <=
- [PULL 07/23] travis.yml: Add missing clang-10 package to the 'Clang (disable-tcg)' job, Thomas Huth, 2023/04/20
- [PULL 04/23] test: Fix test-crypto-secret when compiling without keyring support, Thomas Huth, 2023/04/20
- [PULL 13/23] include/exec: Provide the tswap() functions for target independent code, too, Thomas Huth, 2023/04/20
- [PULL 15/23] hw/display: Compile vga.c as target-independent code, Thomas Huth, 2023/04/20
- [PULL 12/23] softmmu/qtest: Move the target-specific pseries RTAS code out of qtest.c, Thomas Huth, 2023/04/20
- [PULL 17/23] hw/core: Move numa.c into the target independent source set, Thomas Huth, 2023/04/20
- [PULL 21/23] qtest: Move tpm_util_tis_transmit() into tpm-tis-utils.c and rename it, Thomas Huth, 2023/04/20
- [PULL 23/23] tests/vm/freebsd: Update to FreeBSD 13.2, Thomas Huth, 2023/04/20
- [PULL 09/23] tests/migration: Only run auto_converge in slow mode, Thomas Huth, 2023/04/20
- [PULL 11/23] hw/char: Move two more files from specific_ss to softmmu_ss, Thomas Huth, 2023/04/20