[U-Boot-Users] Global Data Pointer

Marius Groeger mgroeger at sysgo.com
Fri Jan 14 11:11:46 CET 2005


On Fri, 14 Jan 2005, Peter Pearse wrote:

> I don't understand the way the global data pointer (gd) is implemented
> in u-boot.
>
> Why is declared as a local register variable (in functions that access
> it), rather than a global register variable?
>
> I know this more a gcc question, rather than u-boot, but perhaps someone
> in the group has time to enlighten me, or point me to some
> documentation.

Well, the register which is used for gd is reserved globally using 
gcc's -ffixed-r* option. So I'd say this is actually a global register 
variable, which the local declarations just hook on to.

Regards,
Marius

-- 
Marius Groeger <mgroeger at sysgo.com>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.imerva.com





More information about the U-Boot mailing list