]> 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 66ff4f3e06d08ee1ce411a202a11d45f4ea0888f..cff463758940ebbdda7992e57b11e81c3d5daef9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <config.h>
 #include <version.h>
+#include <asm/global_data.h>
 
 
 .section .text
@@ -127,6 +128,13 @@ mem_ok:
        /* Set the upper memory limit parameter */
        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 */