5917 User-mode SMB server
[unleashed.git] / usr / src / lib / libfakekernel / common / sys / klwp.h
blob2e0b47b58645361b5220478dd6289dd3003c6470
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
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
29 #ifndef _SYS_KLWP_H
30 #define _SYS_KLWP_H
32 #include <sys/types.h>
33 #include <sys/condvar.h>
34 #include <sys/thread.h>
35 #include <sys/signal.h>
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
42 * The light-weight process object and the methods by which it
43 * is accessed.
46 #define MAXSYSARGS 8 /* Maximum # of arguments passed to a syscall */
48 /* lwp_eosys values */
49 #define NORMALRETURN 0 /* normal return; adjusts PC, registers */
50 #define JUSTRETURN 1 /* just return, leave registers alone */
52 typedef struct _klwp *klwp_id_t;
54 typedef struct _klwp {
56 * linkage
58 struct _kthread *lwp_thread;
59 struct proc *lwp_procp;
61 } klwp_t;
63 /* lwp states */
64 #define LWP_USER 0x01 /* Running in user mode */
65 #define LWP_SYS 0x02 /* Running in kernel mode */
67 #if defined(_KERNEL)
68 extern volatile int lwp_default_stksize;
69 extern klwp_t lwp0;
71 /* where newly-created lwps normally start */
72 extern void lwp_rtt(void);
74 #endif /* _KERNEL */
76 #ifdef __cplusplus
78 #endif
80 #endif /* _SYS_KLWP_H */