From patchwork Wed Mar 16 10:46:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 8599351 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 370C19F294 for ; Wed, 16 Mar 2016 11:59:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 736F7202A1 for ; Wed, 16 Mar 2016 11:59:30 +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 7B53020253 for ; Wed, 16 Mar 2016 11:59:29 +0000 (UTC) Received: from localhost ([::1]:55020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9BO-0004Xo-EZ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 07:00:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8zG-0003LF-UP for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag8zD-0002As-Vp for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:34 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag8zD-0002Ae-ML for qemu-devel@nongnu.org; Wed, 16 Mar 2016 06:47:31 -0400 Received: by mail-wm0-x22f.google.com with SMTP id l124so43285475wmf.1 for ; Wed, 16 Mar 2016 03:47:31 -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=hVjVLk5Ldsw/e7i2PBBfl60BG8vmVg2VyinN7GPU5Zc=; b=OwkRaCotUiR38OzTCoBWSxuiYyIVPd9OrYcaZF69aJpuaNo6CWvpTvIDBE5bNknWMP f7zyCVnVO0pWXLdaZYkwn5uUOJ9App3tYi6elnvE7yDUoH4tv4J2VSQdKcMsKuD6Ucr7 Xdey/L6tA38tsiCPHicJujmifzbkQyz86Gmv92bzfkj7wMiB2+Mkqqy/n1n7Zlj3XVoq CB0y9itPh26lgwKQWEWWPamWy2hGBPHSzRSOa/6asXWBhW2wjHV8WTPSHZDzDo61bmVU R7NamLqPiu2ELfV/MSHmoPq7E5ObjViybC14FvX7HtRjYQ4EThDLaWJDuk8/cy5jfedP AeyQ== 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=hVjVLk5Ldsw/e7i2PBBfl60BG8vmVg2VyinN7GPU5Zc=; b=DHWt4WjZSwhHEF74T/P6kml2aheV6NU58SekDZJNxVJ7GJdzsDLT5I8fUeXGL9BUhq 8cdtQA+B4JltLvY00gimBwpoX2miI/2vfYb3+rjc8Lz/qz5SAktNf1Ruao77u7P+sAyP KMnn8ZO0BM2N7WF3de2mGdKxjAwx3BDOWgG16ZHTxrWPQQuBSEuwXk9YnYEaVXide6dm DRZQiaWuX07uzYQdddTMV6hvGk2NPNXGPYP7hDUyziI7gQmWrSu27DtUJ1ZRP3tMoiDC cRA58ZRfSJtLh42IzMEMbONy8vy3d8kd/inDXeh/IcSXWwUnsMTV+4HhVwkA4AEs1swv j2yg== X-Gm-Message-State: AD7BkJKqbLB5a6x9cuQ+4O8qMKYSMTZxmGBwC6rszoL2pQ1e7HhWmU9L4B2kWVUDDHwyWw== X-Received: by 10.28.183.84 with SMTP id h81mr29928855wmf.100.1458125250986; Wed, 16 Mar 2016 03:47:30 -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.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 03:47:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 16 Mar 2016 11:46:35 +0100 Message-Id: <1458125219-131698-26-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::22f Subject: [Qemu-devel] [PATCH 25/49] mips: use MIPSCPU instead of CPUMIPSState 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 This changes a cpu.h dependency into a cpu-qom.h dependency. Signed-off-by: Paolo Bonzini --- hw/mips/cputimer.c | 4 +++- hw/mips/mips_fulong2e.c | 4 ++-- hw/mips/mips_int.c | 3 ++- hw/mips/mips_jazz.c | 4 ++-- hw/mips/mips_malta.c | 9 ++++----- hw/mips/mips_mipssim.c | 4 ++-- hw/mips/mips_r4k.c | 4 ++-- include/hw/mips/cpudevs.h | 7 +++++-- 8 files changed, 22 insertions(+), 17 deletions(-) diff --git a/hw/mips/cputimer.c b/hw/mips/cputimer.c index efb227d..8a166b3 100644 --- a/hw/mips/cputimer.c +++ b/hw/mips/cputimer.c @@ -151,8 +151,10 @@ static void mips_timer_cb (void *opaque) env->CP0_Count--; } -void cpu_mips_clock_init (CPUMIPSState *env) +void cpu_mips_clock_init (MIPSCPU *cpu) { + CPUMIPSState *env = &cpu->env; + /* * If we're in KVM mode, don't create the periodic timer, that is handled in * kernel. diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index bdb716e7..889cdc7 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -334,8 +334,8 @@ static void mips_fulong2e_init(MachineState *machine) } /* Init internal devices */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); /* North bridge, Bonito --> IP2 */ pci_bus = bonito_init((qemu_irq *)&(env->irq[2])); diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c index 59081f9..48192d2 100644 --- a/hw/mips/mips_int.c +++ b/hw/mips/mips_int.c @@ -58,8 +58,9 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) } } -void cpu_mips_irq_init_cpu(CPUMIPSState *env) +void cpu_mips_irq_init_cpu(MIPSCPU *cpu) { + CPUMIPSState *env = &cpu->env; qemu_irq *qi; int i; diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index d6d8058..dc7423d 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -200,8 +200,8 @@ static void mips_jazz_init(MachineState *machine, } /* Init CPU internal devices */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); /* Chipset */ rc4030 = rc4030_init(&dmas, &rc4030_dma_mr); diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 4ff1bb2..468d297 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -977,11 +977,10 @@ void mips_malta_init(MachineState *machine) fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } - env = &cpu->env; /* Init internal devices */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); qemu_register_reset(main_cpu_reset, cpu); } cpu = MIPS_CPU(first_cpu); @@ -1136,8 +1135,8 @@ void mips_malta_init(MachineState *machine) stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420); /* Init internal devices */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); /* * We have a circular dependency problem: pci_bus depends on isa_irq, diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index a2c2a16..1b91195 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -216,8 +216,8 @@ mips_mipssim_init(MachineState *machine) } /* Init CPU internal devices. */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); /* Register 64 KB of ISA IO space at 0x1fd00000. */ memory_region_init_alias(isa, NULL, "isa_mmio", diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 21aca98..16a59c7 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -267,8 +267,8 @@ void mips_r4k_init(MachineState *machine) } /* Init CPU internal devices */ - cpu_mips_irq_init_cpu(env); - cpu_mips_clock_init(env); + cpu_mips_irq_init_cpu(cpu); + cpu_mips_clock_init(cpu); /* ISA bus: IO space at 0x14000000, mem space at 0x10000000 */ memory_region_init_alias(isa_io, NULL, "isa-io", diff --git a/include/hw/mips/cpudevs.h b/include/hw/mips/cpudevs.h index b2626f2..8673daa 100644 --- a/include/hw/mips/cpudevs.h +++ b/include/hw/mips/cpudevs.h @@ -1,5 +1,8 @@ #ifndef HW_MIPS_CPUDEVS_H #define HW_MIPS_CPUDEVS_H + +#include "target-mips/cpu-qom.h" + /* Definitions for MIPS CPU internal devices. */ /* mips_addr.c */ @@ -9,9 +12,9 @@ uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr); /* mips_int.c */ -void cpu_mips_irq_init_cpu(CPUMIPSState *env); +void cpu_mips_irq_init_cpu(MIPSCPU *cpu); /* mips_timer.c */ -void cpu_mips_clock_init(CPUMIPSState *); +void cpu_mips_clock_init(MIPSCPU *cpu); #endif