1 /* Copyright (C) 1997-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Richard Henderson (rth@tamu.edu).
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/>. */
20 #include "ucontext_i.h"
22 /* int getcontext(ucontext_t *); */
26 ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the
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]
35 stx %o2, [%o0 + UC_M_PC]
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]
56 # error Adjust __getcontext
64 weak_alias (__getcontext, getcontext)