1 /* Install given context.
2 Copyright (C) 2008-2014 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, see
18 <http://www.gnu.org/licenses/>. */
22 #include "ucontext_i.h"
36 /* Set the current signal mask. */
37 /* sigprocmask(SIG_BLOCK, &ucp->uc_sigmask, NULL); */
39 ldo oSIGMASK(%r3), %r25
43 comib,<>,n 0,%ret0,.Lerror
50 /* Get the registers. */
53 /* ldw oR3(%r3), %r3 - used for ucp pointer. */
54 /* ldw oR4(%r3), %r4 - used for original %sp. */
55 /* ldw oR5(%r3), %r5 - used for %dp / %r27. */
56 /* ldw oR6(%r3), %r6 - used for %r19. */
72 /* ldw oR22(%r3), %r22 - dyncall arg. */
81 /* ldw oR31(%r3), %r31 - dyncall scratch register */
83 /* Restore floating-point registers. */
84 ldo oFPREGS31(%r3), %r22
86 fldds,mb -8(%r22), %fr30
87 fldds,mb -8(%r22), %fr29
88 fldds,mb -8(%r22), %fr28
89 fldds,mb -8(%r22), %fr27
90 fldds,mb -8(%r22), %fr26
91 fldds,mb -8(%r22), %fr25
92 fldds,mb -8(%r22), %fr24
93 fldds,mb -8(%r22), %fr23
94 fldds,mb -8(%r22), %fr22
95 fldds,mb -8(%r22), %fr21
96 fldds,mb -8(%r22), %fr20
97 fldds,mb -8(%r22), %fr19
98 fldds,mb -8(%r22), %fr18
99 fldds,mb -8(%r22), %fr17
100 fldds,mb -8(%r22), %fr16
101 fldds,mb -8(%r22), %fr15
102 fldds,mb -8(%r22), %fr14
103 fldds,mb -8(%r22), %fr13
104 fldds,mb -8(%r22), %fr12
105 fldds,mb -8(%r22), %fr11
106 fldds,mb -8(%r22), %fr10
107 fldds,mb -8(%r22), %fr9
108 fldds,mb -8(%r22), %fr8
109 fldds,mb -8(%r22), %fr7
110 fldds,mb -8(%r22), %fr6
111 fldds,mb -8(%r22), %fr5
112 fldds,mb -8(%r22), %fr4
113 fldds,mb -8(%r22), %fr3
114 fldds,mb -8(%r22), %fr2
115 fldds,mb -8(%r22), %fr1
116 fldds,mb -8(%r22), %fr0
118 /* Do not load oSS_SP into %sp. The value of oSS_SP indicates
119 the start of the user allocated stack, but not the sp that
120 should be used by the new context. In fact makecontext
121 will create a frame, and adjust sp as required. We do not
122 support calling getcontext and modifying ss_sp without
123 a call to makecontext to synchronize ss_sp into the machine
126 /* Call external function. */
131 /* We return here. Get new ucp in %r3, reload %sp. */
132 ldw oUC_LINK(%r3), %r3
137 /* Continue until ucp == NULL. */
138 comib,<> 0,%r3,.Lagain
141 /* No further context available. Exit now. */
155 PSEUDO_END(__setcontext)
157 weak_alias(__setcontext, setcontext)