]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/i386/cpu/start.S
x86: Place global data below stack before entering C
[karo-tx-uboot.git] / arch / i386 / cpu / start.S
index 63f733421bc91470a91d84b21819f612e674aea1..cff463758940ebbdda7992e57b11e81c3d5daef9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <config.h>
 #include <version.h>
+#include <asm/global_data.h>
 
 
 .section .text
@@ -114,8 +115,8 @@ mem_ok:
 
        /* Test the stack */
        pushl   $0
-       popl    %eax
-       cmpl    $0, %eax
+       popl    %ecx
+       cmpl    $0, %ecx
        jne     die
        push    $0x55aa55aa
        popl    %ecx
@@ -125,9 +126,15 @@ mem_ok:
        wbinvd
 
        /* Set the upper memory limit parameter */
-       movl    %esp, %eax
        subl    $CONFIG_SYS_STACK_SIZE, %eax
 
+       /* Reserve space for global data */
+       subl    $(GD_SIZE * 4), %eax
+
+       /* %eax points to the global data structure */
+       movl    %esp, (GD_RAM_SIZE * 4)(%eax)
+       movl    %ebx, (GD_FLAGS * 4)(%eax)
+
        call    board_init_f    /* Enter, U-boot! */
 
        /* indicate (lack of) progress */