qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 28/33] target: Use forward declared type instead of structure


From: Philippe Mathieu-Daudé
Subject: Re: [PULL 28/33] target: Use forward declared type instead of structure type
Date: Sun, 6 Mar 2022 22:25:27 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

On 6/3/22 13:59, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

The CPU / CPU state are forward declared.

   $ git grep -E 'struct [A-Za-z]+CPU\ \*'
   target/arm/hvf_arm.h:16:void hvf_arm_set_cpu_features_from_host(struct 
ARMCPU *cpu);
   target/openrisc/cpu.h:234:    int (*cpu_openrisc_map_address_code)(struct 
OpenRISCCPU *cpu,
   target/openrisc/cpu.h:238:    int (*cpu_openrisc_map_address_data)(struct 
OpenRISCCPU *cpu,

   $ git grep -E 'struct CPU[A-Za-z]+State\ \*'

Updating this regexp to catch CPUX86State:

  $ git grep -E 'struct CPU[A-Za-z0-9]+State\ \*'
target/i386/hvf/x86_emu.c:174:static bool is_host_reg(struct CPUX86State *env, target_ulong ptr) target/i386/hvf/x86_emu.c:179:void write_val_ext(struct CPUX86State *env, target_ulong ptr, target_ulong val, int size) target/i386/hvf/x86_emu.c:188:uint8_t *read_mmio(struct CPUX86State *env, target_ulong ptr, int bytes)
  ...

   target/mips/internal.h:137:    int (*map_address)(struct CPUMIPSState *env, 
hwaddr *physical, int *prot,
   target/mips/internal.h:139:    void (*helper_tlbwi)(struct CPUMIPSState 
*env);
   target/mips/internal.h:140:    void (*helper_tlbwr)(struct CPUMIPSState 
*env);
   target/mips/internal.h:141:    void (*helper_tlbp)(struct CPUMIPSState *env);
   target/mips/internal.h:142:    void (*helper_tlbr)(struct CPUMIPSState *env);
   target/mips/internal.h:143:    void (*helper_tlbinv)(struct CPUMIPSState 
*env);
   target/mips/internal.h:144:    void (*helper_tlbinvf)(struct CPUMIPSState 
*env);
   target/xtensa/cpu.h:347:    struct CPUXtensaState *env;

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220214183144.27402-12-f4bug@amsat.org>
---
  target/arm/hvf_arm.h        |  2 +-
  target/mips/internal.h      | 14 +++++++-------
  target/openrisc/cpu.h       |  4 ++--
  target/xtensa/cpu.h         |  2 +-
  target/i386/nvmm/nvmm-all.c | 14 +++++++-------
  target/i386/whpx/whpx-all.c | 18 +++++++++---------
  6 files changed, 27 insertions(+), 27 deletions(-)

Diffstat with new regexp:

 target/arm/hvf_arm.h        |   2 +-
target/i386/hvf/x86_emu.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------
 target/i386/hvf/x86_emu.h   |  22 +++++++++++-----------
 target/i386/nvmm/nvmm-all.c |  14 +++++++-------
 target/i386/whpx/whpx-all.c |  18 +++++++++---------
 target/mips/internal.h      |  14 +++++++-------
 target/openrisc/cpu.h       |   4 ++--
 target/xtensa/cpu.h         |   2 +-
 8 files changed, 93 insertions(+), 93 deletions(-)



reply via email to

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