1 /* Copyright (C) 1998-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Richard Henderson <rth@cygnus.com>, 1998
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.
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.
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 <http://www.gnu.org/licenses/>. */
21 /* On Alpha we desparately want to avoid having to issue an imb. Ordinarily
22 the kernel would have to issue one after setting up the signal return
23 stack, but the Linux rt_sigaction syscall is prepared to accept a pointer
24 to the sigreturn syscall, instead of inlining it on the stack.
26 This just about halves signal delivery time. */
30 ENTRY(__syscall_rt_sigaction)
42 ldl t0, 8(a1) # sa_flags
44 ldah a4, __syscall_sigreturn(gp) !gprelhigh
45 ldah t1, __syscall_rt_sigreturn(gp) !gprelhigh
46 lda a4, __syscall_sigreturn(a4) !gprellow
47 lda t1, __syscall_rt_sigreturn(t1) !gprellow
48 and t0, 0x40, t0 # SA_SIGINFO
51 0: ldi v0, __NR_rt_sigaction
53 bne a3, SYSCALL_ERROR_LABEL
56 PSEUDO_END(__syscall_rt_sigaction)
58 /* To enable unwinding through the signal frame without special hackery
59 elsewhere, describe the entire struct sigcontext with unwind info.
61 In order to minimize the size of the encoding, we set the CFA to the
62 end of the sigcontext, which makes all of the registers have small
63 negative offsets from that. */
65 .macro SIGCONTEXT_REGS_I base, from=0
66 cfi_offset (\from, \base + (4 + \from) * 8)
68 SIGCONTEXT_REGS_I \base, "(\from+1)"
72 .macro SIGCONTEXT_REGS_F base, from=32
73 cfi_offset (\from, \base + (4 + 1 + \from) * 8)
75 SIGCONTEXT_REGS_F \base, "(\from+1)"
79 .macro SIGCONTEXT_REGS base
80 SIGCONTEXT_REGS_I \base
81 SIGCONTEXT_REGS_F \base
82 cfi_offset (63, \base + (4 + 32 + 1 + 32) * 8)
83 cfi_offset (64, \base + 2 * 8)
87 cfi_return_column (64)
90 cfi_def_cfa_offset (648)
92 /* While this frame is marked as a signal frame, that only applies
93 to how this return address is handled for the outer frame.
94 The return address that arrived here, from the inner frame, is
95 not marked as a signal frame and so the unwinder still tries to
96 subtract 1 to examine the presumed call insn. Thus we must
97 extend the unwind info to a nop before the start. */
103 ldi v0, __NR_sigreturn
105 .size __syscall_sigreturn, .-__syscall_sigreturn
106 .type __syscall_sigreturn, @function
108 /* See above wrt including the nop. */
109 cfi_def_cfa_offset (176 + 648)
113 __syscall_rt_sigreturn:
115 ldi v0,__NR_rt_sigreturn
117 .size __syscall_rt_sigreturn, .-__syscall_rt_sigreturn
118 .type __syscall_rt_sigreturn, @function