From patchwork Wed Oct 24 13:21:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12471 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 AFCC323E29 for ; Wed, 24 Oct 2012 13:22:11 +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 3AF66A187B8 for ; Wed, 24 Oct 2012 13:22:11 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so345892iag.11 for ; Wed, 24 Oct 2012 06:22:10 -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=45Js4aFSnXayUKsvV7ushLxCyjc43SW3O0dCyjmJs3s=; b=TIHE7YpqMWvBCdM8ak1kPzUESWglrVkkl7lgz8OMiZOV0liPrghrXRrvWkgAcKFhV5 aUBjGPE68yYgdFQ9nO+ydp0yLiT8VKWi6i8mlTSDfeOBKAF57hCRxXqUkIKqVN7C6oJB ufE/H9sF0fz1igaVeRxXRHYuJiTB1w6O1H8My33E/lZ3knkP6MfezfBUsC+cRjjAkh2E dmWPQsI1o7nGceXyteZmIGO6HNQJ5NADySyxoNKg3PQRUVKiDX5EP98t7n9FkYszwR/o j7dkIGMe2/KCA0x7PKHnKuzDO2KWVYCTqiBTK+v3CIX8SsZ9iaDPUHBxkP89XFP2DnTy Pb6w== Received: by 10.50.100.137 with SMTP id ey9mr2320949igb.57.1351084930666; Wed, 24 Oct 2012 06:22:10 -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 n20csp613644igt; Wed, 24 Oct 2012 06:22:09 -0700 (PDT) Received: by 10.112.38.65 with SMTP id e1mr6600670lbk.15.1351084928472; Wed, 24 Oct 2012 06:22:08 -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 fm4si10830262lbb.16.2012.10.24.06.22.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 06:22:08 -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-0000yc-49; 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 1/8] hw/vexpress.c: Don't prematurely explode QEMUMachineInitArgs Date: Wed, 24 Oct 2012 14:21:57 +0100 Message-Id: <1351084924-3729-2-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: ALoCoQkn1CjwfWBnObjqPNFgh95RaNsmFwRjuwINjLsw+I1WLwdeewsQUJPVISI5OilE+hf66VP6 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 3f7cb66..d93f057 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 hwaddr *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 = {