From patchwork Wed Oct 24 13:22:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12473 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0537F23E29 for ; Wed, 24 Oct 2012 13:22:13 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A2681A18805 for ; Wed, 24 Oct 2012 13:22:12 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so345892iag.11 for ; Wed, 24 Oct 2012 06:22:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=J4wD1d+gX/jQuEGBFfQUN0JWDInNV5zcSkQRxQJAkrw=; b=HDz4+05aRNaKtAXYw6P6qnkljIJQNC1VkjaTtjglFbavkfePAqQWzv6ZJtNgfLwIFH dfF/OhcjO0pgYAJL8apj8u9XUyRfVEWxXYeMJe3Ar3qRlDlMRyT6Ac3MNDZ61UtC1Guz Udt9zE1/zJxjlXZMJ9ST0PKz1lsLPTjEia4zdbQt/1Ms8iscaaVyFA3B2tyzbxEMo5ih z+Y6361F7zNQSL4+MulS58Fvb+pzIlb6lDEkA2URqfwFOkpNqp+MTkYUWZxyAA8FYoQ/ tO+OFwpeG3luL1mrFlMDDpXNxv/LOPsQo0cJmMTvC9+QwdHjNxFY8CORxrlUPA2yYVkr NWGQ== Received: by 10.50.88.233 with SMTP id bj9mr2277461igb.70.1351084932416; Wed, 24 Oct 2012 06:22:12 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp613655igt; Wed, 24 Oct 2012 06:22:11 -0700 (PDT) Received: by 10.180.7.197 with SMTP id l5mr2541320wia.13.1351084930386; Wed, 24 Oct 2012 06:22:10 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id k36si15760482wen.141.2012.10.24.06.22.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 06:22:10 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TR0uL-0000yo-Cc; Wed, 24 Oct 2012 14:22:05 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Eduardo Habkost Subject: [PATCH v2 7/8] hw/mainstone: Don't prematurely explode QEMUMachineInitArgs Date: Wed, 24 Oct 2012 14:22:03 +0100 Message-Id: <1351084924-3729-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1351084924-3729-1-git-send-email-peter.maydell@linaro.org> References: <1351084924-3729-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQni4pSmb/W9y75OM7ZXU8HbynSWff6L9FjCpjdFlXDl5mxjql61JxpUbIPZQ7gaL0IQjxiP Don't explode QEMUMachineInitArgs before passing it to mainstone_init(). Signed-off-by: Peter Maydell --- hw/mainstone.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/mainstone.c b/hw/mainstone.c index 3266946..5bbecb7 100644 --- a/hw/mainstone.c +++ b/hw/mainstone.c @@ -95,10 +95,8 @@ static struct arm_boot_info mainstone_binfo = { }; static void mainstone_common_init(MemoryRegion *address_space_mem, - ram_addr_t ram_size, - const char *kernel_filename, - const char *kernel_cmdline, const char *initrd_filename, - const char *cpu_model, enum mainstone_model_e model, int arm_id) + QEMUMachineInitArgs *args, + enum mainstone_model_e model, int arm_id) { uint32_t sector_len = 256 * 1024; hwaddr mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 }; @@ -108,6 +106,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, int i; int be; MemoryRegion *rom = g_new(MemoryRegion, 1); + const char *cpu_model = args->cpu_model; if (!cpu_model) cpu_model = "pxa270-c5"; @@ -164,22 +163,16 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, smc91c111_init(&nd_table[0], MST_ETH_PHYS, qdev_get_gpio_in(mst_irq, ETHERNET_IRQ)); - mainstone_binfo.kernel_filename = kernel_filename; - mainstone_binfo.kernel_cmdline = kernel_cmdline; - mainstone_binfo.initrd_filename = initrd_filename; + mainstone_binfo.kernel_filename = args->kernel_filename; + mainstone_binfo.kernel_cmdline = args->kernel_cmdline; + mainstone_binfo.initrd_filename = args->initrd_filename; mainstone_binfo.board_id = arm_id; arm_load_kernel(mpu->cpu, &mainstone_binfo); } static void mainstone_init(QEMUMachineInitArgs *args) { - ram_addr_t ram_size = args->ram_size; - const char *cpu_model = args->cpu_model; - const char *kernel_filename = args->kernel_filename; - const char *kernel_cmdline = args->kernel_cmdline; - const char *initrd_filename = args->initrd_filename; - mainstone_common_init(get_system_memory(), ram_size, kernel_filename, - kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196); + mainstone_common_init(get_system_memory(), args, mainstone, 0x196); } static QEMUMachine mainstone2_machine = {