From patchwork Wed Mar 16 10:46:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8597771 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 8FF2EC0553 for ; Wed, 16 Mar 2016 10:54:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9CE82026C for ; Wed, 16 Mar 2016 10:54:05 +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 CBFA9202F2 for ; Wed, 16 Mar 2016 10:54:04 +0000 (UTC) Received: from localhost ([::1]:54964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag95Y-0006ZS-5M for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 06:54:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8z4-0002yb-Dl for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag8z3-000256-5A for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:22 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:35603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8z2-00024x-Rg for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:21 -0400 Received: by mail-wm0-x22c.google.com with SMTP id l68so183359101wml.0 for ; Wed, 16 Mar 2016 03:47:20 -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=qbSqbK8ePFOgsWdpKMPnvCVzJMCfQ54HKzCgIDnhix0=; b=Lk/oJFn+nDA0IJNr27ZVx0bDHgZwcxDv5RV8eSIjxOG8EpjPGisLw8JaWm5QbS7aCV wBIBk1lWi56IqvqtmGqs+/10Xr2Or++FyTA1jCDYKbKSvw6WwsqbL19GCT1IuV47UvGn ZStsN9iKnxRo9Ew5hJISkqRHtbOIKjbfLjtCAN2UrQaB1/UB1qQ8l73pNf4pZJ1mObf4 2FO+3xcq5B1OTPjuyDqnv8KKHAptLxDz1Zm4vHSX9nRk3jMaWSsnvPZp4+ZiYdsSG7Ce pM1xyk9is5aPheW/sXkuyJASXSZPYOA7p2GH2TbtxiWS3quk39OnI6vwiuT0OY205Grx bCvg== 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=qbSqbK8ePFOgsWdpKMPnvCVzJMCfQ54HKzCgIDnhix0=; b=XHU9Sr3UPSufpdiY0GGGVaYtv2FF45S+bPPHXA89BOUhcotuOfSc/TXq9M0EaXCeIF xMtsiGQLXC07ziQM+9I2bzDl0tfEGae+l+Wn33dIXBhUfgdPqkbAKEkn881lmYn2tzZ8 bmm4v45MdxKon7NDiaOoh/fZ5BM77x8piK5Hwo4nFIULjaF5oj/aSP1KVx5bDFTGkXh1 qOnlJt2fTw7xlYRj7aujQAVDKoexX9vi7y6rRUoiPhg/1mWuwj+7lPQgjdfyIXWLU32K 3UbLUrwvE0xwlMoUoMJyNtzrpKE+eIciieVBrada/5sey1D/TS3381F2in9jAFgOKtGM rXbg== X-Gm-Message-State: AD7BkJIFozpDrXZISHCdGXexVnQQF+th8zrU3D/HuFHsm6wBnhOyUfOQdU5dZ+zcWquS1w== X-Received: by 10.28.148.8 with SMTP id w8mr29119598wmd.90.1458125240155; Wed, 16 Mar 2016 03:47:20 -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.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 03:47:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 16 Mar 2016 11:46:25 +0100 Message-Id: <1458125219-131698-16-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::22c Subject: [Qemu-devel] [PATCH 15/49] target-s390x: 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 S390XCPU 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-s390x/cpu-qom.h | 45 +-------------------------------------------- target-s390x/cpu.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 45 deletions(-) diff --git a/target-s390x/cpu-qom.h b/target-s390x/cpu-qom.h index 681e370..66b5d18 100644 --- a/target-s390x/cpu-qom.h +++ b/target-s390x/cpu-qom.h @@ -55,49 +55,6 @@ typedef struct S390CPUClass { void (*initial_cpu_reset)(CPUState *cpu); } S390CPUClass; -/** - * S390CPU: - * @env: #CPUS390XState. - * - * An S/390 CPU. - */ -typedef struct S390CPU { - /*< private >*/ - CPUState parent_obj; - /*< public >*/ - - CPUS390XState env; - int64_t id; - /* needed for live migration */ - void *irqstate; - uint32_t irqstate_saved_size; -} S390CPU; - -static inline S390CPU *s390_env_get_cpu(CPUS390XState *env) -{ - return container_of(env, S390CPU, env); -} - -#define ENV_GET_CPU(e) CPU(s390_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(S390CPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_s390_cpu; -#endif - -void s390_cpu_do_interrupt(CPUState *cpu); -bool s390_cpu_exec_interrupt(CPUState *cpu, int int_req); -void s390_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, - int flags); -int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, - int cpuid, void *opaque); - -hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); -int s390_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); -int s390_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void s390_cpu_gdb_init(CPUState *cs); -void s390x_cpu_debug_excp_handler(CPUState *cs); +typedef struct S390CPU S390CPU; #endif diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 6d97c08..760eadf 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -23,6 +23,7 @@ #define CPU_S390X_H #include "qemu-common.h" +#include "cpu-qom.h" #define TARGET_LONG_BITS 64 @@ -171,7 +172,51 @@ static inline CPU_DoubleU *get_freg(CPUS390XState *cs, int nr) return &cs->vregs[nr][0]; } -#include "cpu-qom.h" +/** + * S390CPU: + * @env: #CPUS390XState. + * + * An S/390 CPU. + */ +struct S390CPU { + /*< private >*/ + CPUState parent_obj; + /*< public >*/ + + CPUS390XState env; + int64_t id; + /* needed for live migration */ + void *irqstate; + uint32_t irqstate_saved_size; +}; + +static inline S390CPU *s390_env_get_cpu(CPUS390XState *env) +{ + return container_of(env, S390CPU, env); +} + +#define ENV_GET_CPU(e) CPU(s390_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(S390CPU, env) + +#ifndef CONFIG_USER_ONLY +extern const struct VMStateDescription vmstate_s390_cpu; +#endif + +void s390_cpu_do_interrupt(CPUState *cpu); +bool s390_cpu_exec_interrupt(CPUState *cpu, int int_req); +void s390_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, + int flags); +int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, + int cpuid, void *opaque); + +hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); +int s390_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); +int s390_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); +void s390_cpu_gdb_init(CPUState *cs); +void s390x_cpu_debug_excp_handler(CPUState *cs); + #include /* distinguish between 24 bit and 31 bit addressing */