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

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Oct 18 19:15:49 CEST 2021


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?

Best regards

Heinrich

> +
>   /* TODO(sjg at chromium.org): Consider using a fixed register for gd on x86_64 */
>   #define gd global_data_ptr
>
>



More information about the U-Boot mailing list