From: Thomas Huth <thuth@redhat.com>
To: "Laurent Vivier" <lvivier@redhat.com>,
qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-ppc@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Cédric Le Goater" <clg@kaod.org>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>
Subject: [PATCH 3/3] softmmu: Make qtest.c target independent
Date: Tue, 11 Apr 2023 20:34:18 +0200 [thread overview]
Message-ID: <20230411183418.1640500-4-thuth@redhat.com> (raw)
In-Reply-To: <20230411183418.1640500-1-thuth@redhat.com>
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.
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 76cbb8bcee..9f2197fd6f 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
next prev parent reply other threads:[~2023-04-11 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 18:34 [PATCH for-8.1 0/3] Make softmmu/qtest.c target independent Thomas Huth
2023-04-11 18:34 ` [PATCH 1/3] softmmu/qtest: Move the target-specific pseries RTAS code out of qtest.c Thomas Huth
2023-04-12 10:44 ` Cédric Le Goater
2023-04-11 18:34 ` [PATCH 2/3] include/exec: Provide the tswap() functions for target independent code, too Thomas Huth
2023-04-12 11:01 ` Cédric Le Goater
2023-04-11 18:34 ` Thomas Huth [this message]
2023-04-12 10:53 ` [PATCH 3/3] softmmu: Make qtest.c target independent Cédric Le Goater
2023-04-12 10:13 ` [PATCH for-8.1 0/3] Make softmmu/qtest.c " Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230411183418.1640500-4-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).