From: Wolfgang Denk Date: Tue, 04 Feb 2003 16:46:37 +0100 Subject: [U-Boot-Users] 32 bit alignment In-Reply-To: Your message of "Tue, 04 Feb 2003 15:18:41 +0100." Message-ID: <20030204154642.A4DC7C608E@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message you wrote: > > > address. The result is that I get the value from the address _before_ > > the marked address (which belongs to the same 32 bit aligned dword). > > This makes the whole network code break which assumes that it can lay > > arbitrary data structures over the piece of memory. > > This is standard behaviour on ARMs, if the alignment exception is > configured to be ignored. The EA is internally simply anded with ~3. > There are 2 ways to handle this: > > 1) Implement an alignment exception handler (have fun) > 2) Don't access unaligned data. Use byte accesses instead. And 2) is what's being used in U-Boot so far. Obviously Robert stumbles over a piece of code that escaped me so far... Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de Command, n.: Statement presented by a human and accepted by a computer in such a manner as to make the human feel as if he is in control.