]>
Commit | Line | Data |
---|---|---|
5b0a4722 A |
1 | /* |
2 | * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_APACHE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
7 | * you may not use this file except in compliance with the License. | |
8 | * You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, software | |
13 | * distributed under the License is distributed on an "AS IS" BASIS, | |
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
15 | * See the License for the specific language governing permissions and | |
16 | * limitations under the License. | |
17 | * | |
18 | * @APPLE_APACHE_LICENSE_HEADER_END@ | |
19 | */ | |
20 | /* | |
21 | * bootstrap -- fundamental service initiator and port server | |
22 | * Mike DeMoney, NeXT, Inc. | |
23 | * Copyright, 1990. All rights reserved. | |
24 | */ | |
25 | ||
eabd1701 | 26 | subsystem job 400; |
5b0a4722 A |
27 | |
28 | #include <mach/std_types.defs> | |
29 | #include <mach/mach_types.defs> | |
eabd1701 | 30 | #include "job_types.defs" |
ef398931 A |
31 | import "vproc.h"; |
32 | import "vproc_priv.h"; | |
33 | import "vproc_internal.h"; | |
5b0a4722 | 34 | |
5b0a4722 A |
35 | userprefix vproc_mig_; |
36 | serverprefix job_mig_; | |
37 | ||
dcace88f A |
38 | routine |
39 | create_server( | |
40 | j : job_t; | |
41 | servercmd : cmd_t; | |
42 | serveruid : uid_t; | |
43 | ondemand : boolean_t; | |
44 | out serverport : mach_port_make_send_t | |
45 | ); | |
46 | ||
47 | routine | |
48 | reboot2( | |
49 | j : job_t; | |
50 | flags : uint64_t | |
51 | ); | |
52 | ||
53 | routine | |
54 | check_in2( | |
55 | j : job_t; | |
56 | servicename : name_t; | |
57 | out serviceport : mach_port_move_receive_t; | |
58 | out instanceid : uuid_t; | |
59 | flags : uint64_t | |
60 | ); | |
61 | ||
62 | routine | |
63 | register2( | |
64 | j : job_t; | |
65 | servicename : name_t; | |
66 | serviceport : mach_port_t; | |
67 | flags : uint64_t | |
68 | ); | |
69 | ||
70 | routine | |
71 | look_up2( | |
72 | j : job_t; | |
73 | sreplyport rp : mach_port_make_send_once_t; | |
74 | servicename : name_t; | |
75 | out serviceport : mach_port_t; | |
76 | UserAuditToken servercreds : audit_token_t; | |
77 | targetpid : pid_t; | |
78 | instanceid : uuid_t; | |
79 | flags : uint64_t | |
80 | ); | |
81 | ||
82 | routine | |
83 | send_signal( | |
84 | j : job_t; | |
85 | sreplyport rp : mach_port_make_send_once_t; | |
86 | label : name_t; | |
87 | sig : integer_t | |
88 | ); | |
89 | ||
90 | routine | |
91 | parent( | |
92 | j : job_t; | |
93 | sreplyport rp : mach_port_make_send_once_t; | |
94 | out parentport : mach_port_make_send_t | |
95 | ); | |
96 | ||
97 | routine | |
98 | post_fork_ping( | |
99 | j : job_t; | |
100 | taskport : task_t; | |
101 | out asport : mach_port_t | |
102 | ); | |
103 | ||
104 | routine | |
105 | info( | |
106 | j : job_t; | |
107 | out names : name_array_t, dealloc; | |
108 | out jobs : name_array_t, dealloc; | |
109 | out actives : bootstrap_status_array_t, dealloc; | |
110 | flags : uint64_t | |
111 | ); | |
112 | ||
113 | routine | |
114 | subset( | |
115 | j : job_t; | |
116 | reqport : mach_port_t; | |
117 | out subsetport : mach_port_make_send_t | |
118 | ); | |
119 | ||
eabd1701 | 120 | skip; /* Formerly setup_shmem. */ |
dcace88f A |
121 | |
122 | routine | |
123 | take_subset( | |
124 | j : job_t; | |
125 | out reqport : mach_port_move_send_t; | |
126 | out recvport : mach_port_move_receive_t; | |
127 | out jobs : pointer_t, dealloc; | |
128 | out ports : mach_port_move_send_array_t, dealloc | |
129 | ); | |
130 | ||
131 | routine | |
132 | getsocket( | |
133 | j : job_t; | |
134 | out sockpath : name_t | |
135 | ); | |
136 | ||
137 | skip; /* Formerly spawn. */ | |
138 | ||
139 | skip; /* Formerly wait. */ | |
140 | ||
141 | skip; /* Formerly uncork_fork. */ | |
142 | ||
143 | routine | |
144 | swap_integer( | |
145 | j : job_t; | |
146 | inkey : vproc_gsk_t; | |
147 | outkey : vproc_gsk_t; | |
148 | inval : int64_t; | |
149 | out outval : int64_t | |
150 | ); | |
151 | ||
152 | routine | |
153 | log( | |
154 | j : job_t; | |
155 | pri : integer_t; | |
156 | err : integer_t; | |
157 | message : logmsg_t | |
158 | ); | |
159 | ||
160 | routine | |
161 | lookup_per_user_context( | |
162 | j : job_t; | |
163 | uid : uid_t; | |
164 | out userbport : mach_port_t | |
165 | ); | |
166 | ||
167 | routine | |
168 | move_subset( | |
169 | j : job_t; | |
170 | targetport : mach_port_t; | |
171 | session : name_t; | |
172 | asport : mach_port_t; | |
173 | flags : uint64_t | |
174 | ); | |
175 | ||
176 | routine | |
177 | swap_complex( | |
178 | j : job_t; | |
179 | inkey : vproc_gsk_t; | |
180 | outkey : vproc_gsk_t; | |
181 | inval : pointer_t; | |
182 | out outval : pointer_t, dealloc | |
183 | ); | |
184 | ||
185 | routine | |
186 | log_drain( | |
187 | j : job_t; | |
188 | sreplyport rp : mach_port_make_send_once_t; | |
189 | out outval : pointer_t, dealloc | |
190 | ); | |
191 | ||
192 | routine | |
193 | log_forward( | |
194 | j : job_t; | |
195 | inval : pointer_t | |
196 | ); | |
197 | ||
198 | routine | |
199 | kickstart( | |
200 | j : job_t; | |
201 | label : name_t; | |
202 | out pid : pid_t; | |
203 | flags : natural_t | |
204 | ); | |
205 | ||
eabd1701 | 206 | skip; /* Formerly embedded_wait. */ |
dcace88f A |
207 | |
208 | routine | |
209 | lookup_children( | |
210 | j : job_t; | |
211 | out childports : mach_port_move_send_array_t, dealloc; | |
212 | out childnames : name_array_t, dealloc; | |
213 | out childprops : bootstrap_property_array_t, dealloc | |
214 | ); | |
215 | ||
216 | routine | |
217 | switch_to_session( | |
218 | j : job_t; | |
219 | reqport : mach_port_t; | |
220 | session : name_t; | |
221 | asport : mach_port_t; | |
222 | out newbsport : mach_port_make_send_t | |
223 | ); | |
224 | ||
eabd1701 A |
225 | skip; /* Formerly transaction_count_for_pid. */ |
226 | ||
dcace88f A |
227 | routine |
228 | pid_is_managed( | |
229 | j : job_t; | |
230 | pid : pid_t; | |
231 | out managed : boolean_t | |
232 | ); | |
233 | ||
234 | routine | |
235 | port_for_label( | |
236 | j : job_t; | |
237 | label : name_t; | |
238 | out jport : mach_port_make_send_t | |
239 | ); | |
240 | ||
241 | routine | |
242 | init_session( | |
243 | j : job_t; | |
244 | session : name_t; | |
245 | asport : mach_port_t | |
246 | ); | |
247 | ||
248 | routine | |
249 | set_security_session( | |
250 | j : job_t; | |
251 | uuid : uuid_t; | |
252 | asport : mach_port_t | |
253 | ); | |
254 | ||
255 | skip; /* Formerly wait2. */ | |
256 | ||
eabd1701 | 257 | skip; /* Formerly event_source_check_in. */ |
dcace88f | 258 | |
eabd1701 | 259 | skip; /* Formerly event_set_state. */ |
dcace88f A |
260 | |
261 | routine | |
262 | spawn2( | |
263 | j : job_t; | |
264 | sreplyport rp : mach_port_make_send_once_t; | |
265 | job : pointer_t; | |
266 | asport : mach_port_t; | |
267 | out outpid : pid_t; | |
268 | out obsrvport : mach_port_move_receive_t | |
269 | ); | |
270 | ||
271 | routine | |
272 | get_root_bootstrap( | |
273 | j : job_t; | |
274 | out rootbs : mach_port_move_send_t | |
275 | ); | |
eabd1701 A |
276 | |
277 | routine | |
278 | legacy_ipc_request( | |
279 | j : job_t; | |
280 | request : pointer_t; | |
281 | request_fds : mach_port_move_send_array_t; | |
282 | out reply : pointer_t, dealloc; | |
283 | out reply_fds : mach_port_move_send_array_t, dealloc; | |
284 | asport : mach_port_t | |
285 | ); | |
95379394 A |
286 | |
287 | routine | |
288 | get_listener_port_rights( | |
289 | j : job_t; | |
290 | out sports : mach_port_make_send_array_t, dealloc | |
291 | ); | |
292 | ||
293 | routine | |
294 | register_gui_session( | |
295 | j : job_t; | |
296 | asport : mach_port_t | |
297 | ); |