qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 14/14] target: Use ArchCPU as interface to target CPU


From: Richard Henderson
Subject: Re: [PATCH v2 14/14] target: Use ArchCPU as interface to target CPU
Date: Thu, 24 Feb 2022 14:10:43 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/14/22 08:31, Philippe Mathieu-Daudé wrote:
ArchCPU is our interface with target-specific code. Use it as
a forward-declared opaque pointer (abstract type), having its
structure defined by each target.

Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
---
  include/hw/core/cpu.h   | 4 ++--
  include/qemu/typedefs.h | 1 +
  target/alpha/cpu.h      | 2 +-
  target/arm/cpu.h        | 2 +-
  target/avr/cpu.h        | 2 +-
  target/cris/cpu.h       | 2 +-
  target/hexagon/cpu.h    | 2 +-
  target/hppa/cpu.h       | 2 +-
  target/i386/cpu.h       | 2 +-
  target/m68k/cpu.h       | 2 +-
  target/microblaze/cpu.h | 2 +-
  target/mips/cpu.h       | 2 +-
  target/nios2/cpu.h      | 2 +-
  target/openrisc/cpu.h   | 2 +-
  target/ppc/cpu.h        | 2 +-
  target/riscv/cpu.h      | 2 +-
  target/rx/cpu.h         | 2 +-
  target/s390x/cpu.h      | 2 +-
  target/sh4/cpu.h        | 2 +-
  target/sparc/cpu.h      | 2 +-
  target/tricore/cpu.h    | 2 +-
  target/xtensa/cpu.h     | 2 +-
  22 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 2a0893b1dc..0efc6153ed 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -70,8 +70,8 @@ DECLARE_CLASS_CHECKERS(CPUClass, CPU,
   * The object struct and class struct need to be declared manually.
   */
  #define OBJECT_DECLARE_CPU_TYPE(CpuInstanceType, CpuClassType, 
CPU_MODULE_OBJ_NAME) \
-    OBJECT_DECLARE_TYPE(CpuInstanceType, CpuClassType, CPU_MODULE_OBJ_NAME); \
-    typedef CpuInstanceType ArchCPU;
+    typedef struct ArchCPU CpuInstanceType; \
+    OBJECT_DECLARE_TYPE(ArchCPU, CpuClassType, CPU_MODULE_OBJ_NAME);

Nice.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

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