From patchwork Fri Apr 8 20:28:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8785661 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1E45B9F71A for ; Fri, 8 Apr 2016 20:34:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64F552024D for ; Fri, 8 Apr 2016 20:34:12 +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 AC675200FF for ; Fri, 8 Apr 2016 20:34:11 +0000 (UTC) Received: from localhost ([::1]:58080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aod6Y-00055z-Ve for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Apr 2016 16:34:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aod1x-0003dN-Sj for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aod1w-00022U-NT for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:25 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aod1w-00022O-Di for qemu-devel@nongnu.org; Fri, 08 Apr 2016 16:29:24 -0400 Received: by mail-wm0-x244.google.com with SMTP id l6so6823431wml.3 for ; Fri, 08 Apr 2016 13:29:24 -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=eJYYOjs1lprQokSbNaTCBCPpgy3OVfv9dopTENuQS3Xum2gBTJUkSRMI74+HVN0xp6 Z9nbVgikEt5RS/qa31cYyzMEI/jovtEO9JeQFsAQYgg6krCjn9dmfd/82sY4VLbNJmF8 LX8eYbcIRAef+89EOpY+PBx9LNFgtaapdhvH3yDL2S3I/hQioL0VmdgII+inA5PPbpGR aMe7osQ6ZaVCJ+2jnJmkLeiD0lk1rJIFFfIctkuMMJOk19vQkn7QtH9c1h8DfbHDOyi2 ece4GGF+ZhDrVMdjzPGgAzoxQei6DxIp959x7E4jPDJeOh0VNehGCZLoxaPHSZG4nNeH K6Hw== 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=lI2yhbjNAccDcrn6ooKEHQYSW27tL7mAqAjWEeIWk74uXgW3DH2+2BkBHBApdwcCsD 4CEiUt94EZSlfiKivx4eDOypqyFaVRxr++BkBPkCogIzAKvRfQ9xGaqPg3wNGE7LKb9D BsTPkA07CYpehxnItgQyXOUmkAvNudY8NG7BCqWjN+0yH5POW0MziwpZsmfvHokke4bm j9QOXJjp9ppKzL17eFvYrcLhT6BiWy6d/XJznCH3FtSdv1PwfJ4nDqJwwd2/z8siogCy Mcqgv/ZIWMpV7iGcrUp0fNM85Gyjjd4vtwxF/ROyJw46ES/0KidjdOSiVpRvIqQbcbdq voow== X-Gm-Message-State: AD7BkJIDZRtk2nXb5AhVyEWLkjEN0GI6jjFBTsGe0GVwMujqUkPprn+nJjwRVhUuraF/EQ== X-Received: by 10.28.143.9 with SMTP id r9mr5638281wmd.37.1460147363880; Fri, 08 Apr 2016 13:29:23 -0700 (PDT) Received: from 640k.lan (94-39-141-76.adsl-ull.clienti.tiscali.it. [94.39.141.76]) by smtp.gmail.com with ESMTPSA id w10sm3849168wjz.9.2016.04.08.13.29.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Apr 2016 13:29:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 8 Apr 2016 22:28:30 +0200 Message-Id: <1460147350-7601-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1460147350-7601-1-git-send-email-pbonzini@redhat.com> References: <1460147350-7601-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::244 Subject: [Qemu-devel] [PATCH 10/50] target-m68k: make cpu-qom.h not target specific X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" 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);