[PATCH v2 06/39] x86: Tidy up global_data pointer for 64-bit
    Simon Glass 
    sjg at chromium.org
       
    Sat Sep 25 02:30:22 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>
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;
+
 /* TODO(sjg at chromium.org): Consider using a fixed register for gd on x86_64 */
 #define gd global_data_ptr
 
-- 
2.33.0.685.g46640cef36-goog
    
    
More information about the U-Boot
mailing list