[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/50] target-alpha: make cpu-qom.h not target speci
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 05/50] target-alpha: make cpu-qom.h not target specific |
Date: |
Mon, 16 May 2016 17:35:37 +0200 |
Make AlphaCPU 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-alpha/cpu-qom.h | 40 +---------------------------------------
target-alpha/cpu.h | 42 +++++++++++++++++++++++++++++++++++++++++-
2 files changed, 42 insertions(+), 40 deletions(-)
diff --git a/target-alpha/cpu-qom.h b/target-alpha/cpu-qom.h
index cf5264a..bae4945 100644
--- a/target-alpha/cpu-qom.h
+++ b/target-alpha/cpu-qom.h
@@ -47,44 +47,6 @@ typedef struct AlphaCPUClass {
void (*parent_reset)(CPUState *cpu);
} AlphaCPUClass;
-/**
- * AlphaCPU:
- * @env: #CPUAlphaState
- *
- * An Alpha CPU.
- */
-typedef struct AlphaCPU {
- /*< private >*/
- CPUState parent_obj;
- /*< public >*/
-
- CPUAlphaState env;
-
- /* This alarm doesn't exist in real hardware; we wish it did. */
- QEMUTimer *alarm_timer;
-} AlphaCPU;
-
-static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
-{
- return container_of(env, AlphaCPU, env);
-}
-
-#define ENV_GET_CPU(e) CPU(alpha_env_get_cpu(e))
-
-#define ENV_OFFSET offsetof(AlphaCPU, env)
-
-#ifndef CONFIG_USER_ONLY
-extern const struct VMStateDescription vmstate_alpha_cpu;
-#endif
-
-void alpha_cpu_do_interrupt(CPUState *cpu);
-bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
-void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
- int flags);
-hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
-int alpha_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
-int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
-void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
- int is_write, int is_user, uintptr_t
retaddr);
+typedef struct AlphaCPU AlphaCPU;
#endif
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 420f2a5..8353bda 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -21,6 +21,7 @@
#define __CPU_ALPHA_H__
#include "qemu-common.h"
+#include "cpu-qom.h"
#define TARGET_LONG_BITS 64
#define ALIGNED_ONLY
@@ -284,12 +285,51 @@ struct CPUAlphaState {
int implver;
};
+/**
+ * AlphaCPU:
+ * @env: #CPUAlphaState
+ *
+ * An Alpha CPU.
+ */
+struct AlphaCPU {
+ /*< private >*/
+ CPUState parent_obj;
+ /*< public >*/
+
+ CPUAlphaState env;
+
+ /* This alarm doesn't exist in real hardware; we wish it did. */
+ QEMUTimer *alarm_timer;
+};
+
+static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
+{
+ return container_of(env, AlphaCPU, env);
+}
+
+#define ENV_GET_CPU(e) CPU(alpha_env_get_cpu(e))
+
+#define ENV_OFFSET offsetof(AlphaCPU, env)
+
+#ifndef CONFIG_USER_ONLY
+extern const struct VMStateDescription vmstate_alpha_cpu;
+#endif
+
+void alpha_cpu_do_interrupt(CPUState *cpu);
+bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
+ int flags);
+hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int alpha_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
+void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
+ int is_write, int is_user, uintptr_t
retaddr);
+
#define cpu_list alpha_cpu_list
#define cpu_exec cpu_alpha_exec
#define cpu_signal_handler cpu_alpha_signal_handler
#include "exec/cpu-all.h"
-#include "cpu-qom.h"
enum {
FEATURE_ASN = 0x00000001,
--
1.8.3.1
- [Qemu-devel] [PATCH 02/50] include: move CPU-related definitions out of qemu-common.h, (continued)
- [Qemu-devel] [PATCH 02/50] include: move CPU-related definitions out of qemu-common.h, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 07/50] target-cris: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 06/50] target-arm: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 04/50] cpu: make cpu-qom.h only include-able from cpu.h, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 09/50] target-lm32: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 08/50] target-i386: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 01/50] scripts: add script to build QEMU and analyze inclusions, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 05/50] target-alpha: make cpu-qom.h not target specific,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 15/50] target-s390x: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 10/50] target-m68k: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 16/50] target-sh4: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 03/50] log: do not use CONFIG_USER_ONLY, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 25/50] mips: use MIPSCPU instead of CPUMIPSState, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 13/50] target-ppc: do not use target_ulong in cpu-qom.h, Paolo Bonzini, 2016/05/16
- [Qemu-devel] [PATCH 12/50] target-mips: make cpu-qom.h not target specific, Paolo Bonzini, 2016/05/16