Libpayload fixes to prevent triple-faults when running in QEMU.
Let the linker figure out the correct address and just CALL the start_main entry point. Signed-off-by: Klaus Schnass <dev@stuffit.at> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3204 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
committed by
Uwe Hermann
parent
ab5b3e0d98
commit
2c6b33ce3e
@@ -50,31 +50,26 @@ _init:
|
||||
/* No interrupts, please. */
|
||||
cli
|
||||
|
||||
/* Get the current stack pointer. */
|
||||
/* Store current stack pointer. */
|
||||
movl %esp, %esi
|
||||
|
||||
/* Setup new stack. */
|
||||
movl _istack, %ebx
|
||||
|
||||
/* lret needs %cs in the stack, so copy it over. */
|
||||
movw %cs, 4(%ebx)
|
||||
movl (%ebx), %esp
|
||||
|
||||
/*
|
||||
* Exchange the current stack pointer for the one in the initial
|
||||
* stack (which happens to be the new stack pointer).
|
||||
*/
|
||||
xchgl %esi, 16(%ebx)
|
||||
|
||||
/* Set the new stack pointer. */
|
||||
movl %esi, %esp
|
||||
|
||||
/* Return into the main entry function and go. */
|
||||
lret
|
||||
/* Save old stack pointer. */
|
||||
pushl %esi
|
||||
|
||||
/* Let's rock. */
|
||||
call start_main
|
||||
|
||||
_leave:
|
||||
movl _istack, %ebx
|
||||
/* Get old stack pointer. */
|
||||
popl %ebx
|
||||
|
||||
/* Restore the stack pointer from the storage area. */
|
||||
movl 16(%ebx), %esp
|
||||
/* Restore old stack. */
|
||||
movl %esp, %ebx
|
||||
|
||||
/* Return to the original context. */
|
||||
lret
|
||||
|
Reference in New Issue
Block a user