From patchwork Mon Feb 4 10:41:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 217935 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 05FE82C02A4 for ; Tue, 5 Feb 2013 01:19:14 +1100 (EST) Received: from localhost ([::1]:36235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JW6-0007QO-Hh for incoming@patchwork.ozlabs.org; Mon, 04 Feb 2013 05:43:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JVs-0007Of-2z for qemu-devel@nongnu.org; Mon, 04 Feb 2013 05:43:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2JVp-0001HK-MF for qemu-devel@nongnu.org; Mon, 04 Feb 2013 05:43:00 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:45811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JVp-0001H3-FC; Mon, 04 Feb 2013 05:42:57 -0500 Received: from gandalf.tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id BF7BBA03EA; Mon, 4 Feb 2013 14:42:56 +0400 (MSK) Received: by gandalf.tls.msk.ru (Postfix, from userid 1000) id 9553954A; Mon, 4 Feb 2013 14:41:29 +0400 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2013 14:41:04 +0400 Message-Id: <1359974470-17044-55-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359974470-17044-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1359974470-17044-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: Peter Maydell , Michael Tokarev , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 54/60] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct 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 From: Peter Maydell Clean up the mix of getting the RAM size from the global ram_size and from the ram_size field in the arm_boot_info structure, so that we always use the structure field. Signed-off-by: Peter Maydell Reviewed-by: Peter A. G. Crosthwaite (cherry picked from commit 0b94438480c8f52cc9e22b1038e6ba5096245c4e) This patch is needed for the subsequent patch: arm_boot: Change initrd load address to "halfway through RAM" Signed-off-by: Michael Tokarev --- hw/arm_boot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm_boot.c b/hw/arm_boot.c index 7447f5c..05701b2 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -351,7 +351,7 @@ void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info) if (kernel_size < 0) { entry = info->loader_start + KERNEL_LOAD_ADDR; kernel_size = load_image_targphys(info->kernel_filename, entry, - ram_size - KERNEL_LOAD_ADDR); + info->ram_size - KERNEL_LOAD_ADDR); is_linux = 1; } if (kernel_size < 0) { @@ -365,7 +365,8 @@ void arm_load_kernel(CPUARMState *env, struct arm_boot_info *info) initrd_size = load_image_targphys(info->initrd_filename, info->loader_start + INITRD_LOAD_ADDR, - ram_size - INITRD_LOAD_ADDR); + info->ram_size + - INITRD_LOAD_ADDR); if (initrd_size < 0) { fprintf(stderr, "qemu: could not load initrd '%s'\n", info->initrd_filename);