From patchwork Tue Oct 23 17:04:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12443 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 66D1123FB6 for ; Tue, 23 Oct 2012 17:04:38 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id EE3D3A18CFA for ; Tue, 23 Oct 2012 17:04:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5437930iej.11 for ; Tue, 23 Oct 2012 10:04:37 -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=VsuIX2fL+IUt1ASoVzvPz5V23WdgdOhu4XXSKFzXhM8=; b=MbJztSd3yDD9AXcH7xekjIshGkq0Vocgu9+BxkEF/wnD9aMkmpPmlZQ5ZQNxffiGi3 BdzJcvrnUS79tYZs+AIaayFKidzsUuV0muanHY2sehy+CFhU15dngIg8CnkTNE51WDJ3 DeCjRXg+zh2AVOv+Vbc4EbtmT+eb+9oOI8B1XfUhAHOVju1mSjY3P2/FyK9j7LeWGJ/k Hlln3+UWxYSU5jZa4lQqQV82+81gCbRhBQhyCta+VjoE9u+enlCO0YUedT1xCRU2jkqs vcey5mA8agXOb4U2SlZDI0/LBncZTmTjVNRWdvH1xIG6iEVi4p1cw1KP51txOnqowa5X N8yg== Received: by 10.50.194.169 with SMTP id hx9mr13672729igc.70.1351011877359; Tue, 23 Oct 2012 10:04:37 -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 n20csp466103igt; Tue, 23 Oct 2012 10:04:36 -0700 (PDT) Received: by 10.152.105.236 with SMTP id gp12mr12044442lab.35.1351011875376; Tue, 23 Oct 2012 10:04:35 -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 tp6si9750929lab.27.2012.10.23.10.04.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 10:04:35 -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-0000Rj-TA; Tue, 23 Oct 2012 18:04:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Eduardo Habkost Subject: [PATCH 6/7] hw/nseries: Don't prematurely explode QEMUMachineInitArgs Date: Tue, 23 Oct 2012 18:04:29 +0100 Message-Id: <1351011870-1680-7-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: ALoCoQkgFE+OthPnhWk8pLZ36u/+slyKaH/nJVSO85ahvR1S0D+Bxj72hVRGp3leRp8tVImQQQX5 Don't explode QEMUMachineInitArgs before passing it to n8x0_init(). Signed-off-by: Peter Maydell --- hw/nseries.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/hw/nseries.c b/hw/nseries.c index 7ada90d..6560d3c 100644 --- a/hw/nseries.c +++ b/hw/nseries.c @@ -1284,17 +1284,15 @@ static int n810_atag_setup(const struct arm_boot_info *info, void *p) return n8x0_atag_setup(p, 810); } -static void n8x0_init(ram_addr_t ram_size, const char *boot_device, - const char *kernel_filename, - const char *kernel_cmdline, const char *initrd_filename, - const char *cpu_model, struct arm_boot_info *binfo, int model) +static void n8x0_init(QEMUMachineInitArgs *args, + struct arm_boot_info *binfo, int model) { MemoryRegion *sysmem = get_system_memory(); struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s)); int sdram_size = binfo->ram_size; DisplayState *ds; - s->mpu = omap2420_mpu_init(sysmem, sdram_size, cpu_model); + s->mpu = omap2420_mpu_init(sysmem, sdram_size, args->cpu_model); /* Setup peripherals * @@ -1337,17 +1335,18 @@ static void n8x0_init(ram_addr_t ram_size, const char *boot_device, if (usb_enabled) n8x0_usb_setup(s); - if (kernel_filename) { + if (args->kernel_filename) { /* Or at the linux loader. */ - binfo->kernel_filename = kernel_filename; - binfo->kernel_cmdline = kernel_cmdline; - binfo->initrd_filename = initrd_filename; + binfo->kernel_filename = args->kernel_filename; + binfo->kernel_cmdline = args->kernel_cmdline; + binfo->initrd_filename = args->initrd_filename; arm_load_kernel(s->mpu->cpu, binfo); qemu_register_reset(n8x0_boot_init, s); } - if (option_rom[0].name && (boot_device[0] == 'n' || !kernel_filename)) { + if (option_rom[0].name && + (args->boot_device[0] == 'n' || !args->kernel_filename)) { int rom_size; uint8_t nolo_tags[0x10000]; /* No, wait, better start at the ROM. */ @@ -1399,28 +1398,12 @@ static struct arm_boot_info n810_binfo = { static void n800_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; - const char *boot_device = args->boot_device; - return n8x0_init(ram_size, boot_device, - kernel_filename, kernel_cmdline, initrd_filename, - cpu_model, &n800_binfo, 800); + return n8x0_init(args, &n800_binfo, 800); } static void n810_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; - const char *boot_device = args->boot_device; - return n8x0_init(ram_size, boot_device, - kernel_filename, kernel_cmdline, initrd_filename, - cpu_model, &n810_binfo, 810); + return n8x0_init(args, &n810_binfo, 810); } static QEMUMachine n800_machine = {