From patchwork Fri Mar 18 08:04:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87491 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 219FDB6FA5 for ; Fri, 18 Mar 2011 19:05:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5ED0A2818D; Fri, 18 Mar 2011 09:05:32 +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 xaTfF9MnDJZk; Fri, 18 Mar 2011 09:05:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9AB8A2818E; Fri, 18 Mar 2011 09:05:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E9EE28166 for ; Fri, 18 Mar 2011 09:05:23 +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 KzBZvbMiPy1u for ; Fri, 18 Mar 2011 09:05:22 +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-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id 666C92817C for ; Fri, 18 Mar 2011 09:05:20 +0100 (CET) Received: by mail-wy0-f172.google.com with SMTP id 42so3264954wyb.3 for ; Fri, 18 Mar 2011 01:05:20 -0700 (PDT) Received: by 10.227.149.11 with SMTP id r11mr855661wbv.165.1300435520283; Fri, 18 Mar 2011 01:05:20 -0700 (PDT) Received: from localhost.localdomain (196-215-42-15.dynamic.isadsl.co.za [196.215.42.15]) by mx.google.com with ESMTPS id y12sm260049wby.25.2011.03.18.01.05.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:05:19 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:04:52 +0200 Message-Id: <1300435500-4909-4-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D81FE7F.8090002@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> Subject: [U-Boot] [PATCH 03/11] Align linebuf to avoid misaligned aliases of it X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 From: Albert Aribaud Commit 64419e47518bbba059c80b77558f93ad4804145c aliases the uint16_t usp and uint32_t uip variables in print_buffer() to uint8_t variable linebuf without aligning it to an uint32_t address, thus causing data aborts on ARM when doing md.l on 32-bit wide area (and probably 16-bit wide as well). Aligning linebuf fixes the issue. Signed-off-by: Albert Aribaud --- lib/display_options.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/display_options.c b/lib/display_options.c index 20319e6..c544777 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -101,7 +101,8 @@ void print_size(unsigned long long size, const char *s) #define DEFAULT_LINE_LENGTH_BYTES (16) int print_buffer (ulong addr, void* data, uint width, uint count, uint linelen) { - uint8_t linebuf[MAX_LINE_LENGTH_BYTES + 1]; + uint8_t linebuf[MAX_LINE_LENGTH_BYTES + 1] + __attribute__((__aligned__(sizeof(uint32_t)))); uint32_t *uip = (void*)linebuf; uint16_t *usp = (void*)linebuf; uint8_t *ucp = (void*)linebuf;