2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
29 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
30 * Import of Mac OS X kernel (~semeria)
32 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
33 * Import of OSF Mach kernel (~mburg)
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]
39 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
41 * [1994/06/13 20:47:52 dlb]
43 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
44 * Checked in NMK16_1 changes
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]
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]
57 * Revision 1.3 1992/12/07 21:29:17 robert
58 * integrate any changes below for 14.0 (branch from 13.16 base)
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]
64 * Revision 1.2 1992/11/25 01:13:00 robert
66 * [1992/11/09 21:25:21 robert]
68 * integrate changes below for norma_14
69 * [1992/11/09 16:42:52 robert]
71 * Revision 0.0 92/10/02 dwm
72 * Add Comment: norma_port_location_hint requires send rights on 'port'.
74 * Revision 1.1 1992/11/05 20:59:18 robert
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.
87 * Revision 2.5 91/11/14 16:56:43 rpd
88 * Picked up mysterious norma changes.
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]
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]
102 * Revision 2.2 91/06/06 17:07:57 jsb
104 * [91/05/25 10:37:22 jsb]
109 * Mach Operating System
110 * Copyright (c) 1991 Carnegie Mellon University
111 * All Rights Reserved.
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.
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.
123 * Carnegie Mellon requests users of this software to return to
125 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
126 * School of Computer Science
127 * Carnegie Mellon University
128 * Pittsburgh PA 15213-3890
130 * any improvements or extensions that they make and grant Carnegie Mellon
131 * the rights to redistribute these changes.
148 #include <mach/std_types.defs>
149 #include <mach/mach_types.defs>
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.
158 routine task_set_child_node(
159 target_task : task_t;
163 * THIS CALL WILL BE ELIMINATED.
164 * Use norma_port_location_hint(,mach_task_self(),) instead.
166 routine norma_node_self(
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.)
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
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.
192 routine norma_task_clone(
193 target_task : task_t;
194 inherit_memory : boolean_t;
196 out child_task : task_t);
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.
204 routine norma_task_create(
205 target_task : task_t;
206 inherit_memory : boolean_t;
208 out child_task : task_t);
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.
216 routine norma_get_special_port(
217 host_priv : host_priv_t;
220 out port : mach_port_t);
223 * Set a given special port for a given node.
224 * See norma_get_special_port.
226 routine norma_set_special_port(
227 host_priv : host_priv_t;
232 * Just like norma_task_clone, except target_task is terminated,
233 * allowing useful VM optimizations.
235 routine norma_task_teleport(
236 target_task : task_t;
237 inherit_memory : boolean_t;
239 out child_task : task_t);
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.
251 routine norma_port_location_hint(