xref: /onnv-gate/usr/src/uts/common/sys/lwp.h (revision 6812:febeba71273d)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*6812Sraf  * Common Development and Distribution License (the "License").
6*6812Sraf  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*6812Sraf 
220Sstevel@tonic-gate /*
23*6812Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_LWP_H
280Sstevel@tonic-gate #define	_SYS_LWP_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <sys/synch.h>
330Sstevel@tonic-gate #include <sys/ucontext.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * lwp create flags
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate #define	LWP_DAEMON	0x00000020
430Sstevel@tonic-gate #define	LWP_DETACHED	0x00000040
440Sstevel@tonic-gate #define	LWP_SUSPENDED	0x00000080
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /*
470Sstevel@tonic-gate  * Definitions for user programs calling into the _lwp interface.
480Sstevel@tonic-gate  */
490Sstevel@tonic-gate struct lwpinfo {
500Sstevel@tonic-gate 	timestruc_t lwp_utime;
510Sstevel@tonic-gate 	timestruc_t lwp_stime;
520Sstevel@tonic-gate 	long	    lwpinfo_pad[64];
530Sstevel@tonic-gate };
540Sstevel@tonic-gate 
550Sstevel@tonic-gate #if defined(_SYSCALL32)
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /* Kernel's view of user ILP32 lwpinfo structure */
580Sstevel@tonic-gate 
590Sstevel@tonic-gate struct lwpinfo32 {
600Sstevel@tonic-gate 	timestruc32_t	lwp_utime;
610Sstevel@tonic-gate 	timestruc32_t	lwp_stime;
620Sstevel@tonic-gate 	int32_t		lwpinfo_pad[64];
630Sstevel@tonic-gate };
640Sstevel@tonic-gate 
650Sstevel@tonic-gate #endif	/* _SYSCALL32 */
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #define	_LWP_FSBASE	0
680Sstevel@tonic-gate #define	_LWP_GSBASE	1
690Sstevel@tonic-gate 
700Sstevel@tonic-gate #define	_LWP_SETPRIVATE	0
710Sstevel@tonic-gate #define	_LWP_GETPRIVATE	1
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #ifndef _KERNEL
740Sstevel@tonic-gate 
750Sstevel@tonic-gate typedef uint_t lwpid_t;
760Sstevel@tonic-gate 
770Sstevel@tonic-gate int		_lwp_kill(lwpid_t, int);
780Sstevel@tonic-gate int		_lwp_info(struct lwpinfo *);
790Sstevel@tonic-gate lwpid_t		_lwp_self(void);
800Sstevel@tonic-gate int		_lwp_suspend(lwpid_t);
810Sstevel@tonic-gate int		_lwp_continue(lwpid_t);
820Sstevel@tonic-gate 
830Sstevel@tonic-gate #endif	/* _KERNEL */
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #ifdef	__cplusplus
860Sstevel@tonic-gate }
870Sstevel@tonic-gate #endif
880Sstevel@tonic-gate 
890Sstevel@tonic-gate #endif	/* _SYS_LWP_H */
90