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