From patchwork Wed Mar 16 10:46:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8597601 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45BCEC0553 for ; Wed, 16 Mar 2016 10:47:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2B2B202BE for ; Wed, 16 Mar 2016 10:47:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E91ED202F0 for ; Wed, 16 Mar 2016 10:47:37 +0000 (UTC) Received: from localhost ([::1]:54902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8zJ-0002vD-Aj for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 06:47:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8yy-0002nm-Rg for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag8yx-000230-Tm for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:16 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:35568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8yx-00022k-Jf for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:15 -0400 Received: by mail-wm0-x235.google.com with SMTP id l68so183356174wml.0 for ; Wed, 16 Mar 2016 03:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=YRFtpUJXHt13S5jYevW0foZqBOIq6Kymaq5vt+N+1tw=; b=GQZ86fmbN9yGpBEg6sOCuny4qfwGuGxPb/NLhM5kVTmEeZAK5EjEIatQmGBMWCl4UD hxSoqVXjl3fah/BbYKtd612NmbWRKe+ezoxCDuxIEcbMI02e4HwBLUMpknaM1N1U2SLg xChi07WMBpx/bG9pjTOsXIwam/fR1cCnXjDsZorZEeLJG7IpBZegf3tZUKTMrbNBZHdG 4fQz8Ww5Ep/GoIunCVepw+m7Gu+NosquUNwEfba8rAY13I3EBJoJWYTWRJFRP3THpqat bCY0juNoDKIugZZV5MPG560NVwyiR9150lgYCVPktOMGwOnIwgDnXjud1W/b/z7zzO3I Sg2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=YRFtpUJXHt13S5jYevW0foZqBOIq6Kymaq5vt+N+1tw=; b=JO8da/+8A5TtDH+vvRjKaMgHZEMUaxlV72mY5+GlHnZYxTkeW6677gc2aXH/9MebtQ Mz8c1p7iTvbCoyChESJlTstjmtir6918TBkcqlLF5ETWlFI2p6gyzH4BULyc0Mo0+g1Z vzkLDBtYGlpmktMAvZll2eoULJLVjegk0RnGaSQIqWas60+mxdpqn2EB0axva6pCQyd1 IttmQ5Z9X6mu8388IlVStv++VFnE4OHtv1sfyIKUDo9X6NuhZB2axHJuJ4oYb2u9WA42 J/KSrVgxAGUiE7K42EknNgatmMVuKjWuQKjhfhi+6Nghj/XILBUkKprvwwyAVcQXRnyP qnaQ== X-Gm-Message-State: AD7BkJI5GcO5Sx38rvb06WQcnNxrGsbbcY1YK+8OEQUz6xc+mweJ92JXqlSx+77GVnRT/w== X-Received: by 10.28.32.16 with SMTP id g16mr3572884wmg.13.1458125234948; Wed, 16 Mar 2016 03:47:14 -0700 (PDT) Received: from 640k.lan (94-39-161-17.adsl-ull.clienti.tiscali.it. [94.39.161.17]) by smtp.gmail.com with ESMTPSA id wr2sm2418094wjc.49.2016.03.16.03.47.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 03:47:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 16 Mar 2016 11:46:20 +0100 Message-Id: <1458125219-131698-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1458125219-131698-1-git-send-email-pbonzini@redhat.com> References: <1458125219-131698-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 Subject: [Qemu-devel] [PATCH 10/49] target-m68k: make cpu-qom.h not target specific X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);