From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1G8Td0-0006CK-IR for mharc-grub-devel@gnu.org; Wed, 02 Aug 2006 23:12:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G8Tcz-00069t-5q for grub-devel@gnu.org; Wed, 02 Aug 2006 23:12:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G8Tcy-00068N-8R for grub-devel@gnu.org; Wed, 02 Aug 2006 23:12:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8Tcy-000680-2h for grub-devel@gnu.org; Wed, 02 Aug 2006 23:12:04 -0400 Received: from [134.134.136.20] (helo=orsmga101-1.jf.intel.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G8TgD-0006yO-Hw for grub-devel@gnu.org; Wed, 02 Aug 2006 23:15:25 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101-1.jf.intel.com with ESMTP; 02 Aug 2006 20:12:00 -0700 Received: from unknown (HELO [10.239.24.50]) ([10.239.24.50]) by orsmga001.jf.intel.com with ESMTP; 02 Aug 2006 20:11:56 -0700 X-IronPort-AV: i="4.07,206,1151910000"; d="scan'208"; a="101252164:sNHT149003169" Message-ID: <44D1685F.3020907@intel.com> Date: Thu, 03 Aug 2006 11:07:11 +0800 From: "bibo,mao" User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: bibo.mao@intel.com Subject: patch grub EFI setjmp in IA32 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 03:12:05 -0000 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