From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2cEM-0003Tq-Hl for qemu-devel@nongnu.org; Tue, 17 May 2016 06:28:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2cEJ-0003Rj-7F for qemu-devel@nongnu.org; Tue, 17 May 2016 06:28:02 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2cEJ-0003Ra-11 for qemu-devel@nongnu.org; Tue, 17 May 2016 06:27:59 -0400 Received: by mail-wm0-f68.google.com with SMTP id e201so3520318wme.2 for ; Tue, 17 May 2016 03:27:58 -0700 (PDT) References: <1463412982-6681-1-git-send-email-pbonzini@redhat.com> <1463412982-6681-11-git-send-email-pbonzini@redhat.com> From: Thomas Huth Message-ID: <573AF22B.4070308@tuxfamily.org> Date: Tue, 17 May 2016 12:27:55 +0200 MIME-Version: 1.0 In-Reply-To: <1463412982-6681-11-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/50] target-m68k: make cpu-qom.h not target specific List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Laurent Vivier On 16.05.2016 17:35, Paolo Bonzini wrote: > 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. > > Signed-off-by: Paolo Bonzini > --- > target-m68k/cpu-qom.h | 34 +--------------------------------- > target-m68k/cpu.h | 36 ++++++++++++++++++++++++++++++++++-- > 2 files changed, 35 insertions(+), 35 deletions(-) > > diff --git a/target-m68k/cpu-qom.h b/target-m68k/cpu-qom.h > index c28e55d..9885bba 100644 > --- a/target-m68k/cpu-qom.h > +++ b/target-m68k/cpu-qom.h > @@ -47,38 +47,6 @@ typedef struct M68kCPUClass { > void (*parent_reset)(CPUState *cpu); > } M68kCPUClass; > > -/** > - * M68kCPU: > - * @env: #CPUM68KState > - * > - * A Motorola 68k CPU. > - */ > -typedef struct M68kCPU { > - /*< private >*/ > - CPUState parent_obj; > - /*< public >*/ > - > - CPUM68KState env; > -} M68kCPU; > - > -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); > +typedef struct M68kCPU M68kCPU; > > #endif > diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h > index 48b4c87..57c2c8d 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); > Looks sane. Reviewed-by: Thomas Huth