From patchwork Tue Oct 23 17:04:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12447 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 DEB2F23E29 for ; Tue, 23 Oct 2012 17:04:43 +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 8B3BFA18B7B for ; Tue, 23 Oct 2012 17:04:43 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so3032377iag.11 for ; Tue, 23 Oct 2012 10:04:43 -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=xPsH80eNaLoG3py4ztr9A3RDXyz34+HcrywiqhqGIyA=; b=QwVF2BkuuvJRwSeZRLF36kBbnGsXrBt+hjarHguxnloCQQY1eueV1Hmj5Uny1ksvc9 Z2ffoBOrp1F6ZI87/mkU91SIs+e4ebziTaH8+MICzGiJ/u+tys4/ppip5VkmC/VYCEUV jEV/pC3BVjZyGGrW1Cm99LMUpNZG71ER2+GPTsRKmZNJy54bNVIJKHXZA2pMJQ6dKlVu yHJKEE2pZ5rer62phBNWtuJzMzG7dqiEgy3cQ75DhGguKTqbp30Z0vw+T0OkPIYNUyMs WrQUN1aQU1viN69Mh6hG3QvjkzTu5tKHRVxD1h0YVjqyOc3AfUoTyZGLJJKoRxf8vvwN VgEA== Received: by 10.43.7.132 with SMTP id oo4mr11452487icb.6.1351011882955; Tue, 23 Oct 2012 10:04:42 -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 n20csp466130igt; Tue, 23 Oct 2012 10:04:42 -0700 (PDT) Received: by 10.180.108.38 with SMTP id hh6mr27767955wib.0.1351011881829; Tue, 23 Oct 2012 10:04:41 -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 g47si13185772wep.42.2012.10.23.10.04.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 10:04:41 -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 1TQhu2-0000Rl-UK; Tue, 23 Oct 2012 18:04:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Eduardo Habkost Subject: [PATCH 7/7] hw/mainstone: Don't prematurely explode QEMUMachineInitArgs Date: Tue, 23 Oct 2012 18:04:30 +0100 Message-Id: <1351011870-1680-8-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1351011870-1680-1-git-send-email-peter.maydell@linaro.org> References: <1351011870-1680-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQm8/tsFgEHCkjezZAtZGykx9AO/piYmy9TYOaC+w94kh+Om50uaGOZjoAKJ4jjdx/wdtMgq 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 c0d6034..95a6d61 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; target_phys_addr_t 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 = {