[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/52] target-tricore: make cpu-qom.h not target spec
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 20/52] target-tricore: make cpu-qom.h not target specific |
Date: |
Thu, 19 May 2016 13:18:14 +0200 |
Make TriCoreCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h. This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.
Signed-off-by: Paolo Bonzini <address@hidden>
---
target-tricore/cpu-qom.h | 28 +---------------------------
target-tricore/cpu.h | 30 +++++++++++++++++++++++++++++-
2 files changed, 30 insertions(+), 28 deletions(-)
diff --git a/target-tricore/cpu-qom.h b/target-tricore/cpu-qom.h
index 66c9664..399c98f 100644
--- a/target-tricore/cpu-qom.h
+++ b/target-tricore/cpu-qom.h
@@ -39,32 +39,6 @@ typedef struct TriCoreCPUClass {
void (*parent_reset)(CPUState *cpu);
} TriCoreCPUClass;
-/**
- * TriCoreCPU:
- * @env: #CPUTriCoreState
- *
- * A TriCore CPU.
- */
-typedef struct TriCoreCPU {
- /*< private >*/
- CPUState parent_obj;
- /*< public >*/
-
- CPUTriCoreState env;
-} TriCoreCPU;
-
-static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)
-{
- return TRICORE_CPU(container_of(env, TriCoreCPU, env));
-}
-
-#define ENV_GET_CPU(e) CPU(tricore_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(TriCoreCPU, env)
-
-hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
- fprintf_function cpu_fprintf, int flags);
-
+typedef struct TriCoreCPU TriCoreCPU;
#endif /*QEMU_TRICORE_CPU_QOM_H */
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index eaebdd2..a48340f 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -21,6 +21,7 @@
#include "tricore-defs.h"
#include "qemu-common.h"
+#include "cpu-qom.h"
#include "exec/cpu-defs.h"
#include "fpu/softfloat.h"
@@ -198,6 +199,34 @@ struct CPUTriCoreState {
struct QEMUTimer *timer; /* Internal timer */
};
+/**
+ * TriCoreCPU:
+ * @env: #CPUTriCoreState
+ *
+ * A TriCore CPU.
+ */
+struct TriCoreCPU {
+ /*< private >*/
+ CPUState parent_obj;
+ /*< public >*/
+
+ CPUTriCoreState env;
+};
+
+static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)
+{
+ return TRICORE_CPU(container_of(env, TriCoreCPU, env));
+}
+
+#define ENV_GET_CPU(e) CPU(tricore_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(TriCoreCPU, env)
+
+hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
+ fprintf_function cpu_fprintf, int flags);
+
+
#define MASK_PCXI_PCPN 0xff000000
#define MASK_PCXI_PIE 0x00800000
#define MASK_PCXI_UL 0x00400000
@@ -341,7 +370,6 @@ void psw_write(CPUTriCoreState *env, uint32_t val);
void fpu_set_state(CPUTriCoreState *env);
-#include "cpu-qom.h"
#define MMU_USER_IDX 2
void tricore_cpu_list(FILE *f, fprintf_function cpu_fprintf);
--
1.8.3.1
- [Qemu-devel] [PULL 11/52] target-m68k: make cpu-qom.h not target specific, (continued)
- [Qemu-devel] [PULL 11/52] target-m68k: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 26/52] alpha: include cpu-qom.h in files that require AlphaCPU, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 34/52] include: poison symbols in osdep.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 32/52] explicitly include linux/kvm.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 35/52] hw: do not use VMSTATE_*TL, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 28/52] ppc: use PowerPCCPU instead of CPUPPCState, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 22/52] target-xtensa: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 21/52] target-unicore32: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 19/52] target-sparc: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 37/52] hw: cannot include hw/hw.h from user emulation, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 20/52] target-tricore: make cpu-qom.h not target specific,
Paolo Bonzini <=
- [Qemu-devel] [PULL 27/52] mips: use MIPSCPU instead of CPUMIPSState, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 33/52] apic: move target-dependent definitions to cpu.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 36/52] hw: move CPU state serialization to migration/cpu.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 30/52] explicitly include qom/cpu.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 42/52] dma: do not depend on kvm_enabled(), Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 29/52] arm: remove useless cpu.h inclusion, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 31/52] explicitly include hw/qdev-core.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 46/52] arm: move arm_log_exception into .c file, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 44/52] acpi: do not use TARGET_PAGE_SIZE, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 45/52] qemu-common: push cpu.h inclusion out of qemu-common.h, Paolo Bonzini, 2016/05/19