summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/start.S
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2011-12-31 22:58:15 +1100
committerGraeme Russ <graeme.russ@gmail.com>2012-01-04 22:17:24 +1100
commit9e6c572ff03cda84c88663b23c7157d8b1f275ac (patch)
treea2c42fef142e1d179d47b20c35d3c331a279359a /arch/x86/cpu/start.S
parent240ab5aa2161df500e8950c2a4f392e84324f78a (diff)
downloadu-boot-imx-9e6c572ff03cda84c88663b23c7157d8b1f275ac.zip
u-boot-imx-9e6c572ff03cda84c88663b23c7157d8b1f275ac.tar.gz
u-boot-imx-9e6c572ff03cda84c88663b23c7157d8b1f275ac.tar.bz2
x86: Use fs for global data
Use the base address of the 'F' segment as a pointer to the global data structure. By adding the linear address (i.e. the 'D' segment address) as the first word of the global data structure, the address of the global data relative to the 'D' segment can be found simply, for example, by: fs movl 0, %eax This makes the gd 'pointer' writable prior to relocation (by reloading the Global Desctriptor Table) which brings x86 into line with all other arches NOTE: Writing to the gd 'pointer' is expensive (but we only do it twice) but using it to access global data members (read and write) is still fairly cheap -- Changes for v2: - Rebased against changes made to patch #3 - Removed extra indent - Tweaked commit message
Diffstat (limited to 'arch/x86/cpu/start.S')
-rw-r--r--arch/x86/cpu/start.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index 69a9b2c..ee0dabe 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -31,7 +31,7 @@
#include <asm/global_data.h>
#include <asm/processor.h>
#include <asm/processor-flags.h>
-#include <generated/asm-offsets.h>
+#include <generated/generic-asm-offsets.h>
.section .text
.code32
@@ -85,6 +85,12 @@ car_init_ret:
*/
movl $CONFIG_SYS_INIT_SP_ADDR, %esp
+ /* Initialise the Global Data Pointer */
+ movl $CONFIG_SYS_INIT_GD_ADDR, %eax
+ movl %eax, %edx
+ addl $GENERATED_GBL_DATA_SIZE, %edx
+ call init_gd;
+
/* Set parameter to board_init_f() to boot flags */
xorl %eax, %eax
movw %bx, %ax