From patchwork Tue Oct 23 17:04:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12444 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 D82ED23E29 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 4C6F9A188BF for ; Tue, 23 Oct 2012 17:04:38 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5437939iej.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=m8377i7Zou/Va1osKA1D1DTX8ZH6G0gSJjv/9lgCQXs=; b=XxASEOv1DVtuCq0VDjVhUW1bbB+L14rzA/Bw9Wv4xLSIMNLWO1Z0K9MSrvDeZFVWa9 JoqJ9b6piiTD8S4AbCuivn/tjBuFTF7J0LZw2ZxfrGGvyJJGu4eSwW2OrnbZz1ogANuZ qbqpPPgccW8xkc9dgLJUW9+fsXtN9X3S5YT7t5wHWbAsGNYi8tIijcl6N/IZ+s7WxugO ZwM1zTGSByUWSxKulK6hBPsAzUoSMUbruQLXs7D1kmKipkRkRJPJMX8KNI1R72hJJ6YJ tCgfYa9tIucZtg1lMYHk7bmFHgcpPVITp8eA8pKIsgmb/LXrIc+szrPHde4p6Hh+Rzs+ UoVw== Received: by 10.50.91.195 with SMTP id cg3mr20792741igb.57.1351011877718; 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 n20csp466099igt; Tue, 23 Oct 2012 10:04:36 -0700 (PDT) Received: by 10.205.127.146 with SMTP id ha18mr4040691bkc.130.1351011875255; 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 fo7si15844420bkc.43.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-0000RZ-Mo; Tue, 23 Oct 2012 18:04:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Eduardo Habkost Subject: [PATCH 1/7] hw/vexpress.c: Don't prematurely explode QEMUMachineInitArgs Date: Tue, 23 Oct 2012 18:04:24 +0100 Message-Id: <1351011870-1680-2-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: ALoCoQmG3oHs6ajLCGQKGxxD2g+QvYQ25tqlu5hgQIuxsbWuXKzIzIfiGQlNgzV6ipCF6TzxJgbi Don't explode QEMUMachineInitArgs before passing it to the vexpress common init function. Signed-off-by: Peter Maydell --- hw/vexpress.c | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/hw/vexpress.c b/hw/vexpress.c index 36503d6..cd5aafc 100644 --- a/hw/vexpress.c +++ b/hw/vexpress.c @@ -348,12 +348,7 @@ static const VEDBoardInfo a15_daughterboard = { }; static void vexpress_common_init(const VEDBoardInfo *daughterboard, - 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) + QEMUMachineInitArgs *args) { DeviceState *dev, *sysctl, *pl041; qemu_irq pic[64]; @@ -366,7 +361,8 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard, MemoryRegion *sram = g_new(MemoryRegion, 1); const target_phys_addr_t *map = daughterboard->motherboard_map; - daughterboard->init(daughterboard, ram_size, cpu_model, pic, &proc_id); + daughterboard->init(daughterboard, args->ram_size, args->cpu_model, + pic, &proc_id); /* Motherboard peripherals: the wiring is the same but the * addresses vary between the legacy and A-Series memory maps. @@ -454,10 +450,10 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard, /* VE_DAPROM: not modelled */ - vexpress_binfo.ram_size = ram_size; - vexpress_binfo.kernel_filename = kernel_filename; - vexpress_binfo.kernel_cmdline = kernel_cmdline; - vexpress_binfo.initrd_filename = initrd_filename; + vexpress_binfo.ram_size = args->ram_size; + vexpress_binfo.kernel_filename = args->kernel_filename; + vexpress_binfo.kernel_cmdline = args->kernel_cmdline; + vexpress_binfo.initrd_filename = args->initrd_filename; vexpress_binfo.nb_cpus = smp_cpus; vexpress_binfo.board_id = VEXPRESS_BOARD_ID; vexpress_binfo.loader_start = daughterboard->loader_start; @@ -469,28 +465,12 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard, static void vexpress_a9_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; - vexpress_common_init(&a9_daughterboard, - ram_size, boot_device, kernel_filename, - kernel_cmdline, initrd_filename, cpu_model); + vexpress_common_init(&a9_daughterboard, args); } static void vexpress_a15_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; - vexpress_common_init(&a15_daughterboard, - ram_size, boot_device, kernel_filename, - kernel_cmdline, initrd_filename, cpu_model); + vexpress_common_init(&a15_daughterboard, args); } static QEMUMachine vexpress_a9_machine = {