From patchwork Wed Oct 24 13:21:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12469 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 EFBF823E29 for ; Wed, 24 Oct 2012 13:22:10 +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 9E176A187B8 for ; Wed, 24 Oct 2012 13:22:10 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so593288iej.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=0BDxacaZgf0c2kZ4xWMYAj0XDBlNsHHaPfK9+H+nI9s=; b=aTNC1+wwK8KyhDgmvUoZ8+pBwaQGsOkJQ2qrc18RFBM+mAMugcNo8qBYpJzcDuV9NY KJlbwBlml6ZKKyW70ScXEuGdUJij21W2XzbUYNzlwUa4LHjuOeTQRQcqQUSwyxin1W6R uXGDKPLxbR1pnGrH0mUDEG6t5bXp1H7U3Jw2TS4jaz3m75OipGIb2e8x6M3QY5QvS1ic 21ASFBcQaCdtpPz33a4vtXhCUHR74VttSwDnkTgqBS3u5b6ZuKx65YIjJ/5v5aHrQdYp WWWwcIeJcDh6jXpNzVuxTy5leHYD61lgZ/SL5doEYkdzZ8tME5yNVYaGQMsna8si94gu YMGg== Received: by 10.42.145.66 with SMTP id e2mr13573482icv.18.1351084930362; 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 n20csp613639igt; Wed, 24 Oct 2012 06:22:08 -0700 (PDT) Received: by 10.216.201.24 with SMTP id a24mr9754250weo.102.1351084928104; 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 o10si4493459wiy.30.2012.10.24.06.22.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 06:22:07 -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-0000yg-7F; 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 3/8] hw/versatilepb: Don't prematurely explode QEMUMachineInitArgs Date: Wed, 24 Oct 2012 14:21:59 +0100 Message-Id: <1351084924-3729-4-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: ALoCoQnrnPzpXDUoM49rGf45JmbdNKeIkWNtGEB6fmFt5v2Aex/HAj0lA6///kNGWtNL+o0A7JdE Don't explode QEMUMachineInitArgs before passing it to the common versatile init function. Signed-off-by: Peter Maydell --- hw/versatilepb.c | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/hw/versatilepb.c b/hw/versatilepb.c index f55bd0c..02c750b 100644 --- a/hw/versatilepb.c +++ b/hw/versatilepb.c @@ -167,11 +167,7 @@ static int vpb_sic_init(SysBusDevice *dev) static struct arm_boot_info versatile_binfo; -static void versatile_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, - int board_id) +static void versatile_init(QEMUMachineInitArgs *args, int board_id) { ARMCPU *cpu; MemoryRegion *sysmem = get_system_memory(); @@ -189,15 +185,15 @@ static void versatile_init(ram_addr_t ram_size, int done_smc = 0; DriveInfo *dinfo; - if (!cpu_model) { - cpu_model = "arm926"; + if (!args->cpu_model) { + args->cpu_model = "arm926"; } - cpu = cpu_arm_init(cpu_model); + cpu = cpu_arm_init(args->cpu_model); if (!cpu) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } - memory_region_init_ram(ram, "versatile.ram", ram_size); + memory_region_init_ram(ram, "versatile.ram", args->ram_size); vmstate_register_ram_global(ram); /* ??? RAM should repeat to fill physical memory space. */ /* SDRAM at address zero. */ @@ -340,40 +336,22 @@ static void versatile_init(ram_addr_t ram_size, fprintf(stderr, "qemu: Error registering flash memory.\n"); } - versatile_binfo.ram_size = ram_size; - versatile_binfo.kernel_filename = kernel_filename; - versatile_binfo.kernel_cmdline = kernel_cmdline; - versatile_binfo.initrd_filename = initrd_filename; + versatile_binfo.ram_size = args->ram_size; + versatile_binfo.kernel_filename = args->kernel_filename; + versatile_binfo.kernel_cmdline = args->kernel_cmdline; + versatile_binfo.initrd_filename = args->initrd_filename; versatile_binfo.board_id = board_id; arm_load_kernel(cpu, &versatile_binfo); } static void vpb_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; - versatile_init(ram_size, - boot_device, - kernel_filename, kernel_cmdline, - initrd_filename, cpu_model, 0x183); + versatile_init(args, 0x183); } static void vab_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; - versatile_init(ram_size, - boot_device, - kernel_filename, kernel_cmdline, - initrd_filename, cpu_model, 0x25e); + versatile_init(args, 0x25e); } static QEMUMachine versatilepb_machine = {