1/* longjmp for ARC.
2 Copyright (C) 2020-2024 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 License as
7 published by the Free Software Foundation; either version 2.1 of the
8 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, see
17 <https://www.gnu.org/licenses/>. */
18
19#include <sysdep.h>
20#include <jmpbuf-offsets.h>
21
22/* @ r0 = jump buffer from which regs will be restored
23 @ r1 = value that setjmp( ) will return due to this longjmp. */
24
25ENTRY (__longjmp)
26
27 LDR (blink, r0, 0)
28 LDR (sp, r0, 1)
29 LDR (fp, r0, 2)
30 LDR (gp, r0, 3)
31
32 LDR (r13, r0, 4)
33 LDR (r14, r0, 5)
34 LDR (r15, r0, 6)
35 LDR (r16, r0, 7)
36 LDR (r17, r0, 8)
37 LDR (r18, r0, 9)
38 LDR (r19, r0, 10)
39 LDR (r20, r0, 11)
40 LDR (r21, r0, 12)
41 LDR (r22, r0, 13)
42 LDR (r23, r0, 14)
43 LDR (r24, r0, 15)
44
45 mov.f r0, r1
46 j.d [blink]
47 mov.z r0, 1 /* don't return 0 to setjmp callsite from longjmp. */
48
49END (__longjmp)
50

source code of glibc/sysdeps/arc/__longjmp.S