[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch grub EFI setjmp in IA32
From: |
bibo,mao |
Subject: |
patch grub EFI setjmp in IA32 |
Date: |
Thu, 03 Aug 2006 11:07:11 +0800 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
hi,
In IA32 application function parameter is passed on stack but not register,
on grub_setjmp funciton, env is pushed on stack, but not eax register.Caller is
responsible to push parameter on the stack and after function call pop the
stack.
Here is the patch for setjmp.S in IA32 EFI, any suggestion is welcome.
Thanks
bibo,mao
--- grub-1.94.org/normal/i386/setjmp.S 2004-04-04 21:46:03.000000000 +0800
+++ grub-1.94/normal/i386/setjmp.S 2006-08-03 11:00:02.000000000 +0800
@@ -27,11 +27,13 @@
* int grub_setjmp (grub_jmp_buf env)
*/
FUNCTION(grub_setjmp)
+ popl %ecx
+ popl %eax
+ pushl %eax
movl %ebx, 0(%eax) /* EBX */
movl %esi, 4(%eax) /* ESI */
movl %edi, 8(%eax) /* EDI */
movl %ebp, 12(%eax) /* EBP */
- popl %ecx
movl %esp, 16(%eax) /* ESP */
movl %ecx, 20(%eax) /* EIP */
xorl %eax, %eax
@@ -42,6 +44,11 @@ FUNCTION(grub_setjmp)
* int grub_longjmp (grub_jmp_buf env, int val)
*/
FUNCTION(grub_longjmp)
+ popl %eax /* skip return address */
+ popl %edx
+ popl %eax
+ pushl %eax
+ pushl %edx
movl 0(%eax), %ebx
movl 4(%eax), %esi
movl 8(%eax), %edi
- patch grub EFI setjmp in IA32,
bibo,mao <=