On Mon, Jul 14, 2008 at 11:21:47PM +0800, Zhang Rui wrote:
2008/7/14, Kevin O'Connor kevin@koconnor.net:
movl %esp, %esi movl $BUILD_STACK_ADDR, %esp ljmp 0x10, $1f
1: calll post_coreboot
movl %esi, %esp retl
I used this: "movl %esp, %esi\n" "movl $" __stringify(BUILD_STACK_ADDR) ", %esp\n" "ljmp $0x10, $post_coreboot\n"
and added this at the end of post_coreboot() function: asm( "movl %esi, %esp\n" "retl" );
That's dangerous because the compiler might use %esi in the post_coreboot() function. If you really want to do this, you should move %esp to %eax and declare the stack pointer as an argument to post_coreboot() and then pass the argument to the inline asm.
-Kevin