|
Packit |
6c4009 |
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
Contributed by Richard Henderson (rth@tamu.edu).
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sysdep.h>
|
|
Packit |
6c4009 |
#include "ucontext_i.h"
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* int getcontext(ucontext_t *); */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ENTRY(__getcontext)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the
|
|
Packit |
6c4009 |
trap clears it. */
|
|
Packit |
6c4009 |
ta 0x6e
|
|
Packit |
6c4009 |
1:
|
|
Packit |
6c4009 |
ldx [%o0 + UC_M_PC], %o2
|
|
Packit |
6c4009 |
ldx [%o0 + UC_M_NPC], %o3
|
|
Packit |
6c4009 |
ldx [%o0 + __UC_SIGMASK], %o4
|
|
Packit |
6c4009 |
stx %o1, [%o0 + UC_LINK]
|
|
Packit |
6c4009 |
add %o2, 2f - 1b, %o2
|
|
Packit |
6c4009 |
stx %o2, [%o0 + UC_M_PC]
|
|
Packit |
6c4009 |
add %o3, 2f - 1b, %o3
|
|
Packit |
6c4009 |
stx %o3, [%o0 + UC_M_NPC]
|
|
Packit |
6c4009 |
#if SIGMASK_WORDS == 16
|
|
Packit |
6c4009 |
stx %o4, [%o0 + UC_SIGMASK]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 8]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 16]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 24]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 32]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 40]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 48]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 56]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 64]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 72]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 80]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 88]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 96]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 104]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 112]
|
|
Packit |
6c4009 |
stx %g0, [%o0 + UC_SIGMASK + 120]
|
|
Packit |
6c4009 |
#else
|
|
Packit |
6c4009 |
# error Adjust __getcontext
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
2:
|
|
Packit |
6c4009 |
retl
|
|
Packit |
6c4009 |
clr %o0
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
END(__getcontext)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
weak_alias (__getcontext, getcontext)
|