mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target: Move ArchCPUClass definition to 'cpu.h'
The OBJECT_DECLARE_CPU_TYPE() macro forward-declares each ArchCPUClass type. These forward declarations are sufficient for code in hw/ to use the QOM definitions. No need to expose these structure definitions. Keep each local to their target/ by moving them to the corresponding "cpu.h" header. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231013140116.255-13-philmd@linaro.org>
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#define QEMU_ALPHA_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_ALPHA_CPU "alpha-cpu"
|
||||
|
||||
@@ -30,19 +29,4 @@ OBJECT_DECLARE_CPU_TYPE(AlphaCPU, AlphaCPUClass, ALPHA_CPU)
|
||||
#define ALPHA_CPU_TYPE_SUFFIX "-" TYPE_ALPHA_CPU
|
||||
#define ALPHA_CPU_TYPE_NAME(model) model ALPHA_CPU_TYPE_SUFFIX
|
||||
|
||||
/**
|
||||
* AlphaCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_reset: The parent class' reset handler.
|
||||
*
|
||||
* An Alpha CPU model.
|
||||
*/
|
||||
struct AlphaCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceReset parent_reset;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -267,6 +267,19 @@ struct ArchCPU {
|
||||
QEMUTimer *alarm_timer;
|
||||
};
|
||||
|
||||
/**
|
||||
* AlphaCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_reset: The parent class' reset handler.
|
||||
*
|
||||
* An Alpha CPU model.
|
||||
*/
|
||||
struct AlphaCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceReset parent_reset;
|
||||
};
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
extern const VMStateDescription vmstate_alpha_cpu;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define QEMU_ARM_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_ARM_CPU "arm-cpu"
|
||||
|
||||
@@ -29,35 +28,9 @@ OBJECT_DECLARE_CPU_TYPE(ARMCPU, ARMCPUClass, ARM_CPU)
|
||||
|
||||
#define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU
|
||||
|
||||
typedef struct ARMCPUInfo {
|
||||
const char *name;
|
||||
void (*initfn)(Object *obj);
|
||||
void (*class_init)(ObjectClass *oc, void *data);
|
||||
} ARMCPUInfo;
|
||||
|
||||
/**
|
||||
* ARMCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* An ARM CPU model.
|
||||
*/
|
||||
struct ARMCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
const ARMCPUInfo *info;
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
#define TYPE_AARCH64_CPU "aarch64-cpu"
|
||||
typedef struct AArch64CPUClass AArch64CPUClass;
|
||||
DECLARE_CLASS_CHECKERS(AArch64CPUClass, AARCH64_CPU,
|
||||
TYPE_AARCH64_CPU)
|
||||
|
||||
struct AArch64CPUClass {
|
||||
ARMCPUClass parent_class;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1116,6 +1116,31 @@ struct ArchCPU {
|
||||
uint64_t gt_cntfrq_hz;
|
||||
};
|
||||
|
||||
typedef struct ARMCPUInfo {
|
||||
const char *name;
|
||||
void (*initfn)(Object *obj);
|
||||
void (*class_init)(ObjectClass *oc, void *data);
|
||||
} ARMCPUInfo;
|
||||
|
||||
/**
|
||||
* ARMCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* An ARM CPU model.
|
||||
*/
|
||||
struct ARMCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
const ARMCPUInfo *info;
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
struct AArch64CPUClass {
|
||||
ARMCPUClass parent_class;
|
||||
};
|
||||
|
||||
/* Callback functions for the generic timer's timers. */
|
||||
void arm_gt_ptimer_cb(void *opaque);
|
||||
void arm_gt_vtimer_cb(void *opaque);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define TARGET_AVR_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_AVR_CPU "avr-cpu"
|
||||
|
||||
@@ -31,19 +30,4 @@ OBJECT_DECLARE_CPU_TYPE(AVRCPU, AVRCPUClass, AVR_CPU)
|
||||
#define AVR_CPU_TYPE_SUFFIX "-" TYPE_AVR_CPU
|
||||
#define AVR_CPU_TYPE_NAME(name) (name AVR_CPU_TYPE_SUFFIX)
|
||||
|
||||
/**
|
||||
* AVRCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A AVR CPU model.
|
||||
*/
|
||||
struct AVRCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
#endif /* TARGET_AVR_CPU_QOM_H */
|
||||
|
||||
@@ -147,6 +147,20 @@ struct ArchCPU {
|
||||
CPUAVRState env;
|
||||
};
|
||||
|
||||
/**
|
||||
* AVRCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A AVR CPU model.
|
||||
*/
|
||||
struct AVRCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
extern const struct VMStateDescription vms_avr_cpu;
|
||||
|
||||
void avr_cpu_do_interrupt(CPUState *cpu);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define QEMU_CRIS_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_CRIS_CPU "cris-cpu"
|
||||
|
||||
@@ -30,22 +29,4 @@ OBJECT_DECLARE_CPU_TYPE(CRISCPU, CRISCPUClass, CRIS_CPU)
|
||||
#define CRIS_CPU_TYPE_SUFFIX "-" TYPE_CRIS_CPU
|
||||
#define CRIS_CPU_TYPE_NAME(name) (name CRIS_CPU_TYPE_SUFFIX)
|
||||
|
||||
/**
|
||||
* CRISCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
* @vr: Version Register value.
|
||||
*
|
||||
* A CRIS CPU model.
|
||||
*/
|
||||
struct CRISCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
|
||||
uint32_t vr;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -179,6 +179,22 @@ struct ArchCPU {
|
||||
CPUCRISState env;
|
||||
};
|
||||
|
||||
/**
|
||||
* CRISCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
* @vr: Version Register value.
|
||||
*
|
||||
* A CRIS CPU model.
|
||||
*/
|
||||
struct CRISCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
|
||||
uint32_t vr;
|
||||
};
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
extern const VMStateDescription vmstate_cris_cpu;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#define QEMU_HEXAGON_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_HEXAGON_CPU "hexagon-cpu"
|
||||
|
||||
|
||||
@@ -21,26 +21,10 @@
|
||||
#define QEMU_HPPA_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_HPPA_CPU "hppa-cpu"
|
||||
#define TYPE_HPPA64_CPU "hppa64-cpu"
|
||||
|
||||
OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU)
|
||||
|
||||
/**
|
||||
* HPPACPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_reset: The parent class' reset handler.
|
||||
*
|
||||
* An HPPA CPU model.
|
||||
*/
|
||||
struct HPPACPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceReset parent_reset;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -253,6 +253,20 @@ struct ArchCPU {
|
||||
QEMUTimer *alarm_timer;
|
||||
};
|
||||
|
||||
/**
|
||||
* HPPACPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_reset: The parent class' reset handler.
|
||||
*
|
||||
* An HPPA CPU model.
|
||||
*/
|
||||
struct HPPACPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceReset parent_reset;
|
||||
};
|
||||
|
||||
#include "exec/cpu-all.h"
|
||||
|
||||
static inline bool hppa_is_pa20(CPUHPPAState *env)
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#define QEMU_I386_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#ifdef TARGET_X86_64
|
||||
#define TYPE_X86_CPU "x86_64-cpu"
|
||||
@@ -35,41 +33,4 @@ OBJECT_DECLARE_CPU_TYPE(X86CPU, X86CPUClass, X86_CPU)
|
||||
#define X86_CPU_TYPE_SUFFIX "-" TYPE_X86_CPU
|
||||
#define X86_CPU_TYPE_NAME(name) (name X86_CPU_TYPE_SUFFIX)
|
||||
|
||||
typedef struct X86CPUModel X86CPUModel;
|
||||
|
||||
/**
|
||||
* X86CPUClass:
|
||||
* @cpu_def: CPU model definition
|
||||
* @host_cpuid_required: Whether CPU model requires cpuid from host.
|
||||
* @ordering: Ordering on the "-cpu help" CPU model list.
|
||||
* @migration_safe: See CpuDefinitionInfo::migration_safe
|
||||
* @static_model: See CpuDefinitionInfo::static
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* An x86 CPU model or family.
|
||||
*/
|
||||
struct X86CPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
/* CPU definition, automatically loaded by instance_init if not NULL.
|
||||
* Should be eventually replaced by subclass-specific property defaults.
|
||||
*/
|
||||
X86CPUModel *model;
|
||||
|
||||
bool host_cpuid_required;
|
||||
int ordering;
|
||||
bool migration_safe;
|
||||
bool static_model;
|
||||
|
||||
/* Optional description of CPU model.
|
||||
* If unavailable, cpu_def->model_id is used */
|
||||
const char *model_description;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceUnrealize parent_unrealize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2037,6 +2037,44 @@ struct ArchCPU {
|
||||
bool xen_vapic;
|
||||
};
|
||||
|
||||
typedef struct X86CPUModel X86CPUModel;
|
||||
|
||||
/**
|
||||
* X86CPUClass:
|
||||
* @cpu_def: CPU model definition
|
||||
* @host_cpuid_required: Whether CPU model requires cpuid from host.
|
||||
* @ordering: Ordering on the "-cpu help" CPU model list.
|
||||
* @migration_safe: See CpuDefinitionInfo::migration_safe
|
||||
* @static_model: See CpuDefinitionInfo::static
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* An x86 CPU model or family.
|
||||
*/
|
||||
struct X86CPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
/*
|
||||
* CPU definition, automatically loaded by instance_init if not NULL.
|
||||
* Should be eventually replaced by subclass-specific property defaults.
|
||||
*/
|
||||
X86CPUModel *model;
|
||||
|
||||
bool host_cpuid_required;
|
||||
int ordering;
|
||||
bool migration_safe;
|
||||
bool static_model;
|
||||
|
||||
/*
|
||||
* Optional description of CPU model.
|
||||
* If unavailable, cpu_def->model_id is used.
|
||||
*/
|
||||
const char *model_description;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceUnrealize parent_unrealize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
extern const VMStateDescription vmstate_x86_cpu;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#define LOONGARCH_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_LOONGARCH_CPU "loongarch-cpu"
|
||||
#define TYPE_LOONGARCH32_CPU "loongarch32-cpu"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define QEMU_M68K_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_M68K_CPU "m68k-cpu"
|
||||
|
||||
@@ -30,19 +29,4 @@ OBJECT_DECLARE_CPU_TYPE(M68kCPU, M68kCPUClass, M68K_CPU)
|
||||
#define M68K_CPU_TYPE_SUFFIX "-" TYPE_M68K_CPU
|
||||
#define M68K_CPU_TYPE_NAME(model) model M68K_CPU_TYPE_SUFFIX
|
||||
|
||||
/*
|
||||
* M68kCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A Motorola 68k CPU model.
|
||||
*/
|
||||
struct M68kCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -169,6 +169,19 @@ struct ArchCPU {
|
||||
CPUM68KState env;
|
||||
};
|
||||
|
||||
/*
|
||||
* M68kCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A Motorola 68k CPU model.
|
||||
*/
|
||||
struct M68kCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
void m68k_cpu_do_interrupt(CPUState *cpu);
|
||||
|
||||
@@ -21,25 +21,9 @@
|
||||
#define QEMU_MICROBLAZE_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_MICROBLAZE_CPU "microblaze-cpu"
|
||||
|
||||
OBJECT_DECLARE_CPU_TYPE(MicroBlazeCPU, MicroBlazeCPUClass, MICROBLAZE_CPU)
|
||||
|
||||
/**
|
||||
* MicroBlazeCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A MicroBlaze CPU model.
|
||||
*/
|
||||
struct MicroBlazeCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -355,6 +355,19 @@ struct ArchCPU {
|
||||
MicroBlazeCPUConfig cfg;
|
||||
};
|
||||
|
||||
/**
|
||||
* MicroBlazeCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A MicroBlaze CPU model.
|
||||
*/
|
||||
struct MicroBlazeCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
};
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
void mb_cpu_do_interrupt(CPUState *cs);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#define QEMU_MIPS_CPU_QOM_H
|
||||
|
||||
#include "hw/core/cpu.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#ifdef TARGET_MIPS64
|
||||
#define TYPE_MIPS_CPU "mips64-cpu"
|
||||
@@ -34,23 +33,4 @@ OBJECT_DECLARE_CPU_TYPE(MIPSCPU, MIPSCPUClass, MIPS_CPU)
|
||||
#define MIPS_CPU_TYPE_SUFFIX "-" TYPE_MIPS_CPU
|
||||
#define MIPS_CPU_TYPE_NAME(model) model MIPS_CPU_TYPE_SUFFIX
|
||||
|
||||
/**
|
||||
* MIPSCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A MIPS CPU model.
|
||||
*/
|
||||
struct MIPSCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
const struct mips_def_t *cpu_def;
|
||||
|
||||
/* Used for the jazz board to modify mips_cpu_do_transaction_failed. */
|
||||
bool no_data_aborts;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1217,6 +1217,23 @@ struct ArchCPU {
|
||||
Clock *count_div; /* Divider for CP0_Count clock */
|
||||
};
|
||||
|
||||
/**
|
||||
* MIPSCPUClass:
|
||||
* @parent_realize: The parent class' realize handler.
|
||||
* @parent_phases: The parent class' reset phase handlers.
|
||||
*
|
||||
* A MIPS CPU model.
|
||||
*/
|
||||
struct MIPSCPUClass {
|
||||
CPUClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
ResettablePhases parent_phases;
|
||||
const struct mips_def_t *cpu_def;
|
||||
|
||||
/* Used for the jazz board to modify mips_cpu_do_transaction_failed. */
|
||||
bool no_data_aborts;
|
||||
};
|
||||
|
||||
void mips_cpu_list(void);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user