[U-Boot] [RFC 07/10] ARM: make gd a function a function for clang

Jeroen Hofstee jeroen at myspectrum.nl
Tue Jun 3 21:44:55 CEST 2014


On ma, 2014-06-02 at 20:20 -0600, Simon Glass wrote:
> Hi Jeroen,
> 
> On 31 May 2014 14:32, Jeroen Hofstee <jeroen at myspectrum.nl> wrote:
> > ---
> >  arch/arm/include/asm/global_data.h | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
> > index 63e4ad5..646d694 100644
> > --- a/arch/arm/include/asm/global_data.h
> > +++ b/arch/arm/include/asm/global_data.h
> > @@ -44,10 +44,27 @@ struct arch_global_data {
> >
> >  #include <asm-generic/global_data.h>
> >
> > +#ifdef __clang__
> > +
> > +#define DECLARE_GLOBAL_DATA_PTR
> > +#define gd     get_gd()
> > +
> > +static __inline volatile gd_t *get_gd(void)
> > +{
> > +       gd_t *gd_ptr;
> > +
> > +       __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr));
> > +
> > +       return gd_ptr;
> > +}
> > +
> > +#else
> > +
> >  #ifdef CONFIG_ARM64
> >  #define DECLARE_GLOBAL_DATA_PTR                register volatile gd_t *gd asm ("x18")
> >  #else
> >  #define DECLARE_GLOBAL_DATA_PTR                register volatile gd_t *gd asm ("r9")
> >  #endif
> > +#endif
> >
> >  #endif /* __ASM_GBL_DATA_H */
> 
> Probably a good idea to copy Albert on these patches. What happens if
> you compile ARM64 with Clang?
> 
> Regards,
> Simon




More information about the U-Boot mailing list