]> 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 551965f42ecb932ef889025478af0240ffae6dcb..cff463758940ebbdda7992e57b11e81c3d5daef9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <config.h>
 #include <version.h>
+#include <asm/global_data.h>
 
 
 .section .text
@@ -114,20 +115,26 @@ mem_ok:
 
        /* Test the stack */
        pushl   $0
-       popl    %eax
-       cmpl    $0, %eax
+       popl    %ecx
+       cmpl    $0, %ecx
        jne     die
        push    $0x55aa55aa
-       popl    %ebx
-       cmpl    $0x55aa55aa, %ebx
+       popl    %ecx
+       cmpl    $0x55aa55aa, %ecx
        jne     die
 
        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 */