1
/* Get current user context.
2
Copyright (C) 2008 Free Software Foundation, Inc.
3
This file is part of the GNU C Library.
4
Contributed by Helge Deller <deller@gmx.de>, 2008.
6
The GNU C Library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
11
The GNU C Library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with the GNU C Library; if not, write to the Free
18
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
#include "ucontext_i.h"
26
/* Trampoline function. */
27
/* Can not use ENTRY(__getcontext_ret) here. */
28
.type __getcontext_ret, @function
29
.hidden __getcontext_ret
32
.callinfo FRAME=0,NO_CALLS
40
.size __getcontext_ret, .-__getcontext_ret
44
/* Save the registers. */
47
/* stw %r2, oR2(%r26) - used for trampoline. */
65
/* stw %r20, oR20(%r26) - used for trampoline. */
68
/* stw %r23, oR23(%r26) - used for trampoline. */
69
/* stw %r24, oR24(%r26) - used for trampoline. */
70
/* stw %r25, oR25(%r26) - used for trampoline. */
71
/* stw %r26, oR26(%r26) - used for trampoline. */
75
ldo -64(%sp), %r1 /* Calculate %sp in %r1. */
76
stw %r1, oR30(%r26) /* Save new %sp. */
79
stw %r0, oUC_FLAGS(%r26)
80
/* stw %r0, oUC_LINK(%r26) - Do not overwrite. */
82
stw %r0, oSS_FLAGS(%r26)
83
stw %r0, oSS_SIZE(%r26)
85
stw %r0, oSC_FLAGS(%r26)
91
stw %r0, oSAR(%r26) /* used as flag in swapcontext(). */
94
/* Store floating-point regs. */
95
ldo oFPREGS0(%r26),%r1
100
fstds,ma %fr4, 8(%r1)
101
fstds,ma %fr5, 8(%r1)
102
fstds,ma %fr6, 8(%r1)
103
fstds,ma %fr7, 8(%r1)
104
fstds,ma %fr8, 8(%r1)
105
fstds,ma %fr9, 8(%r1)
106
fstds,ma %fr10, 8(%r1)
107
fstds,ma %fr11, 8(%r1)
108
fstds,ma %fr12, 8(%r1)
109
fstds,ma %fr13, 8(%r1)
110
fstds,ma %fr14, 8(%r1)
111
fstds,ma %fr15, 8(%r1)
112
fstds,ma %fr16, 8(%r1)
113
fstds,ma %fr17, 8(%r1)
114
fstds,ma %fr18, 8(%r1)
115
fstds,ma %fr19, 8(%r1)
116
fstds,ma %fr20, 8(%r1)
117
fstds,ma %fr21, 8(%r1)
118
fstds,ma %fr22, 8(%r1)
119
fstds,ma %fr23, 8(%r1)
120
fstds,ma %fr24, 8(%r1)
121
fstds,ma %fr25, 8(%r1)
122
fstds,ma %fr26, 8(%r1)
123
fstds,ma %fr27, 8(%r1)
124
fstds,ma %fr28, 8(%r1)
125
fstds,ma %fr29, 8(%r1)
126
fstds,ma %fr30, 8(%r1)
135
/* Set up the trampoline registers.
136
r20, r23, r24, r25, r26 and r2 are clobbered
137
by call to getcontext() anyway. Reuse them. */
143
ldil L%__getcontext_ret, %r1
144
ldo R%__getcontext_ret(%r1), %r1
147
/* Save the current signal mask. */
148
/* sigprocmask(SIG_BLOCK, NULL, &ucp->uc_sigmask); */
149
ldo oSIGMASK(%r26), %r24
163
weak_alias (__getcontext, getcontext)