[PATCH v2 06/39] x86: Tidy up global_data pointer for 64-bit

Simon Glass sjg at chromium.org
Tue Oct 26 05:29:22 CEST 2021


Hi Heinrich,

On Mon, 18 Oct 2021 at 11:15, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 9/25/21 2:30 AM, Simon Glass wrote:
> > Add an extern declaration so that it is possible to use this macro in
> > files other than the one that defines it.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> > ---
> >
> > (no changes since v1)
> >
> >   arch/x86/cpu/x86_64/cpu.c          | 3 +++
> >   arch/x86/include/asm/global_data.h | 2 ++
> >   2 files changed, 5 insertions(+)
> >
> > diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
> > index 90a766c3c57..e090b1b478a 100644
> > --- a/arch/x86/cpu/x86_64/cpu.c
> > +++ b/arch/x86/cpu/x86_64/cpu.c
> > @@ -8,6 +8,9 @@
> >   #include <cpu_func.h>
> >   #include <debug_uart.h>
> >   #include <init.h>
> > +#include <asm/global_data.h>
> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> >
> >   /*
> >    * Global declaration of gd.
> > diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
> > index 3e4044593c8..f95fb5a1931 100644
> > --- a/arch/x86/include/asm/global_data.h
> > +++ b/arch/x86/include/asm/global_data.h
> > @@ -133,6 +133,8 @@ struct arch_global_data {
> >   #ifndef __ASSEMBLY__
> >   # if defined(CONFIG_EFI_APP) || CONFIG_IS_ENABLED(X86_64)
> >
> > +extern struct global_data *global_data_ptr;
>
> You already have:
> arch/x86/include/asm/global_data.h:139:
> #define DECLARE_GLOBAL_DATA_PTR   extern struct global_data *global_data_ptr
>
> Why don't you use DECLARE_GLOBAL_DATA_PTR where needed?

I have no idea what I was thinking or how I got into this state. But
anyway, I don't think we need this patch. Thanks for catching it.

Regards,
Simon


More information about the U-Boot mailing list