[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/14] target: Use forward declared type instead of structure
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 11/14] target: Use forward declared type instead of structure type |
Date: |
Mon, 14 Feb 2022 19:31:41 +0100 |
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\ \*'
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>
---
target/arm/hvf_arm.h | 2 +-
target/mips/internal.h | 14 +++++++-------
target/openrisc/cpu.h | 4 ++--
target/xtensa/cpu.h | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/target/arm/hvf_arm.h b/target/arm/hvf_arm.h
index ea238cff83..9a9d1a0bf5 100644
--- a/target/arm/hvf_arm.h
+++ b/target/arm/hvf_arm.h
@@ -13,6 +13,6 @@
#include "cpu.h"
-void hvf_arm_set_cpu_features_from_host(struct ARMCPU *cpu);
+void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
#endif
diff --git a/target/mips/internal.h b/target/mips/internal.h
index f705d6bfa6..ac6e03e2f2 100644
--- a/target/mips/internal.h
+++ b/target/mips/internal.h
@@ -134,14 +134,14 @@ struct r4k_tlb_t {
struct CPUMIPSTLBContext {
uint32_t nb_tlb;
uint32_t tlb_in_use;
- int (*map_address)(struct CPUMIPSState *env, hwaddr *physical, int *prot,
+ int (*map_address)(CPUMIPSState *env, hwaddr *physical, int *prot,
target_ulong address, MMUAccessType access_type);
- void (*helper_tlbwi)(struct CPUMIPSState *env);
- void (*helper_tlbwr)(struct CPUMIPSState *env);
- void (*helper_tlbp)(struct CPUMIPSState *env);
- void (*helper_tlbr)(struct CPUMIPSState *env);
- void (*helper_tlbinv)(struct CPUMIPSState *env);
- void (*helper_tlbinvf)(struct CPUMIPSState *env);
+ void (*helper_tlbwi)(CPUMIPSState *env);
+ void (*helper_tlbwr)(CPUMIPSState *env);
+ void (*helper_tlbp)(CPUMIPSState *env);
+ void (*helper_tlbr)(CPUMIPSState *env);
+ void (*helper_tlbinv)(CPUMIPSState *env);
+ void (*helper_tlbinvf)(CPUMIPSState *env);
union {
struct {
r4k_tlb_t tlb[MIPS_TLB_MAX];
diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h
index ee069b080c..5711591520 100644
--- a/target/openrisc/cpu.h
+++ b/target/openrisc/cpu.h
@@ -231,11 +231,11 @@ typedef struct CPUOpenRISCTLBContext {
OpenRISCTLBEntry itlb[TLB_SIZE];
OpenRISCTLBEntry dtlb[TLB_SIZE];
- int (*cpu_openrisc_map_address_code)(struct OpenRISCCPU *cpu,
+ int (*cpu_openrisc_map_address_code)(OpenRISCCPU *cpu,
hwaddr *physical,
int *prot,
target_ulong address, int rw);
- int (*cpu_openrisc_map_address_data)(struct OpenRISCCPU *cpu,
+ int (*cpu_openrisc_map_address_data)(OpenRISCCPU *cpu,
hwaddr *physical,
int *prot,
target_ulong address, int rw);
diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h
index 02143f2f77..f2165b17e2 100644
--- a/target/xtensa/cpu.h
+++ b/target/xtensa/cpu.h
@@ -344,7 +344,7 @@ typedef struct XtensaGdbRegmap {
} XtensaGdbRegmap;
typedef struct XtensaCcompareTimer {
- struct CPUXtensaState *env;
+ CPUXtensaState *env;
QEMUTimer *timer;
} XtensaCcompareTimer;
--
2.34.1
- [PATCH v2 08/14] Hexagon (target/hexagon) convert to OBJECT_DECLARE_TYPE, (continued)
- [PATCH v2 08/14] Hexagon (target/hexagon) convert to OBJECT_DECLARE_TYPE, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 09/14] target: Include missing 'cpu.h', Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 10/14] target/hexagon: Add missing 'hw/core/cpu.h' include, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 12/14] target: Use CPUArchState as interface to target-specific CPU state, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 14/14] target: Use ArchCPU as interface to target CPU, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 13/14] target: Introduce and use OBJECT_DECLARE_CPU_TYPE() macro, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v2 11/14] target: Use forward declared type instead of structure type,
Philippe Mathieu-Daudé <=
- Re: [PATCH v2 00/14] target: Use ArchCPU & CPUArchState as abstract interface to target CPU, Damien Hedde, 2022/02/15