From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Wed, 18 Aug 2010 19:46:10 +0200 Subject: [U-Boot] [PATCH] Align linebuf to avoid misaligned aliases of it In-Reply-To: References: <1281773473-5697-1-git-send-email-albert.aribaud@free.fr> <4C6654C5.5010000@free.fr> <4C6BD6BE.6090909@free.fr> Message-ID: <4C6C1C62.9020609@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 18/08/2010 18:46, Mike Frysinger a ?crit : > On Wed, Aug 18, 2010 at 8:49 AM, Albert ARIBAUD wrote: >> Le 14/08/2010 19:42, Mike Frysinger a ?crit : >>> On Sat, Aug 14, 2010 at 4:33 AM, Albert ARIBAUD wrote: >>>> Le 14/08/2010 10:25, Mike Frysinger a ?crit : >>>>>> 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)))); >>>>> >>>>> __aligned(sizeof(uint32_t)) >>>> >>>> I based the __aligned__ on what's in post/cpu/ppc4xx/cache.c. What is the >>>> difference between __aligned and __aligned__? >>> >>> i dont mean "__attribute__((__aligned(sizeof(uint32_t))))", i mean >>> "__aligned(sizeof(uint32_t))". the linux compiler headers take care >>> of expanding it to an attribute. >> >> The __aligned(...) syntax fails to compile with the ELDK 4.2 arm toolchain. > > you need to include linux/compiler.h first ... but i would have > thought this be a header already included globally. maybe that's a > new topic to start. > -mike I don't understand why I should introduce a dependency on linux. What is the benefit? Amicalement, -- Albert.