[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/52] target-microblaze: make cpu-qom.h not target s
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 12/52] target-microblaze: make cpu-qom.h not target specific |
Date: |
Thu, 19 May 2016 13:18:06 +0200 |
Make MicroBlazeCPU 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-microblaze/cpu-qom.h | 44 +-------------------------------------------
target-microblaze/cpu.h | 45 ++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 45 insertions(+), 44 deletions(-)
diff --git a/target-microblaze/cpu-qom.h b/target-microblaze/cpu-qom.h
index 34f6273..1a61db7 100644
--- a/target-microblaze/cpu-qom.h
+++ b/target-microblaze/cpu-qom.h
@@ -47,48 +47,6 @@ typedef struct MicroBlazeCPUClass {
void (*parent_reset)(CPUState *cpu);
} MicroBlazeCPUClass;
-/**
- * MicroBlazeCPU:
- * @env: #CPUMBState
- *
- * A MicroBlaze CPU.
- */
-typedef struct MicroBlazeCPU {
- /*< private >*/
- CPUState parent_obj;
-
- /*< public >*/
-
- /* Microblaze Configuration Settings */
- struct {
- bool stackprot;
- uint32_t base_vectors;
- uint8_t use_fpu;
- bool use_mmu;
- bool dcache_writeback;
- bool endi;
- char *version;
- uint8_t pvr;
- } cfg;
-
- CPUMBState env;
-} MicroBlazeCPU;
-
-static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env)
-{
- return container_of(env, MicroBlazeCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(mb_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(MicroBlazeCPU, env)
-
-void mb_cpu_do_interrupt(CPUState *cs);
-bool mb_cpu_exec_interrupt(CPUState *cs, int int_req);
-void mb_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
- int flags);
-hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int mb_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+typedef struct MicroBlazeCPU MicroBlazeCPU;
#endif
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index bf74e2c..98d9c4f 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -20,6 +20,7 @@
#define CPU_MICROBLAZE_H
#include "qemu-common.h"
+#include "cpu-qom.h"
#define TARGET_LONG_BITS 32
@@ -274,7 +275,49 @@ struct CPUMBState {
} pvr;
};
-#include "cpu-qom.h"
+/**
+ * MicroBlazeCPU:
+ * @env: #CPUMBState
+ *
+ * A MicroBlaze CPU.
+ */
+struct MicroBlazeCPU {
+ /*< private >*/
+ CPUState parent_obj;
+
+ /*< public >*/
+
+ /* Microblaze Configuration Settings */
+ struct {
+ bool stackprot;
+ uint32_t base_vectors;
+ uint8_t use_fpu;
+ bool use_mmu;
+ bool dcache_writeback;
+ bool endi;
+ char *version;
+ uint8_t pvr;
+ } cfg;
+
+ CPUMBState env;
+};
+
+static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env)
+{
+ return container_of(env, MicroBlazeCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(mb_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(MicroBlazeCPU, env)
+
+void mb_cpu_do_interrupt(CPUState *cs);
+bool mb_cpu_exec_interrupt(CPUState *cs, int int_req);
+void mb_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
+ int flags);
+hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int mb_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
void mb_tcg_init(void);
MicroBlazeCPU *cpu_mb_init(const char *cpu_model);
--
1.8.3.1
- [Qemu-devel] [PULL 06/52] target-alpha: make cpu-qom.h not target specific, (continued)
- [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
- [Qemu-devel] [PULL 12/52] target-microblaze: make cpu-qom.h not target specific,
Paolo Bonzini <=
- [Qemu-devel] [PULL 15/52] target-ppc: do not make PowerPCCPUClass depend on target-specific symbols, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 17/52] target-s390x: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 25/52] sh4: include cpu-qom.h in files that require SuperHCPU, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 24/52] m68k: include cpu-qom.h in files that require M68KCPU, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 23/52] arm: include cpu-qom.h in files that require ARMCPU, Paolo Bonzini, 2016/05/19
- [Qemu-devel] [PULL 16/52] target-ppc: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/19
- [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