diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-15 13:49:25 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-05-19 13:08:05 +0200 |
commit | a836b8fa00fa1032ccd234a71b33943627d211ea (patch) | |
tree | 408b836596a2c26f5ea4a4ece798b09f3f8a3e6e /target-m68k/cpu.h | |
parent | 6adb9c5474fe417c86db3905e65887eb636d446f (diff) | |
download | qemu-a836b8fa00fa1032ccd234a71b33943627d211ea.zip |
target-m68k: make cpu-qom.h not target specific
Make M68KCPU 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.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-m68k/cpu.h')
-rw-r--r-- | target-m68k/cpu.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index d2f467ca9b..86a1ff0d80 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -26,7 +26,7 @@ #include "qemu-common.h" #include "exec/cpu-defs.h" - +#include "cpu-qom.h" #include "fpu/softfloat.h" #define MAX_QREGS 32 @@ -109,7 +109,39 @@ typedef struct CPUM68KState { uint32_t features; } CPUM68KState; -#include "cpu-qom.h" +/** + * M68kCPU: + * @env: #CPUM68KState + * + * A Motorola 68k CPU. + */ +struct M68kCPU { + /*< private >*/ + CPUState parent_obj; + /*< public >*/ + + CPUM68KState env; +}; + +static inline M68kCPU *m68k_env_get_cpu(CPUM68KState *env) +{ + return container_of(env, M68kCPU, env); +} + +#define ENV_GET_CPU(e) CPU(m68k_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(M68kCPU, env) + +void m68k_cpu_do_interrupt(CPUState *cpu); +bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req); +void m68k_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, + int flags); +hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); +int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); + +void m68k_cpu_exec_enter(CPUState *cs); +void m68k_cpu_exec_exit(CPUState *cs); void m68k_tcg_init(void); void m68k_cpu_init_gdb(M68kCPU *cpu); |