Dear Vipin Kumar, In message <4ca9a095.9000...@st.com> you wrote: > > 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
I bet this is on some ARM system? > Incidently, the same code works well with 4.2.4 ...which surprises me. I thought this has always been an ARM "feature". > The problem is visible in the usb host driver which uses the packed > structures for > accessing device registers. Hm... Why do these structs have any "__attribute__ ((packed))" at all? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If I had to live my life again, I'd make the same mistakes, only sooner. -- Tallulah Bankhead _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot