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