]>
Commit | Line | Data |
---|---|---|
d614a753 | 1 | /* Copyright (C) 1997-2020 Free Software Foundation, Inc. |
41bdb6e2 | 2 | This file is part of the GNU C Library. |
5ae3e846 | 3 | Contributed by Richard Henderson (rth@tamu.edu). |
28f540f4 | 4 | |
c84142e8 | 5 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
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. | |
28f540f4 | 9 | |
c84142e8 UD |
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 | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
28f540f4 | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 16 | License along with the GNU C Library; if not, see |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
28f540f4 | 18 | |
5ae3e846 | 19 | #include <sysdep.h> |
9bab9806 | 20 | #include "ucontext_i.h" |
28f540f4 | 21 | |
9bab9806 | 22 | /* int getcontext(ucontext_t *); */ |
28f540f4 | 23 | |
5ae3e846 | 24 | ENTRY(__getcontext) |
28f540f4 | 25 | |
9bab9806 UD |
26 | ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the |
27 | trap clears it. */ | |
5ae3e846 | 28 | ta 0x6e |
9bab9806 UD |
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 | |
5ae3e846 UD |
61 | |
62 | END(__getcontext) | |
63 | ||
1ab18a5b | 64 | weak_alias (__getcontext, getcontext) |