Skip to contentSkip to conversation

a couple questions about global_data

U-Boot Robert P. J. Day 1 participant 1 message Feb 2, 2013

lore
Share & tools
lore
#0 lore raw

first, in include/asm-generic/global_data_flags.h:

* transitional header until we merge global_data.h

what exactly is "transitional" about that header file, what sort of merging is going to be done with respect to global_data.h?

and in the top-level README file:

"OTE: DECLARE_GLOBAL_DATA_PTR must be used with file-global scope, or current versions of GCC may "optimize" the code too much."

but in arch/arm/include/asm/arch-at91/clk.h, you have a number of static inlines of the form:

static inline unsigned long get_main_clk_rate(void)

{
        DECLARE_GLOBAL_DATA_PTR;
        return gd->main_clk_rate_hz;
}

and based on how gcc optimizes, i'm not convinced that that macro invocation is going to be in file-global scope, or am i just forgetting my C scoping rules?

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
========================================================================