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

Wolfgang Denk wd at denx.de
Tue Oct 26 16:41:07 CEST 2010


Dear Stefan Roese,

In message <201010261622.57768.sr at denx.de> you wrote:
> 
> 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?

You are right, especially as the resulting start address of the global
data is usually also used as the top of the internal stack. Guess we
should align it on 16 bytes, to be sure.

BTW - this uncovers a number of other problems.

commit 800eb096 "POST cleanup." inserts a single data word between
global data and initial stack, thus also breaking stack alignment.

I think this approach is wrong, the POST word should be made part of
the global_data instead.

[This was one of the reasons I did not replace
CONFIG_SYS_GBL_DATA_OFFSET yet, which usually is always
"(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)", nor
CONFIG_SYS_INIT_SP_OFFSET, which usually is the same as
CONFIG_SYS_GBL_DATA_OFFSET.] 

Patch v3 following.

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: wd at denx.de
Witch!  Witch!  They'll burn ya!
	-- Hag, "Tomorrow is Yesterday", stardate unknown


More information about the U-Boot mailing list