[U-Boot] a couple questions about global_data

Robert P. J. Day rpjday at crashcourse.ca
Sat Feb 2 15:36:55 CET 2013


  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

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the U-Boot mailing list