xref: /titanic_50/usr/src/lib/libc/common/sys/syslwp.s (revision db94676fbd90b0affb8474a2af4e10718ba3136d)
17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate * CDDL HEADER START
37c478bd9Sstevel@tonic-gate *
47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5883492d5Sraf * Common Development and Distribution License (the "License").
6883492d5Sraf * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate *
87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate * and limitations under the License.
127c478bd9Sstevel@tonic-gate *
137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate *
197c478bd9Sstevel@tonic-gate * CDDL HEADER END
207c478bd9Sstevel@tonic-gate */
21883492d5Sraf
227c478bd9Sstevel@tonic-gate/*
23c242ec1bSRoger A. Faulkner * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate */
267c478bd9Sstevel@tonic-gate
279a70fc3bSMark J. Nelson	.file	"syslwp.s"
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gate#include "SYS.h"
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gate/*
327c478bd9Sstevel@tonic-gate * int
337c478bd9Sstevel@tonic-gate * __lwp_create(ucontext_t *uc, unsigned long flags, lwpid_t *lwpidp)
347c478bd9Sstevel@tonic-gate */
357c478bd9Sstevel@tonic-gate	ENTRY(__lwp_create)
367c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_create)
377c478bd9Sstevel@tonic-gate	SYSLWPERR
387c478bd9Sstevel@tonic-gate	RET
397c478bd9Sstevel@tonic-gate	SET_SIZE(__lwp_create)
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gate/*
427c478bd9Sstevel@tonic-gate * int
437257d1b4Sraf * _lwp_continue(lwpid_t lwpid)
447c478bd9Sstevel@tonic-gate */
457257d1b4Sraf	ENTRY(_lwp_continue)
467c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_continue)
477c478bd9Sstevel@tonic-gate	SYSLWPERR
487c478bd9Sstevel@tonic-gate	RET
497257d1b4Sraf	SET_SIZE(_lwp_continue)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate/*
527c478bd9Sstevel@tonic-gate * int
537c478bd9Sstevel@tonic-gate * ___lwp_suspend(lwpid_t lwpid)
547c478bd9Sstevel@tonic-gate */
557c478bd9Sstevel@tonic-gate	SYSREENTRY(___lwp_suspend)
567c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_suspend)
577c478bd9Sstevel@tonic-gate	SYSINTR_RESTART(.restart____lwp_suspend)
587c478bd9Sstevel@tonic-gate	RET
597c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_suspend)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate/*
627c478bd9Sstevel@tonic-gate * int
637257d1b4Sraf * _lwp_kill(lwpid_t lwpid, int sig)
647c478bd9Sstevel@tonic-gate */
657257d1b4Sraf	ENTRY(_lwp_kill)
667c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_kill)
677c478bd9Sstevel@tonic-gate	SYSLWPERR
687c478bd9Sstevel@tonic-gate	RET
697257d1b4Sraf	SET_SIZE(_lwp_kill)
707c478bd9Sstevel@tonic-gate
717c478bd9Sstevel@tonic-gate/*
727c478bd9Sstevel@tonic-gate * lwpid_t
737257d1b4Sraf * _lwp_self(void)
747c478bd9Sstevel@tonic-gate */
757257d1b4Sraf	ENTRY(_lwp_self)
767c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_self)
777c478bd9Sstevel@tonic-gate	RET
787257d1b4Sraf	SET_SIZE(_lwp_self)
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate/*
817c478bd9Sstevel@tonic-gate * int
827c478bd9Sstevel@tonic-gate * __lwp_wait(lwpid_t lwpid, lwpid_t *departed)
837c478bd9Sstevel@tonic-gate */
847c478bd9Sstevel@tonic-gate	ENTRY(__lwp_wait)
857c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_wait)
867c478bd9Sstevel@tonic-gate	SYSLWPERR
877c478bd9Sstevel@tonic-gate	RET
887c478bd9Sstevel@tonic-gate	SET_SIZE(__lwp_wait)
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gate/*
917c478bd9Sstevel@tonic-gate * int
927c478bd9Sstevel@tonic-gate * __lwp_detach(lwpid_t lwpid)
937c478bd9Sstevel@tonic-gate */
947c478bd9Sstevel@tonic-gate	ENTRY(__lwp_detach)
957c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_detach)
967c478bd9Sstevel@tonic-gate	SYSLWPERR
977c478bd9Sstevel@tonic-gate	RET
987c478bd9Sstevel@tonic-gate	SET_SIZE(__lwp_detach)
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gate/*
1017c478bd9Sstevel@tonic-gate * The ___lwp_mutex_timedlock() and ___lwp_mutex_wakeup() functions
1027c478bd9Sstevel@tonic-gate * are called while holding non-preemptive spin locks and we must
1037c478bd9Sstevel@tonic-gate * not call out of the library while holding such locks in order
1047c478bd9Sstevel@tonic-gate * to avoid invoking the dynamic linker.  For this reason, these
1057c478bd9Sstevel@tonic-gate * functions must never become exported symbols from the library.
1067c478bd9Sstevel@tonic-gate */
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate/*
1097c478bd9Sstevel@tonic-gate * int
110*db94676fSRoger A. Faulkner * ___lwp_mutex_timedlock(lwp_mutex_t *, timespec_t *, uintptr_t)
1117c478bd9Sstevel@tonic-gate */
1127c478bd9Sstevel@tonic-gate	SYSREENTRY(___lwp_mutex_timedlock)
1137c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_mutex_timedlock)
1147c478bd9Sstevel@tonic-gate	SYSINTR_RESTART(.restart____lwp_mutex_timedlock)
1157c478bd9Sstevel@tonic-gate	RET
1167c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_mutex_timedlock)
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate/*
1197c478bd9Sstevel@tonic-gate * int
120883492d5Sraf * ___lwp_mutex_wakeup(lwp_mutex_t *mp, int)
1217c478bd9Sstevel@tonic-gate */
1227c478bd9Sstevel@tonic-gate	ENTRY(___lwp_mutex_wakeup)
1237c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_mutex_wakeup)
1247c478bd9Sstevel@tonic-gate	SYSLWPERR
1257c478bd9Sstevel@tonic-gate	RET
1267c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_mutex_wakeup)
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate/*
1297c478bd9Sstevel@tonic-gate * int
1307257d1b4Sraf * _lwp_cond_broadcast(lwp_cond_t *cvp)
1317c478bd9Sstevel@tonic-gate */
1327257d1b4Sraf	ENTRY(_lwp_cond_broadcast)
1337c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_cond_broadcast)
1347c478bd9Sstevel@tonic-gate	SYSLWPERR
1357c478bd9Sstevel@tonic-gate	RET
1367257d1b4Sraf	SET_SIZE(_lwp_cond_broadcast)
1377c478bd9Sstevel@tonic-gate
1387c478bd9Sstevel@tonic-gate/*
1397c478bd9Sstevel@tonic-gate * int
1407c478bd9Sstevel@tonic-gate * ___lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *, timespec_t *, int)
1417c478bd9Sstevel@tonic-gate */
1427c478bd9Sstevel@tonic-gate	ENTRY(___lwp_cond_wait)
1437c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_cond_wait)
1447c478bd9Sstevel@tonic-gate	SYSLWPERR
1457c478bd9Sstevel@tonic-gate	RET
1467c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_cond_wait)
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate/*
1497c478bd9Sstevel@tonic-gate * int
1507257d1b4Sraf * _lwp_cond_signal(lwp_cond_t *cvp)
1517c478bd9Sstevel@tonic-gate */
1527257d1b4Sraf	ENTRY(_lwp_cond_signal)
1537c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_cond_signal)
1547c478bd9Sstevel@tonic-gate	SYSLWPERR
1557c478bd9Sstevel@tonic-gate	RET
1567257d1b4Sraf	SET_SIZE(_lwp_cond_signal)
1577c478bd9Sstevel@tonic-gate
1587c478bd9Sstevel@tonic-gate/*
1597c478bd9Sstevel@tonic-gate * int
1607c478bd9Sstevel@tonic-gate * ___lwp_sema_timedwait(lwp_sema_t *, timespec_t *, int check_park)
1617c478bd9Sstevel@tonic-gate */
1627c478bd9Sstevel@tonic-gate	ENTRY(___lwp_sema_timedwait)
1637c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_sema_timedwait)
1647c478bd9Sstevel@tonic-gate	SYSLWPERR
1657c478bd9Sstevel@tonic-gate	RET
1667c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_sema_timedwait)
1677c478bd9Sstevel@tonic-gate
1687c478bd9Sstevel@tonic-gate/*
1697c478bd9Sstevel@tonic-gate * int
1707257d1b4Sraf * _lwp_sema_trywait(lwp_sema_t *sp)
1717c478bd9Sstevel@tonic-gate */
1727257d1b4Sraf	ENTRY(_lwp_sema_trywait)
1737c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_sema_trywait)
1747c478bd9Sstevel@tonic-gate	SYSLWPERR
1757c478bd9Sstevel@tonic-gate	RET
1767257d1b4Sraf	SET_SIZE(_lwp_sema_trywait)
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gate/*
1797c478bd9Sstevel@tonic-gate * int
1807257d1b4Sraf * _lwp_sema_post(lwp_sema_t *sp)
1817c478bd9Sstevel@tonic-gate */
1827257d1b4Sraf	ENTRY(_lwp_sema_post)
1837c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_sema_post)
1847c478bd9Sstevel@tonic-gate	SYSLWPERR
1857c478bd9Sstevel@tonic-gate	RET
1867257d1b4Sraf	SET_SIZE(_lwp_sema_post)
1877c478bd9Sstevel@tonic-gate
1887c478bd9Sstevel@tonic-gate/*
1897c478bd9Sstevel@tonic-gate * int
1907257d1b4Sraf * _lwp_info(struct lwpinfo *infop)
1917c478bd9Sstevel@tonic-gate */
1927257d1b4Sraf	ENTRY(_lwp_info)
1937c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_info)
1947c478bd9Sstevel@tonic-gate	SYSLWPERR
1957c478bd9Sstevel@tonic-gate	RET
1967257d1b4Sraf	SET_SIZE(_lwp_info)
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gate/*
1997c478bd9Sstevel@tonic-gate * sc_shared_t *
2007c478bd9Sstevel@tonic-gate * __schedctl(void)
2017c478bd9Sstevel@tonic-gate */
2027c478bd9Sstevel@tonic-gate	SYSCALL2_RVAL1(__schedctl,schedctl)
2037c478bd9Sstevel@tonic-gate	RET
2047c478bd9Sstevel@tonic-gate	SET_SIZE(__schedctl)
2057c478bd9Sstevel@tonic-gate
2067c478bd9Sstevel@tonic-gate/*
2077c478bd9Sstevel@tonic-gate * int
208*db94676fSRoger A. Faulkner * ___lwp_mutex_trylock(lwp_mutex_t *mp, uintptr_t)
2097c478bd9Sstevel@tonic-gate */
2107c478bd9Sstevel@tonic-gate	ENTRY(___lwp_mutex_trylock)
2117c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_mutex_trylock)
2127c478bd9Sstevel@tonic-gate	SYSLWPERR
2137c478bd9Sstevel@tonic-gate	RET
2147c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_mutex_trylock)
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gate/*
2177c478bd9Sstevel@tonic-gate * int
2187c478bd9Sstevel@tonic-gate * ___lwp_mutex_unlock(lwp_mutex_t *mp)
2197c478bd9Sstevel@tonic-gate */
2207c478bd9Sstevel@tonic-gate	ENTRY(___lwp_mutex_unlock)
2217c478bd9Sstevel@tonic-gate	SYSTRAP_RVAL1(lwp_mutex_unlock)
2227c478bd9Sstevel@tonic-gate	SYSLWPERR
2237c478bd9Sstevel@tonic-gate	RET
2247c478bd9Sstevel@tonic-gate	SET_SIZE(___lwp_mutex_unlock)
2257c478bd9Sstevel@tonic-gate
2267c478bd9Sstevel@tonic-gate/*
2277c478bd9Sstevel@tonic-gate * int
228c242ec1bSRoger A. Faulkner * ___lwp_mutex_register(lwp_mutex_t *mp, lwp_mutex_t **uaddr)
2297c478bd9Sstevel@tonic-gate */
230883492d5Sraf	ENTRY(___lwp_mutex_register)
231883492d5Sraf	SYSTRAP_RVAL1(lwp_mutex_register)
2327c478bd9Sstevel@tonic-gate	SYSLWPERR
2337c478bd9Sstevel@tonic-gate	RET
234883492d5Sraf	SET_SIZE(___lwp_mutex_register)
235