From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vipin Kumar Date: Mon, 4 Oct 2010 15:08:29 +0530 Subject: [U-Boot] packed attribute problem Message-ID: <4CA9A095.9000900@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi All, I encountered a problem something like struct xyz { int x; int y; int z[CONST]; } __attribute__ ((packed)); struct xyz *abc; u32 * status_reg = (u32 *)&abc->z[0]; writel(status, status_reg); This writel results in writing byte by byte on the address pointed to by status_reg. This problem is visible with both gcc version 4.4.1 as well as 4.5.0 Incidently, the same code works well with 4.2.4 The problem is visible in the usb host driver which uses the packed structures for accessing device registers. Regards Vipin