]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/arm/sigrestorer.S
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / arm / sigrestorer.S
1 /* Copyright (C) 1999 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17
18 #include <bits/arm_asm.h>
19 #include <sys/syscall.h>
20 #include <linux/version.h>
21
22 /* If no SA_RESTORER function was specified by the application we use
23    one of these.  This avoids the need for the kernel to synthesise a return
24    instruction on the stack, which would involve expensive cache flushes.
25
26    Nowadays (2.6 series, and somewhat earlier) the kernel uses a high page
27    for signal trampolines, so the cache flushes are not an issue.  But since
28    we do not have a vDSO, continue to use these so that we can provide
29    unwind information.
30
31    Start the unwind tables at least one instruction before the signal
32    trampoline, because the unwinder will assume we are returning after
33    a call site.
34
35    The signal frame layout changed in 2.6.18.  */
36
37 .global __default_sa_restorer
38 .type __default_sa_restorer,%function
39 .align 2
40 #ifdef __ARM_EABI__
41 #ifdef __thumb__
42 .thumb_func
43 #endif
44         .fnstart
45         .save {r0-r15}
46 #if LINUX_VERSION_CODE >= 0x020612
47         .pad #32
48 #else
49         .pad #12
50 #endif
51         nop
52 __default_sa_restorer:
53         mov     r7, $SYS_ify(sigreturn)
54         swi     0x0
55         .fnend
56 #else
57 __default_sa_restorer:
58         DO_CALL (sigreturn)
59 #endif
60
61
62 #ifdef __NR_rt_sigreturn
63
64 .global __default_rt_sa_restorer
65 .type __default_rt_sa_restorer,%function
66 .align 2
67 #ifdef __ARM_EABI__
68 #ifdef __thumb__
69 .thumb_func
70 #endif
71         .fnstart
72         .save {r0-r15}
73 #if LINUX_VERSION_CODE >= 0x020612
74         .pad #160
75 #else
76         .pad #168
77 #endif
78         nop
79 __default_rt_sa_restorer:
80         mov     r7, $SYS_ify(rt_sigreturn)
81         swi     0x0
82         .fnend
83 #else
84 __default_rt_sa_restorer:
85         DO_CALL (rt_sigreturn)
86 #endif
87
88 #endif