From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-s390x@nongnu.org, Yanan Wang <wangyanan55@huawei.com>,
Richard Henderson <richard.henderson@linaro.org>,
David Hildenbrand <david@redhat.com>,
Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH 2/3] cpu: Introduce a wrapper for being able to use TARGET_NAME in common code
Date: Mon, 24 Apr 2023 18:04:33 +0200 [thread overview]
Message-ID: <20230424160434.331175-3-thuth@redhat.com> (raw)
In-Reply-To: <20230424160434.331175-1-thuth@redhat.com>
In some spots, it would be helpful to be able to use TARGET_NAME
in common (target independent) code, too. Thus introduce a wrapper
that can be called from common code, too, just like we already
have one for target_words_bigendian().
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/core/cpu.h | 2 ++
cpu.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 5a019a27bc..39150cf8f8 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -1013,6 +1013,8 @@ void cpu_exec_unrealizefn(CPUState *cpu);
*/
bool target_words_bigendian(void);
+const char *target_name(void);
+
void page_size_init(void);
#ifdef NEED_CPU_H
diff --git a/cpu.c b/cpu.c
index 9105c85404..65ebaf8159 100644
--- a/cpu.c
+++ b/cpu.c
@@ -427,6 +427,11 @@ bool target_words_bigendian(void)
#endif
}
+const char *target_name(void)
+{
+ return TARGET_NAME;
+}
+
void page_size_init(void)
{
/* NOTE: we can always suppose that qemu_host_page_size >=
--
2.31.1
next prev parent reply other threads:[~2023-04-24 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 16:04 [PATCH 0/3] hw/core: Make machine-qmp-cmds.c target independent Thomas Huth
2023-04-24 16:04 ` [PATCH 1/3] hw/core: Use a callback for target specific query-cpus-fast information Thomas Huth
2023-04-24 16:04 ` Thomas Huth [this message]
2023-04-24 16:04 ` [PATCH 3/3] hw/core: Move machine-qmp-cmds.c into the target independent source set Thomas Huth
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=20230424160434.331175-3-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=iii@linux.ibm.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=wangyanan55@huawei.com \
/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).