]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target: Use ArchCPU as interface to target CPU
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 14 Feb 2022 16:15:16 +0000 (17:15 +0100)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 6 Mar 2022 21:23:09 +0000 (22:23 +0100)
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>

22 files changed:
include/hw/core/cpu.h
include/qemu/typedefs.h
target/alpha/cpu.h
target/arm/cpu.h
target/avr/cpu.h
target/cris/cpu.h
target/hexagon/cpu.h
target/hppa/cpu.h
target/i386/cpu.h
target/m68k/cpu.h
target/microblaze/cpu.h
target/mips/cpu.h
target/nios2/cpu.h
target/openrisc/cpu.h
target/ppc/cpu.h
target/riscv/cpu.h
target/rx/cpu.h
target/s390x/cpu.h
target/sh4/cpu.h
target/sparc/cpu.h
target/tricore/cpu.h
target/xtensa/cpu.h

index 2a0893b1dc754695911eddfd8b1469c30b9e57e1..0efc6153ed03bbe2594841751944f8d153867f0c 100644 (file)
@@ -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,
index c6f692b0dd53344817ce5f06b55a829e509bae8f..c564f54c112fe9be7c8fc8308f1f5a7714e56332 100644 (file)
@@ -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;
index 84430aff421e28f2307fbd9def047f50932d56a7..58f00b7814fd7fb63725b1db24c07a9e6fa2480c 100644 (file)
@@ -257,7 +257,7 @@ typedef struct CPUArchState {
  *
  * An Alpha CPU.
  */
-struct AlphaCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index af89509f5a963e1e89951bfe574c9038692a325c..0b4b5bbf54cadcd344cbf7db07be9fc7739f5ac6 100644 (file)
@@ -774,7 +774,7 @@ typedef struct ARMISARegisters ARMISARegisters;
  *
  * An ARM CPU core.
  */
-struct ARMCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index a833799fc14a077c61943801a185323d18cbf1ad..55497f851dc8784e194043ce246ef52dcc0090c5 100644 (file)
@@ -143,7 +143,7 @@ typedef struct CPUArchState {
  *
  *  A AVR CPU.
  */
-struct AVRCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index af7121bba06f7a6c6b906835a3db3ef3373afdac..e6776f25b1720dc8fcb5fa9d7ad0edca03553b95 100644 (file)
@@ -173,7 +173,7 @@ typedef struct CPUArchState {
  *
  * A CRIS CPU.
  */
-struct CRISCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 8db0aa542d6f92305b6be2339e16e0dca61547cd..2a65a57bab3817cf1b37babd9602d26b8aee7263 100644 (file)
@@ -140,7 +140,7 @@ typedef struct HexagonCPUClass {
     DeviceReset parent_reset;
 } HexagonCPUClass;
 
-struct HexagonCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 73a3f3238956bbc2ca62b2696aa98bc3594cb431..4cc936b6bfda3b8179b24f3988de629f50a0ea59 100644 (file)
@@ -213,7 +213,7 @@ typedef struct CPUArchState {
  *
  * An HPPA CPU.
  */
-struct HPPACPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index d99e175e17ceec5d44a8e801920c7b88cbacd921..e11734ba866a91d622237bfba0719a1f36ee3875 100644 (file)
@@ -1707,7 +1707,7 @@ struct kvm_msrs;
  *
  * An x86 CPU.
  */
-struct X86CPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 76a7cc70b4f143d2b1e8ea64f9f3f3e85018c549..872e8ce6375823a3b5a25257a903521a8ba32479 100644 (file)
@@ -156,7 +156,7 @@ typedef struct CPUArchState {
  *
  * A Motorola 68k CPU.
  */
-struct M68kCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 6e4e90a41edf11f9b3b2488a0e1b0d831dc1d506..0a0ce71b6a5c8c186ac9d66ad65d44431b11d2e5 100644 (file)
@@ -339,7 +339,7 @@ typedef struct {
  *
  * A MicroBlaze CPU.
  */
-struct MicroBlazeCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
 
index c361408cc81d61cdc5f73dee69574b811f676d1d..09e98f64de571d3aa53f618ee07243a5fa8efe8a 100644 (file)
@@ -1171,7 +1171,7 @@ typedef struct CPUArchState {
  *
  * A MIPS CPU.
  */
-struct MIPSCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index e07da73df0dd6fdc6783fbecfec6d966e3e4e2b9..ca0f3420cd1b161a4478df6b9b343a5ec3446d83 100644 (file)
@@ -169,7 +169,7 @@ struct CPUArchState {
  *
  * A Nios2 CPU.
  */
-struct Nios2CPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index bcd28802e49cba109cfaaf544db28aa64067126b..bdf29d2dc4c357d6e04b938d0fd8f3c63f158893 100644 (file)
@@ -297,7 +297,7 @@ typedef struct CPUArchState {
  *
  * A OpenRISC CPU.
  */
-struct OpenRISCCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 03bba61c8b4e004f98d1f88d19b7d98550264f42..047b24ba50eadb930477cf34841aec00102f9bdc 100644 (file)
@@ -1275,7 +1275,7 @@ typedef struct PPCVirtualHypervisorClass PPCVirtualHypervisorClass;
  *
  * A PowerPC CPU.
  */
-struct PowerPCCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 2810389fddbbfd4e0894021310a907e576ab894e..c069fe85fa1be3c5871a6a17390a7ab43f7b030e 100644 (file)
@@ -394,7 +394,7 @@ typedef struct RISCVCPUConfig RISCVCPUConfig;
  *
  * A RISCV CPU.
  */
-struct RISCVCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index f81bf5b592a926602b99096ec565339ba5306366..b4abd90ccd1eab827a2ee086b95914a3a9962a59 100644 (file)
@@ -105,7 +105,7 @@ typedef struct CPUArchState {
  *
  * A RX CPU
  */
-struct RXCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index bdf3f7d4feb34735cffafb45fad1461a0be6acf2..c49c8466e74d6721cd904473b8be3a32c55bf94e 100644 (file)
@@ -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 >*/
index dd477ba5771fa9ba57e46fa1301237a264167d4c..c72a30edfd413b0ef5d074e56c1a76a4ab39598c 100644 (file)
@@ -195,7 +195,7 @@ typedef struct CPUArchState {
  *
  * A SuperH CPU.
  */
-struct SuperHCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index 2a7fd47da3eb48af035013861132da4cbc8cf4de..abb38db6749dee5c5eba1a5ff6ba618923def2b8 100644 (file)
@@ -556,7 +556,7 @@ struct CPUArchState {
  *
  * A SPARC CPU.
  */
-struct SPARCCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index cd1954aa9ed5f724523f3c3702af545c3a6111b6..108d6b8288fb2aac9fbec036072feed733a8c5b9 100644 (file)
@@ -196,7 +196,7 @@ typedef struct CPUArchState {
  *
  * A TriCore CPU.
  */
-struct TriCoreCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/
index a361ab878591749bd24ff39128245ff7f9ab523e..4515f682aa26a267f3c4010e22dbcde4885a3304 100644 (file)
@@ -553,7 +553,7 @@ struct CPUArchState {
  *
  * An Xtensa CPU.
  */
-struct XtensaCPU {
+struct ArchCPU {
     /*< private >*/
     CPUState parent_obj;
     /*< public >*/