2 * Sigreturn trampolines for returning from a signal when the SA_RESTORER
5 * Copyright (C) 2016 ARM Limited
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * Based on glibc's arm sa_restorer. While this is not strictly necessary, we
20 * provide both A32 and T32 versions, in accordance with the arm sigreturn
24 #include <linux/linkage.h>
25 #include <asm/asm-offsets.h>
26 #include <asm/unistd32.h>
28 .macro sigreturn_trampoline name, syscall, regs_offset
30 * We provide directives for enabling stack unwinding through the
31 * trampoline. On arm, CFI directives are only used for debugging (and
32 * the vDSO is stripped of debug information), so only the arm-specific
33 * unwinding directives are useful here.
39 * It is necessary to start the unwind tables at least one instruction
40 * before the trampoline, as the unwinder will assume that the signal
41 * handler has been called from the trampoline, that is just before
42 * where the signal handler returns (mov r7, ...).
50 * We would like to use ENDPROC, but the macro uses @ which is a
51 * comment symbol for arm assemblers, so directly use .type with %
54 .type \name, %function
61 sigreturn_trampoline __kernel_sigreturn_arm, \
63 COMPAT_SIGFRAME_REGS_OFFSET
65 sigreturn_trampoline __kernel_rt_sigreturn_arm, \
67 COMPAT_RT_SIGFRAME_REGS_OFFSET
70 sigreturn_trampoline __kernel_sigreturn_thumb, \
72 COMPAT_SIGFRAME_REGS_OFFSET
74 sigreturn_trampoline __kernel_rt_sigreturn_thumb, \
76 COMPAT_RT_SIGFRAME_REGS_OFFSET