2003-01-20 04:13:46 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* GRUB -- GRand Unified Bootloader
|
2007-07-21 23:32:33 +00:00
|
|
|
* Copyright (C) 2003,2007 Free Software Foundation, Inc.
|
2003-01-20 04:13:46 +00:00
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
2003-01-20 04:13:46 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-21 23:32:33 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2003-01-20 04:13:46 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
2003-01-20 04:13:46 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-21 23:32:33 +00:00
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
2003-01-20 04:13:46 +00:00
|
|
|
*/
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#include <grub/symbol.h>
|
2011-04-19 23:37:48 +00:00
|
|
|
#include <grub/dl.h>
|
2003-01-20 04:13:46 +00:00
|
|
|
|
|
|
|
.file "setjmp.S"
|
2009-06-10 21:04:23 +00:00
|
|
|
|
2011-04-19 23:37:48 +00:00
|
|
|
GRUB_MOD_LICENSE ("GPLv3+")
|
|
|
|
|
2003-01-20 04:13:46 +00:00
|
|
|
.text
|
2009-06-10 21:04:23 +00:00
|
|
|
|
2003-01-20 04:13:46 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* int grub_setjmp (grub_jmp_buf env)
|
2003-01-20 04:13:46 +00:00
|
|
|
*/
|
2004-04-04 13:46:03 +00:00
|
|
|
FUNCTION(grub_setjmp)
|
2003-01-20 04:13:46 +00:00
|
|
|
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
|
|
|
|
jmp *%ecx
|
|
|
|
|
2009-06-10 21:04:23 +00:00
|
|
|
|
2003-01-20 04:13:46 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* int grub_longjmp (grub_jmp_buf env, int val)
|
2003-01-20 04:13:46 +00:00
|
|
|
*/
|
2004-04-04 13:46:03 +00:00
|
|
|
FUNCTION(grub_longjmp)
|
2003-01-20 04:13:46 +00:00
|
|
|
movl 0(%eax), %ebx
|
|
|
|
movl 4(%eax), %esi
|
|
|
|
movl 8(%eax), %edi
|
|
|
|
movl 12(%eax), %ebp
|
|
|
|
movl 16(%eax), %esp
|
|
|
|
movl 20(%eax), %ecx
|
|
|
|
|
|
|
|
movl %edx, %eax
|
|
|
|
testl %eax, %eax
|
|
|
|
jnz 1f
|
|
|
|
incl %eax
|
|
|
|
1: jmp *%ecx
|
2009-06-10 21:04:23 +00:00
|
|
|
|