2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
28 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
29 * Import of Mac OS X kernel (~semeria)
31 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
32 * Import of OSF Mach kernel (~mburg)
34 * Revision 1.3.17.2 1994/09/23 02:38:45 ezf
35 * change marker to not FREE
36 * [1994/09/22 21:40:54 ezf]
38 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
40 * [1994/06/13 20:47:52 dlb]
42 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
43 * Checked in NMK16_1 changes
46 * Revision 1.3.4.2 1993/07/22 13:54:29 bernadat
47 * [Joe Barerra: joebar@microsoft.com] Added norma_task_teleport as
48 * an alternative migration mechanism.
49 * Change from NORMA_MK14.6 [93/03/08 sjs]
52 * Revision 1.3.2.2 1993/06/02 23:45:24 jeffc
53 * Added to OSF/1 R1.3 from NMK15.0.
54 * [1993/06/02 21:16:50 jeffc]
56 * Revision 1.3 1992/12/07 21:29:17 robert
57 * integrate any changes below for 14.0 (branch from 13.16 base)
59 * Joseph Barrera (jsb) at Carnegie-Mellon University 03-Jul-92
60 * Added norma_task_clone to support task migration.
61 * [1992/12/06 20:25:30 robert]
63 * Revision 1.2 1992/11/25 01:13:00 robert
65 * [1992/11/09 21:25:21 robert]
67 * integrate changes below for norma_14
68 * [1992/11/09 16:42:52 robert]
70 * Revision 0.0 92/10/02 dwm
71 * Add Comment: norma_port_location_hint requires send rights on 'port'.
73 * Revision 1.1 1992/11/05 20:59:18 robert
81 * Revision 2.6 91/12/13 13:45:12 jsb
82 * Moved non-exported interfaces to norma/norma_internal.defs.
83 * Changed name of task_create_remote to norma_task_create.
86 * Revision 2.5 91/11/14 16:56:43 rpd
87 * Picked up mysterious norma changes.
90 * Revision 2.4 91/08/28 11:15:08 jsb
91 * Added KERNEL_USER definitions.
92 * Removed norma_set_task_server.
93 * Added task_create_remote, norma_copy_create.
94 * [91/08/15 13:28:27 jsb]
96 * Revision 2.3 91/08/03 18:19:02 jsb
97 * Removed norma_get_{host,host_priv,device}_port;
98 * Use norma_{get,set}_special_port instead.
99 * [91/07/25 07:51:11 jsb]
101 * Revision 2.2 91/06/06 17:07:57 jsb
103 * [91/05/25 10:37:22 jsb]
108 * Mach Operating System
109 * Copyright (c) 1991 Carnegie Mellon University
110 * All Rights Reserved.
112 * Permission to use, copy, modify and distribute this software and its
113 * documentation is hereby granted, provided that both the copyright
114 * notice and this permission notice appear in all copies of the
115 * software, derivative works or modified versions, and any portions
116 * thereof, and that both notices appear in supporting documentation.
118 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
119 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
120 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
122 * Carnegie Mellon requests users of this software to return to
124 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
125 * School of Computer Science
126 * Carnegie Mellon University
127 * Pittsburgh PA 15213-3890
129 * any improvements or extensions that they make and grant Carnegie Mellon
130 * the rights to redistribute these changes.
147 #include <mach/std_types.defs>
148 #include <mach/mach_types.defs>
153 * Specify a node upon which children tasks will be created.
154 * This call exists only to allow testing with unmodified servers.
155 * Server developers should use norma_task_create instead.
157 routine task_set_child_node(
158 target_task : task_t;
162 * THIS CALL WILL BE ELIMINATED.
163 * Use norma_port_location_hint(,mach_task_self(),) instead.
165 routine norma_node_self(
174 * Create a task on the given node, possibly inheriting memory.
175 * Same inheritance semantics as task_create, including inheritance
176 * of initial ports and emulation library, except for memory:
177 * inheritance attributes are ignored, so that all regions appear
178 * in the child task, shared with the parent, until the parent
179 * is destroyed. (The inheritance of the regions in the child
180 * will, however, be set to match the parent.)
182 * This call is intended to support process migration, where the
183 * inheritance semantics of norma_task_create would break migrated
184 * programs that depended upon sharing relationships remaining
187 * This call is not a true task migration call, in that it does not
188 * migrate the port space, threads, and other non-address-space
189 * attributes of the task.
191 routine norma_task_clone(
192 target_task : task_t;
193 inherit_memory : boolean_t;
195 out child_task : task_t);
198 * Create a task on the given node, possibly inheriting memory.
199 * Same inheritance semantics as task_create, including inheritance
200 * of initial ports and emulation library.
201 * Setting child_node to node_self forces local task creation.
203 routine norma_task_create(
204 target_task : task_t;
205 inherit_memory : boolean_t;
207 out child_task : task_t);
210 * Get a given special port for a given node.
211 * Norma special ports are defined in norma_special_ports.h;
212 * examples include the master device port.
213 * There are a limited number of slots available for system servers.
215 routine norma_get_special_port(
216 host_priv : host_priv_t;
219 out port : mach_port_t);
222 * Set a given special port for a given node.
223 * See norma_get_special_port.
225 routine norma_set_special_port(
226 host_priv : host_priv_t;
231 * Just like norma_task_clone, except target_task is terminated,
232 * allowing useful VM optimizations.
234 routine norma_task_teleport(
235 target_task : task_t;
236 inherit_memory : boolean_t;
238 out child_task : task_t);
245 * Return best guess of port's current location.
246 * Guaranteed to be a node where the port once was.
247 * Guaranteed to be accurate if port has never moved.
248 * Can be used to determine residence node for hosts, tasks, threads, etc.
250 routine norma_port_location_hint(