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 (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2015 Joyent, Inc. All rights reserved.
25 */
26
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _SYS_PROC_H
31 #define _SYS_PROC_H
32
33 #include <sys/time.h>
34 #include <sys/thread.h>
35 #include <sys/cred.h>
36 #include <sys/user.h>
37 #include <sys/watchpoint.h>
38 #include <sys/timer.h>
39 #if defined(__x86)
40 #include <sys/tss.h>
41 #include <sys/segments.h>
42 #endif
43 #include <sys/utrap.h>
44 #include <sys/model.h>
705 void (*)(), void (*)(), void (*)(), void (*)());
706 extern void savectx(kthread_t *);
707 extern void restorectx(kthread_t *);
708 extern void forkctx(kthread_t *, kthread_t *);
709 extern void lwp_createctx(kthread_t *, kthread_t *);
710 extern void exitctx(kthread_t *);
711 extern void freectx(kthread_t *, int);
712 extern void installpctx(proc_t *, void *, void (*)(), void (*)(),
713 void (*)(), void (*)(), void (*)());
714 extern int removepctx(proc_t *, void *, void (*)(), void (*)(),
715 void (*)(), void (*)(), void (*)());
716 extern void savepctx(proc_t *);
717 extern void restorepctx(proc_t *);
718 extern void forkpctx(proc_t *, proc_t *);
719 extern void exitpctx(proc_t *);
720 extern void freepctx(proc_t *, int);
721 extern kthread_t *thread_unpin(void);
722 extern void thread_init(void);
723 extern void thread_load(kthread_t *, void (*)(), caddr_t, size_t);
724
725 extern void thread_splitstack(void (*)(void *), void *, size_t);
726 extern void thread_splitstack_run(caddr_t, void (*)(void *), void *);
727 extern void thread_splitstack_cleanup(void);
728
729 extern void tsd_create(uint_t *, void (*)(void *));
730 extern void tsd_destroy(uint_t *);
731 extern void *tsd_getcreate(uint_t *, void (*)(void *), void *(*)(void));
732 extern void *tsd_get(uint_t);
733 extern int tsd_set(uint_t, void *);
734 extern void tsd_exit(void);
735 extern void *tsd_agent_get(kthread_t *, uint_t);
736 extern int tsd_agent_set(kthread_t *, uint_t, void *);
737
738 /* lwp function prototypes */
739
740 extern kthread_t *lwp_kernel_create(proc_t *, void (*)(), void *, int, pri_t);
741 extern klwp_t *lwp_create(
742 void (*proc)(),
743 caddr_t arg,
744 size_t len,
745 proc_t *p,
746 int state,
747 int pri,
748 const k_sigset_t *smask,
|
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 (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2014 Joyent, Inc. All rights reserved.
25 */
26
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
29
30 #ifndef _SYS_PROC_H
31 #define _SYS_PROC_H
32
33 #include <sys/time.h>
34 #include <sys/thread.h>
35 #include <sys/cred.h>
36 #include <sys/user.h>
37 #include <sys/watchpoint.h>
38 #include <sys/timer.h>
39 #if defined(__x86)
40 #include <sys/tss.h>
41 #include <sys/segments.h>
42 #endif
43 #include <sys/utrap.h>
44 #include <sys/model.h>
705 void (*)(), void (*)(), void (*)(), void (*)());
706 extern void savectx(kthread_t *);
707 extern void restorectx(kthread_t *);
708 extern void forkctx(kthread_t *, kthread_t *);
709 extern void lwp_createctx(kthread_t *, kthread_t *);
710 extern void exitctx(kthread_t *);
711 extern void freectx(kthread_t *, int);
712 extern void installpctx(proc_t *, void *, void (*)(), void (*)(),
713 void (*)(), void (*)(), void (*)());
714 extern int removepctx(proc_t *, void *, void (*)(), void (*)(),
715 void (*)(), void (*)(), void (*)());
716 extern void savepctx(proc_t *);
717 extern void restorepctx(proc_t *);
718 extern void forkpctx(proc_t *, proc_t *);
719 extern void exitpctx(proc_t *);
720 extern void freepctx(proc_t *, int);
721 extern kthread_t *thread_unpin(void);
722 extern void thread_init(void);
723 extern void thread_load(kthread_t *, void (*)(), caddr_t, size_t);
724
725 extern void tsd_create(uint_t *, void (*)(void *));
726 extern void tsd_destroy(uint_t *);
727 extern void *tsd_getcreate(uint_t *, void (*)(void *), void *(*)(void));
728 extern void *tsd_get(uint_t);
729 extern int tsd_set(uint_t, void *);
730 extern void tsd_exit(void);
731 extern void *tsd_agent_get(kthread_t *, uint_t);
732 extern int tsd_agent_set(kthread_t *, uint_t, void *);
733
734 /* lwp function prototypes */
735
736 extern kthread_t *lwp_kernel_create(proc_t *, void (*)(), void *, int, pri_t);
737 extern klwp_t *lwp_create(
738 void (*proc)(),
739 caddr_t arg,
740 size_t len,
741 proc_t *p,
742 int state,
743 int pri,
744 const k_sigset_t *smask,
|