qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] cpu: Introduce a wrapper for being able to use TARGET_NAME i


From: Thomas Huth
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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]