diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2010-10-07 20:03:29 +1100 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2010-10-07 20:03:29 +1100 |
commit | 161b3589ea19ad262a2eebbf7b4f10aeb6812f35 (patch) | |
tree | 0f25a9a4ded4cb28b5ee819f0fa403ee5bd95712 /arch/i386/cpu | |
parent | 5a3876d2ac0aaaf16d50ce91b03c2030822da66f (diff) | |
download | u-boot-imx-161b3589ea19ad262a2eebbf7b4f10aeb6812f35.zip u-boot-imx-161b3589ea19ad262a2eebbf7b4f10aeb6812f35.tar.gz u-boot-imx-161b3589ea19ad262a2eebbf7b4f10aeb6812f35.tar.bz2 |
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')
-rw-r--r-- | arch/i386/cpu/start.S | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S index 66ff4f3..cff4637 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 */ |