]>
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 | ||
26 | subsystem protocol_vproc 400; | |
27 | ||
28 | #include <mach/std_types.defs> | |
29 | #include <mach/mach_types.defs> | |
30 | #include "launchd_mig_types.defs" | |
ef398931 A |
31 | import "vproc.h"; |
32 | import "vproc_priv.h"; | |
33 | import "vproc_internal.h"; | |
5b0a4722 A |
34 | |
35 | type mach_port_move_send_array_t = array[] of mach_port_move_send_t | |
36 | ctype: mach_port_array_t; | |
37 | ||
5b0a4722 A |
38 | userprefix vproc_mig_; |
39 | serverprefix job_mig_; | |
40 | ||
dcace88f A |
41 | routine |
42 | create_server( | |
43 | j : job_t; | |
44 | servercmd : cmd_t; | |
45 | serveruid : uid_t; | |
46 | ondemand : boolean_t; | |
47 | out serverport : mach_port_make_send_t | |
48 | ); | |
49 | ||
50 | routine | |
51 | reboot2( | |
52 | j : job_t; | |
53 | flags : uint64_t | |
54 | ); | |
55 | ||
56 | routine | |
57 | check_in2( | |
58 | j : job_t; | |
59 | servicename : name_t; | |
60 | out serviceport : mach_port_move_receive_t; | |
61 | out instanceid : uuid_t; | |
62 | flags : uint64_t | |
63 | ); | |
64 | ||
65 | routine | |
66 | register2( | |
67 | j : job_t; | |
68 | servicename : name_t; | |
69 | serviceport : mach_port_t; | |
70 | flags : uint64_t | |
71 | ); | |
72 | ||
73 | routine | |
74 | look_up2( | |
75 | j : job_t; | |
76 | sreplyport rp : mach_port_make_send_once_t; | |
77 | servicename : name_t; | |
78 | out serviceport : mach_port_t; | |
79 | UserAuditToken servercreds : audit_token_t; | |
80 | targetpid : pid_t; | |
81 | instanceid : uuid_t; | |
82 | flags : uint64_t | |
83 | ); | |
84 | ||
85 | routine | |
86 | send_signal( | |
87 | j : job_t; | |
88 | sreplyport rp : mach_port_make_send_once_t; | |
89 | label : name_t; | |
90 | sig : integer_t | |
91 | ); | |
92 | ||
93 | routine | |
94 | parent( | |
95 | j : job_t; | |
96 | sreplyport rp : mach_port_make_send_once_t; | |
97 | out parentport : mach_port_make_send_t | |
98 | ); | |
99 | ||
100 | routine | |
101 | post_fork_ping( | |
102 | j : job_t; | |
103 | taskport : task_t; | |
104 | out asport : mach_port_t | |
105 | ); | |
106 | ||
107 | routine | |
108 | info( | |
109 | j : job_t; | |
110 | out names : name_array_t, dealloc; | |
111 | out jobs : name_array_t, dealloc; | |
112 | out actives : bootstrap_status_array_t, dealloc; | |
113 | flags : uint64_t | |
114 | ); | |
115 | ||
116 | routine | |
117 | subset( | |
118 | j : job_t; | |
119 | reqport : mach_port_t; | |
120 | out subsetport : mach_port_make_send_t | |
121 | ); | |
122 | ||
123 | routine | |
124 | setup_shmem( | |
125 | j : job_t; | |
126 | out shmemport : mach_port_move_send_t | |
127 | ); | |
128 | ||
129 | routine | |
130 | take_subset( | |
131 | j : job_t; | |
132 | out reqport : mach_port_move_send_t; | |
133 | out recvport : mach_port_move_receive_t; | |
134 | out jobs : pointer_t, dealloc; | |
135 | out ports : mach_port_move_send_array_t, dealloc | |
136 | ); | |
137 | ||
138 | routine | |
139 | getsocket( | |
140 | j : job_t; | |
141 | out sockpath : name_t | |
142 | ); | |
143 | ||
144 | skip; /* Formerly spawn. */ | |
145 | ||
146 | skip; /* Formerly wait. */ | |
147 | ||
148 | skip; /* Formerly uncork_fork. */ | |
149 | ||
150 | routine | |
151 | swap_integer( | |
152 | j : job_t; | |
153 | inkey : vproc_gsk_t; | |
154 | outkey : vproc_gsk_t; | |
155 | inval : int64_t; | |
156 | out outval : int64_t | |
157 | ); | |
158 | ||
159 | routine | |
160 | log( | |
161 | j : job_t; | |
162 | pri : integer_t; | |
163 | err : integer_t; | |
164 | message : logmsg_t | |
165 | ); | |
166 | ||
167 | routine | |
168 | lookup_per_user_context( | |
169 | j : job_t; | |
170 | uid : uid_t; | |
171 | out userbport : mach_port_t | |
172 | ); | |
173 | ||
174 | routine | |
175 | move_subset( | |
176 | j : job_t; | |
177 | targetport : mach_port_t; | |
178 | session : name_t; | |
179 | asport : mach_port_t; | |
180 | flags : uint64_t | |
181 | ); | |
182 | ||
183 | routine | |
184 | swap_complex( | |
185 | j : job_t; | |
186 | inkey : vproc_gsk_t; | |
187 | outkey : vproc_gsk_t; | |
188 | inval : pointer_t; | |
189 | out outval : pointer_t, dealloc | |
190 | ); | |
191 | ||
192 | routine | |
193 | log_drain( | |
194 | j : job_t; | |
195 | sreplyport rp : mach_port_make_send_once_t; | |
196 | out outval : pointer_t, dealloc | |
197 | ); | |
198 | ||
199 | routine | |
200 | log_forward( | |
201 | j : job_t; | |
202 | inval : pointer_t | |
203 | ); | |
204 | ||
205 | routine | |
206 | kickstart( | |
207 | j : job_t; | |
208 | label : name_t; | |
209 | out pid : pid_t; | |
210 | flags : natural_t | |
211 | ); | |
212 | ||
213 | skip; | |
214 | ||
215 | routine | |
216 | lookup_children( | |
217 | j : job_t; | |
218 | out childports : mach_port_move_send_array_t, dealloc; | |
219 | out childnames : name_array_t, dealloc; | |
220 | out childprops : bootstrap_property_array_t, dealloc | |
221 | ); | |
222 | ||
223 | routine | |
224 | switch_to_session( | |
225 | j : job_t; | |
226 | reqport : mach_port_t; | |
227 | session : name_t; | |
228 | asport : mach_port_t; | |
229 | out newbsport : mach_port_make_send_t | |
230 | ); | |
231 | ||
232 | routine | |
233 | transaction_count_for_pid( | |
234 | j : job_t; | |
235 | pid : pid_t; | |
236 | out count : integer_t; | |
237 | out condemned : boolean_t | |
238 | ); | |
ddbbfbc1 | 239 | |
dcace88f A |
240 | routine |
241 | pid_is_managed( | |
242 | j : job_t; | |
243 | pid : pid_t; | |
244 | out managed : boolean_t | |
245 | ); | |
246 | ||
247 | routine | |
248 | port_for_label( | |
249 | j : job_t; | |
250 | label : name_t; | |
251 | out jport : mach_port_make_send_t | |
252 | ); | |
253 | ||
254 | routine | |
255 | init_session( | |
256 | j : job_t; | |
257 | session : name_t; | |
258 | asport : mach_port_t | |
259 | ); | |
260 | ||
261 | routine | |
262 | set_security_session( | |
263 | j : job_t; | |
264 | uuid : uuid_t; | |
265 | asport : mach_port_t | |
266 | ); | |
267 | ||
268 | skip; /* Formerly wait2. */ | |
269 | ||
270 | routine | |
271 | event_source_check_in( | |
272 | j : job_t; | |
273 | stream : name_t; | |
274 | pingport : mach_port_make_send_once_t; | |
275 | out events : pointer_t, dealloc; | |
276 | out tokens : event_token_array_t | |
277 | ); | |
278 | ||
279 | routine | |
280 | event_set_state( | |
281 | j : job_t; | |
282 | stream : name_t; | |
283 | token : uint64_t; | |
284 | state : boolean_t | |
285 | ); | |
286 | ||
287 | routine | |
288 | spawn2( | |
289 | j : job_t; | |
290 | sreplyport rp : mach_port_make_send_once_t; | |
291 | job : pointer_t; | |
292 | asport : mach_port_t; | |
293 | out outpid : pid_t; | |
294 | out obsrvport : mach_port_move_receive_t | |
295 | ); | |
296 | ||
297 | routine | |
298 | get_root_bootstrap( | |
299 | j : job_t; | |
300 | out rootbs : mach_port_move_send_t | |
301 | ); |