]>
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 | ||
41 | routine create_server( | |
ddbbfbc1 A |
42 | __bs_port : job_t; |
43 | __server_cmd : cmd_t; | |
44 | __server_uid : uid_t; | |
45 | __on_demand : boolean_t; | |
46 | out __server_port : mach_port_make_send_t); | |
5b0a4722 A |
47 | |
48 | routine reboot2( | |
ddbbfbc1 A |
49 | __bs_port : job_t; |
50 | __flags : uint64_t); | |
5b0a4722 | 51 | |
ddbbfbc1 A |
52 | routine check_in2( |
53 | __bs_port : job_t; | |
54 | __service_name : name_t; | |
55 | out __service_port : mach_port_move_receive_t; | |
56 | __flags : uint64_t); | |
5b0a4722 A |
57 | |
58 | routine register2( | |
ddbbfbc1 A |
59 | __bs_port : job_t; |
60 | __service_name : name_t; | |
61 | __service_port : mach_port_t; | |
62 | __flags : uint64_t); | |
5b0a4722 A |
63 | |
64 | routine look_up2( | |
ddbbfbc1 A |
65 | __bs_port : job_t; |
66 | sreplyport __rport : mach_port_make_send_once_t; | |
67 | __service_name : name_t; | |
68 | out __service_port : mach_port_t; | |
69 | UserAuditToken __server_cred : audit_token_t; | |
70 | __target_pid : pid_t; | |
71 | __flags : uint64_t); | |
5b0a4722 A |
72 | |
73 | routine send_signal( | |
ddbbfbc1 A |
74 | __bs_port : job_t; |
75 | sreplyport __rport : mach_port_make_send_once_t; | |
76 | __label : name_t; | |
77 | __signal : integer_t); | |
5b0a4722 A |
78 | |
79 | routine parent( | |
ddbbfbc1 A |
80 | __bs_port : job_t; |
81 | sreplyport __rport : mach_port_make_send_once_t; | |
82 | out __parent_port : mach_port_make_send_t); | |
5b0a4722 A |
83 | |
84 | routine post_fork_ping( | |
ddbbfbc1 A |
85 | __bs_port : job_t; |
86 | __task_port : task_t; | |
87 | out __audit_session : mach_port_t); | |
5b0a4722 A |
88 | |
89 | routine info( | |
ddbbfbc1 A |
90 | __bs_port : job_t; |
91 | out __service_names : name_array_t, dealloc; | |
92 | out __service_jobs : name_array_t, dealloc; | |
93 | out __service_active : bootstrap_status_array_t, dealloc; | |
94 | __flags : uint64_t); | |
5b0a4722 A |
95 | |
96 | routine subset( | |
ddbbfbc1 A |
97 | __bs_port : job_t; |
98 | __requestor_port : mach_port_t; | |
99 | out __subset_port : mach_port_make_send_t); | |
5b0a4722 | 100 | |
ddbbfbc1 A |
101 | routine setup_shmem( |
102 | __bs_port : job_t; | |
103 | out __shmem_port : mach_port_move_send_t); | |
5b0a4722 A |
104 | |
105 | routine take_subset( | |
ddbbfbc1 A |
106 | __bs_port : job_t; |
107 | out __bs_reqport : mach_port_move_send_t; | |
108 | out __bs_rcvright : mach_port_move_receive_t; | |
109 | out __outdata : pointer_t, dealloc; | |
110 | out __service_ports : mach_port_move_send_array_t, dealloc); | |
5b0a4722 A |
111 | |
112 | routine getsocket( | |
ddbbfbc1 A |
113 | __bs_port : job_t; |
114 | out __sockpath : name_t); | |
5b0a4722 A |
115 | |
116 | routine spawn( | |
ddbbfbc1 A |
117 | __bs_port : job_t; |
118 | __indata : pointer_t; | |
119 | __audit_session : mach_port_t; | |
120 | out __pid : pid_t; | |
121 | out __obsvr_port : mach_port_make_send_t); | |
5b0a4722 A |
122 | |
123 | routine wait( | |
ddbbfbc1 A |
124 | __bs_port : job_t; |
125 | sreplyport __rport : mach_port_make_send_once_t; | |
126 | out __waitval : integer_t); | |
5b0a4722 A |
127 | |
128 | routine uncork_fork( | |
ddbbfbc1 | 129 | __bs_port : job_t); |
5b0a4722 A |
130 | |
131 | routine swap_integer( | |
ddbbfbc1 A |
132 | __bs_port : job_t; |
133 | __inkey : vproc_gsk_t; | |
134 | __outkey : vproc_gsk_t; | |
135 | __inval : int64_t; | |
136 | out __outval : int64_t); | |
5b0a4722 A |
137 | |
138 | routine log( | |
ddbbfbc1 A |
139 | __bs_port : job_t; |
140 | __pri : integer_t; | |
141 | __err : integer_t; | |
142 | __msg : logmsg_t); | |
5b0a4722 A |
143 | |
144 | routine lookup_per_user_context( | |
ddbbfbc1 A |
145 | __bs_port : job_t; |
146 | __wu : uid_t; | |
147 | out __u_cont : mach_port_t); | |
5b0a4722 A |
148 | |
149 | routine move_subset( | |
ddbbfbc1 A |
150 | __bs_port : job_t; |
151 | __target_port : mach_port_t; | |
152 | __sessiontype : name_t; | |
153 | __audit_session : mach_port_t; | |
154 | __sessionflags : uint64_t); | |
5b0a4722 A |
155 | |
156 | routine swap_complex( | |
ddbbfbc1 A |
157 | __bs_port : job_t; |
158 | __inkey : vproc_gsk_t; | |
159 | __outkey : vproc_gsk_t; | |
160 | __inval : pointer_t; | |
161 | out __outval : pointer_t, dealloc); | |
5b0a4722 A |
162 | |
163 | routine log_drain( | |
ddbbfbc1 A |
164 | __bs_port : job_t; |
165 | sreplyport __rport : mach_port_make_send_once_t; | |
166 | out __outval : pointer_t, dealloc); | |
5b0a4722 A |
167 | |
168 | routine log_forward( | |
ddbbfbc1 A |
169 | __bs_port : job_t; |
170 | __inval : pointer_t); | |
f36da725 | 171 | |
ddbbfbc1 A |
172 | routine kickstart( |
173 | __bs_port : job_t; | |
174 | __label : name_t; | |
175 | out __pid : pid_t; | |
176 | out __name_port : mach_port_t; | |
177 | out __obsrvr_port : mach_port_make_send_t; | |
178 | __flags : natural_t); | |
f36da725 A |
179 | |
180 | routine embedded_wait( | |
ddbbfbc1 A |
181 | __bs_port : job_t; |
182 | __label : name_t; | |
183 | out __waitval : integer_t); | |
184 | ||
185 | routine lookup_children( | |
186 | __bs_port : job_t; | |
187 | out __child_ports : mach_port_move_send_array_t, dealloc; | |
188 | out __child_names : name_array_t, dealloc; | |
189 | out __child_properties : bootstrap_property_array_t, dealloc); | |
190 | ||
191 | routine switch_to_session( | |
192 | __bs_port : job_t; | |
193 | __req_port : mach_port_t; | |
194 | __session_name : name_t; | |
195 | __audit_session : mach_port_t; | |
196 | out __new_bs_port : mach_port_make_send_t); | |
197 | ||
198 | routine transaction_count_for_pid( | |
199 | __bs_port : job_t; | |
200 | __pid : pid_t; | |
201 | out __cnt : integer_t; | |
202 | out __condemend : boolean_t); | |
203 | ||
204 | routine pid_is_managed( | |
205 | __bs_port : job_t; | |
206 | __pid : pid_t; | |
207 | out __managed : boolean_t); | |
208 | ||
209 | routine port_for_label( | |
210 | __bs_port : job_t; | |
211 | __label : name_t; | |
212 | out __mp : mach_port_make_send_t); | |
213 | ||
214 | routine init_session( | |
215 | __bs_port : job_t; | |
216 | __session_name : name_t; | |
217 | __audit_session : mach_port_t); | |
218 | ||
219 | routine set_security_session( | |
220 | __bs_port : job_t; | |
221 | __uuid : uuid_t; | |
222 | __session : mach_port_t); | |
223 | ||
224 | routine wait2( | |
225 | __bs_port : job_t; | |
226 | __target_port : job_t; | |
227 | sreplyport __rport : mach_port_make_send_once_t; | |
228 | out __waitval : integer_t; | |
229 | __legacy : boolean_t); |