summaryrefslogtreecommitdiffstats
path: root/arch/i386/cpu/start.S
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:29 +1100
committerGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:29 +1100
commit161b3589ea19ad262a2eebbf7b4f10aeb6812f35 (patch)
tree0f25a9a4ded4cb28b5ee819f0fa403ee5bd95712 /arch/i386/cpu/start.S
parent5a3876d2ac0aaaf16d50ce91b03c2030822da66f (diff)
downloadtalos-obmc-uboot-161b3589ea19ad262a2eebbf7b4f10aeb6812f35.tar.gz
talos-obmc-uboot-161b3589ea19ad262a2eebbf7b4f10aeb6812f35.zip
x86: Place global data below stack before entering C
By reserving space for the Global Data immediately below the stack during assembly level initialisation, the C declaration of the static global data can be removed, along with the 'RAM Bootstrap' function. This results in cleaner code, and the ability to pass boot-up flags from assembler into C
Diffstat (limited to 'arch/i386/cpu/start.S')
-rw-r--r--arch/i386/cpu/start.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S
index 66ff4f3e06..cff4637589 100644
--- a/arch/i386/cpu/start.S
+++ b/arch/i386/cpu/start.S
@@ -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 */
OpenPOWER on IntegriCloud