From patchwork Thu May 19 11:18:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9126931 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 614C29FCE6 for ; Thu, 19 May 2016 11:41:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A30F2020F for ; Thu, 19 May 2016 11:41:00 +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 BB53620211 for ; Thu, 19 May 2016 11:40:58 +0000 (UTC) Received: from localhost ([::1]:49796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3MK1-00070y-QE for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 07:40:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Lyz-0004FE-Oy for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3Lyt-000469-IX for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:13 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Lys-00045y-U2 for qemu-devel@nongnu.org; Thu, 19 May 2016 07:19:07 -0400 Received: by mail-wm0-x244.google.com with SMTP id s63so5550731wme.2 for ; Thu, 19 May 2016 04:19:06 -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=JpyrnWR1hur3zG8n16wfiGoGPf3IkUVJ19ynmKNr8aw=; b=I8cszsj3qamTDA7ibYcGlynxyNcBV95AOuWDa/g1MutskKW2MjeL49GK0Gx4A2KIXW UthAayCpEN9f+7mZiqlpOqqVzkfmR077vJAN6lJwpPiJBU3kvcoemVOPox8mmNH2O1b4 Jeg1xpFxxCu4jO7+rQQvT0L3H4ce+SerWq6fhblEHONtkzFv6ZI737mqGIR/k/kc1Jmr 99NWneve/ybBreKNjCowBHC4hk83Wb9ACMqu+vnYrdT6sYK01+XGGY5tF4tRI14BK066 iMOAAlIZe4tyPCQ6LWWcbMkkf6rQKwYvCcPZUYW0nZ1Lp11FsntUnswndWDEdL1m9288 KhBw== 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=JpyrnWR1hur3zG8n16wfiGoGPf3IkUVJ19ynmKNr8aw=; b=cejvRwyUUHeoE8YxZPOVCgmfEaMbtuYIZDnZagWSPTgvx6QilLDpxbnvAdp9voIfhY pcF7fv9YrGHapEn2guArgdoOz1RUjdIYlaZkOTexbgWiBCTJ0Yt5NWAhpaqixYOZztxm NKa9sIMGZ4+J5XHF5IP4/MKFhIiC+4Mthdgz4RK3++uH2qoYmYV3RLMwz4/QnKrqF3JA fLx05G0IKB1w9A3vgWqOJwvhMnjg8YQH9TlMd/3mpCSh2zCPOgp4NNQBK+3BlbEr6JX1 oGw3FNui3Lw7mcrCH8W1FBeH9uDfcC4KmxuO0AOYTgUuk4Ih3LmH3W7QSJIf+PdCLvek NbCw== X-Gm-Message-State: AOPr4FUnzsGQsxZA8Un+C2xBdm2Ro0erW+1scoQZdBuFZyExUq8BXfyQj7q9HAWCc8NZbA== X-Received: by 10.194.149.37 with SMTP id tx5mr14157257wjb.94.1463656746389; Thu, 19 May 2016 04:19:06 -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.19.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 04:19:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 19 May 2016 13:18:11 +0200 Message-Id: <1463656726-35952-18-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::244 Subject: [Qemu-devel] [PULL 17/52] target-s390x: 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 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. Acked-by: Cornelia Huck 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 00e9f69..c99b7d0 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 @@ -173,7 +174,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 */