2013-11-16 19:52:55 +00:00
|
|
|
/*
|
|
|
|
* GRUB -- GRand Unified Bootloader
|
|
|
|
* Copyright (C) 2013 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
|
|
|
* 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
|
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <grub/symbol.h>
|
2015-05-21 16:28:48 +00:00
|
|
|
#include <grub/dl.h>
|
2013-11-16 19:52:55 +00:00
|
|
|
|
|
|
|
.file "setjmp.S"
|
2015-05-21 16:28:48 +00:00
|
|
|
GRUB_MOD_LICENSE "GPLv3+"
|
2013-11-16 19:52:55 +00:00
|
|
|
.text
|
|
|
|
|
|
|
|
/*
|
|
|
|
* int grub_setjmp (grub_jmp_buf env)
|
|
|
|
*/
|
|
|
|
FUNCTION(grub_setjmp)
|
|
|
|
stp x19, x20, [x0], #16
|
|
|
|
stp x21, x22, [x0], #16
|
|
|
|
stp x23, x24, [x0], #16
|
|
|
|
stp x25, x26, [x0], #16
|
|
|
|
stp x27, x28, [x0], #16
|
|
|
|
stp x29, x30, [x0], #16
|
|
|
|
mov x1, sp
|
|
|
|
str x1, [x0]
|
|
|
|
mov x0, #0
|
|
|
|
ret
|
|
|
|
|
|
|
|
/*
|
|
|
|
* int grub_longjmp (grub_jmp_buf env, int val)
|
|
|
|
*/
|
|
|
|
FUNCTION(grub_longjmp)
|
|
|
|
ldp x19, x20, [x0], #16
|
|
|
|
ldp x21, x22, [x0], #16
|
|
|
|
ldp x23, x24, [x0], #16
|
|
|
|
ldp x25, x26, [x0], #16
|
|
|
|
ldp x27, x28, [x0], #16
|
|
|
|
ldp x29, x30, [x0], #16
|
|
|
|
ldr x2, [x0]
|
|
|
|
mov sp, x2
|
2016-01-07 20:10:05 +00:00
|
|
|
mov x0, #1
|
2013-11-16 19:52:55 +00:00
|
|
|
cmp x1, #0
|
|
|
|
csel x0, x1, x0, ne
|
|
|
|
ret
|