2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
34 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
35 * Import of Mac OS X kernel (~semeria)
37 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
38 * Import of OSF Mach kernel (~mburg)
40 * Revision 1.3.17.2 1994/09/23 02:38:45 ezf
41 * change marker to not FREE
42 * [1994/09/22 21:40:54 ezf]
44 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
46 * [1994/06/13 20:47:52 dlb]
48 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
49 * Checked in NMK16_1 changes
52 * Revision 1.3.4.2 1993/07/22 13:54:29 bernadat
53 * [Joe Barerra: joebar@microsoft.com] Added norma_task_teleport as
54 * an alternative migration mechanism.
55 * Change from NORMA_MK14.6 [93/03/08 sjs]
58 * Revision 1.3.2.2 1993/06/02 23:45:24 jeffc
59 * Added to OSF/1 R1.3 from NMK15.0.
60 * [1993/06/02 21:16:50 jeffc]
62 * Revision 1.3 1992/12/07 21:29:17 robert
63 * integrate any changes below for 14.0 (branch from 13.16 base)
65 * Joseph Barrera (jsb) at Carnegie-Mellon University 03-Jul-92
66 * Added norma_task_clone to support task migration.
67 * [1992/12/06 20:25:30 robert]
69 * Revision 1.2 1992/11/25 01:13:00 robert
71 * [1992/11/09 21:25:21 robert]
73 * integrate changes below for norma_14
74 * [1992/11/09 16:42:52 robert]
76 * Revision 0.0 92/10/02 dwm
77 * Add Comment: norma_port_location_hint requires send rights on 'port'.
79 * Revision 1.1 1992/11/05 20:59:18 robert
87 * Revision 2.6 91/12/13 13:45:12 jsb
88 * Moved non-exported interfaces to norma/norma_internal.defs.
89 * Changed name of task_create_remote to norma_task_create.
92 * Revision 2.5 91/11/14 16:56:43 rpd
93 * Picked up mysterious norma changes.
96 * Revision 2.4 91/08/28 11:15:08 jsb
97 * Added KERNEL_USER definitions.
98 * Removed norma_set_task_server.
99 * Added task_create_remote, norma_copy_create.
100 * [91/08/15 13:28:27 jsb]
102 * Revision 2.3 91/08/03 18:19:02 jsb
103 * Removed norma_get_{host,host_priv,device}_port;
104 * Use norma_{get,set}_special_port instead.
105 * [91/07/25 07:51:11 jsb]
107 * Revision 2.2 91/06/06 17:07:57 jsb
109 * [91/05/25 10:37:22 jsb]
114 * Mach Operating System
115 * Copyright (c) 1991 Carnegie Mellon University
116 * All Rights Reserved.
118 * Permission to use, copy, modify and distribute this software and its
119 * documentation is hereby granted, provided that both the copyright
120 * notice and this permission notice appear in all copies of the
121 * software, derivative works or modified versions, and any portions
122 * thereof, and that both notices appear in supporting documentation.
124 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
125 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
126 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
128 * Carnegie Mellon requests users of this software to return to
130 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
131 * School of Computer Science
132 * Carnegie Mellon University
133 * Pittsburgh PA 15213-3890
135 * any improvements or extensions that they make and grant Carnegie Mellon
136 * the rights to redistribute these changes.
153 #include <mach/std_types.defs>
154 #include <mach/mach_types.defs>
159 * Specify a node upon which children tasks will be created.
160 * This call exists only to allow testing with unmodified servers.
161 * Server developers should use norma_task_create instead.
163 routine task_set_child_node(
164 target_task : task_t;
168 * THIS CALL WILL BE ELIMINATED.
169 * Use norma_port_location_hint(,mach_task_self(),) instead.
171 routine norma_node_self(
180 * Create a task on the given node, possibly inheriting memory.
181 * Same inheritance semantics as task_create, including inheritance
182 * of initial ports and emulation library, except for memory:
183 * inheritance attributes are ignored, so that all regions appear
184 * in the child task, shared with the parent, until the parent
185 * is destroyed. (The inheritance of the regions in the child
186 * will, however, be set to match the parent.)
188 * This call is intended to support process migration, where the
189 * inheritance semantics of norma_task_create would break migrated
190 * programs that depended upon sharing relationships remaining
193 * This call is not a true task migration call, in that it does not
194 * migrate the port space, threads, and other non-address-space
195 * attributes of the task.
197 routine norma_task_clone(
198 target_task : task_t;
199 inherit_memory : boolean_t;
201 out child_task : task_t);
204 * Create a task on the given node, possibly inheriting memory.
205 * Same inheritance semantics as task_create, including inheritance
206 * of initial ports and emulation library.
207 * Setting child_node to node_self forces local task creation.
209 routine norma_task_create(
210 target_task : task_t;
211 inherit_memory : boolean_t;
213 out child_task : task_t);
216 * Get a given special port for a given node.
217 * Norma special ports are defined in norma_special_ports.h;
218 * examples include the master device port.
219 * There are a limited number of slots available for system servers.
221 routine norma_get_special_port(
222 host_priv : host_priv_t;
225 out port : mach_port_t);
228 * Set a given special port for a given node.
229 * See norma_get_special_port.
231 routine norma_set_special_port(
232 host_priv : host_priv_t;
237 * Just like norma_task_clone, except target_task is terminated,
238 * allowing useful VM optimizations.
240 routine norma_task_teleport(
241 target_task : task_t;
242 inherit_memory : boolean_t;
244 out child_task : task_t);
251 * Return best guess of port's current location.
252 * Guaranteed to be a node where the port once was.
253 * Guaranteed to be accurate if port has never moved.
254 * Can be used to determine residence node for hosts, tasks, threads, etc.
256 routine norma_port_location_hint(