From patchwork Mon Feb 20 23:45:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hornung X-Patchwork-Id: 142260 X-Patchwork-Delegate: thomas@wytron.com.tw Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 07B70B6FAB for ; Tue, 21 Feb 2012 19:37:15 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3AF5A28134; Tue, 21 Feb 2012 09:37:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3-TklS9u2QE8; Tue, 21 Feb 2012 09:37:00 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C074D28110; Tue, 21 Feb 2012 09:36:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 439CA28098 for ; Tue, 21 Feb 2012 00:45:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9VwU07k-o3rs for ; Tue, 21 Feb 2012 00:45:52 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id BA85728096 for ; Tue, 21 Feb 2012 00:45:51 +0100 (CET) Received: by werg1 with SMTP id g1so2549870wer.3 for ; Mon, 20 Feb 2012 15:45:50 -0800 (PST) Received-SPF: pass (google.com: domain of ahornung@gmail.com designates 10.180.107.67 as permitted sender) client-ip=10.180.107.67; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ahornung@gmail.com designates 10.180.107.67 as permitted sender) smtp.mail=ahornung@gmail.com; dkim=pass header.i=ahornung@gmail.com Received: from mr.google.com ([10.180.107.67]) by 10.180.107.67 with SMTP id ha3mr20936393wib.8.1329781550778 (num_hops = 1); Mon, 20 Feb 2012 15:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=nPhAfID67KlT0rPUKlxXl2GBX4PqL4Ouq93d5XJU9fg=; b=nSDImDHqZNiNwrCGgrLWpQGoMeBlduGKr5uepuUTekY2ZmWQbsiyiVVpAukX9F935G 3f46LiUkXSh9JlvaFggNWZ1vrK3YbUxon1j6xAdqlXTNHXpcSmI86dJAAVxebcmUzLmY PsmEhdqmZLCZXQjeVsBFAJJoeDuP+NTYO6aRs= Received: by 10.180.107.67 with SMTP id ha3mr17411943wib.8.1329781550738; Mon, 20 Feb 2012 15:45:50 -0800 (PST) Received: from localhost.localdomain (94-192-45-141.zone6.bethere.co.uk. [94.192.45.141]) by mx.google.com with ESMTPS id ga1sm46840187wib.5.2012.02.20.15.45.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Feb 2012 15:45:50 -0800 (PST) From: Alex Hornung To: u-boot@lists.denx.de Date: Mon, 20 Feb 2012 23:45:45 +0000 Message-Id: <1329781545-18177-1-git-send-email-alex@alexhornung.com> X-Mailer: git-send-email 1.7.3.4 X-Mailman-Approved-At: Tue, 21 Feb 2012 09:36:39 +0100 Cc: Alex Hornung Subject: [U-Boot] [PATCH 1/1] nios2 - adjust gbl data off to account for bd_info X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de * Adjust the GBL_DATA_OFFSET to account for the fact that we'll be using the space between that offset and the start of the malloc region to allocate both a gd structure and a board info structure. * This fixes a memory corruption bug due to overlap of the malloc region and the bd_info structure. Signed-off-by: Alex Hornung --- include/configs/nios2-generic.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h index 9ba35e8..17017a5 100644 --- a/include/configs/nios2-generic.h +++ b/include/configs/nios2-generic.h @@ -131,7 +131,8 @@ #define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - \ CONFIG_SYS_MALLOC_LEN) #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_MALLOC_BASE - \ - GENERATED_GBL_DATA_SIZE) + GENERATED_GBL_DATA_SIZE - \ + GENERATED_BD_INFO_SIZE) #define CONFIG_SYS_INIT_SP CONFIG_SYS_GBL_DATA_OFFSET /*