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 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /*
27 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
28 */
29
30 #ifndef _SYS_KLWP_H
31 #define _SYS_KLWP_H
32
33 #include <sys/types.h>
34 #include <sys/condvar.h>
35 #include <sys/thread.h>
36 #include <sys/signal.h>
37 #include <sys/siginfo.h>
38 #include <sys/pcb.h>
39 #include <sys/time.h>
40 #include <sys/msacct.h>
41 #include <sys/ucontext.h>
42 #include <sys/lwp.h>
43 #include <sys/contract.h>
44
45 #if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
46 #include <sys/machparam.h>
47 #endif
174 */
175 short lwp_badpriv;
176
177 /*
178 * linkage
179 */
180 struct _kthread *lwp_thread;
181 struct proc *lwp_procp;
182
183 size_t lwp_childstksz; /* kernel stksize for this lwp's descendants */
184
185 uintptr_t lwp_ustack; /* current stack bounds */
186 size_t lwp_old_stk_ctl; /* old stack limit */
187
188 /*
189 * Contracts
190 */
191 struct ct_template *lwp_ct_active[CTT_MAXTYPE]; /* active templates */
192 struct contract *lwp_ct_latest[CTT_MAXTYPE]; /* last created contract */
193
194 void *lwp_brand; /* per-lwp brand data */
195 struct psinfo *lwp_spymaster; /* if an agent LWP, our spymaster */
196 } klwp_t;
197
198 /* lwp states */
199 #define LWP_USER 0x01 /* Running in user mode */
200 #define LWP_SYS 0x02 /* Running in kernel mode */
201
202 #if defined(_KERNEL)
203 extern int lwp_default_stksize;
204 extern int lwp_reapcnt;
205
206 extern struct _kthread *lwp_deathrow;
207 extern kmutex_t reaplock;
208 extern struct kmem_cache *lwp_cache;
209 extern void *segkp_lwp;
210 extern klwp_t lwp0;
211
212 /* where newly-created lwps normally start */
213 extern void lwp_rtt(void);
214
|
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 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /*
27 * Copyright 2016 Joyent, Inc.
28 */
29
30 #ifndef _SYS_KLWP_H
31 #define _SYS_KLWP_H
32
33 #include <sys/types.h>
34 #include <sys/condvar.h>
35 #include <sys/thread.h>
36 #include <sys/signal.h>
37 #include <sys/siginfo.h>
38 #include <sys/pcb.h>
39 #include <sys/time.h>
40 #include <sys/msacct.h>
41 #include <sys/ucontext.h>
42 #include <sys/lwp.h>
43 #include <sys/contract.h>
44
45 #if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
46 #include <sys/machparam.h>
47 #endif
174 */
175 short lwp_badpriv;
176
177 /*
178 * linkage
179 */
180 struct _kthread *lwp_thread;
181 struct proc *lwp_procp;
182
183 size_t lwp_childstksz; /* kernel stksize for this lwp's descendants */
184
185 uintptr_t lwp_ustack; /* current stack bounds */
186 size_t lwp_old_stk_ctl; /* old stack limit */
187
188 /*
189 * Contracts
190 */
191 struct ct_template *lwp_ct_active[CTT_MAXTYPE]; /* active templates */
192 struct contract *lwp_ct_latest[CTT_MAXTYPE]; /* last created contract */
193
194 /*
195 * Branding:
196 * lwp_brand - per-lwp brand data
197 * lwp_brand_syscall - brand syscall interposer
198 */
199 void *lwp_brand;
200 int (*lwp_brand_syscall)(void);
201
202 struct psinfo *lwp_spymaster; /* if an agent LWP, our spymaster */
203 } klwp_t;
204
205 /* lwp states */
206 #define LWP_USER 0x01 /* Running in user mode */
207 #define LWP_SYS 0x02 /* Running in kernel mode */
208
209 #if defined(_KERNEL)
210 extern int lwp_default_stksize;
211 extern int lwp_reapcnt;
212
213 extern struct _kthread *lwp_deathrow;
214 extern kmutex_t reaplock;
215 extern struct kmem_cache *lwp_cache;
216 extern void *segkp_lwp;
217 extern klwp_t lwp0;
218
219 /* where newly-created lwps normally start */
220 extern void lwp_rtt(void);
221
|