]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sparc / sparc64 / getcontext.S
1 /* Copyright (C) 1997-2016 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Richard Henderson (rth@tamu.edu).
4
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.
9
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.
14
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/>. */
18
19 #include <sysdep.h>
20 #include "ucontext_i.h"
21
22 /* int getcontext(ucontext_t *); */
23
24 ENTRY(__getcontext)
25
26 ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the
27 trap clears it. */
28 ta 0x6e
29 1:
30 ldx [%o0 + UC_M_PC], %o2
31 ldx [%o0 + UC_M_NPC], %o3
32 ldx [%o0 + __UC_SIGMASK], %o4
33 stx %o1, [%o0 + UC_LINK]
34 add %o2, 2f - 1b, %o2
35 stx %o2, [%o0 + UC_M_PC]
36 add %o3, 2f - 1b, %o3
37 stx %o3, [%o0 + UC_M_NPC]
38 #if SIGMASK_WORDS == 16
39 stx %o4, [%o0 + UC_SIGMASK]
40 stx %g0, [%o0 + UC_SIGMASK + 8]
41 stx %g0, [%o0 + UC_SIGMASK + 16]
42 stx %g0, [%o0 + UC_SIGMASK + 24]
43 stx %g0, [%o0 + UC_SIGMASK + 32]
44 stx %g0, [%o0 + UC_SIGMASK + 40]
45 stx %g0, [%o0 + UC_SIGMASK + 48]
46 stx %g0, [%o0 + UC_SIGMASK + 56]
47 stx %g0, [%o0 + UC_SIGMASK + 64]
48 stx %g0, [%o0 + UC_SIGMASK + 72]
49 stx %g0, [%o0 + UC_SIGMASK + 80]
50 stx %g0, [%o0 + UC_SIGMASK + 88]
51 stx %g0, [%o0 + UC_SIGMASK + 96]
52 stx %g0, [%o0 + UC_SIGMASK + 104]
53 stx %g0, [%o0 + UC_SIGMASK + 112]
54 stx %g0, [%o0 + UC_SIGMASK + 120]
55 #else
56 # error Adjust __getcontext
57 #endif
58 2:
59 retl
60 clr %o0
61
62 END(__getcontext)
63
64 weak_alias (__getcontext, getcontext)