2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
35 * Import of OSF Mach kernel (~mburg)
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]
41 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
43 * [1994/06/13 20:47:52 dlb]
45 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
46 * Checked in NMK16_1 changes
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]
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]
59 * Revision 1.3 1992/12/07 21:29:17 robert
60 * integrate any changes below for 14.0 (branch from 13.16 base)
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]
66 * Revision 1.2 1992/11/25 01:13:00 robert
68 * [1992/11/09 21:25:21 robert]
70 * integrate changes below for norma_14
71 * [1992/11/09 16:42:52 robert]
73 * Revision 0.0 92/10/02 dwm
74 * Add Comment: norma_port_location_hint requires send rights on 'port'.
76 * Revision 1.1 1992/11/05 20:59:18 robert
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.
89 * Revision 2.5 91/11/14 16:56:43 rpd
90 * Picked up mysterious norma changes.
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]
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]
104 * Revision 2.2 91/06/06 17:07:57 jsb
106 * [91/05/25 10:37:22 jsb]
111 * Mach Operating System
112 * Copyright (c) 1991 Carnegie Mellon University
113 * All Rights Reserved.
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.
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.
125 * Carnegie Mellon requests users of this software to return to
127 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
128 * School of Computer Science
129 * Carnegie Mellon University
130 * Pittsburgh PA 15213-3890
132 * any improvements or extensions that they make and grant Carnegie Mellon
133 * the rights to redistribute these changes.
150 #include <mach/std_types.defs>
151 #include <mach/mach_types.defs>
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.
160 routine task_set_child_node(
161 target_task : task_t;
165 * THIS CALL WILL BE ELIMINATED.
166 * Use norma_port_location_hint(,mach_task_self(),) instead.
168 routine norma_node_self(
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.)
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
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.
194 routine norma_task_clone(
195 target_task : task_t;
196 inherit_memory : boolean_t;
198 out child_task : task_t);
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.
206 routine norma_task_create(
207 target_task : task_t;
208 inherit_memory : boolean_t;
210 out child_task : task_t);
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.
218 routine norma_get_special_port(
219 host_priv : host_priv_t;
222 out port : mach_port_t);
225 * Set a given special port for a given node.
226 * See norma_get_special_port.
228 routine norma_set_special_port(
229 host_priv : host_priv_t;
234 * Just like norma_task_clone, except target_task is terminated,
235 * allowing useful VM optimizations.
237 routine norma_task_teleport(
238 target_task : task_t;
239 inherit_memory : boolean_t;
241 out child_task : task_t);
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.
253 routine norma_port_location_hint(