|
Packit |
6c4009 |
/* _Unwind_Resume wrapper for ARM EABI.
|
|
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 |
|
|
Packit |
6c4009 |
/* This is just implementing exactly what the C version does.
|
|
Packit |
6c4009 |
We do it in assembly just to ensure that we get an unmolested tail
|
|
Packit |
6c4009 |
call to the libgcc function, which is necessary for the ARM unwinder. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ENTRY (_Unwind_Resume)
|
|
Packit |
6c4009 |
LDR_HIDDEN (ip, ip, __libgcc_s_resume, 0)
|
|
Packit |
6c4009 |
cmp ip, #0
|
|
Packit |
6c4009 |
beq 1f
|
|
Packit |
6c4009 |
0: PTR_DEMANGLE (ip, ip, r2, r3)
|
|
Packit |
6c4009 |
bx ip
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* We need to save and restore LR (for our own return address)
|
|
Packit |
6c4009 |
and R0 (for the argument to _Unwind_Resume) around the call. */
|
|
Packit |
6c4009 |
1: push {r0, lr}
|
|
Packit |
6c4009 |
cfi_adjust_cfa_offset (8)
|
|
Packit |
6c4009 |
cfi_rel_offset (r0, 0)
|
|
Packit |
6c4009 |
cfi_rel_offset (lr, 4)
|
|
Packit |
6c4009 |
bl __libgcc_s_init
|
|
Packit |
6c4009 |
pop {r0, lr}
|
|
Packit |
6c4009 |
cfi_adjust_cfa_offset (-8)
|
|
Packit |
6c4009 |
cfi_restore (r0)
|
|
Packit |
6c4009 |
cfi_restore (lr)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
LDR_HIDDEN (ip, ip, __libgcc_s_resume, 0)
|
|
Packit |
6c4009 |
b 0b
|
|
Packit |
6c4009 |
END (_Unwind_Resume)
|