Patchwork [U-Boot,04/19] x86: Declare global_data pointer when it is used

login
register
mail settings
Submitter Simon Glass
Date April 18, 2013, 2:13 a.m.
Message ID <1366251228-19884-5-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/237402/
State Accepted, archived
Delegated to: Simon Glass
Headers show

Comments

Simon Glass - April 18, 2013, 2:13 a.m.
Several files use the global_data pointer without declaring it. This works
because the declaration is currently a NOP. But still it is better to
fix this so that x86 lines up with other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/x86/cpu/interrupts.c | 2 ++
 arch/x86/lib/cmd_boot.c   | 2 ++
 arch/x86/lib/physmem.c    | 2 ++
 arch/x86/lib/relocate.c   | 2 ++
 arch/x86/lib/timer.c      | 2 ++
 5 files changed, 10 insertions(+)

Patch

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index 6dc74e3..e733bcb 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -37,6 +37,8 @@ 
 #include <asm/msr.h>
 #include <asm/u-boot-x86.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define DECLARE_INTERRUPT(x) \
 	".globl irq_"#x"\n" \
 	".hidden irq_"#x"\n" \
diff --git a/arch/x86/lib/cmd_boot.c b/arch/x86/lib/cmd_boot.c
index a81a9a3..315be5a 100644
--- a/arch/x86/lib/cmd_boot.c
+++ b/arch/x86/lib/cmd_boot.c
@@ -36,6 +36,8 @@ 
 #include <malloc.h>
 #include <asm/u-boot-x86.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 unsigned long do_go_exec(ulong (*entry)(int, char * const []),
 			 int argc, char * const argv[])
 {
diff --git a/arch/x86/lib/physmem.c b/arch/x86/lib/physmem.c
index 18f0e62..59b3fe9 100644
--- a/arch/x86/lib/physmem.c
+++ b/arch/x86/lib/physmem.c
@@ -12,6 +12,8 @@ 
 #include <physmem.h>
 #include <linux/compiler.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Large pages are 2MB. */
 #define LARGE_PAGE_SIZE ((1 << 20) * 2)
 
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index f178db9..21982db 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -39,6 +39,8 @@ 
 #include <asm/sections.h>
 #include <elf.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int copy_uboot_to_ram(void)
 {
 	size_t len = (size_t)&__data_end - (size_t)&__text_start;
diff --git a/arch/x86/lib/timer.c b/arch/x86/lib/timer.c
index 1f8ce60..fb11bfe 100644
--- a/arch/x86/lib/timer.c
+++ b/arch/x86/lib/timer.c
@@ -30,6 +30,8 @@ 
 #include <asm/i8254.h>
 #include <asm/ibmpc.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 struct timer_isr_function {
 	struct timer_isr_function *next;
 	timer_fnc_t *isr_func;