Skip to contentSkip to conversation

curious if XTRN_DECLARE_GLOBAL_DATA_PTR is still of value

U-Boot Robert P. J. Day 2 participants 2 messages Dec 16, 2015 – Jan 11, 2016

lore
Share & tools
lore
#0 lore raw

perusing the code related to the global data ptr and noticed in
common/board_f.c:

/*
* Pointer to initial global data area
*
* Here we initialize it if needed.
*/
#ifdef XTRN_DECLARE_GLOBAL_DATA_PTR
#undef XTRN_DECLARE_GLOBAL_DATA_PTR
#define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */
DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); #else
DECLARE_GLOBAL_DATA_PTR;
#endif

i was curious to see if anything took advantage of that and the only
other place in the code that referred to that was in arch/powerpc/include/asm/global_data.h:

#if 1
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
#else /* We could use plain global data, but the resulting code is bigger */
#define XTRN_DECLARE_GLOBAL_DATA_PTR extern
#define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \
gd_t *gd
#endif

and given the "#if 1", it's pretty clear powerpc doesn't care about
that, and that file common/board_f.c is the only place i can see in the entire code base that refers to CONFIG_SYS_INIT_GD_ADDR.

so are people still taking advantage of this in some way?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

Hi Robert,

Quoted 29 lines · Robert P. J. Day

perusing the code related to the global data ptr and noticed in
common/board_f.c:

/*
* Pointer to initial global data area
*
* Here we initialize it if needed.
*/
#ifdef XTRN_DECLARE_GLOBAL_DATA_PTR
#undef XTRN_DECLARE_GLOBAL_DATA_PTR
#define XTRN_DECLARE_GLOBAL_DATA_PTR /* empty = allocate here */
DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR); #else
DECLARE_GLOBAL_DATA_PTR;
#endif

i was curious to see if anything took advantage of that and the only
other place in the code that referred to that was in arch/powerpc/include/asm/global_data.h:

#if 1
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2")
#else /* We could use plain global data, but the resulting code is bigger */
#define XTRN_DECLARE_GLOBAL_DATA_PTR extern
#define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \
gd_t *gd
#endif

Quoted 5 lines

and given the "#if 1", it's pretty clear powerpc doesn't care about
that, and that file common/board_f.c is the only place i can see in the entire code base that refers to CONFIG_SYS_INIT_GD_ADDR.

so are people still taking advantage of this in some way?

Not that I know of. Looks like it could be cleaned up.

Regards,
Simon