From: Robert Schwebel Date: Tue, 4 Feb 2003 14:50:00 +0100 Subject: [U-Boot-Users] 32 bit alignment Message-ID: <20030204135000.GJ25315@pengutronix.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I have a strange problem with the U-Boot network code. This is how some piece of memory (network buffer) looks like: 0005 5ddd 81aa 0005 5df6 026c 0800 4510 014c 0000 0000 1011 de4a d5fc 8fa5 d5fc 8fa8 0043 0044 0138 76b9 0201 0600 5de8 ^^^^ 283b 0000 0000 0000 0000 d5fc 8fa8 d5fc 8fa5 0000 0000 0005 5ddd 81aa 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 The DHCP payload starts at the marked address, which is not 32 bit aligned. Now I want to access the 32 bit value at the marked address and the following one by using a pointer (u32*)bp which points to the marked 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. Any idea what I'm missing here? Robert -- Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry Braunschweiger Str. 79, 31134 Hildesheim, Germany Handelsregister: Amtsgericht Hildesheim, HRA 2686 Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4