From patchwork Thu May 19 11:18:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9126571 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 D7C7D9F1C3 for ; Thu, 19 May 2016 11:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 197A520219 for ; Thu, 19 May 2016 11:24:54 +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 556BA2021B for ; Thu, 19 May 2016 11:24:53 +0000 (UTC) Received: from localhost ([::1]:49711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3M4S-0000hl-35 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 07:24:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Lyy-0004DP-PA for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3Lyn-00044E-G6 for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:12 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Lyn-00043y-5q for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:01 -0400 Received: by mail-wm0-x243.google.com with SMTP id s63so5550184wme.2 for ; Thu, 19 May 2016 04:19:01 -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=DQE0YKwh784dKeHxXlucT56xWozTv0lderuCoLapI4Q=; b=rAe9vcELUg7FEC8DNGPZ4IH4DbFbJRSUtfFYjDi/qA02SC8E67BUcV78nEPHG4KIqg 0ZGQPL5wFSmTxIXo1gN0q7LpOXgaEE/AEQ/BUdXqiI29qpTIj4BL9SO0bMksovy3g82G PSrD2CqF8o37BULtUB+k9GnccuIra9XSnoc7lcTsEmxfGjAYfR8SyrD0ZSgf3iQqwQkW pqbo5eC+E7/qjQncMwzxb2WiXOc6ed+0hZpJIA7Q5Z8ZLxe/z5BIxmewGkQbAMhZmR0+ SCB9joTLxqA/RAxmw51ElcRCU27Wh9wQ9+HITo49avLD/qD8gjgQoT6e0cnSS08ELuDq RChg== 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=DQE0YKwh784dKeHxXlucT56xWozTv0lderuCoLapI4Q=; b=O5b0y+EiZ/K9Dm3xJtdPnUSj+VrBfvCNHKi47CSJD3qYFMCE8ZeUiWWvAwrUHm/IMj vXTqjsSJ8wG4whAFFXDl4n62CyX38svkDn1GFkES7LJGwODl57MH8tNXKdp8VRJRbWn2 2AMpZsB6wC/tpDPA/AimD0Fbsr+IeuYUm/emWOge6kKuBp90CZHUH5EGHXZkn2vEYwQk ygWc+EM4bdt4TUDdCftc1t4ABlXIHjP7LsgMDyOBTuM4A0mw0g3/1m9eFb5amTGOmzbr yHk8UQ91oGINHKUBt6Wd04NXGEc8GwNvLWI1cuBU0Z21ojYK2kD6iUfrV66+qmQyVj6L HJyA== X-Gm-Message-State: AOPr4FXW7gPqKtE0ZQSmqjgVZwxCu+26jp4tQNgYyJtr1Owtn6404dC37FNxamYhxuwDyQ== X-Received: by 10.194.6.65 with SMTP id y1mr13015283wjy.12.1463656740668; Thu, 19 May 2016 04:19:00 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-252-58.clienti.tiscali.it. [78.12.252.58]) by smtp.gmail.com with ESMTPSA id c7sm8374317wji.38.2016.05.19.04.18.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 04:18:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 19 May 2016 13:18:05 +0200 Message-Id: <1463656726-35952-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1463656726-35952-1-git-send-email-pbonzini@redhat.com> References: <1463656726-35952-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::243 Subject: [Qemu-devel] [PULL 11/52] 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. Reviewed-by: Thomas Huth 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 d2f467c..86a1ff0 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);