qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 10/13] target: Use CPUArchState as interface to target-specif


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 10/13] target: Use CPUArchState as interface to target-specific CPU state
Date: Wed, 9 Feb 2022 22:47:02 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

On 8/2/22 23:40, Richard Henderson wrote:
On 2/9/22 02:22, Philippe Mathieu-Daudé wrote:
While CPUState is our interface with generic code, CPUArchState is
our interface with target-specific code. Use CPUArchState as an
abstract type, defined by each target.

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

Nice.

It's tempting to purge CPUFooState entirely, which would eliminate e.g. patch 8, and put the onus on having cpu.h (and thus the actual definition of CPUArchState) in scope to the C file that includes those headers.

I tried but I doubt the result code will please maintainers. I went
back and inverted the typedef, to keep CPUFooState. Maybe a simple
aesthetic concern... I can post (on top of the respin) if you are
interested.

Thanks,

Phil.



reply via email to

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