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