xref: /NextBSD/sys/sys/mach/ipc_kobject.h (revision 33da5adc555b3bc29986eeadca03829e4ad06b1e)
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.6.4.4  92/06/24  18:05:20  jeffreyh
27  * 	Added IKOT_HOST_PAGING
28  * 	[92/06/24  17:51:05  jeffreyh]
29  *
30  * Revision 2.6.4.3  92/03/03  16:20:05  jeffreyh
31  * 	Merge in mainline. Number for IKOT_PAGING_NAME
32  * 	needed to change to avoid merge conflicts.
33  * 	[92/02/24            jeffreyh]
34  *
35  * Revision 2.7  92/01/14  16:44:52  rpd
36  * 	Added IKOT_PAGING_NAME.
37  * 	[91/12/28            rpd]
38  *
39  * Revision 2.6.4.2  92/02/21  11:23:53  jsb
40  * 	Added IKOT_PAGER_TERMINATING.
41  * 	[92/02/16  16:14:31  jsb]
42  *
43  * 	One more xmm kobject shuffle.
44  * 	[92/02/10  16:36:53  jsb]
45  *
46  * 	Removed IKOT_XMM_{MOBJ,KOBJ}; added IKOT_XMM_{PAGING,PROXY}_REQUEST.
47  * 	[92/02/09  14:43:55  jsb]
48  *
49  * Revision 2.6.4.1  92/01/21  21:50:45  jsb
50  * 	Added IKOT_XMM_{MOBJ,KOBJ,REPLY}.
51  * 	[92/01/21  18:59:57  jsb]
52  *
53  * Revision 2.6  91/08/28  11:14:31  jsb
54  * 	Add support for using page lists with devices.  Split the macro
55  * 	that says whether to use page lists into a macro that says whether
56  * 	to use them (vm_page_list) and a macro that says whether the pages
57  * 	should be stolen (vm_page_steal).
58  * 	[91/07/31  15:05:17  dlb]
59  *
60  * Revision 2.5  91/07/01  08:24:58  jsb
61  * 	For NORMA_VM: added IKOT_XMM_PAGER, for memory_objects mapped only
62  * 	by other kernels.
63  *
64  * 	From David Black at OSF: added ipc_kobject_vm_special.
65  * 	[91/06/29  14:33:34  jsb]
66  *
67  * Revision 2.4  91/05/14  16:42:08  mrt
68  * 	Correcting copyright
69  *
70  * Revision 2.3  91/02/05  17:26:40  mrt
71  * 	Changed to new Mach copyright
72  * 	[91/02/01  16:12:58  mrt]
73  *
74  * Revision 2.2  90/06/02  14:54:12  rpd
75  * 	Created for new IPC.
76  * 	[90/03/26  23:47:04  rpd]
77  *
78  */
79 /* CMU_ENDHIST */
80 /*
81  * Mach Operating System
82  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
83  * All Rights Reserved.
84  *
85  * Permission to use, copy, modify and distribute this software and its
86  * documentation is hereby granted, provided that both the copyright
87  * notice and this permission notice appear in all copies of the
88  * software, derivative works or modified versions, and any portions
89  * thereof, and that both notices appear in supporting documentation.
90  *
91  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
92  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
93  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
94  *
95  * Carnegie Mellon requests users of this software to return to
96  *
97  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
98  *  School of Computer Science
99  *  Carnegie Mellon University
100  *  Pittsburgh PA 15213-3890
101  *
102  * any improvements or extensions that they make and grant Carnegie Mellon
103  * the rights to redistribute these changes.
104  */
105 /*
106  */
107 /*
108  *	File:	kern/ipc_kobject.h
109  *	Author:	Rich Draves
110  *	Date:	1989
111  *
112  *	Declarations for letting a port represent a kernel object.
113  */
114 
115 #include <sys/mach/ipc/ipc_kmsg.h>
116 #include <sys/mach/ipc/ipc_port.h>
117 #include <sys/mach/ipc_common.h>	/* for ipc_kobject_t */
118 
119 #ifndef	_KERN_IPC_KOBJECT_H_
120 #define _KERN_IPC_KOBJECT_H_
121 
122 #include <sys/mach/vm_types.h>
123 
124 #define	IKO_NULL	((ipc_kobject_t) 0)
125 
126 typedef natural_t ipc_kobject_type_t;
127 
128 #define	IKOT_NONE		0
129 #define IKOT_THREAD		1
130 #define	IKOT_TASK		2
131 #define	IKOT_HOST		3
132 #define	IKOT_HOST_PRIV		4
133 #define	IKOT_PROCESSOR		5
134 #define	IKOT_PSET		6
135 #define	IKOT_PSET_NAME		7
136 #define	IKOT_PAGER		8
137 #define	IKOT_PAGING_REQUEST	9
138 #define	IKOT_DEVICE		10
139 #define	IKOT_XMM_OBJECT		11
140 #define	IKOT_XMM_PAGER		12
141 #define	IKOT_XMM_KERNEL		13
142 #define	IKOT_XMM_REPLY		14
143 #define	IKOT_PAGER_TERMINATING	15
144 #define IKOT_HOST_SECURITY	17
145 #define	IKOT_LEDGER		18
146 #define IKOT_MASTER_DEVICE	19
147 #define IKOT_ACT		20
148 #define IKOT_SUBSYSTEM		21
149 #define IKOT_IO_DONE_QUEUE	22
150 #define IKOT_SEMAPHORE		23
151 #define IKOT_LOCK_SET		24
152 #define IKOT_CLOCK		25
153 #define IKOT_CLOCK_CTRL		26
154 					/* << new entries here	*/
155 #define	IKOT_UNKNOWN		27	/* magic catchall	*/
156 #define	IKOT_MAX_TYPE		28	/* # of IKOT_ types	*/
157  /* Please keep ipc/ipc_object.c:ikot_print_array up to date	*/
158 
159 #define is_ipc_kobject(ikot)	(ikot != IKOT_NONE)
160 
161 /*
162  *	Define types of kernel objects that use page lists instead
163  *	of entry lists for copyin of out of line memory.
164  */
165 
166 #define ipc_kobject_vm_page_list(ikot) 			\
167 	((ikot == IKOT_PAGING_REQUEST) || (ikot == IKOT_DEVICE))
168 
169 #define ipc_kobject_vm_page_steal(ikot)	(ikot == IKOT_PAGING_REQUEST)
170 
171 /* Initialize kernel server dispatch table */
172 extern void mig_init(void);
173 
174 /* Dispatch a kernel server function */
175 extern ipc_kmsg_t ipc_kobject_server(
176 	ipc_kmsg_t	request);
177 
178 /* Make a port represent a kernel object of the given type */
179 extern void ipc_kobject_set(
180 	ipc_port_t		port,
181 	ipc_kobject_t		kobject,
182 	ipc_kobject_type_t	type);
183 
184 /* Release any kernel object resources associated with a port */
185 extern void ipc_kobject_destroy(
186 	ipc_port_t		port);
187 
188 #define	null_conversion(port)	(port)
189 
190 #endif	/* _KERN_IPC_KOBJECT_H_ */
191