[U-Boot] [PATCH 3/3] Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value

Kumar Gala galak at kernel.crashing.org
Tue Oct 26 16:32:47 CEST 2010


On Oct 26, 2010, at 9:22 AM, Stefan Roese wrote:

> Hi Wolfgang,
> 
> On Tuesday 26 October 2010 16:00:01 Wolfgang Denk wrote:
>> CONFIG_SYS_GBL_DATA_SIZE has always been just a bad workarond for not
>> being able to use "sizeof(struct global_data)" in assembler files.
>> Recent experience has shown that manual synchronization is not
>> reliable enough.  This patch renames CONFIG_SYS_GBL_DATA_SIZE into
>> GENERATED_GBL_DATA_SIZE which gets automatically generated by the
>> asm-offsets tool.  In the result, all definitions of this value can be
>> deleted from the board config files.  We have to make sure that all
>> files that reference such data include the new <asm-offsets.h> file.
>> 
>> No other changes have been done yet, but it is obvious that similar
>> changes / simplifications can be done for other, related macro
>> definitions as well.
> 
> Nice. Thanks all for this work.
> 
> One thing that comes to my mind while looking into this patchset is, if we 
> need to make sure that the replacement for CONFIG_SYS_GBL_DATA_SIZE is (still) 
> aligned. Till now CONFIG_SYS_GBL_DATA_SIZE has been defined mostly to 
> something like 64/128/256. Now with using sizeof(struct global_data) this is 
> may not the case any more. Perhaps I'm missing something (didn't look through 
> the patchset too closely), but shouldn't we make sure that the new values used 
> for the memory-reservation is at least 4-byte aligned?
> 

I was wondering about this too, and since most of these are used to define CONFIG_SYS_INIT_SP_OFFSET, we probably need stack level alignment.

- k


More information about the U-Boot mailing list