From patchwork Sun Jul 10 18:14:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 104096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7CD90B6F9F for ; Mon, 11 Jul 2011 05:39:05 +1000 (EST) Received: from localhost ([::1]:46128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfzqH-00088C-72 for incoming@patchwork.ozlabs.org; Sun, 10 Jul 2011 15:39:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfyXO-0004GR-NS for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfyXE-0007XX-Ay for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfyXD-0007WF-7f for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:15 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6AIFEEx027507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 Jul 2011 14:15:14 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6AIFDjR032728; Sun, 10 Jul 2011 14:15:14 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 2C9D0250B3C; Sun, 10 Jul 2011 21:15:11 +0300 (IDT) From: Avi Kivity To: qemu-devel@nongnu.org Date: Sun, 10 Jul 2011 21:14:26 +0300 Message-Id: <1310321709-30770-14-git-send-email-avi@redhat.com> In-Reply-To: <1310321709-30770-1-git-send-email-avi@redhat.com> References: <1310321709-30770-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kvm@vger.kernel.org Subject: [Qemu-devel] [RFC v3 13/56] pc: move global memory map out of pc_init1() and into its callers 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Avi Kivity --- hw/pc_piix.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index d83854c..f2d0476 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -68,7 +68,8 @@ static void ioapic_init(IsaIrqState *isa_irq_state) } /* PC hardware initialisation */ -static void pc_init1(ram_addr_t ram_size, +static void pc_init1(MemoryRegion *system_memory, + ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, @@ -91,9 +92,6 @@ static void pc_init1(ram_addr_t ram_size, DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BusState *idebus[MAX_IDE_BUS]; ISADevice *rtc_state; - MemoryRegion *system_memory; - - system_memory = get_system_memory(); pc_cpus_init(cpu_model); @@ -214,7 +212,8 @@ static void pc_init_pci(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { - pc_init1(ram_size, boot_device, + pc_init1(get_system_memory(), + ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 1, 1); } @@ -226,7 +225,8 @@ static void pc_init_pci_no_kvmclock(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { - pc_init1(ram_size, boot_device, + pc_init1(get_system_memory(), + ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 1, 0); } @@ -240,7 +240,8 @@ static void pc_init_isa(ram_addr_t ram_size, { if (cpu_model == NULL) cpu_model = "486"; - pc_init1(ram_size, boot_device, + pc_init1(get_system_memory(), + ram_size, boot_device, kernel_filename, kernel_cmdline, initrd_filename, cpu_model, 0, 1); }