Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / grub-core / lib / sparc64 / setjmp.S
blobec9c53057e61108abba75bd1bc18ce9fbd1e7246
1 /*
2  *  GRUB  --  GRand Unified Bootloader
3  *  Copyright (C) 2005,2007,2009  Free Software Foundation, Inc.
4  *
5  *  GRUB is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  GRUB is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
17  */
19 #include <grub/symbol.h>
20 #include <grub/dl.h>
22         .file   "setjmp.S"
24 GRUB_MOD_LICENSE "GPLv3+"
26         .text
29  * int grub_setjmp (grub_jmp_buf env)
30  */
31 FUNCTION(grub_setjmp)
32         stx     %o7, [%o0 + 0x00]
33         stx     %sp, [%o0 + 0x08]
34         stx     %fp, [%o0 + 0x10]
35         retl
36          clr    %o0
39  * int grub_longjmp (grub_jmp_buf env, int val)
40  */
41 FUNCTION(grub_longjmp)
42         ldx     [%o0 + 0x10], %g1
43         movrz   %o1, 1, %o1
44         flushw
45         ldx     [%o0 + 0x00], %o7
46         ldx     [%o0 + 0x08], %fp
47         sub     %fp, 192, %sp
48         stx     %g1, [%sp + 2047 + (14 * 8)]
49         retl
50          restore %o1, 0, %o0