On 15/11/10 00:46, Reinhard Meyer wrote: > Dear Wolfgang Denk, > > To make it crystal clear now, and put the complete context: > > That simple change would rid us of all alignment concerns: > Setting stack to end of initial storage will certainly > be aligned, and the auto_gd will be aligned as the > toolchain deems necessary. > > We would not need GENERATED_GBL_DATA_SIZE anymore. > > The auto_gd space on stack will be valid even into the call > to relocate_code. > >> void board_init_f (ulong bootflag) >> { >> bd_t *bd; >> init_fnc_t **init_fnc_ptr; >> gd_t *id; >> ulong addr, addr_sp; >> + gd_t auto_gd; >> >> /* Pointer is writable since we allocated a register for it */ >> - gd = (gd_t *) (CONFIG_SYS_INIT_SP_ADDR); >> + gd =&auto_gd; >> /* compiler optimization barrier needed for GCC>= 3.4 */ >> /* Q: why is that needed anyway ??? */ >> __asm__ __volatile__("": : :"memory"); >> >> memset ((void*)gd, 0, sizeof (gd_t)); >> .... >> debug ("relocation Offset is: %08lx\n", gd->reloc_off); >> memcpy (id, (void *)gd, sizeof (gd_t)); >> >> relocate_code (addr_sp, id, addr); >> >> /* NOTREACHED - relocate_code() does not return */ >> } >> >> This, and setting CONFIG_SYS_INIT_SP_ADDR to an aligned value in >> initial storage (SRAM, pinned down Cache, or other) removes alot >> of the headache about making stuff aligned. >> > > This three line change DOES NOT propose any different method > of handling gd other then it is currently done. > > It is ONLY a more elegant way to allocate the pre-relocation > storage for gd.
On the proviso that gd is not needed _BEFORE_ board_init_f() Regards, Graeme _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot