[U-Boot] [PATCH] x86: Add a default implementation for cleanup_before_linux.

Gabe Black gabeblack at chromium.org
Tue Dec 6 02:55:54 CET 2011


This function provides an opportunity for some last minute cleanup and
reconfiguration before control is handed over to Linux. It's possible this
may need to do something in the future, but for now it's left empty. It's set
up as a weak symbol so it can be overridden if necessary on a case by case
basis.

Signed-off-by: Gabe Black <gabeblack at chromium.org>
---
 arch/x86/cpu/cpu.c                |    8 ++++++++
 arch/x86/include/asm/u-boot-x86.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 61d0b69..3a2a64a 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -86,6 +86,14 @@ static void reload_gdt(void)
 		     : : "m" (gdt) : "ecx");
 }
 
+int x86_cleanup_before_linux(void)
+{
+	return 0;
+}
+int cleanup_before_linux(void)
+	__attribute__((weak, alias("x86_cleanup_before_linux")));
+
+
 int x86_cpu_init_f(void)
 {
 	const u32 em_rst = ~X86_CR0_EM;
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 755f88a..8cc4be6 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -37,6 +37,7 @@ int x86_cpu_init_r(void);
 int cpu_init_r(void);
 int x86_cpu_init_f(void);
 int cpu_init_f(void);
+int cleanup_before_linux(void);
 
 /* cpu/.../timer.c */
 void timer_isr(void *);
-- 
1.7.3.1



More information about the U-Boot mailing list