target: Use CPUArchState as interface to target-specific CPU state

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.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220214183144.27402-13-f4bug@amsat.org>
This commit is contained in:
Philippe Mathieu-Daudé 2022-02-07 13:35:58 +01:00
parent 3686119875
commit 1ea4a06af0
26 changed files with 37 additions and 70 deletions

View File

@ -51,8 +51,6 @@
#pragma GCC poison TARGET_PAGE_BITS #pragma GCC poison TARGET_PAGE_BITS
#pragma GCC poison TARGET_PAGE_ALIGN #pragma GCC poison TARGET_PAGE_ALIGN
#pragma GCC poison CPUArchState
#pragma GCC poison CPU_INTERRUPT_HARD #pragma GCC poison CPU_INTERRUPT_HARD
#pragma GCC poison CPU_INTERRUPT_EXITTB #pragma GCC poison CPU_INTERRUPT_EXITTB
#pragma GCC poison CPU_INTERRUPT_HALT #pragma GCC poison CPU_INTERRUPT_HALT

View File

@ -340,7 +340,7 @@ struct CPUState {
AddressSpace *as; AddressSpace *as;
MemoryRegion *memory; MemoryRegion *memory;
void *env_ptr; /* CPUArchState */ CPUArchState *env_ptr;
IcountDecr *icount_decr_ptr; IcountDecr *icount_decr_ptr;
/* Accessed in parallel; all accesses must be atomic */ /* Accessed in parallel; all accesses must be atomic */

View File

@ -39,6 +39,7 @@ typedef struct CompatProperty CompatProperty;
typedef struct CoMutex CoMutex; typedef struct CoMutex CoMutex;
typedef struct ConfidentialGuestSupport ConfidentialGuestSupport; typedef struct ConfidentialGuestSupport ConfidentialGuestSupport;
typedef struct CPUAddressSpace CPUAddressSpace; typedef struct CPUAddressSpace CPUAddressSpace;
typedef struct CPUArchState CPUArchState;
typedef struct CPUState CPUState; typedef struct CPUState CPUState;
typedef struct DeviceListener DeviceListener; typedef struct DeviceListener DeviceListener;
typedef struct DeviceState DeviceState; typedef struct DeviceState DeviceState;

View File

@ -197,9 +197,7 @@ enum {
#define MMU_USER_IDX 1 #define MMU_USER_IDX 1
#define MMU_PHYS_IDX 2 #define MMU_PHYS_IDX 2
typedef struct CPUAlphaState CPUAlphaState; typedef struct CPUArchState {
struct CPUAlphaState {
uint64_t ir[31]; uint64_t ir[31];
float64 fir[31]; float64 fir[31];
uint64_t pc; uint64_t pc;
@ -251,7 +249,7 @@ struct CPUAlphaState {
uint32_t features; uint32_t features;
uint32_t amask; uint32_t amask;
int implver; int implver;
}; } CPUAlphaState;
/** /**
* AlphaCPU: * AlphaCPU:
@ -285,7 +283,6 @@ int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
#define cpu_list alpha_cpu_list #define cpu_list alpha_cpu_list
typedef CPUAlphaState CPUArchState;
typedef AlphaCPU ArchCPU; typedef AlphaCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -232,7 +232,7 @@ typedef struct CPUARMTBFlags {
target_ulong flags2; target_ulong flags2;
} CPUARMTBFlags; } CPUARMTBFlags;
typedef struct CPUARMState { typedef struct CPUArchState {
/* Regs for current mode. */ /* Regs for current mode. */
uint32_t regs[16]; uint32_t regs[16];
@ -3410,7 +3410,6 @@ static inline bool arm_cpu_data_is_big_endian(CPUARMState *env)
} }
} }
typedef CPUARMState CPUArchState;
typedef ARMCPU ArchCPU; typedef ARMCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -108,9 +108,7 @@ typedef enum AVRFeature {
AVR_FEATURE_RAMPZ, AVR_FEATURE_RAMPZ,
} AVRFeature; } AVRFeature;
typedef struct CPUAVRState CPUAVRState; typedef struct CPUArchState {
struct CPUAVRState {
uint32_t pc_w; /* 0x003fffff up to 22 bits */ uint32_t pc_w; /* 0x003fffff up to 22 bits */
uint32_t sregC; /* 0x00000001 1 bit */ uint32_t sregC; /* 0x00000001 1 bit */
@ -137,7 +135,7 @@ struct CPUAVRState {
bool fullacc; /* CPU/MEM if true MEM only otherwise */ bool fullacc; /* CPU/MEM if true MEM only otherwise */
uint64_t features; uint64_t features;
}; } CPUAVRState;
/** /**
* AVRCPU: * AVRCPU:
@ -247,7 +245,6 @@ bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx, MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr); bool probe, uintptr_t retaddr);
typedef CPUAVRState CPUArchState;
typedef AVRCPU ArchCPU; typedef AVRCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -105,7 +105,7 @@ typedef struct {
uint32_t lo; uint32_t lo;
} TLBSet; } TLBSet;
typedef struct CPUCRISState { typedef struct CPUArchState {
uint32_t regs[16]; uint32_t regs[16];
/* P0 - P15 are referred to as special registers in the docs. */ /* P0 - P15 are referred to as special registers in the docs. */
uint32_t pregs[16]; uint32_t pregs[16];
@ -265,7 +265,6 @@ static inline int cpu_mmu_index (CPUCRISState *env, bool ifetch)
#define SFR_RW_MM_TLB_LO env->pregs[PR_SRS]][5 #define SFR_RW_MM_TLB_LO env->pregs[PR_SRS]][5
#define SFR_RW_MM_TLB_HI env->pregs[PR_SRS]][6 #define SFR_RW_MM_TLB_HI env->pregs[PR_SRS]][6
typedef CPUCRISState CPUArchState;
typedef CRISCPU ArchCPU; typedef CRISCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -18,9 +18,6 @@
#ifndef HEXAGON_CPU_H #ifndef HEXAGON_CPU_H
#define HEXAGON_CPU_H #define HEXAGON_CPU_H
/* Forward declaration needed by some of the header files */
typedef struct CPUHexagonState CPUHexagonState;
#include "fpu/softfloat-types.h" #include "fpu/softfloat-types.h"
#include "exec/cpu-defs.h" #include "exec/cpu-defs.h"
@ -77,7 +74,7 @@ typedef struct {
/* Maximum number of vector temps in a packet */ /* Maximum number of vector temps in a packet */
#define VECTOR_TEMPS_MAX 4 #define VECTOR_TEMPS_MAX 4
struct CPUHexagonState { typedef struct CPUArchState {
target_ulong gpr[TOTAL_PER_THREAD_REGS]; target_ulong gpr[TOTAL_PER_THREAD_REGS];
target_ulong pred[NUM_PREGS]; target_ulong pred[NUM_PREGS];
target_ulong branch_taken; target_ulong branch_taken;
@ -131,7 +128,7 @@ struct CPUHexagonState {
target_ulong vstore_pending[VSTORES_MAX]; target_ulong vstore_pending[VSTORES_MAX];
bool vtcm_pending; bool vtcm_pending;
VTCMStoreLog vtcm_log; VTCMStoreLog vtcm_log;
}; } CPUHexagonState;
OBJECT_DECLARE_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU) OBJECT_DECLARE_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU)
@ -177,7 +174,6 @@ static inline int cpu_mmu_index(CPUHexagonState *env, bool ifetch)
#endif #endif
} }
typedef struct CPUHexagonState CPUArchState;
typedef HexagonCPU ArchCPU; typedef HexagonCPU ArchCPU;
void hexagon_translate_init(void); void hexagon_translate_init(void);

