mirror of https://github.com/xemu-project/xemu.git
target: Use ArchCPU as interface to target CPU
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. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220214183144.27402-15-f4bug@amsat.org>
This commit is contained in:
parent
9295b1aa92
commit
b36e239e08
|
@ -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);
|
||||
|
||||
typedef enum MMUAccessType {
|
||||
MMU_DATA_LOAD = 0,
|
||||
|
|
|
@ -26,6 +26,7 @@ typedef struct AddressSpace AddressSpace;
|
|||
typedef struct AioContext AioContext;
|
||||
typedef struct Aml Aml;
|
||||
typedef struct AnnounceTimer AnnounceTimer;
|
||||
typedef struct ArchCPU ArchCPU;
|
||||
typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
|
||||
typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
|
||||
typedef struct BlockBackend BlockBackend;
|
||||
|
|
|
@ -257,7 +257,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* An Alpha CPU.
|
||||
*/
|
||||
struct AlphaCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -774,7 +774,7 @@ typedef struct ARMISARegisters ARMISARegisters;
|
|||
*
|
||||
* An ARM CPU core.
|
||||
*/
|
||||
struct ARMCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -143,7 +143,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A AVR CPU.
|
||||
*/
|
||||
struct AVRCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -173,7 +173,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A CRIS CPU.
|
||||
*/
|
||||
struct CRISCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -140,7 +140,7 @@ typedef struct HexagonCPUClass {
|
|||
DeviceReset parent_reset;
|
||||
} HexagonCPUClass;
|
||||
|
||||
struct HexagonCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -213,7 +213,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* An HPPA CPU.
|
||||
*/
|
||||
struct HPPACPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -1707,7 +1707,7 @@ struct kvm_msrs;
|
|||
*
|
||||
* An x86 CPU.
|
||||
*/
|
||||
struct X86CPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -156,7 +156,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A Motorola 68k CPU.
|
||||
*/
|
||||
struct M68kCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -339,7 +339,7 @@ typedef struct {
|
|||
*
|
||||
* A MicroBlaze CPU.
|
||||
*/
|
||||
struct MicroBlazeCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
|
||||
|
|
|
@ -1171,7 +1171,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A MIPS CPU.
|
||||
*/
|
||||
struct MIPSCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -169,7 +169,7 @@ struct CPUArchState {
|
|||
*
|
||||
* A Nios2 CPU.
|
||||
*/
|
||||
struct Nios2CPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -297,7 +297,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A OpenRISC CPU.
|
||||
*/
|
||||
struct OpenRISCCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -1275,7 +1275,7 @@ typedef struct PPCVirtualHypervisorClass PPCVirtualHypervisorClass;
|
|||
*
|
||||
* A PowerPC CPU.
|
||||
*/
|
||||
struct PowerPCCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -394,7 +394,7 @@ typedef struct RISCVCPUConfig RISCVCPUConfig;
|
|||
*
|
||||
* A RISCV CPU.
|
||||
*/
|
||||
struct RISCVCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -105,7 +105,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A RX CPU
|
||||
*/
|
||||
struct RXCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -163,7 +163,7 @@ static inline uint64_t *get_freg(CPUS390XState *cs, int nr)
|
|||
*
|
||||
* An S/390 CPU.
|
||||
*/
|
||||
struct S390CPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -195,7 +195,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A SuperH CPU.
|
||||
*/
|
||||
struct SuperHCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -556,7 +556,7 @@ struct CPUArchState {
|
|||
*
|
||||
* A SPARC CPU.
|
||||
*/
|
||||
struct SPARCCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -196,7 +196,7 @@ typedef struct CPUArchState {
|
|||
*
|
||||
* A TriCore CPU.
|
||||
*/
|
||||
struct TriCoreCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
|
@ -553,7 +553,7 @@ struct CPUArchState {
|
|||
*
|
||||
* An Xtensa CPU.
|
||||
*/
|
||||
struct XtensaCPU {
|
||||
struct ArchCPU {
|
||||
/*< private >*/
|
||||
CPUState parent_obj;
|
||||
/*< public >*/
|
||||
|
|
Loading…
Reference in New Issue