[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/49] target-tricore: make cpu-qom.h not target spe
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 18/49] target-tricore: make cpu-qom.h not target specific |
Date: |
Wed, 16 Mar 2016 11:46:28 +0100 |
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 5fee376..f0da68c 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"
@@ -199,6 +200,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
@@ -339,7 +368,6 @@ enum {
uint32_t psw_read(CPUTriCoreState *env);
void psw_write(CPUTriCoreState *env, uint32_t val);
-#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] [PATCH 03/49] hw: explicitly include qemu-common.h and cpu.h, (continued)
- [Qemu-devel] [PATCH 03/49] hw: explicitly include qemu-common.h and cpu.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 06/49] target-arm: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 10/49] target-m68k: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 07/49] target-cris: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 11/49] target-microblaze: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 09/49] target-lm32: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 08/49] target-i386: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 12/49] target-mips: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 13/49] target-ppc: do not use target_ulong in cpu-qom.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 15/49] target-s390x: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 18/49] target-tricore: make cpu-qom.h not target specific,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 16/49] target-sh4: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 14/49] target-ppc: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 25/49] mips: use MIPSCPU instead of CPUMIPSState, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 20/49] target-xtensa: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 19/49] target-unicore32: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 22/49] m68k: include cpu-qom.h in files that require M68KCPU, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 17/49] target-sparc: make cpu-qom.h not target specific, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 21/49] arm: include cpu-qom.h in files that require ARMCPU, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 24/49] alpha: include cpu-qom.h in files that require AlphaCPU, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 23/49] sh4: include cpu-qom.h in files that require SuperHCPU, Paolo Bonzini, 2016/03/16