From patchwork Thu Oct 25 08:47:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 194075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AECE82C0097 for ; Thu, 25 Oct 2012 19:48:00 +1100 (EST) Received: from localhost ([::1]:45521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJ6c-0005KQ-GH for incoming@patchwork.ozlabs.org; Thu, 25 Oct 2012 04:47:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJ6V-0005KE-W2 for qemu-devel@nongnu.org; Thu, 25 Oct 2012 04:47:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRJ6U-00056t-VT for qemu-devel@nongnu.org; Thu, 25 Oct 2012 04:47:51 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:54329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJ6U-00056l-Oe for qemu-devel@nongnu.org; Thu, 25 Oct 2012 04:47:50 -0400 Received: by mail-la0-f45.google.com with SMTP id m13so1127896lah.4 for ; Thu, 25 Oct 2012 01:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=pWchwjVYysMpZYmxOJLXW9iSso06kBnj2ROSgCPJboY=; b=fc2pdoTsc8PA38aUqNSA9bGLi9YE3wIDniHi6CKtCxxAxnRF/4YzMHxe3lWG6Qc9pg fldMpvt/Q1V/e1UWw/GXaVBtldLpFhbTICFY9JZP7wpmhOAtVIMsbhVVmOENrxbCQ8V/ aSrT9z/0aUFdNGo2xmmElh97N0yJmEoLgJ+gQEzRVkBc9ApgWDeEo6pZolhKh0GkfuEb EQofHPSVgyneYZImZA7Z5vS8x812yTYuHQWCJJILHKKjM3p5RYYeCtVp/RkY95CYdNLo g0fqFjRbEcWlmfkGtWOUu1DK1GMFgBoCy8T3UOVBC27ZqN3j6YjwJ5EY0vY1ybwmd+/y AX1Q== Received: by 10.112.45.165 with SMTP id o5mr7215936lbm.74.1351154869737; Thu, 25 Oct 2012 01:47:49 -0700 (PDT) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id eo4sm4607915lbb.5.2012.10.25.01.47.48 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 01:47:48 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Thu, 25 Oct 2012 12:47:31 +0400 Message-Id: <1351154852-29217-2-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1351154852-29217-1-git-send-email-jcmvbkbc@gmail.com> References: <1351154852-29217-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.45 Cc: Blue Swirl , Peter Maydell , Max Filippov , Markus Armbruster , Eduardo Habkost Subject: [Qemu-devel] [PATCH 1/2] hw/xtensa_lx60: don't prematurely explode QEMUMachineInitArgs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Don't explode QEMUMachineInitArgs before passing it to lx_init. Signed-off-by: Max Filippov --- hw/xtensa_lx60.c | 25 ++++++------------------- 1 files changed, 6 insertions(+), 19 deletions(-) diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c index 5dd2e08..b4d3b8e 100644 --- a/hw/xtensa_lx60.c +++ b/hw/xtensa_lx60.c @@ -156,9 +156,7 @@ static void lx60_reset(void *opaque) } static void lx_init(const LxBoardDesc *board, - 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) + ram_addr_t ram_size, QEMUMachineInitArgs *args) { #ifdef TARGET_WORDS_BIGENDIAN int be = 1; @@ -171,6 +169,9 @@ static void lx_init(const LxBoardDesc *board, MemoryRegion *ram, *rom, *system_io; DriveInfo *dinfo; pflash_t *flash = NULL; + const char *cpu_model = args->cpu_model; + const char *kernel_filename = args->kernel_filename; + const char *kernel_cmdline = args->kernel_cmdline; int n; if (!cpu_model) { @@ -272,37 +273,23 @@ static void lx_init(const LxBoardDesc *board, static void xtensa_lx60_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; static const LxBoardDesc lx60_board = { .flash_size = 0x400000, .flash_sector_size = 0x10000, .sram_size = 0x20000, }; - lx_init(&lx60_board, ram_size, boot_device, - kernel_filename, kernel_cmdline, - initrd_filename, cpu_model); + lx_init(&lx60_board, ram_size, args); } static void xtensa_lx200_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; static const LxBoardDesc lx200_board = { .flash_size = 0x1000000, .flash_sector_size = 0x20000, .sram_size = 0x2000000, }; - lx_init(&lx200_board, ram_size, boot_device, - kernel_filename, kernel_cmdline, - initrd_filename, cpu_model); + lx_init(&lx200_board, ram_size, args); } static QEMUMachine xtensa_lx60_machine = {