Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / libc / common / sys / syslwp.s
blob3d044661882197abfd140e95494fe78cccdffeb2
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 .file "syslwp.s"
29 #include "SYS.h"
32 * int
33 * __lwp_create(ucontext_t *uc, unsigned long flags, lwpid_t *lwpidp)
35 ENTRY(__lwp_create)
36 SYSTRAP_RVAL1(lwp_create)
37 SYSLWPERR
38 RET
39 SET_SIZE(__lwp_create)
42 * int
43 * _lwp_continue(lwpid_t lwpid)
45 ENTRY(_lwp_continue)
46 SYSTRAP_RVAL1(lwp_continue)
47 SYSLWPERR
48 RET
49 SET_SIZE(_lwp_continue)
52 * int
53 * ___lwp_suspend(lwpid_t lwpid)
55 SYSREENTRY(___lwp_suspend)
56 SYSTRAP_RVAL1(lwp_suspend)
57 SYSINTR_RESTART(.restart____lwp_suspend)
58 RET
59 SET_SIZE(___lwp_suspend)
62 * int
63 * _lwp_kill(lwpid_t lwpid, int sig)
65 ENTRY(_lwp_kill)
66 SYSTRAP_RVAL1(lwp_kill)
67 SYSLWPERR
68 RET
69 SET_SIZE(_lwp_kill)
72 * lwpid_t
73 * _lwp_self(void)
75 ENTRY(_lwp_self)
76 SYSTRAP_RVAL1(lwp_self)
77 RET
78 SET_SIZE(_lwp_self)
81 * int
82 * __lwp_wait(lwpid_t lwpid, lwpid_t *departed)
84 ENTRY(__lwp_wait)
85 SYSTRAP_RVAL1(lwp_wait)
86 SYSLWPERR
87 RET
88 SET_SIZE(__lwp_wait)
91 * int
92 * __lwp_detach(lwpid_t lwpid)
94 ENTRY(__lwp_detach)
95 SYSTRAP_RVAL1(lwp_detach)
96 SYSLWPERR
97 RET
98 SET_SIZE(__lwp_detach)
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.
109 * int
110 * ___lwp_mutex_timedlock(lwp_mutex_t *, timespec_t *, uintptr_t)
112 SYSREENTRY(___lwp_mutex_timedlock)
113 SYSTRAP_RVAL1(lwp_mutex_timedlock)
114 SYSINTR_RESTART(.restart____lwp_mutex_timedlock)
116 SET_SIZE(___lwp_mutex_timedlock)
119 * int
120 * ___lwp_mutex_wakeup(lwp_mutex_t *mp, int)
122 ENTRY(___lwp_mutex_wakeup)
123 SYSTRAP_RVAL1(lwp_mutex_wakeup)
124 SYSLWPERR
126 SET_SIZE(___lwp_mutex_wakeup)
129 * int
130 * _lwp_cond_broadcast(lwp_cond_t *cvp)
132 ENTRY(_lwp_cond_broadcast)
133 SYSTRAP_RVAL1(lwp_cond_broadcast)
134 SYSLWPERR
136 SET_SIZE(_lwp_cond_broadcast)
139 * int
140 * ___lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *, timespec_t *, int)
142 ENTRY(___lwp_cond_wait)
143 SYSTRAP_RVAL1(lwp_cond_wait)
144 SYSLWPERR
146 SET_SIZE(___lwp_cond_wait)
149 * int
150 * _lwp_cond_signal(lwp_cond_t *cvp)
152 ENTRY(_lwp_cond_signal)
153 SYSTRAP_RVAL1(lwp_cond_signal)
154 SYSLWPERR
156 SET_SIZE(_lwp_cond_signal)
159 * int
160 * ___lwp_sema_timedwait(lwp_sema_t *, timespec_t *, int check_park)
162 ENTRY(___lwp_sema_timedwait)
163 SYSTRAP_RVAL1(lwp_sema_timedwait)
164 SYSLWPERR
166 SET_SIZE(___lwp_sema_timedwait)
169 * int
170 * _lwp_sema_trywait(lwp_sema_t *sp)
172 ENTRY(_lwp_sema_trywait)
173 SYSTRAP_RVAL1(lwp_sema_trywait)
174 SYSLWPERR
176 SET_SIZE(_lwp_sema_trywait)
179 * int
180 * _lwp_sema_post(lwp_sema_t *sp)
182 ENTRY(_lwp_sema_post)
183 SYSTRAP_RVAL1(lwp_sema_post)
184 SYSLWPERR
186 SET_SIZE(_lwp_sema_post)
189 * int
190 * _lwp_info(struct lwpinfo *infop)
192 ENTRY(_lwp_info)
193 SYSTRAP_RVAL1(lwp_info)
194 SYSLWPERR
196 SET_SIZE(_lwp_info)
199 * sc_shared_t *
200 * __schedctl(void)
202 SYSCALL2_RVAL1(__schedctl,schedctl)
204 SET_SIZE(__schedctl)
207 * int
208 * ___lwp_mutex_trylock(lwp_mutex_t *mp, uintptr_t)
210 ENTRY(___lwp_mutex_trylock)
211 SYSTRAP_RVAL1(lwp_mutex_trylock)
212 SYSLWPERR
214 SET_SIZE(___lwp_mutex_trylock)
217 * int
218 * ___lwp_mutex_unlock(lwp_mutex_t *mp)
220 ENTRY(___lwp_mutex_unlock)
221 SYSTRAP_RVAL1(lwp_mutex_unlock)
222 SYSLWPERR
224 SET_SIZE(___lwp_mutex_unlock)
227 * int
228 * ___lwp_mutex_register(lwp_mutex_t *mp, lwp_mutex_t **uaddr)
230 ENTRY(___lwp_mutex_register)
231 SYSTRAP_RVAL1(lwp_mutex_register)
232 SYSLWPERR
234 SET_SIZE(___lwp_mutex_register)