]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/mach_norma.defs
xnu-201.19.3.tar.gz
[apple/xnu.git] / osfmk / mach / mach_norma.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 */
25 /*
26 * HISTORY
27 *
28 * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez
29 * Import of Mac OS X kernel (~semeria)
30 *
31 * Revision 1.1.1.1 1998/03/07 02:25:45 wsanchez
32 * Import of OSF Mach kernel (~mburg)
33 *
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]
37 *
38 * Revision 1.3.17.1 1994/06/13 20:49:36 dlb
39 * Merge MK6 and NMK17
40 * [1994/06/13 20:47:52 dlb]
41 *
42 * Revision 1.3.11.1 1994/02/08 11:01:11 bernadat
43 * Checked in NMK16_1 changes
44 * [94/02/04 bernadat]
45 *
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]
50 * [93/07/16 bernadat]
51 *
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]
55 *
56 * Revision 1.3 1992/12/07 21:29:17 robert
57 * integrate any changes below for 14.0 (branch from 13.16 base)
58 *
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]
62 *
63 * Revision 1.2 1992/11/25 01:13:00 robert
64 * fix history
65 * [1992/11/09 21:25:21 robert]
66 *
67 * integrate changes below for norma_14
68 * [1992/11/09 16:42:52 robert]
69 *
70 * Revision 0.0 92/10/02 dwm
71 * Add Comment: norma_port_location_hint requires send rights on 'port'.
72 *
73 * Revision 1.1 1992/11/05 20:59:18 robert
74 * Initial revision
75 * [92/10/02 dwm]
76 *
77 * $EndLog$
78 */
79 /* CMU_HIST */
80 /*
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.
84 * Added comments.
85 *
86 * Revision 2.5 91/11/14 16:56:43 rpd
87 * Picked up mysterious norma changes.
88 * [91/11/14 rpd]
89 *
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]
95 *
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]
100 *
101 * Revision 2.2 91/06/06 17:07:57 jsb
102 * First checkin.
103 * [91/05/25 10:37:22 jsb]
104 *
105 */
106 /* CMU_ENDHIST */
107 /*
108 * Mach Operating System
109 * Copyright (c) 1991 Carnegie Mellon University
110 * All Rights Reserved.
111 *
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.
117 *
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.
121 *
122 * Carnegie Mellon requests users of this software to return to
123 *
124 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
125 * School of Computer Science
126 * Carnegie Mellon University
127 * Pittsburgh PA 15213-3890
128 *
129 * any improvements or extensions that they make and grant Carnegie Mellon
130 * the rights to redistribute these changes.
131 */
132 /*
133 */
134
135 subsystem
136 #if KERNEL_USER
137 KernelUser
138 #endif KERNEL_USER
139 #if KERNEL_SERVER
140 KernelServer
141 #endif KERNEL_SERVER
142 mach_norma 555000;
143 #ifdef KERNEL_USER
144 userprefix r_;
145 #endif KERNEL_USER
146
147 #include <mach/std_types.defs>
148 #include <mach/mach_types.defs>
149
150 skip;
151
152 /*
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.
156 */
157 routine task_set_child_node(
158 target_task : task_t;
159 child_node : int);
160
161 /*
162 * THIS CALL WILL BE ELIMINATED.
163 * Use norma_port_location_hint(,mach_task_self(),) instead.
164 */
165 routine norma_node_self(
166 host : host_t;
167 out node : int);
168
169 skip;
170
171 skip;
172
173 /*
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.)
181 *
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
185 * after migration.
186 *
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.
190 */
191 routine norma_task_clone(
192 target_task : task_t;
193 inherit_memory : boolean_t;
194 child_node : int;
195 out child_task : task_t);
196
197 /*
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.
202 */
203 routine norma_task_create(
204 target_task : task_t;
205 inherit_memory : boolean_t;
206 child_node : int;
207 out child_task : task_t);
208
209 /*
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.
214 */
215 routine norma_get_special_port(
216 host_priv : host_priv_t;
217 node : int;
218 which : int;
219 out port : mach_port_t);
220
221 /*
222 * Set a given special port for a given node.
223 * See norma_get_special_port.
224 */
225 routine norma_set_special_port(
226 host_priv : host_priv_t;
227 which : int;
228 port : mach_port_t);
229
230 /*
231 * Just like norma_task_clone, except target_task is terminated,
232 * allowing useful VM optimizations.
233 */
234 routine norma_task_teleport(
235 target_task : task_t;
236 inherit_memory : boolean_t;
237 child_node : int;
238 out child_task : task_t);
239
240 skip;
241
242 skip;
243
244 /*
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.
249 */
250 routine norma_port_location_hint(
251 task : task_t;
252 port : mach_port_t;
253 out node : int);