]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/mach_norma.defs
xnu-344.21.73.tar.gz
[apple/xnu.git] / osfmk / mach / mach_norma.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 */
28 /*
29 * HISTORY
30 *
31 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
32 * Import of Mac OS X kernel (~semeria)
33 *
34 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
35 * Import of OSF Mach kernel (~mburg)
36 *
37 * Revision 1.3.17.2 1994/09/23 02:38:45 ezf
38 * change marker to not FREE
39 * [1994/09/22 21:40:54 ezf]
40 *
41 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
42 * Merge MK6 and NMK17
43 * [1994/06/13 20:47:52 dlb]
44 *
45 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
46 * Checked in NMK16_1 changes
47 * [94/02/04 bernadat]
48 *
49 * Revision 1.3.4.2 1993/07/22 13:54:29 bernadat
50 * [Joe Barerra: joebar@microsoft.com] Added norma_task_teleport as
51 * an alternative migration mechanism.
52 * Change from NORMA_MK14.6 [93/03/08 sjs]
53 * [93/07/16 bernadat]
54 *
55 * Revision 1.3.2.2 1993/06/02 23:45:24 jeffc
56 * Added to OSF/1 R1.3 from NMK15.0.
57 * [1993/06/02 21:16:50 jeffc]
58 *
59 * Revision 1.3 1992/12/07 21:29:17 robert
60 * integrate any changes below for 14.0 (branch from 13.16 base)
61 *
62 * Joseph Barrera (jsb) at Carnegie-Mellon University 03-Jul-92
63 * Added norma_task_clone to support task migration.
64 * [1992/12/06 20:25:30 robert]
65 *
66 * Revision 1.2 1992/11/25 01:13:00 robert
67 * fix history
68 * [1992/11/09 21:25:21 robert]
69 *
70 * integrate changes below for norma_14
71 * [1992/11/09 16:42:52 robert]
72 *
73 * Revision 0.0 92/10/02 dwm
74 * Add Comment: norma_port_location_hint requires send rights on 'port'.
75 *
76 * Revision 1.1 1992/11/05 20:59:18 robert
77 * Initial revision
78 * [92/10/02 dwm]
79 *
80 * $EndLog$
81 */
82 /* CMU_HIST */
83 /*
84 * Revision 2.6 91/12/13 13:45:12 jsb
85 * Moved non-exported interfaces to norma/norma_internal.defs.
86 * Changed name of task_create_remote to norma_task_create.
87 * Added comments.
88 *
89 * Revision 2.5 91/11/14 16:56:43 rpd
90 * Picked up mysterious norma changes.
91 * [91/11/14 rpd]
92 *
93 * Revision 2.4 91/08/28 11:15:08 jsb
94 * Added KERNEL_USER definitions.
95 * Removed norma_set_task_server.
96 * Added task_create_remote, norma_copy_create.
97 * [91/08/15 13:28:27 jsb]
98 *
99 * Revision 2.3 91/08/03 18:19:02 jsb
100 * Removed norma_get_{host,host_priv,device}_port;
101 * Use norma_{get,set}_special_port instead.
102 * [91/07/25 07:51:11 jsb]
103 *
104 * Revision 2.2 91/06/06 17:07:57 jsb
105 * First checkin.
106 * [91/05/25 10:37:22 jsb]
107 *
108 */
109 /* CMU_ENDHIST */
110 /*
111 * Mach Operating System
112 * Copyright (c) 1991 Carnegie Mellon University
113 * All Rights Reserved.
114 *
115 * Permission to use, copy, modify and distribute this software and its
116 * documentation is hereby granted, provided that both the copyright
117 * notice and this permission notice appear in all copies of the
118 * software, derivative works or modified versions, and any portions
119 * thereof, and that both notices appear in supporting documentation.
120 *
121 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
122 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
123 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
124 *
125 * Carnegie Mellon requests users of this software to return to
126 *
127 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
128 * School of Computer Science
129 * Carnegie Mellon University
130 * Pittsburgh PA 15213-3890
131 *
132 * any improvements or extensions that they make and grant Carnegie Mellon
133 * the rights to redistribute these changes.
134 */
135 /*
136 */
137
138 subsystem
139 #if KERNEL_USER
140 KernelUser
141 #endif KERNEL_USER
142 #if KERNEL_SERVER
143 KernelServer
144 #endif KERNEL_SERVER
145 mach_norma 555000;
146 #ifdef KERNEL_USER
147 userprefix r_;
148 #endif KERNEL_USER
149
150 #include <mach/std_types.defs>
151 #include <mach/mach_types.defs>
152
153 skip;
154
155 /*
156 * Specify a node upon which children tasks will be created.
157 * This call exists only to allow testing with unmodified servers.
158 * Server developers should use norma_task_create instead.
159 */
160 routine task_set_child_node(
161 target_task : task_t;
162 child_node : int);
163
164 /*
165 * THIS CALL WILL BE ELIMINATED.
166 * Use norma_port_location_hint(,mach_task_self(),) instead.
167 */
168 routine norma_node_self(
169 host : host_t;
170 out node : int);
171
172 skip;
173
174 skip;
175
176 /*
177 * Create a task on the given node, possibly inheriting memory.
178 * Same inheritance semantics as task_create, including inheritance
179 * of initial ports and emulation library, except for memory:
180 * inheritance attributes are ignored, so that all regions appear
181 * in the child task, shared with the parent, until the parent
182 * is destroyed. (The inheritance of the regions in the child
183 * will, however, be set to match the parent.)
184 *
185 * This call is intended to support process migration, where the
186 * inheritance semantics of norma_task_create would break migrated
187 * programs that depended upon sharing relationships remaining
188 * after migration.
189 *
190 * This call is not a true task migration call, in that it does not
191 * migrate the port space, threads, and other non-address-space
192 * attributes of the task.
193 */
194 routine norma_task_clone(
195 target_task : task_t;
196 inherit_memory : boolean_t;
197 child_node : int;
198 out child_task : task_t);
199
200 /*
201 * Create a task on the given node, possibly inheriting memory.
202 * Same inheritance semantics as task_create, including inheritance
203 * of initial ports and emulation library.
204 * Setting child_node to node_self forces local task creation.
205 */
206 routine norma_task_create(
207 target_task : task_t;
208 inherit_memory : boolean_t;
209 child_node : int;
210 out child_task : task_t);
211
212 /*
213 * Get a given special port for a given node.
214 * Norma special ports are defined in norma_special_ports.h;
215 * examples include the master device port.
216 * There are a limited number of slots available for system servers.
217 */
218 routine norma_get_special_port(
219 host_priv : host_priv_t;
220 node : int;
221 which : int;
222 out port : mach_port_t);
223
224 /*
225 * Set a given special port for a given node.
226 * See norma_get_special_port.
227 */
228 routine norma_set_special_port(
229 host_priv : host_priv_t;
230 which : int;
231 port : mach_port_t);
232
233 /*
234 * Just like norma_task_clone, except target_task is terminated,
235 * allowing useful VM optimizations.
236 */
237 routine norma_task_teleport(
238 target_task : task_t;
239 inherit_memory : boolean_t;
240 child_node : int;
241 out child_task : task_t);
242
243 skip;
244
245 skip;
246
247 /*
248 * Return best guess of port's current location.
249 * Guaranteed to be a node where the port once was.
250 * Guaranteed to be accurate if port has never moved.
251 * Can be used to determine residence node for hosts, tasks, threads, etc.
252 */
253 routine norma_port_location_hint(
254 task : task_t;
255 port : mach_port_t;
256 out node : int);