4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
31 / This is where execution resumes when
a thread created with
32 / thr_create
() or pthread_create
() returns
(see setup_context
()).
33 / We pass the
(void
*) return value to _thrp_terminate
().
38 addl $
4, %esp
/ actually
, never returns
41 / All we need to do now is
(carefully
) call lwp_exit
().
43 SYSTRAP_RVAL1
(lwp_exit
)
44 RET
/ if we return
, it is very bad
45 SET_SIZE
(_lwp_terminate
)
51 SET_SIZE
(set_curthread
)
54 popl
%edx
/ add subcode; save return address
57 SYSTRAP_RVAL1
(lwp_park
)
59 popl
%edx
/ restore return address
65 popl
%edx
/ add subcode; save return address
68 SYSTRAP_RVAL1
(lwp_park
)
70 popl
%edx
/ restore return address
73 SET_SIZE
(__lwp_unpark
)
75 ENTRY
(__lwp_unpark_all
)
76 popl
%edx
/ add subcode; save return address
79 SYSTRAP_RVAL1
(lwp_park
)
81 popl
%edx
/ restore return address
84 SET_SIZE
(__lwp_unpark_all
)
87 * __sighndlr(int sig, siginfo_t *si, ucontext_t *uc, void (*hndlr)())
89 * This is called from sigacthandler() for the purpose of
90 * communicating the ucontext to java's stack tracing functions
91 * and to ensure a 16-byte aligned stack pointer for the benefit
92 * of gcc-compiled floating point code
98 andl $
-16,%esp
/ make sure handler is called with
99 subl $
4,%esp
/ a 16-byte aligned stack pointer
110 * int _sigsetjmp(sigjmp_buf env, int savemask)
112 * This version is faster than the old non-threaded version because we
113 * don't normally have to call __getcontext() to get the signal mask.
114 * (We have a copy of it in the ulwp_t structure.)
119 ENTRY2
(sigsetjmp
,_sigsetjmp
) / EIP already pushed
121 push
%ds
/ segment registers
127 / args
: cs
, ss
, gs
, ..., eip, env, savemask
129 addl $
56, %esp
/ pop
14 words