[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/52] target-cris: make cpu-qom.h not target specifi
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 08/52] target-cris: make cpu-qom.h not target specific |
Date: |
Thu, 19 May 2016 13:18:02 +0200 |
Make CRISCPU 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-cris/cpu-qom.h | 40 +---------------------------------------
target-cris/cpu.h | 41 ++++++++++++++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 40 deletions(-)
diff --git a/target-cris/cpu-qom.h b/target-cris/cpu-qom.h
index df4c0b5..7556e9f 100644
--- a/target-cris/cpu-qom.h
+++ b/target-cris/cpu-qom.h
@@ -50,44 +50,6 @@ typedef struct CRISCPUClass {
uint32_t vr;
} CRISCPUClass;
-/**
- * CRISCPU:
- * @env: #CPUCRISState
- *
- * A CRIS CPU.
- */
-typedef struct CRISCPU {
- /*< private >*/
- CPUState parent_obj;
- /*< public >*/
-
- CPUCRISState env;
-} CRISCPU;
-
-static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
-{
- return container_of(env, CRISCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(cris_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(CRISCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_cris_cpu;
-#endif
-
-void cris_cpu_do_interrupt(CPUState *cpu);
-void crisv10_cpu_do_interrupt(CPUState *cpu);
-bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req);
-
-void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
- int flags);
-
-hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-
-int crisv10_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct CRISCPU CRISCPU;
#endif
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index a492fc6..8cc8bf5 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -21,6 +21,7 @@
#define CPU_CRIS_H
#include "qemu-common.h"
+#include "cpu-qom.h"
#define TARGET_LONG_BITS 32
@@ -171,7 +172,45 @@ typedef struct CPUCRISState {
void *load_info;
} CPUCRISState;
-#include "cpu-qom.h"
+/**
+ * CRISCPU:
+ * @env: #CPUCRISState
+ *
+ * A CRIS CPU.
+ */
+struct CRISCPU {
+ /*< private >*/
+ CPUState parent_obj;
+ /*< public >*/
+
+ CPUCRISState env;
+};
+
+static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
+{
+ return container_of(env, CRISCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(cris_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(CRISCPU, env)
+
+#ifndef CONFIG_USER_ONLY
+extern const struct VMStateDescription vmstate_cris_cpu;
+#endif
+
+void cris_cpu_do_interrupt(CPUState *cpu);
+void crisv10_cpu_do_interrupt(CPUState *cpu);
+bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req);
+
+void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
+ int flags);
+
+hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+
+int crisv10_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
CRISCPU *cpu_cris_init(const char *cpu_model);
int cpu_cris_exec(CPUState *cpu);
--
1.8.3.1
- [Qemu-devel] [PULL 00/52] NEED_CPU_H cleanups, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 04/52] log: do not use CONFIG_USER_ONLY, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 05/52] cpu: make cpu-qom.h only include-able from cpu.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 08/52] target-cris: make cpu-qom.h not target specific,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/52] target-alpha: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 03/52] include: move CPU-related definitions out of qemu-common.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 07/52] target-arm: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 02/52] s390x: move .needed functions for subsections to machine.c, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 13/52] target-mips: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 01/52] scripts: add script to build QEMU and analyze inclusions, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 09/52] target-i386: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 14/52] target-ppc: do not use target_ulong in cpu-qom.h, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 18/52] target-sh4: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 10/52] target-lm32: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19