cpu: Introduce a wrapper for being able to use TARGET_NAME in common code
authorThomas Huth <thuth@redhat.com>
Mon, 24 Apr 2023 16:04:33 +0000 (18:04 +0200)
committerThomas Huth <thuth@redhat.com>
Tue, 16 May 2023 07:14:18 +0000 (09:14 +0200)
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().

Message-Id: <20230424160434.331175-3-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
cpu.c
include/hw/core/cpu.h

diff --git a/cpu.c b/cpu.c
index 9105c85404ce4eff0cdd9eebc30bf6fc5a931e65..65ebaf8159bdee05258da2d0b9836855ed5286f4 100644 (file)
--- 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 >=
index 5a019a27bc1e138b70bdcf06eeceb1ce62522747..39150cf8f8357d89bf1286bedc454fa9af61ae0c 100644 (file)
@@ -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