xref: /illumos-gate/usr/src/lib/libc/common/sys/syslwp.S (revision 5d9d9091)
1/*
2 * CDDL HEADER START
3 *
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.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27	.file	"syslwp.s"
28
29#include "SYS.h"
30
31/*
32 * int
33 * __lwp_create(ucontext_t *uc, unsigned long flags, lwpid_t *lwpidp)
34 */
35	ENTRY(__lwp_create)
36	SYSTRAP_RVAL1(lwp_create)
37	SYSLWPERR
38	RET
39	SET_SIZE(__lwp_create)
40
41/*
42 * int
43 * _lwp_continue(lwpid_t lwpid)
44 */
45	ENTRY(_lwp_continue)
46	SYSTRAP_RVAL1(lwp_continue)
47	SYSLWPERR
48	RET
49	SET_SIZE(_lwp_continue)
50
51/*
52 * int
53 * ___lwp_suspend(lwpid_t lwpid)
54 */
55	SYSREENTRY(___lwp_suspend)
56	SYSTRAP_RVAL1(lwp_suspend)
57	SYSINTR_RESTART(.restart____lwp_suspend)
58	RET
59	SET_SIZE(___lwp_suspend)
60
61/*
62 * int
63 * _lwp_kill(lwpid_t lwpid, int sig)
64 */
65	ENTRY(_lwp_kill)
66	SYSTRAP_RVAL1(lwp_kill)
67	SYSLWPERR
68	RET
69	SET_SIZE(_lwp_kill)
70
71/*
72 * lwpid_t
73 * _lwp_self(void)
74 */
75	ENTRY(_lwp_self)
76	SYSTRAP_RVAL1(lwp_self)
77	RET
78	SET_SIZE(_lwp_self)
79
80/*
81 * int
82 * __lwp_wait(lwpid_t lwpid, lwpid_t *departed)
83 */
84	ENTRY(__lwp_wait)
85	SYSTRAP_RVAL1(lwp_wait)
86	SYSLWPERR
87	RET
88	SET_SIZE(__lwp_wait)
89
90/*
91 * int
92 * __lwp_detach(lwpid_t lwpid)
93 */
94	ENTRY(__lwp_detach)
95	SYSTRAP_RVAL1(lwp_detach)
96	SYSLWPERR
97	RET
98	SET_SIZE(__lwp_detach)
99
100/*
101 * The ___lwp_mutex_timedlock() and ___lwp_mutex_wakeup() functions
102 * are called while holding non-preemptive spin locks and we must
103 * not call out of the library while holding such locks in order
104 * to avoid invoking the dynamic linker.  For this reason, these
105 * functions must never become exported symbols from the library.
106 */
107
108/*
109 * int
110 * ___lwp_mutex_timedlock(lwp_mutex_t *, timespec_t *, uintptr_t)
111 */
112	SYSREENTRY(___lwp_mutex_timedlock)
113	SYSTRAP_RVAL1(lwp_mutex_timedlock)
114	SYSINTR_RESTART(.restart____lwp_mutex_timedlock)
115	RET
116	SET_SIZE(___lwp_mutex_timedlock)
117
118/*
119 * int
120 * ___lwp_mutex_wakeup(lwp_mutex_t *mp, int)
121 */
122	ENTRY(___lwp_mutex_wakeup)
123	SYSTRAP_RVAL1(lwp_mutex_wakeup)
124	SYSLWPERR
125	RET
126	SET_SIZE(___lwp_mutex_wakeup)
127
128/*
129 * int
130 * _lwp_cond_broadcast(lwp_cond_t *cvp)
131 */
132	ENTRY(_lwp_cond_broadcast)
133	SYSTRAP_RVAL1(lwp_cond_broadcast)
134	SYSLWPERR
135	RET
136	SET_SIZE(_lwp_cond_broadcast)
137
138/*
139 * int
140 * ___lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *, timespec_t *, int)
141 */
142	ENTRY(___lwp_cond_wait)
143	SYSTRAP_RVAL1(lwp_cond_wait)
144	SYSLWPERR
145	RET
146	SET_SIZE(___lwp_cond_wait)
147
148/*
149 * int
150 * _lwp_cond_signal(lwp_cond_t *cvp)
151 */
152	ENTRY(_lwp_cond_signal)
153	SYSTRAP_RVAL1(lwp_cond_signal)
154	SYSLWPERR
155	RET
156	SET_SIZE(_lwp_cond_signal)
157
158/*
159 * int
160 * ___lwp_sema_timedwait(lwp_sema_t *, timespec_t *, int check_park)
161 */
162	ENTRY(___lwp_sema_timedwait)
163	SYSTRAP_RVAL1(lwp_sema_timedwait)
164	SYSLWPERR
165	RET
166	SET_SIZE(___lwp_sema_timedwait)
167
168/*
169 * int
170 * _lwp_sema_trywait(lwp_sema_t *sp)
171 */
172	ENTRY(_lwp_sema_trywait)
173	SYSTRAP_RVAL1(lwp_sema_trywait)
174	SYSLWPERR
175	RET
176	SET_SIZE(_lwp_sema_trywait)
177
178/*
179 * int
180 * _lwp_sema_post(lwp_sema_t *sp)
181 */
182	ENTRY(_lwp_sema_post)
183	SYSTRAP_RVAL1(lwp_sema_post)
184	SYSLWPERR
185	RET
186	SET_SIZE(_lwp_sema_post)
187
188/*
189 * int
190 * _lwp_info(struct lwpinfo *infop)
191 */
192	ENTRY(_lwp_info)
193	SYSTRAP_RVAL1(lwp_info)
194	SYSLWPERR
195	RET
196	SET_SIZE(_lwp_info)
197
198/*
199 * sc_shared_t *
200 * __schedctl(void)
201 */
202	SYSCALL2_RVAL1(__schedctl,schedctl)
203	RET
204	SET_SIZE(__schedctl)
205
206/*
207 * int
208 * ___lwp_mutex_trylock(lwp_mutex_t *mp, uintptr_t)
209 */
210	ENTRY(___lwp_mutex_trylock)
211	SYSTRAP_RVAL1(lwp_mutex_trylock)
212	SYSLWPERR
213	RET
214	SET_SIZE(___lwp_mutex_trylock)
215
216/*
217 * int
218 * ___lwp_mutex_unlock(lwp_mutex_t *mp)
219 */
220	ENTRY(___lwp_mutex_unlock)
221	SYSTRAP_RVAL1(lwp_mutex_unlock)
222	SYSLWPERR
223	RET
224	SET_SIZE(___lwp_mutex_unlock)
225
226/*
227 * int
228 * ___lwp_mutex_register(lwp_mutex_t *mp, lwp_mutex_t **uaddr)
229 */
230	ENTRY(___lwp_mutex_register)
231	SYSTRAP_RVAL1(lwp_mutex_register)
232	SYSLWPERR
233	RET
234	SET_SIZE(___lwp_mutex_register)
235