View File

@ -138,8 +138,6 @@
#define CR_IPSW 22 #define CR_IPSW 22
#define CR_EIRR 23 #define CR_EIRR 23
typedef struct CPUHPPAState CPUHPPAState;
#if TARGET_REGISTER_BITS == 32 #if TARGET_REGISTER_BITS == 32
typedef uint32_t target_ureg; typedef uint32_t target_ureg;
typedef int32_t target_sreg; typedef int32_t target_sreg;
@ -168,7 +166,7 @@ typedef struct {
unsigned access_id : 16; unsigned access_id : 16;
} hppa_tlb_entry; } hppa_tlb_entry;
struct CPUHPPAState { typedef struct CPUArchState {
target_ureg gr[32]; target_ureg gr[32];
uint64_t fr[32]; uint64_t fr[32];
uint64_t sr[8]; /* stored shifted into place for gva */ uint64_t sr[8]; /* stored shifted into place for gva */
@ -207,7 +205,7 @@ struct CPUHPPAState {
/* ??? We should use a more intelligent data structure. */ /* ??? We should use a more intelligent data structure. */
hppa_tlb_entry tlb[HPPA_TLB_ENTRIES]; hppa_tlb_entry tlb[HPPA_TLB_ENTRIES];
uint32_t tlb_last; uint32_t tlb_last;
}; } CPUHPPAState;
/** /**
* HPPACPU: * HPPACPU:
@ -225,8 +223,6 @@ struct HPPACPU {
QEMUTimer *alarm_timer; QEMUTimer *alarm_timer;
}; };
typedef CPUHPPAState CPUArchState;
typedef HPPACPU ArchCPU; typedef HPPACPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -1431,7 +1431,7 @@ typedef struct HVFX86LazyFlags {
target_ulong auxbits; target_ulong auxbits;
} HVFX86LazyFlags; } HVFX86LazyFlags;
typedef struct CPUX86State { typedef struct CPUArchState {
/* standard registers */ /* standard registers */
target_ulong regs[CPU_NB_REGS]; target_ulong regs[CPU_NB_REGS];
target_ulong eip; target_ulong eip;
@ -2074,7 +2074,6 @@ static inline int cpu_mmu_index_kernel(CPUX86State *env)
#define CC_SRC2 (env->cc_src2) #define CC_SRC2 (env->cc_src2)
#define CC_OP (env->cc_op) #define CC_OP (env->cc_op)
typedef CPUX86State CPUArchState;
typedef X86CPU ArchCPU; typedef X86CPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -79,7 +79,7 @@
typedef CPU_LDoubleU FPReg; typedef CPU_LDoubleU FPReg;
typedef struct CPUM68KState { typedef struct CPUArchState {
uint32_t dregs[8]; uint32_t dregs[8];
uint32_t aregs[8]; uint32_t aregs[8];
uint32_t pc; uint32_t pc;
@ -574,7 +574,6 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr,
int mmu_idx, MemTxAttrs attrs, int mmu_idx, MemTxAttrs attrs,
MemTxResult response, uintptr_t retaddr); MemTxResult response, uintptr_t retaddr);
typedef CPUM68KState CPUArchState;
typedef M68kCPU ArchCPU; typedef M68kCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -24,7 +24,7 @@
#include "exec/cpu-defs.h" #include "exec/cpu-defs.h"
#include "fpu/softfloat-types.h" #include "fpu/softfloat-types.h"
typedef struct CPUMBState CPUMBState; typedef struct CPUArchState CPUMBState;
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
#include "mmu.h" #include "mmu.h"
#endif #endif
@ -239,7 +239,7 @@ typedef struct CPUMBState CPUMBState;
#define USE_NON_SECURE_M_AXI_DC_MASK 0x4 #define USE_NON_SECURE_M_AXI_DC_MASK 0x4
#define USE_NON_SECURE_M_AXI_IC_MASK 0x8 #define USE_NON_SECURE_M_AXI_IC_MASK 0x8
struct CPUMBState { struct CPUArchState {
uint32_t bvalue; /* TCG temporary, only valid during a TB */ uint32_t bvalue; /* TCG temporary, only valid during a TB */
uint32_t btarget; /* Full resolved branch destination */ uint32_t btarget; /* Full resolved branch destination */
@ -394,7 +394,6 @@ void mb_tcg_init(void);
#define MMU_USER_IDX 2 #define MMU_USER_IDX 2
/* See NB_MMU_MODES further up the file. */ /* See NB_MMU_MODES further up the file. */
typedef CPUMBState CPUArchState;
typedef MicroBlazeCPU ArchCPU; typedef MicroBlazeCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -524,8 +524,7 @@ struct TCState {
}; };
struct MIPSITUState; struct MIPSITUState;
typedef struct CPUMIPSState CPUMIPSState; typedef struct CPUArchState {
struct CPUMIPSState {
TCState active_tc; TCState active_tc;
CPUMIPSFPUContext active_fpu; CPUMIPSFPUContext active_fpu;
@ -1161,7 +1160,7 @@ struct CPUMIPSState {
QEMUTimer *timer; /* Internal timer */ QEMUTimer *timer; /* Internal timer */
target_ulong exception_base; /* ExceptionBase input to the core */ target_ulong exception_base; /* ExceptionBase input to the core */
uint64_t cp0_count_ns; /* CP0_Count clock period (in nanoseconds) */ uint64_t cp0_count_ns; /* CP0_Count clock period (in nanoseconds) */
}; } CPUMIPSState;
/** /**
* MIPSCPU: * MIPSCPU:
@ -1218,7 +1217,6 @@ static inline int cpu_mmu_index(CPUMIPSState *env, bool ifetch)
return hflags_mmu_index(env->hflags); return hflags_mmu_index(env->hflags);
} }
typedef CPUMIPSState CPUArchState;
typedef MIPSCPU ArchCPU; typedef MIPSCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -25,7 +25,7 @@
#include "hw/core/cpu.h" #include "hw/core/cpu.h"
#include "qom/object.h" #include "qom/object.h"
typedef struct CPUNios2State CPUNios2State; typedef struct CPUArchState CPUNios2State;
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
#include "mmu.h" #include "mmu.h"
#endif #endif
@ -155,7 +155,7 @@ struct Nios2CPUClass {
#define CPU_INTERRUPT_NMI CPU_INTERRUPT_TGT_EXT_3 #define CPU_INTERRUPT_NMI CPU_INTERRUPT_TGT_EXT_3
struct CPUNios2State { struct CPUArchState {
uint32_t regs[NUM_CORE_REGS]; uint32_t regs[NUM_CORE_REGS];
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)

View File

@ -242,7 +242,7 @@ typedef struct CPUOpenRISCTLBContext {
} CPUOpenRISCTLBContext; } CPUOpenRISCTLBContext;
#endif #endif
typedef struct CPUOpenRISCState { typedef struct CPUArchState {
target_ulong shadow_gpr[16][32]; /* Shadow registers */ target_ulong shadow_gpr[16][32]; /* Shadow registers */
target_ulong pc; /* Program counter */ target_ulong pc; /* Program counter */
@ -348,7 +348,6 @@ void cpu_openrisc_count_stop(OpenRISCCPU *cpu);
#define OPENRISC_CPU_TYPE_NAME(model) model OPENRISC_CPU_TYPE_SUFFIX #define OPENRISC_CPU_TYPE_NAME(model) model OPENRISC_CPU_TYPE_SUFFIX
#define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU #define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU
typedef CPUOpenRISCState CPUArchState;
typedef OpenRISCCPU ArchCPU; typedef OpenRISCCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -32,7 +32,7 @@
OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass, OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass,
POWERPC_CPU) POWERPC_CPU)
typedef struct CPUPPCState CPUPPCState; typedef struct CPUArchState CPUPPCState;
typedef struct ppc_tb_t ppc_tb_t; typedef struct ppc_tb_t ppc_tb_t;
typedef struct ppc_dcr_t ppc_dcr_t; typedef struct ppc_dcr_t ppc_dcr_t;

View File

@ -1077,7 +1077,7 @@ struct ppc_radix_page_info {
#define PPC_CPU_OPCODES_LEN 0x40 #define PPC_CPU_OPCODES_LEN 0x40
#define PPC_CPU_INDIRECT_OPCODES_LEN 0x20 #define PPC_CPU_INDIRECT_OPCODES_LEN 0x20
struct CPUPPCState { struct CPUArchState {
/* Most commonly used resources during translated code execution first */ /* Most commonly used resources during translated code execution first */
target_ulong gpr[32]; /* general purpose registers */ target_ulong gpr[32]; /* general purpose registers */
target_ulong gprh[32]; /* storage for GPR MSB, used by the SPE extension */ target_ulong gprh[32]; /* storage for GPR MSB, used by the SPE extension */
@ -1477,7 +1477,6 @@ void ppc_compat_add_property(Object *obj, const char *name,
uint32_t *compat_pvr, const char *basedesc); uint32_t *compat_pvr, const char *basedesc);
#endif /* defined(TARGET_PPC64) */ #endif /* defined(TARGET_PPC64) */
typedef CPUPPCState CPUArchState;
typedef PowerPCCPU ArchCPU; typedef PowerPCCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -98,7 +98,7 @@ enum {
#define MAX_RISCV_PMPS (16) #define MAX_RISCV_PMPS (16)
typedef struct CPURISCVState CPURISCVState; typedef struct CPUArchState CPURISCVState;
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
#include "pmp.h" #include "pmp.h"
@ -113,7 +113,7 @@ FIELD(VTYPE, VMA, 7, 1)
FIELD(VTYPE, VEDIV, 8, 2) FIELD(VTYPE, VEDIV, 8, 2)
FIELD(VTYPE, RESERVED, 10, sizeof(target_ulong) * 8 - 11) FIELD(VTYPE, RESERVED, 10, sizeof(target_ulong) * 8 - 11)
struct CPURISCVState { struct CPUArchState {
target_ulong gpr[32]; target_ulong gpr[32];
target_ulong gprh[32]; /* 64 top bits of the 128-bit registers */ target_ulong gprh[32]; /* 64 top bits of the 128-bit registers */
uint64_t fpr[32]; /* assume both F and D extensions */ uint64_t fpr[32]; /* assume both F and D extensions */
@ -499,7 +499,6 @@ void riscv_cpu_set_fflags(CPURISCVState *env, target_ulong);
#define TB_FLAGS_MSTATUS_FS MSTATUS_FS #define TB_FLAGS_MSTATUS_FS MSTATUS_FS
#define TB_FLAGS_MSTATUS_VS MSTATUS_VS #define TB_FLAGS_MSTATUS_VS MSTATUS_VS
typedef CPURISCVState CPUArchState;
typedef RISCVCPU ArchCPU; typedef RISCVCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -45,6 +45,4 @@ struct RXCPUClass {
DeviceReset parent_reset; DeviceReset parent_reset;
}; };
#define CPUArchState struct CPURXState
#endif #endif

View File

@ -65,7 +65,7 @@ enum {
NUM_REGS = 16, NUM_REGS = 16,
}; };
typedef struct CPURXState { typedef struct CPUArchState {
/* CPU registers */ /* CPU registers */
uint32_t regs[NUM_REGS]; /* general registers */ uint32_t regs[NUM_REGS]; /* general registers */
uint32_t psw_o; /* O bit of status register */ uint32_t psw_o; /* O bit of status register */

View File

@ -31,6 +31,8 @@ OBJECT_DECLARE_TYPE(S390CPU, S390CPUClass,
typedef struct S390CPUModel S390CPUModel; typedef struct S390CPUModel S390CPUModel;
typedef struct S390CPUDef S390CPUDef; typedef struct S390CPUDef S390CPUDef;
typedef struct CPUArchState CPUS390XState;
typedef enum cpu_reset_type { typedef enum cpu_reset_type {
S390_CPU_RESET_NORMAL, S390_CPU_RESET_NORMAL,
S390_CPU_RESET_INITIAL, S390_CPU_RESET_INITIAL,
@ -63,6 +65,4 @@ struct S390CPUClass {
void (*reset)(CPUState *cpu, cpu_reset_type type); void (*reset)(CPUState *cpu, cpu_reset_type type);
}; };
typedef struct CPUS390XState CPUS390XState;
#endif #endif

View File

@ -51,7 +51,7 @@ typedef struct PSW {
uint64_t addr; uint64_t addr;
} PSW; } PSW;
struct CPUS390XState { struct CPUArchState {
uint64_t regs[16]; /* GP registers */ uint64_t regs[16]; /* GP registers */
/* /*
* The floating point registers are part of the vector registers. * The floating point registers are part of the vector registers.
@ -840,7 +840,6 @@ uint64_t s390_cpu_get_psw_mask(CPUS390XState *env);
/* outside of target/s390x/ */ /* outside of target/s390x/ */
S390CPU *s390_cpu_addr2state(uint16_t cpu_addr); S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
typedef CPUS390XState CPUArchState;
typedef S390CPU ArchCPU; typedef S390CPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -130,7 +130,7 @@ typedef struct memory_content {
struct memory_content *next; struct memory_content *next;
} memory_content; } memory_content;
typedef struct CPUSH4State { typedef struct CPUArchState {
uint32_t flags; /* general execution flags */ uint32_t flags; /* general execution flags */
uint32_t gregs[24]; /* general registers */ uint32_t gregs[24]; /* general registers */
float32 fregs[32]; /* floating point registers */ float32 fregs[32]; /* floating point registers */
@ -264,7 +264,6 @@ static inline int cpu_mmu_index (CPUSH4State *env, bool ifetch)
} }
} }
typedef CPUSH4State CPUArchState;
typedef SuperHCPU ArchCPU; typedef SuperHCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -420,7 +420,7 @@ struct CPUTimer
typedef struct CPUTimer CPUTimer; typedef struct CPUTimer CPUTimer;
typedef struct CPUSPARCState CPUSPARCState; typedef struct CPUArchState CPUSPARCState;
#if defined(TARGET_SPARC64) #if defined(TARGET_SPARC64)
typedef union { typedef union {
uint64_t mmuregs[16]; uint64_t mmuregs[16];
@ -439,7 +439,7 @@ typedef union {
}; };
} SparcV9MMU; } SparcV9MMU;
#endif #endif
struct CPUSPARCState { struct CPUArchState {
target_ulong gregs[8]; /* general registers */ target_ulong gregs[8]; /* general registers */
target_ulong *regwptr; /* pointer to current register window */ target_ulong *regwptr; /* pointer to current register window */
target_ulong pc; /* program counter */ target_ulong pc; /* program counter */
@ -743,7 +743,6 @@ static inline int cpu_pil_allowed(CPUSPARCState *env1, int pil)
#endif #endif
} }
typedef CPUSPARCState CPUArchState;
typedef SPARCCPU ArchCPU; typedef SPARCCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -28,8 +28,7 @@ struct tricore_boot_info;
typedef struct tricore_def_t tricore_def_t; typedef struct tricore_def_t tricore_def_t;
typedef struct CPUTriCoreState CPUTriCoreState; typedef struct CPUArchState {
struct CPUTriCoreState {
/* GPR Register */ /* GPR Register */
uint32_t gpr_a[16]; uint32_t gpr_a[16];
uint32_t gpr_d[16]; uint32_t gpr_d[16];
@ -189,7 +188,7 @@ struct CPUTriCoreState {
const tricore_def_t *cpu_model; const tricore_def_t *cpu_model;
void *irq[8]; void *irq[8];
struct QEMUTimer *timer; /* Internal timer */ struct QEMUTimer *timer; /* Internal timer */
}; } CPUTriCoreState;
/** /**
* TriCoreCPU: * TriCoreCPU:
@ -369,7 +368,6 @@ static inline int cpu_mmu_index(CPUTriCoreState *env, bool ifetch)
return 0; return 0;
} }
typedef CPUTriCoreState CPUArchState;
typedef TriCoreCPU ArchCPU; typedef TriCoreCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"

View File

@ -306,7 +306,7 @@ typedef enum {
INTTYPE_MAX INTTYPE_MAX
} interrupt_type; } interrupt_type;
struct CPUXtensaState; typedef struct CPUArchState CPUXtensaState;
typedef struct xtensa_tlb_entry { typedef struct xtensa_tlb_entry {
uint32_t vaddr; uint32_t vaddr;
@ -506,7 +506,7 @@ enum {
}; };
#endif #endif
typedef struct CPUXtensaState { struct CPUArchState {
const XtensaConfig *config; const XtensaConfig *config;
uint32_t regs[16]; uint32_t regs[16];
uint32_t pc; uint32_t pc;
@ -545,7 +545,7 @@ typedef struct CPUXtensaState {
/* Watchpoints for DBREAK registers */ /* Watchpoints for DBREAK registers */
struct CPUWatchpoint *cpu_watchpoint[MAX_NDBREAK]; struct CPUWatchpoint *cpu_watchpoint[MAX_NDBREAK];
} CPUXtensaState; };
/** /**
* XtensaCPU: * XtensaCPU:
@ -722,7 +722,6 @@ static inline int cpu_mmu_index(CPUXtensaState *env, bool ifetch)
#define XTENSA_CSBASE_LBEG_OFF_MASK 0x00ff0000 #define XTENSA_CSBASE_LBEG_OFF_MASK 0x00ff0000
#define XTENSA_CSBASE_LBEG_OFF_SHIFT 16 #define XTENSA_CSBASE_LBEG_OFF_SHIFT 16
typedef CPUXtensaState CPUArchState;
typedef XtensaCPU ArchCPU; typedef XtensaCPU ArchCPU;
#include "exec/cpu-all.h" #include "exec/cpu-all.h"