From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [sodaville] [PATCH 3/4] of/dtc: force dtb size to modulo 32 bytes Date: Thu, 11 Nov 2010 16:47:31 -0800 Message-ID: <4CDC8EA3.6080608@linux.intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Cc: sodaville-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, arjan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org List-Id: devicetree@vger.kernel.org On 11/11/2010 04:03 PM, dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > From: Dirk Brandewie > > This patch forces the size of the DTB to be modulo 32 bytes. This is > needed to support linking multiple DTB's into a single section in the > image. GCC wants structures to be 32 byte aligned without this change > DTB's after the first in the section may not be properly aligned so > the flat tree parsing code will fall over. > > Signed-off-by: Dirk Brandewie I don't think 32 is a universal number; it should depend on the ABI. On x86, for one thing, I'm pretty sure that there is no particular alignment requirements beyond the natural alignment of the data items, for example. Although 32 is probably conservative on any platform, please flag the origin of this with a comment, or make it a constant defined in a header file... otherwise, if this breaks for whatever reason it'll be near impossible to find. -hpa