xref: /trueos/sys/sys/mach/thread_switch.h (revision 5c2af2babd55e162bc0d20285062c2633c2a1817)
1 /*
2  * Copyright 1991-1998 by Open Software Foundation, Inc.
3  *              All Rights Reserved
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both the copyright notice and this permission notice appear in
9  * supporting documentation.
10  *
11  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  * FOR A PARTICULAR PURPOSE.
14  *
15  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
16  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
18  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
19  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  */
21 /*
22  * MkLinux
23  */
24 /* CMU_HIST */
25 /*
26  * Revision 2.4  91/05/14  17:01:33  mrt
27  * 	Correcting copyright
28  *
29  * Revision 2.3  91/02/05  17:36:45  mrt
30  * 	Changed to new Mach copyright
31  * 	[91/02/01  17:22:02  mrt]
32  *
33  * Revision 2.2  90/06/02  15:00:19  rpd
34  * 	Created for new host/processor technology.
35  * 	[90/03/26  23:51:49  rpd]
36  *
37  * 	Merge to X96
38  * 	[89/08/02  23:12:52  dlb]
39  *
40  * 	Created.
41  * 	[89/07/25  19:05:41  dlb]
42  *
43  * Revision 2.3  89/10/15  02:06:04  rpd
44  * 	Minor cleanups.
45  *
46  * Revision 2.2  89/10/11  14:41:47  dlb
47  * 	Merge.
48  * 	[89/09/01  17:57:58  dlb]
49  *
50  */
51 /* CMU_ENDHIST */
52 /*
53  * Mach Operating System
54  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
55  * All Rights Reserved.
56  *
57  * Permission to use, copy, modify and distribute this software and its
58  * documentation is hereby granted, provided that both the copyright
59  * notice and this permission notice appear in all copies of the
60  * software, derivative works or modified versions, and any portions
61  * thereof, and that both notices appear in supporting documentation.
62  *
63  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
64  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
65  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
66  *
67  * Carnegie Mellon requests users of this software to return to
68  *
69  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
70  *  School of Computer Science
71  *  Carnegie Mellon University
72  *  Pittsburgh PA 15213-3890
73  *
74  * any improvements or extensions that they make and grant Carnegie Mellon
75  * the rights to redistribute these changes.
76  */
77 /*
78  */
79 
80 #ifndef	_MACH_THREAD_SWITCH_H_
81 #define	_MACH_THREAD_SWITCH_H_
82 
83 #include <sys/mach/kern_return.h>
84 #include <sys/mach/message.h>
85 #include <sys/mach/port.h>
86 
87 /*
88  *	Constant definitions for thread_switch trap.
89  */
90 
91 #define	SWITCH_OPTION_NONE	0
92 #define SWITCH_OPTION_DEPRESS	1
93 #define SWITCH_OPTION_WAIT	2
94 #define SWITCH_OPTION_IDLE	3
95 
96 #define valid_switch_option(opt)	((0 <= (opt)) && ((opt) <= 2))
97 
98 /* Attempt to context switch */
99 extern kern_return_t	mach_thread_switch(
100 				mach_port_name_t		thread_name,
101 				int			option,
102 				mach_msg_timeout_t	option_time);
103 
104 #endif	/* _MACH_THREAD_SWITCH_H_ */
105