[PATCH 04/35] x86: Tidy up global_data pointer for 64-bit
Simon Glass
sjg at chromium.org
Wed Sep 8 15:33:34 CEST 2021
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>
---
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;
+
/* TODO(sjg at chromium.org): Consider using a fixed register for gd on x86_64 */
#define gd global_data_ptr
--
2.33.0.153.gba50c8fa24-goog
More information about the U-Boot
mailing list