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#ifndef	_SYS_LWP_H
28#define	_SYS_LWP_H
29
30#pragma ident	"@(#)lwp.h	1.36	08/05/31 SMI"
31
32
33#ifdef KERNEL
34#ifndef _KERNEL
35#define _KERNEL /* Solaris vs. Darwin */
36#endif
37#endif
38
39#include "darwin_shim.h" /* In lieu of Solaris <sys/synch.h> and <sys/ucontext.h> */
40
41#ifdef	__cplusplus
42extern "C" {
43#endif
44
45/*
46 * lwp create flags
47 */
48#define	LWP_DAEMON	0x00000020
49#define	LWP_DETACHED	0x00000040
50#define	LWP_SUSPENDED	0x00000080
51
52/*
53 * Definitions for user programs calling into the _lwp interface.
54 */
55struct lwpinfo {
56	timestruc_t lwp_utime;
57	timestruc_t lwp_stime;
58	long	    lwpinfo_pad[64];
59};
60
61#if defined(_SYSCALL32)
62
63/* Kernel's view of user ILP32 lwpinfo structure */
64
65struct lwpinfo32 {
66	timestruc32_t	lwp_utime;
67	timestruc32_t	lwp_stime;
68	int32_t		lwpinfo_pad[64];
69};
70
71#endif	/* _SYSCALL32 */
72
73#define	_LWP_FSBASE	0
74#define	_LWP_GSBASE	1
75
76#define	_LWP_SETPRIVATE	0
77#define	_LWP_GETPRIVATE	1
78
79#ifndef _KERNEL
80
81typedef uint_t lwpid_t;
82
83int		_lwp_kill(lwpid_t, int);
84int		_lwp_info(struct lwpinfo *);
85lwpid_t		_lwp_self(void);
86int		_lwp_suspend(lwpid_t);
87int		_lwp_continue(lwpid_t);
88
89#endif	/* _KERNEL */
90
91#ifdef	__cplusplus
92}
93#endif
94
95#endif	/* _SYS_LWP_H */
96