]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_norma.defs
xnu-1504.9.17.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 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
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 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.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
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.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * HISTORY
33 *
34 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
35 * Import of Mac OS X kernel (~semeria)
36 *
37 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
38 * Import of OSF Mach kernel (~mburg)
39 *
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]
43 *
44 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
45 * Merge MK6 and NMK17
46 * [1994/06/13 20:47:52 dlb]
47 *
48 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
49 * Checked in NMK16_1 changes
50 * [94/02/04 bernadat]
51 *
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]
56 * [93/07/16 bernadat]
57 *
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]
61 *
62 * Revision 1.3 1992/12/07 21:29:17 robert
63 * integrate any changes below for 14.0 (branch from 13.16 base)
64 *
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]
68 *
69 * Revision 1.2 1992/11/25 01:13:00 robert
70 * fix history
71 * [1992/11/09 21:25:21 robert]
72 *
73 * integrate changes below for norma_14
74 * [1992/11/09 16:42:52 robert]
75 *
76 * Revision 0.0 92/10/02 dwm
77 * Add Comment: norma_port_location_hint requires send rights on 'port'.
78 *
79 * Revision 1.1 1992/11/05 20:59:18 robert
80 * Initial revision
81 * [92/10/02 dwm]
82 *
83 * $EndLog$
84 */
85/* CMU_HIST */
86/*
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.
90 * Added comments.
91 *
92 * Revision 2.5 91/11/14 16:56:43 rpd
93 * Picked up mysterious norma changes.
94 * [91/11/14 rpd]
95 *
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]
101 *
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]
106 *
107 * Revision 2.2 91/06/06 17:07:57 jsb
108 * First checkin.
109 * [91/05/25 10:37:22 jsb]
110 *
111 */
112/* CMU_ENDHIST */
113/*
114 * Mach Operating System
115 * Copyright (c) 1991 Carnegie Mellon University
116 * All Rights Reserved.
117 *
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.
123 *
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.
127 *
128 * Carnegie Mellon requests users of this software to return to
129 *
130 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
131 * School of Computer Science
132 * Carnegie Mellon University
133 * Pittsburgh PA 15213-3890
134 *
135 * any improvements or extensions that they make and grant Carnegie Mellon
136 * the rights to redistribute these changes.
137 */
138/*
139 */
140
141subsystem
142#if KERNEL_USER
143 KernelUser
b0d623f7 144#endif /* KERNEL_USER */
1c79356b
A
145#if KERNEL_SERVER
146 KernelServer
b0d623f7 147#endif /* KERNEL_SERVER */
1c79356b
A
148 mach_norma 555000;
149#ifdef KERNEL_USER
150userprefix r_;
b0d623f7 151#endif /* KERNEL_USER */
1c79356b
A
152
153#include <mach/std_types.defs>
154#include <mach/mach_types.defs>
155
156skip;
157
158/*
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.
162 */
163routine task_set_child_node(
164 target_task : task_t;
165 child_node : int);
166
167/*
168 * THIS CALL WILL BE ELIMINATED.
169 * Use norma_port_location_hint(,mach_task_self(),) instead.
170 */
171routine norma_node_self(
172 host : host_t;
173 out node : int);
174
175skip;
176
177skip;
178
179/*
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.)
187 *
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
191 * after migration.
192 *
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.
196 */
197routine norma_task_clone(
198 target_task : task_t;
199 inherit_memory : boolean_t;
200 child_node : int;
201 out child_task : task_t);
202
203/*
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.
208 */
209routine norma_task_create(
210 target_task : task_t;
211 inherit_memory : boolean_t;
212 child_node : int;
213 out child_task : task_t);
214
215/*
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.
220 */
221routine norma_get_special_port(
222 host_priv : host_priv_t;
223 node : int;
224 which : int;
225 out port : mach_port_t);
226
227/*
228 * Set a given special port for a given node.
229 * See norma_get_special_port.
230 */
231routine norma_set_special_port(
232 host_priv : host_priv_t;
233 which : int;
234 port : mach_port_t);
235
236/*
237 * Just like norma_task_clone, except target_task is terminated,
238 * allowing useful VM optimizations.
239 */
240routine norma_task_teleport(
241 target_task : task_t;
242 inherit_memory : boolean_t;
243 child_node : int;
244 out child_task : task_t);
245
246skip;
247
248skip;
249
250/*
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.
255 */
256routine norma_port_location_hint(
257 task : task_t;
258 port : mach_port_t;
259 out node : int);
2d21ac55
A
260
261/* vim: set ft=c : */