1 | /* longjmp, OpenRISC version. |
2 | Copyright (C) 2022 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. |
4 | |
5 | The GNU C Library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2.1 of the License, or (at your option) any later version. |
9 | |
10 | The GNU C Library 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 GNU |
13 | Lesser General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Lesser General Public |
16 | License along with the GNU C Library; if not, write to the Free |
17 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
18 | 02111-1307 USA. */ |
19 | |
20 | #include <sysdep.h> |
21 | #define _ASM |
22 | #define _SETJMP_H |
23 | #include <bits/setjmp.h> |
24 | |
25 | ENTRY (__longjmp) |
26 | l.lwz r1, 0(r3) |
27 | l.lwz r2, 4(r3) |
28 | |
29 | /* if r4 is 0, something wrong, so set it to 1 */ |
30 | l.sfeqi r4, 0x0 |
31 | l.bnf 1f /* r4 != 0, longjmp value sensible */ |
32 | l.nop |
33 | l.ori r4, r0, 0x1 /* make nonzero */ |
34 | 1: |
35 | l.addi r11, r4, 0 |
36 | l.lwz r9, 8(r3) |
37 | l.lwz r10, 12(r3) |
38 | l.lwz r14, 16(r3) |
39 | l.lwz r16, 20(r3) |
40 | l.lwz r18, 24(r3) |
41 | l.lwz r20, 28(r3) |
42 | l.lwz r22, 32(r3) |
43 | l.lwz r24, 36(r3) |
44 | l.lwz r26, 40(r3) |
45 | l.lwz r28, 44(r3) |
46 | l.lwz r30, 48(r3) |
47 | l.jr r9 |
48 | l.nop |
49 | END (__longjmp) |
50 | libc_hidden_def (__longjmp) |
51 | |