[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/49] target-unicore32: make cpu-qom.h not target s
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 19/49] target-unicore32: make cpu-qom.h not target specific |
Date: |
Wed, 16 Mar 2016 11:46:29 +0100 |
Make UniCore32CPU 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-unicore32/cpu-qom.h | 29 +----------------------------
target-unicore32/cpu.h | 31 ++++++++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/target-unicore32/cpu-qom.h b/target-unicore32/cpu-qom.h
index e554f1f..bc68e78 100644
--- a/target-unicore32/cpu-qom.h
+++ b/target-unicore32/cpu-qom.h
@@ -36,33 +36,6 @@ typedef struct UniCore32CPUClass {
DeviceRealize parent_realize;
} UniCore32CPUClass;
-/**
- * UniCore32CPU:
- * @env: #CPUUniCore32State
- *
- * A UniCore32 CPU.
- */
-typedef struct UniCore32CPU {
- /*< private >*/
- CPUState parent_obj;
- /*< public >*/
-
- CPUUniCore32State env;
-} UniCore32CPU;
-
-static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env)
-{
- return container_of(env, UniCore32CPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(UniCore32CPU, env)
-
-void uc32_cpu_do_interrupt(CPUState *cpu);
-bool uc32_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void uc32_cpu_dump_state(CPUState *cpu, FILE *f,
- fprintf_function cpu_fprintf, int flags);
-hwaddr uc32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+typedef struct UniCore32CPU UniCore32CPU;
#endif
diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 9c1fbf9..22a0aef 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -20,6 +20,7 @@
#define CPUArchState struct CPUUniCore32State
#include "qemu-common.h"
+#include "cpu-qom.h"
#include "exec/cpu-defs.h"
#include "fpu/softfloat.h"
@@ -71,6 +72,35 @@ typedef struct CPUUniCore32State {
} CPUUniCore32State;
+/**
+ * UniCore32CPU:
+ * @env: #CPUUniCore32State
+ *
+ * A UniCore32 CPU.
+ */
+struct UniCore32CPU {
+ /*< private >*/
+ CPUState parent_obj;
+ /*< public >*/
+
+ CPUUniCore32State env;
+};
+
+static inline UniCore32CPU *uc32_env_get_cpu(CPUUniCore32State *env)
+{
+ return container_of(env, UniCore32CPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(uc32_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(UniCore32CPU, env)
+
+void uc32_cpu_do_interrupt(CPUState *cpu);
+bool uc32_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void uc32_cpu_dump_state(CPUState *cpu, FILE *f,
+ fprintf_function cpu_fprintf, int flags);
+hwaddr uc32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+
#define ASR_M (0x1f)
#define ASR_MODE_USER (0x10)
#define ASR_MODE_INTR (0x12)
@@ -134,7 +164,6 @@ static inline int cpu_mmu_index(CPUUniCore32State *env,
bool ifetch)
}
#include "exec/cpu-all.h"
-#include "cpu-qom.h"
#include "exec/exec-all.h"
int uc32_cpu_exec(CPUState *s);
--
1.8.3.1
- [Qemu-devel] [PATCH 09/49] target-lm32: make cpu-qom.h not target specific, (continued)
- [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, 2016/03/16
- [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 <=
- [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
- [Qemu-devel] [PATCH 31/49] apic: move target-dependent definitions to cpu.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 28/49] explicitly include qom/cpu.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 32/49] include: poison symbols in osdep.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 29/49] explicitly include hw/qdev-core.h, Paolo Bonzini, 2016/03/16
- [Qemu-devel] [PATCH 30/49] explicitly include linux/kvm.h, Paolo Bonzini, 2016/03/16