|
Packit |
6c4009 |
/* longjmp for Nios II.
|
|
Packit |
6c4009 |
Copyright (C) 2015-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public License as
|
|
Packit |
6c4009 |
published by the Free Software Foundation; either version 2.1 of the
|
|
Packit |
6c4009 |
License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library. If not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sysdep.h>
|
|
Packit |
6c4009 |
#include <jmpbuf-offsets.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* __longjmp(jmpbuf, val) */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ENTRY (__longjmp)
|
|
Packit |
6c4009 |
mov r2, r5
|
|
Packit |
6c4009 |
bne r5, zero, 1f
|
|
Packit |
6c4009 |
movi r2, 1
|
|
Packit |
6c4009 |
1:
|
|
Packit |
6c4009 |
#ifdef PTR_DEMANGLE
|
|
Packit |
6c4009 |
PTR_MANGLE_GUARD (r3)
|
|
Packit |
6c4009 |
ldw r5, (JB_RA*4)(r4)
|
|
Packit |
6c4009 |
ldw r6, (JB_SP*4)(r4)
|
|
Packit |
6c4009 |
PTR_DEMANGLE (r5, r5, r3)
|
|
Packit |
6c4009 |
PTR_DEMANGLE (r6, r6, r3)
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
cfi_def_cfa (r4, 0)
|
|
Packit |
6c4009 |
cfi_offset (r16, JB_R16*4)
|
|
Packit |
6c4009 |
cfi_offset (r17, JB_R17*4)
|
|
Packit |
6c4009 |
cfi_offset (r18, JB_R18*4)
|
|
Packit |
6c4009 |
cfi_offset (r19, JB_R19*4)
|
|
Packit |
6c4009 |
cfi_offset (r20, JB_R20*4)
|
|
Packit |
6c4009 |
cfi_offset (r21, JB_R21*4)
|
|
Packit |
6c4009 |
cfi_offset (r22, JB_R22*4)
|
|
Packit |
6c4009 |
cfi_offset (fp, JB_FP*4)
|
|
Packit |
6c4009 |
#ifdef PTR_DEMANGLE
|
|
Packit |
6c4009 |
cfi_register (ra, r5)
|
|
Packit |
6c4009 |
cfi_register (sp, r7)
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
cfi_offset (ra, JB_RA*4)
|
|
Packit |
6c4009 |
cfi_offset (sp, JB_SP*4)
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
ldw r16, (JB_R16*4)(r4)
|
|
Packit |
6c4009 |
ldw r17, (JB_R17*4)(r4)
|
|
Packit |
6c4009 |
ldw r18, (JB_R18*4)(r4)
|
|
Packit |
6c4009 |
ldw r19, (JB_R19*4)(r4)
|
|
Packit |
6c4009 |
ldw r20, (JB_R20*4)(r4)
|
|
Packit |
6c4009 |
ldw r21, (JB_R21*4)(r4)
|
|
Packit |
6c4009 |
ldw r22, (JB_R22*4)(r4)
|
|
Packit |
6c4009 |
ldw fp, (JB_FP*4)(r4)
|
|
Packit |
6c4009 |
#ifdef PTR_DEMANGLE
|
|
Packit |
6c4009 |
mov ra, r5
|
|
Packit |
6c4009 |
mov sp, r6
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
ldw ra, (JB_RA*4)(r4)
|
|
Packit |
6c4009 |
ldw sp, (JB_SP*4)(r4)
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
cfi_same_value (r16)
|
|
Packit |
6c4009 |
cfi_same_value (r17)
|
|
Packit |
6c4009 |
cfi_same_value (r18)
|
|
Packit |
6c4009 |
cfi_same_value (r19)
|
|
Packit |
6c4009 |
cfi_same_value (r20)
|
|
Packit |
6c4009 |
cfi_same_value (r21)
|
|
Packit |
6c4009 |
cfi_same_value (r22)
|
|
Packit |
6c4009 |
cfi_same_value (fp)
|
|
Packit |
6c4009 |
cfi_same_value (ra)
|
|
Packit |
6c4009 |
cfi_same_value (sp)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ret
|
|
Packit |
6c4009 |
END (__longjmp)
|