File: | obj-scan-build/boot/ioServer.c |
Location: | line 1172, column 2 |
Description: | Value stored to 'msgh_simple' is never read |
1 | /* Module io */ |
2 | |
3 | #ifndef _GNU_SOURCE1 |
4 | #define _GNU_SOURCE1 1 |
5 | #endif |
6 | |
7 | #define EXPORT_BOOLEAN |
8 | #include <mach/boolean.h> |
9 | #include <mach/kern_return.h> |
10 | #include <mach/message.h> |
11 | #include <mach/mig_errors.h> |
12 | #include <mach/mig_support.h> |
13 | |
14 | #ifndef mig_internalstatic |
15 | #define mig_internalstatic static |
16 | #endif |
17 | |
18 | #ifndef mig_external |
19 | #define mig_external |
20 | #endif |
21 | |
22 | #ifndef mig_unlikely |
23 | #define mig_unlikely(X)__builtin_expect (!! (X), 0) __builtin_expect (!! (X), 0) |
24 | #endif |
25 | |
26 | #ifndef TypeCheck1 |
27 | #define TypeCheck1 1 |
28 | #endif |
29 | |
30 | #ifndef UseExternRCSId1 |
31 | #define UseExternRCSId1 1 |
32 | #endif |
33 | |
34 | #define BAD_TYPECHECK(type, check)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) mig_unlikely (({\__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
35 | union { mach_msg_type_t t; unsigned32_t w; } _t, _c;\__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
36 | _t.t = *(type); _c.t = *(check);_t.w != _c.w; }))__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(type); _c.t = *(check);_t.w != _c.w; } )), 0) |
37 | #define msgh_request_portmsgh_local_port msgh_local_port |
38 | #define MACH_MSGH_BITS_REQUEST(bits)(((bits) & 0x0000ff00) >> 8) MACH_MSGH_BITS_LOCAL(bits)(((bits) & 0x0000ff00) >> 8) |
39 | #define msgh_reply_portmsgh_remote_port msgh_remote_port |
40 | #define MACH_MSGH_BITS_REPLY(bits)((bits) & 0x000000ff) MACH_MSGH_BITS_REMOTE(bits)((bits) & 0x000000ff) |
41 | |
42 | #include <mach/std_types.h> |
43 | #include <mach/mach_types.h> |
44 | #include <device/device_types.h> |
45 | #include <device/net_status.h> |
46 | #include <sys/types.h> |
47 | #include <sys/stat.h> |
48 | #include <sys/statfs.h> |
49 | #include <sys/resource.h> |
50 | #include <sys/utsname.h> |
51 | #include <hurd/hurd_types.h> |
52 | |
53 | /* Routine io_write */ |
54 | mig_internalstatic void _Xio_write |
55 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
56 | { |
57 | typedef struct { |
58 | mach_msg_header_t Head; |
59 | mach_msg_type_long_t dataType; |
60 | char data[2048]; |
61 | mach_msg_type_t offsetType; |
62 | loff_t offset; |
63 | } Request; |
64 | |
65 | typedef struct { |
66 | mach_msg_header_t Head; |
67 | mach_msg_type_t RetCodeType; |
68 | kern_return_t RetCode; |
69 | mach_msg_type_t amountType; |
70 | vm_size_t amount; |
71 | } Reply; |
72 | |
73 | Request *In0P = (Request *) InHeadP; |
74 | Request *In1P; |
75 | Reply *OutP = (Reply *) OutHeadP; |
76 | mig_external kern_return_t S_io_write |
77 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t data, mach_msg_type_number_t dataCnt, loff_t offset, vm_size_t *amount); |
78 | |
79 | #if TypeCheck1 |
80 | boolean_t msgh_simple = msgh_simple; |
81 | #endif /* TypeCheck */ |
82 | |
83 | unsigned int msgh_size; |
84 | unsigned int msgh_size_delta; |
85 | |
86 | const mach_msg_type_t offsetCheck = { |
87 | /* msgt_name = */ 11, |
88 | /* msgt_size = */ 64, |
89 | /* msgt_number = */ 1, |
90 | /* msgt_inline = */ TRUE((boolean_t) 1), |
91 | /* msgt_longform = */ FALSE((boolean_t) 0), |
92 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
93 | /* msgt_unused = */ 0 |
94 | }; |
95 | |
96 | const mach_msg_type_t amountType = { |
97 | /* msgt_name = */ 2, |
98 | /* msgt_size = */ 32, |
99 | /* msgt_number = */ 1, |
100 | /* msgt_inline = */ TRUE((boolean_t) 1), |
101 | /* msgt_longform = */ FALSE((boolean_t) 0), |
102 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
103 | /* msgt_unused = */ 0 |
104 | }; |
105 | |
106 | #if TypeCheck1 |
107 | msgh_size = In0P->Head.msgh_size; |
108 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
109 | if (mig_unlikely ((msgh_size < 48))__builtin_expect (!! ((msgh_size < 48)), 0)) |
110 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
111 | #endif /* TypeCheck */ |
112 | |
113 | #if TypeCheck1 |
114 | if (mig_unlikely ((In0P->dataType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0) |
115 | (In0P->dataType.msgtl_name != 8) ||__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0) |
116 | (In0P->dataType.msgtl_size != 8))__builtin_expect (!! ((In0P->dataType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->dataType.msgtl_name != 8) || (In0P->dataType.msgtl_size != 8)), 0)) |
117 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
118 | #endif /* TypeCheck */ |
119 | |
120 | msgh_size_delta = (In0P->dataType.msgtl_header.msgt_inline) ? (In0P->dataType.msgtl_number + 3) & ~3 : sizeof(char *); |
121 | #if TypeCheck1 |
122 | if (mig_unlikely (msgh_size != 48 + msgh_size_delta)__builtin_expect (!! (msgh_size != 48 + msgh_size_delta), 0)) |
123 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
124 | #endif /* TypeCheck */ |
125 | |
126 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
127 | |
128 | #if TypeCheck1 |
129 | if (BAD_TYPECHECK(&In1P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In1P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
130 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
131 | #endif /* TypeCheck */ |
132 | |
133 | OutP->RetCode = S_io_write(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), (In0P->dataType.msgtl_header.msgt_inline) ? In0P->data : *((char **)In0P->data), In0P->dataType.msgtl_number, In1P->offset, &OutP->amount); |
134 | if (OutP->RetCode == KERN_SUCCESS0) |
135 | if (!In0P->dataType.msgtl_header.msgt_inline) |
136 | __mig_deallocate(* (vm_offset_t *) In0P->data, In0P->dataType.msgtl_number); |
137 | if (OutP->RetCode != KERN_SUCCESS0) |
138 | return; |
139 | |
140 | OutP->Head.msgh_size = 40; |
141 | |
142 | OutP->amountType = amountType; |
143 | } |
144 | |
145 | /* Default implementation of S_io_write */ |
146 | #ifdef MIG_EOPNOTSUPP |
147 | kern_return_t __attribute__ ((weak)) |
148 | S_io_write |
149 | ( |
150 | io_t io_object, |
151 | mach_port_t reply, |
152 | mach_msg_type_name_t replyPoly, |
153 | data_t data, |
154 | mach_msg_type_number_t dataCnt, |
155 | loff_t offset, |
156 | vm_size_t *amount |
157 | ) { return MIG_EOPNOTSUPP; } |
158 | #endif /* MIG_EOPNOTSUPP */ |
159 | |
160 | /* Routine io_read */ |
161 | mig_internalstatic void _Xio_read |
162 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
163 | { |
164 | typedef struct { |
165 | mach_msg_header_t Head; |
166 | mach_msg_type_t offsetType; |
167 | loff_t offset; |
168 | mach_msg_type_t amountType; |
169 | vm_size_t amount; |
170 | } Request; |
171 | |
172 | typedef struct { |
173 | mach_msg_header_t Head; |
174 | mach_msg_type_t RetCodeType; |
175 | kern_return_t RetCode; |
176 | mach_msg_type_long_t dataType; |
177 | char data[2048]; |
178 | } Reply; |
179 | |
180 | Request *In0P = (Request *) InHeadP; |
181 | Reply *OutP = (Reply *) OutHeadP; |
182 | mig_external kern_return_t S_io_read |
183 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, data_t *data, mach_msg_type_number_t *dataCnt, loff_t offset, vm_size_t amount); |
184 | |
185 | boolean_t msgh_simple = msgh_simple; |
186 | const mach_msg_type_t offsetCheck = { |
187 | /* msgt_name = */ 11, |
188 | /* msgt_size = */ 64, |
189 | /* msgt_number = */ 1, |
190 | /* msgt_inline = */ TRUE((boolean_t) 1), |
191 | /* msgt_longform = */ FALSE((boolean_t) 0), |
192 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
193 | /* msgt_unused = */ 0 |
194 | }; |
195 | |
196 | const mach_msg_type_t amountCheck = { |
197 | /* msgt_name = */ 2, |
198 | /* msgt_size = */ 32, |
199 | /* msgt_number = */ 1, |
200 | /* msgt_inline = */ TRUE((boolean_t) 1), |
201 | /* msgt_longform = */ FALSE((boolean_t) 0), |
202 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
203 | /* msgt_unused = */ 0 |
204 | }; |
205 | |
206 | const mach_msg_type_long_t dataType = { |
207 | { |
208 | /* msgt_name = */ 0, |
209 | /* msgt_size = */ 0, |
210 | /* msgt_number = */ 0, |
211 | /* msgt_inline = */ TRUE((boolean_t) 1), |
212 | /* msgt_longform = */ TRUE((boolean_t) 1), |
213 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
214 | /* msgt_unused = */ 0 |
215 | }, |
216 | /* msgtl_name = */ 8, |
217 | /* msgtl_size = */ 8, |
218 | /* msgtl_number = */ 2048, |
219 | }; |
220 | |
221 | mach_msg_type_number_t dataCnt; |
222 | |
223 | char *dataP; |
224 | |
225 | #if TypeCheck1 |
226 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
227 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
228 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
229 | #endif /* TypeCheck */ |
230 | |
231 | #if TypeCheck1 |
232 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
233 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
234 | #endif /* TypeCheck */ |
235 | |
236 | #if TypeCheck1 |
237 | if (BAD_TYPECHECK(&In0P->amountType, &amountCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->amountType); _c.t = *(& amountCheck);_t.w != _c.w; })), 0)) |
238 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
239 | #endif /* TypeCheck */ |
240 | |
241 | dataP = OutP->data; |
242 | dataCnt = 2048; |
243 | |
244 | OutP->RetCode = S_io_read(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &dataP, &dataCnt, In0P->offset, In0P->amount); |
245 | if (OutP->RetCode != KERN_SUCCESS0) |
246 | return; |
247 | |
248 | msgh_simple = TRUE((boolean_t) 1); |
249 | |
250 | OutP->dataType = dataType; |
251 | if (dataP != OutP->data) { |
252 | OutP->dataType.msgtl_header.msgt_inline = FALSE((boolean_t) 0); |
253 | OutP->dataType.msgtl_header.msgt_deallocate = TRUE((boolean_t) 1); |
254 | *((char **)OutP->data) = dataP; |
255 | msgh_simple = FALSE((boolean_t) 0); |
256 | } |
257 | |
258 | OutP->dataType.msgtl_number = dataCnt; |
259 | OutP->Head.msgh_size = 44 + ((OutP->dataType.msgtl_header.msgt_inline) ? (dataCnt + 3) & ~3 : sizeof(char *)); |
260 | |
261 | if (!msgh_simple) |
262 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
263 | } |
264 | |
265 | /* Default implementation of S_io_read */ |
266 | #ifdef MIG_EOPNOTSUPP |
267 | kern_return_t __attribute__ ((weak)) |
268 | S_io_read |
269 | ( |
270 | io_t io_object, |
271 | mach_port_t reply, |
272 | mach_msg_type_name_t replyPoly, |
273 | data_t *data, |
274 | mach_msg_type_number_t *dataCnt, |
275 | loff_t offset, |
276 | vm_size_t amount |
277 | ) { return MIG_EOPNOTSUPP; } |
278 | #endif /* MIG_EOPNOTSUPP */ |
279 | |
280 | /* Routine io_seek */ |
281 | mig_internalstatic void _Xio_seek |
282 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
283 | { |
284 | typedef struct { |
285 | mach_msg_header_t Head; |
286 | mach_msg_type_t offsetType; |
287 | loff_t offset; |
288 | mach_msg_type_t whenceType; |
289 | int whence; |
290 | } Request; |
291 | |
292 | typedef struct { |
293 | mach_msg_header_t Head; |
294 | mach_msg_type_t RetCodeType; |
295 | kern_return_t RetCode; |
296 | mach_msg_type_t newpType; |
297 | loff_t newp; |
298 | } Reply; |
299 | |
300 | Request *In0P = (Request *) InHeadP; |
301 | Reply *OutP = (Reply *) OutHeadP; |
302 | mig_external kern_return_t S_io_seek |
303 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, loff_t offset, int whence, loff_t *newp); |
304 | |
305 | const mach_msg_type_t offsetCheck = { |
306 | /* msgt_name = */ 11, |
307 | /* msgt_size = */ 64, |
308 | /* msgt_number = */ 1, |
309 | /* msgt_inline = */ TRUE((boolean_t) 1), |
310 | /* msgt_longform = */ FALSE((boolean_t) 0), |
311 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
312 | /* msgt_unused = */ 0 |
313 | }; |
314 | |
315 | const mach_msg_type_t whenceCheck = { |
316 | /* msgt_name = */ 2, |
317 | /* msgt_size = */ 32, |
318 | /* msgt_number = */ 1, |
319 | /* msgt_inline = */ TRUE((boolean_t) 1), |
320 | /* msgt_longform = */ FALSE((boolean_t) 0), |
321 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
322 | /* msgt_unused = */ 0 |
323 | }; |
324 | |
325 | const mach_msg_type_t newpType = { |
326 | /* msgt_name = */ 11, |
327 | /* msgt_size = */ 64, |
328 | /* msgt_number = */ 1, |
329 | /* msgt_inline = */ TRUE((boolean_t) 1), |
330 | /* msgt_longform = */ FALSE((boolean_t) 0), |
331 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
332 | /* msgt_unused = */ 0 |
333 | }; |
334 | |
335 | #if TypeCheck1 |
336 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
337 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
338 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
339 | #endif /* TypeCheck */ |
340 | |
341 | #if TypeCheck1 |
342 | if (BAD_TYPECHECK(&In0P->offsetType, &offsetCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->offsetType); _c.t = *(& offsetCheck);_t.w != _c.w; })), 0)) |
343 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
344 | #endif /* TypeCheck */ |
345 | |
346 | #if TypeCheck1 |
347 | if (BAD_TYPECHECK(&In0P->whenceType, &whenceCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->whenceType); _c.t = *(& whenceCheck);_t.w != _c.w; })), 0)) |
348 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
349 | #endif /* TypeCheck */ |
350 | |
351 | OutP->RetCode = S_io_seek(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->offset, In0P->whence, &OutP->newp); |
352 | if (OutP->RetCode != KERN_SUCCESS0) |
353 | return; |
354 | |
355 | OutP->Head.msgh_size = 44; |
356 | |
357 | OutP->newpType = newpType; |
358 | } |
359 | |
360 | /* Default implementation of S_io_seek */ |
361 | #ifdef MIG_EOPNOTSUPP |
362 | kern_return_t __attribute__ ((weak)) |
363 | S_io_seek |
364 | ( |
365 | io_t io_object, |
366 | mach_port_t reply, |
367 | mach_msg_type_name_t replyPoly, |
368 | loff_t offset, |
369 | int whence, |
370 | loff_t *newp |
371 | ) { return MIG_EOPNOTSUPP; } |
372 | #endif /* MIG_EOPNOTSUPP */ |
373 | |
374 | /* Routine io_readable */ |
375 | mig_internalstatic void _Xio_readable |
376 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
377 | { |
378 | typedef struct { |
379 | mach_msg_header_t Head; |
380 | } Request; |
381 | |
382 | typedef struct { |
383 | mach_msg_header_t Head; |
384 | mach_msg_type_t RetCodeType; |
385 | kern_return_t RetCode; |
386 | mach_msg_type_t amountType; |
387 | vm_size_t amount; |
388 | } Reply; |
389 | |
390 | Request *In0P = (Request *) InHeadP; |
391 | Reply *OutP = (Reply *) OutHeadP; |
392 | mig_external kern_return_t S_io_readable |
393 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, vm_size_t *amount); |
394 | |
395 | const mach_msg_type_t amountType = { |
396 | /* msgt_name = */ 2, |
397 | /* msgt_size = */ 32, |
398 | /* msgt_number = */ 1, |
399 | /* msgt_inline = */ TRUE((boolean_t) 1), |
400 | /* msgt_longform = */ FALSE((boolean_t) 0), |
401 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
402 | /* msgt_unused = */ 0 |
403 | }; |
404 | |
405 | #if TypeCheck1 |
406 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
407 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
408 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
409 | #endif /* TypeCheck */ |
410 | |
411 | OutP->RetCode = S_io_readable(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->amount); |
412 | if (OutP->RetCode != KERN_SUCCESS0) |
413 | return; |
414 | |
415 | OutP->Head.msgh_size = 40; |
416 | |
417 | OutP->amountType = amountType; |
418 | } |
419 | |
420 | /* Default implementation of S_io_readable */ |
421 | #ifdef MIG_EOPNOTSUPP |
422 | kern_return_t __attribute__ ((weak)) |
423 | S_io_readable |
424 | ( |
425 | io_t io_object, |
426 | mach_port_t reply, |
427 | mach_msg_type_name_t replyPoly, |
428 | vm_size_t *amount |
429 | ) { return MIG_EOPNOTSUPP; } |
430 | #endif /* MIG_EOPNOTSUPP */ |
431 | |
432 | /* Routine io_set_all_openmodes */ |
433 | mig_internalstatic void _Xio_set_all_openmodes |
434 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
435 | { |
436 | typedef struct { |
437 | mach_msg_header_t Head; |
438 | mach_msg_type_t newbitsType; |
439 | int newbits; |
440 | } Request; |
441 | |
442 | typedef struct { |
443 | mach_msg_header_t Head; |
444 | mach_msg_type_t RetCodeType; |
445 | kern_return_t RetCode; |
446 | } Reply; |
447 | |
448 | Request *In0P = (Request *) InHeadP; |
449 | Reply *OutP = (Reply *) OutHeadP; |
450 | mig_external kern_return_t S_io_set_all_openmodes |
451 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int newbits); |
452 | |
453 | const mach_msg_type_t newbitsCheck = { |
454 | /* msgt_name = */ 2, |
455 | /* msgt_size = */ 32, |
456 | /* msgt_number = */ 1, |
457 | /* msgt_inline = */ TRUE((boolean_t) 1), |
458 | /* msgt_longform = */ FALSE((boolean_t) 0), |
459 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
460 | /* msgt_unused = */ 0 |
461 | }; |
462 | |
463 | #if TypeCheck1 |
464 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
465 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
466 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
467 | #endif /* TypeCheck */ |
468 | |
469 | #if TypeCheck1 |
470 | if (BAD_TYPECHECK(&In0P->newbitsType, &newbitsCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->newbitsType); _c.t = *(& newbitsCheck);_t.w != _c.w; })), 0)) |
471 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
472 | #endif /* TypeCheck */ |
473 | |
474 | OutP->RetCode = S_io_set_all_openmodes(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->newbits); |
475 | } |
476 | |
477 | /* Default implementation of S_io_set_all_openmodes */ |
478 | #ifdef MIG_EOPNOTSUPP |
479 | kern_return_t __attribute__ ((weak)) |
480 | S_io_set_all_openmodes |
481 | ( |
482 | io_t io_object, |
483 | mach_port_t reply, |
484 | mach_msg_type_name_t replyPoly, |
485 | int newbits |
486 | ) { return MIG_EOPNOTSUPP; } |
487 | #endif /* MIG_EOPNOTSUPP */ |
488 | |
489 | /* Routine io_get_openmodes */ |
490 | mig_internalstatic void _Xio_get_openmodes |
491 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
492 | { |
493 | typedef struct { |
494 | mach_msg_header_t Head; |
495 | } Request; |
496 | |
497 | typedef struct { |
498 | mach_msg_header_t Head; |
499 | mach_msg_type_t RetCodeType; |
500 | kern_return_t RetCode; |
501 | mach_msg_type_t bitsType; |
502 | int bits; |
503 | } Reply; |
504 | |
505 | Request *In0P = (Request *) InHeadP; |
506 | Reply *OutP = (Reply *) OutHeadP; |
507 | mig_external kern_return_t S_io_get_openmodes |
508 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int *bits); |
509 | |
510 | const mach_msg_type_t bitsType = { |
511 | /* msgt_name = */ 2, |
512 | /* msgt_size = */ 32, |
513 | /* msgt_number = */ 1, |
514 | /* msgt_inline = */ TRUE((boolean_t) 1), |
515 | /* msgt_longform = */ FALSE((boolean_t) 0), |
516 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
517 | /* msgt_unused = */ 0 |
518 | }; |
519 | |
520 | #if TypeCheck1 |
521 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
522 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
523 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
524 | #endif /* TypeCheck */ |
525 | |
526 | OutP->RetCode = S_io_get_openmodes(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->bits); |
527 | if (OutP->RetCode != KERN_SUCCESS0) |
528 | return; |
529 | |
530 | OutP->Head.msgh_size = 40; |
531 | |
532 | OutP->bitsType = bitsType; |
533 | } |
534 | |
535 | /* Default implementation of S_io_get_openmodes */ |
536 | #ifdef MIG_EOPNOTSUPP |
537 | kern_return_t __attribute__ ((weak)) |
538 | S_io_get_openmodes |
539 | ( |
540 | io_t io_object, |
541 | mach_port_t reply, |
542 | mach_msg_type_name_t replyPoly, |
543 | int *bits |
544 | ) { return MIG_EOPNOTSUPP; } |
545 | #endif /* MIG_EOPNOTSUPP */ |
546 | |
547 | /* Routine io_set_some_openmodes */ |
548 | mig_internalstatic void _Xio_set_some_openmodes |
549 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
550 | { |
551 | typedef struct { |
552 | mach_msg_header_t Head; |
553 | mach_msg_type_t bits_to_setType; |
554 | int bits_to_set; |
555 | } Request; |
556 | |
557 | typedef struct { |
558 | mach_msg_header_t Head; |
559 | mach_msg_type_t RetCodeType; |
560 | kern_return_t RetCode; |
561 | } Reply; |
562 | |
563 | Request *In0P = (Request *) InHeadP; |
564 | Reply *OutP = (Reply *) OutHeadP; |
565 | mig_external kern_return_t S_io_set_some_openmodes |
566 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int bits_to_set); |
567 | |
568 | const mach_msg_type_t bits_to_setCheck = { |
569 | /* msgt_name = */ 2, |
570 | /* msgt_size = */ 32, |
571 | /* msgt_number = */ 1, |
572 | /* msgt_inline = */ TRUE((boolean_t) 1), |
573 | /* msgt_longform = */ FALSE((boolean_t) 0), |
574 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
575 | /* msgt_unused = */ 0 |
576 | }; |
577 | |
578 | #if TypeCheck1 |
579 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
580 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
581 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
582 | #endif /* TypeCheck */ |
583 | |
584 | #if TypeCheck1 |
585 | if (BAD_TYPECHECK(&In0P->bits_to_setType, &bits_to_setCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_setType); _c.t = *(&bits_to_setCheck);_t.w != _c.w; })), 0)) |
586 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
587 | #endif /* TypeCheck */ |
588 | |
589 | OutP->RetCode = S_io_set_some_openmodes(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->bits_to_set); |
590 | } |
591 | |
592 | /* Default implementation of S_io_set_some_openmodes */ |
593 | #ifdef MIG_EOPNOTSUPP |
594 | kern_return_t __attribute__ ((weak)) |
595 | S_io_set_some_openmodes |
596 | ( |
597 | io_t io_object, |
598 | mach_port_t reply, |
599 | mach_msg_type_name_t replyPoly, |
600 | int bits_to_set |
601 | ) { return MIG_EOPNOTSUPP; } |
602 | #endif /* MIG_EOPNOTSUPP */ |
603 | |
604 | /* Routine io_clear_some_openmodes */ |
605 | mig_internalstatic void _Xio_clear_some_openmodes |
606 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
607 | { |
608 | typedef struct { |
609 | mach_msg_header_t Head; |
610 | mach_msg_type_t bits_to_clearType; |
611 | int bits_to_clear; |
612 | } Request; |
613 | |
614 | typedef struct { |
615 | mach_msg_header_t Head; |
616 | mach_msg_type_t RetCodeType; |
617 | kern_return_t RetCode; |
618 | } Reply; |
619 | |
620 | Request *In0P = (Request *) InHeadP; |
621 | Reply *OutP = (Reply *) OutHeadP; |
622 | mig_external kern_return_t S_io_clear_some_openmodes |
623 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int bits_to_clear); |
624 | |
625 | const mach_msg_type_t bits_to_clearCheck = { |
626 | /* msgt_name = */ 2, |
627 | /* msgt_size = */ 32, |
628 | /* msgt_number = */ 1, |
629 | /* msgt_inline = */ TRUE((boolean_t) 1), |
630 | /* msgt_longform = */ FALSE((boolean_t) 0), |
631 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
632 | /* msgt_unused = */ 0 |
633 | }; |
634 | |
635 | #if TypeCheck1 |
636 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
637 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
638 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
639 | #endif /* TypeCheck */ |
640 | |
641 | #if TypeCheck1 |
642 | if (BAD_TYPECHECK(&In0P->bits_to_clearType, &bits_to_clearCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->bits_to_clearType); _c.t = *(&bits_to_clearCheck);_t.w != _c.w; })), 0)) |
643 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
644 | #endif /* TypeCheck */ |
645 | |
646 | OutP->RetCode = S_io_clear_some_openmodes(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->bits_to_clear); |
647 | } |
648 | |
649 | /* Default implementation of S_io_clear_some_openmodes */ |
650 | #ifdef MIG_EOPNOTSUPP |
651 | kern_return_t __attribute__ ((weak)) |
652 | S_io_clear_some_openmodes |
653 | ( |
654 | io_t io_object, |
655 | mach_port_t reply, |
656 | mach_msg_type_name_t replyPoly, |
657 | int bits_to_clear |
658 | ) { return MIG_EOPNOTSUPP; } |
659 | #endif /* MIG_EOPNOTSUPP */ |
660 | |
661 | /* Routine io_async */ |
662 | mig_internalstatic void _Xio_async |
663 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
664 | { |
665 | typedef struct { |
666 | mach_msg_header_t Head; |
667 | mach_msg_type_t notify_portType; |
668 | mach_port_t notify_port; |
669 | } Request; |
670 | |
671 | typedef struct { |
672 | mach_msg_header_t Head; |
673 | mach_msg_type_t RetCodeType; |
674 | kern_return_t RetCode; |
675 | mach_msg_type_t async_id_portType; |
676 | mach_port_t async_id_port; |
677 | } Reply; |
678 | |
679 | Request *In0P = (Request *) InHeadP; |
680 | Reply *OutP = (Reply *) OutHeadP; |
681 | mig_external kern_return_t S_io_async |
682 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t notify_port, mach_port_t *async_id_port, mach_msg_type_name_t *async_id_portPoly); |
683 | |
684 | boolean_t msgh_simple = msgh_simple; |
685 | const mach_msg_type_t notify_portCheck = { |
686 | /* msgt_name = */ 17, |
687 | /* msgt_size = */ 32, |
688 | /* msgt_number = */ 1, |
689 | /* msgt_inline = */ TRUE((boolean_t) 1), |
690 | /* msgt_longform = */ FALSE((boolean_t) 0), |
691 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
692 | /* msgt_unused = */ 0 |
693 | }; |
694 | |
695 | const mach_msg_type_t async_id_portType = { |
696 | /* msgt_name = */ -1, |
697 | /* msgt_size = */ 32, |
698 | /* msgt_number = */ 1, |
699 | /* msgt_inline = */ TRUE((boolean_t) 1), |
700 | /* msgt_longform = */ FALSE((boolean_t) 0), |
701 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
702 | /* msgt_unused = */ 0 |
703 | }; |
704 | |
705 | mach_msg_type_name_t async_id_portPoly; |
706 | |
707 | #if TypeCheck1 |
708 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
709 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
710 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
711 | #endif /* TypeCheck */ |
712 | |
713 | #if TypeCheck1 |
714 | if (BAD_TYPECHECK(&In0P->notify_portType, ¬ify_portCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->notify_portType); _c.t = *(¬ify_portCheck);_t.w != _c.w; })), 0)) |
715 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
716 | #endif /* TypeCheck */ |
717 | |
718 | OutP->RetCode = S_io_async(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->notify_port, &OutP->async_id_port, &async_id_portPoly); |
719 | if (OutP->RetCode != KERN_SUCCESS0) |
720 | return; |
721 | |
722 | msgh_simple = TRUE((boolean_t) 1); |
723 | OutP->Head.msgh_size = 40; |
724 | |
725 | OutP->async_id_portType = async_id_portType; |
726 | |
727 | if (MACH_MSG_TYPE_PORT_ANY(async_id_portPoly)(((async_id_portPoly) >= 16) && ((async_id_portPoly ) <= 21))) |
728 | msgh_simple = FALSE((boolean_t) 0); |
729 | |
730 | OutP->async_id_portType.msgt_name = async_id_portPoly; |
731 | |
732 | if (!msgh_simple) |
733 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
734 | } |
735 | |
736 | /* Default implementation of S_io_async */ |
737 | #ifdef MIG_EOPNOTSUPP |
738 | kern_return_t __attribute__ ((weak)) |
739 | S_io_async |
740 | ( |
741 | io_t io_object, |
742 | mach_port_t reply, |
743 | mach_msg_type_name_t replyPoly, |
744 | mach_port_t notify_port, |
745 | mach_port_t *async_id_port, |
746 | mach_msg_type_name_t *async_id_portPoly |
747 | ) { return MIG_EOPNOTSUPP; } |
748 | #endif /* MIG_EOPNOTSUPP */ |
749 | |
750 | /* Routine io_mod_owner */ |
751 | mig_internalstatic void _Xio_mod_owner |
752 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
753 | { |
754 | typedef struct { |
755 | mach_msg_header_t Head; |
756 | mach_msg_type_t ownerType; |
757 | pid_t owner; |
758 | } Request; |
759 | |
760 | typedef struct { |
761 | mach_msg_header_t Head; |
762 | mach_msg_type_t RetCodeType; |
763 | kern_return_t RetCode; |
764 | } Reply; |
765 | |
766 | Request *In0P = (Request *) InHeadP; |
767 | Reply *OutP = (Reply *) OutHeadP; |
768 | mig_external kern_return_t S_io_mod_owner |
769 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, pid_t owner); |
770 | |
771 | const mach_msg_type_t ownerCheck = { |
772 | /* msgt_name = */ 2, |
773 | /* msgt_size = */ 32, |
774 | /* msgt_number = */ 1, |
775 | /* msgt_inline = */ TRUE((boolean_t) 1), |
776 | /* msgt_longform = */ FALSE((boolean_t) 0), |
777 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
778 | /* msgt_unused = */ 0 |
779 | }; |
780 | |
781 | #if TypeCheck1 |
782 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
783 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
784 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
785 | #endif /* TypeCheck */ |
786 | |
787 | #if TypeCheck1 |
788 | if (BAD_TYPECHECK(&In0P->ownerType, &ownerCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->ownerType); _c.t = *(& ownerCheck);_t.w != _c.w; })), 0)) |
789 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
790 | #endif /* TypeCheck */ |
791 | |
792 | OutP->RetCode = S_io_mod_owner(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->owner); |
793 | } |
794 | |
795 | /* Default implementation of S_io_mod_owner */ |
796 | #ifdef MIG_EOPNOTSUPP |
797 | kern_return_t __attribute__ ((weak)) |
798 | S_io_mod_owner |
799 | ( |
800 | io_t io_object, |
801 | mach_port_t reply, |
802 | mach_msg_type_name_t replyPoly, |
803 | pid_t owner |
804 | ) { return MIG_EOPNOTSUPP; } |
805 | #endif /* MIG_EOPNOTSUPP */ |
806 | |
807 | /* Routine io_get_owner */ |
808 | mig_internalstatic void _Xio_get_owner |
809 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
810 | { |
811 | typedef struct { |
812 | mach_msg_header_t Head; |
813 | } Request; |
814 | |
815 | typedef struct { |
816 | mach_msg_header_t Head; |
817 | mach_msg_type_t RetCodeType; |
818 | kern_return_t RetCode; |
819 | mach_msg_type_t ownerType; |
820 | pid_t owner; |
821 | } Reply; |
822 | |
823 | Request *In0P = (Request *) InHeadP; |
824 | Reply *OutP = (Reply *) OutHeadP; |
825 | mig_external kern_return_t S_io_get_owner |
826 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, pid_t *owner); |
827 | |
828 | const mach_msg_type_t ownerType = { |
829 | /* msgt_name = */ 2, |
830 | /* msgt_size = */ 32, |
831 | /* msgt_number = */ 1, |
832 | /* msgt_inline = */ TRUE((boolean_t) 1), |
833 | /* msgt_longform = */ FALSE((boolean_t) 0), |
834 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
835 | /* msgt_unused = */ 0 |
836 | }; |
837 | |
838 | #if TypeCheck1 |
839 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
840 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
841 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
842 | #endif /* TypeCheck */ |
843 | |
844 | OutP->RetCode = S_io_get_owner(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->owner); |
845 | if (OutP->RetCode != KERN_SUCCESS0) |
846 | return; |
847 | |
848 | OutP->Head.msgh_size = 40; |
849 | |
850 | OutP->ownerType = ownerType; |
851 | } |
852 | |
853 | /* Default implementation of S_io_get_owner */ |
854 | #ifdef MIG_EOPNOTSUPP |
855 | kern_return_t __attribute__ ((weak)) |
856 | S_io_get_owner |
857 | ( |
858 | io_t io_object, |
859 | mach_port_t reply, |
860 | mach_msg_type_name_t replyPoly, |
861 | pid_t *owner |
862 | ) { return MIG_EOPNOTSUPP; } |
863 | #endif /* MIG_EOPNOTSUPP */ |
864 | |
865 | /* Routine io_get_icky_async_id */ |
866 | mig_internalstatic void _Xio_get_icky_async_id |
867 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
868 | { |
869 | typedef struct { |
870 | mach_msg_header_t Head; |
871 | } Request; |
872 | |
873 | typedef struct { |
874 | mach_msg_header_t Head; |
875 | mach_msg_type_t RetCodeType; |
876 | kern_return_t RetCode; |
877 | mach_msg_type_t icky_async_id_portType; |
878 | mach_port_t icky_async_id_port; |
879 | } Reply; |
880 | |
881 | Request *In0P = (Request *) InHeadP; |
882 | Reply *OutP = (Reply *) OutHeadP; |
883 | mig_external kern_return_t S_io_get_icky_async_id |
884 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *icky_async_id_port, mach_msg_type_name_t *icky_async_id_portPoly); |
885 | |
886 | boolean_t msgh_simple = msgh_simple; |
887 | const mach_msg_type_t icky_async_id_portType = { |
888 | /* msgt_name = */ -1, |
889 | /* msgt_size = */ 32, |
890 | /* msgt_number = */ 1, |
891 | /* msgt_inline = */ TRUE((boolean_t) 1), |
892 | /* msgt_longform = */ FALSE((boolean_t) 0), |
893 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
894 | /* msgt_unused = */ 0 |
895 | }; |
896 | |
897 | mach_msg_type_name_t icky_async_id_portPoly; |
898 | |
899 | #if TypeCheck1 |
900 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
901 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
902 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
903 | #endif /* TypeCheck */ |
904 | |
905 | OutP->RetCode = S_io_get_icky_async_id(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->icky_async_id_port, &icky_async_id_portPoly); |
906 | if (OutP->RetCode != KERN_SUCCESS0) |
907 | return; |
908 | |
909 | msgh_simple = TRUE((boolean_t) 1); |
910 | OutP->Head.msgh_size = 40; |
911 | |
912 | OutP->icky_async_id_portType = icky_async_id_portType; |
913 | |
914 | if (MACH_MSG_TYPE_PORT_ANY(icky_async_id_portPoly)(((icky_async_id_portPoly) >= 16) && ((icky_async_id_portPoly ) <= 21))) |
915 | msgh_simple = FALSE((boolean_t) 0); |
916 | |
917 | OutP->icky_async_id_portType.msgt_name = icky_async_id_portPoly; |
918 | |
919 | if (!msgh_simple) |
920 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
921 | } |
922 | |
923 | /* Default implementation of S_io_get_icky_async_id */ |
924 | #ifdef MIG_EOPNOTSUPP |
925 | kern_return_t __attribute__ ((weak)) |
926 | S_io_get_icky_async_id |
927 | ( |
928 | io_t io_object, |
929 | mach_port_t reply, |
930 | mach_msg_type_name_t replyPoly, |
931 | mach_port_t *icky_async_id_port, |
932 | mach_msg_type_name_t *icky_async_id_portPoly |
933 | ) { return MIG_EOPNOTSUPP; } |
934 | #endif /* MIG_EOPNOTSUPP */ |
935 | |
936 | /* Routine io_select */ |
937 | mig_internalstatic void _Xio_select |
938 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
939 | { |
940 | typedef struct { |
941 | mach_msg_header_t Head; |
942 | mach_msg_type_t select_typeType; |
943 | int select_type; |
944 | } Request; |
945 | |
946 | typedef struct { |
947 | mach_msg_header_t Head; |
948 | mach_msg_type_t RetCodeType; |
949 | kern_return_t RetCode; |
950 | mach_msg_type_t select_typeType; |
951 | int select_type; |
952 | } Reply; |
953 | |
954 | Request *In0P = (Request *) InHeadP; |
955 | Reply *OutP = (Reply *) OutHeadP; |
956 | mig_external kern_return_t S_io_select |
957 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int *select_type); |
958 | |
959 | const mach_msg_type_t select_typeCheck = { |
960 | /* msgt_name = */ 2, |
961 | /* msgt_size = */ 32, |
962 | /* msgt_number = */ 1, |
963 | /* msgt_inline = */ TRUE((boolean_t) 1), |
964 | /* msgt_longform = */ FALSE((boolean_t) 0), |
965 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
966 | /* msgt_unused = */ 0 |
967 | }; |
968 | |
969 | const mach_msg_type_t select_typeType = { |
970 | /* msgt_name = */ 2, |
971 | /* msgt_size = */ 32, |
972 | /* msgt_number = */ 1, |
973 | /* msgt_inline = */ TRUE((boolean_t) 1), |
974 | /* msgt_longform = */ FALSE((boolean_t) 0), |
975 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
976 | /* msgt_unused = */ 0 |
977 | }; |
978 | |
979 | #if TypeCheck1 |
980 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
981 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
982 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
983 | #endif /* TypeCheck */ |
984 | |
985 | #if TypeCheck1 |
986 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck);_t.w != _c.w; })), 0)) |
987 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
988 | #endif /* TypeCheck */ |
989 | |
990 | OutP->RetCode = S_io_select(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &In0P->select_type); |
991 | if (OutP->RetCode != KERN_SUCCESS0) |
992 | return; |
993 | |
994 | OutP->Head.msgh_size = 40; |
995 | |
996 | OutP->select_typeType = select_typeType; |
997 | |
998 | OutP->select_type = In0P->select_type; |
999 | } |
1000 | |
1001 | /* Default implementation of S_io_select */ |
1002 | #ifdef MIG_EOPNOTSUPP |
1003 | kern_return_t __attribute__ ((weak)) |
1004 | S_io_select |
1005 | ( |
1006 | io_t io_object, |
1007 | mach_port_t reply, |
1008 | mach_msg_type_name_t replyPoly, |
1009 | int *select_type |
1010 | ) { return MIG_EOPNOTSUPP; } |
1011 | #endif /* MIG_EOPNOTSUPP */ |
1012 | |
1013 | /* Routine io_stat */ |
1014 | mig_internalstatic void _Xio_stat |
1015 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1016 | { |
1017 | typedef struct { |
1018 | mach_msg_header_t Head; |
1019 | } Request; |
1020 | |
1021 | typedef struct { |
1022 | mach_msg_header_t Head; |
1023 | mach_msg_type_t RetCodeType; |
1024 | kern_return_t RetCode; |
1025 | mach_msg_type_t stat_infoType; |
1026 | io_statbuf_t stat_info; |
1027 | } Reply; |
1028 | |
1029 | Request *In0P = (Request *) InHeadP; |
1030 | Reply *OutP = (Reply *) OutHeadP; |
1031 | mig_external kern_return_t S_io_stat |
1032 | (io_t stat_object, mach_port_t reply, mach_msg_type_name_t replyPoly, io_statbuf_t *stat_info); |
1033 | |
1034 | const mach_msg_type_t stat_infoType = { |
1035 | /* msgt_name = */ 2, |
1036 | /* msgt_size = */ 32, |
1037 | /* msgt_number = */ 32, |
1038 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1039 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1040 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1041 | /* msgt_unused = */ 0 |
1042 | }; |
1043 | |
1044 | #if TypeCheck1 |
1045 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1046 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1047 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1048 | #endif /* TypeCheck */ |
1049 | |
1050 | OutP->RetCode = S_io_stat(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->stat_info); |
1051 | if (OutP->RetCode != KERN_SUCCESS0) |
1052 | return; |
1053 | |
1054 | OutP->Head.msgh_size = 164; |
1055 | |
1056 | OutP->stat_infoType = stat_infoType; |
1057 | } |
1058 | |
1059 | /* Default implementation of S_io_stat */ |
1060 | #ifdef MIG_EOPNOTSUPP |
1061 | kern_return_t __attribute__ ((weak)) |
1062 | S_io_stat |
1063 | ( |
1064 | io_t stat_object, |
1065 | mach_port_t reply, |
1066 | mach_msg_type_name_t replyPoly, |
1067 | io_statbuf_t *stat_info |
1068 | ) { return MIG_EOPNOTSUPP; } |
1069 | #endif /* MIG_EOPNOTSUPP */ |
1070 | |
1071 | /* SimpleRoutine io_reauthenticate */ |
1072 | mig_internalstatic void _Xio_reauthenticate |
1073 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1074 | { |
1075 | typedef struct { |
1076 | mach_msg_header_t Head; |
1077 | mach_msg_type_t rendezvous2Type; |
1078 | mach_port_t rendezvous2; |
1079 | } Request; |
1080 | |
1081 | typedef struct { |
1082 | mach_msg_header_t Head; |
1083 | mach_msg_type_t RetCodeType; |
1084 | kern_return_t RetCode; |
1085 | } Reply; |
1086 | |
1087 | Request *In0P = (Request *) InHeadP; |
1088 | Reply *OutP = (Reply *) OutHeadP; |
1089 | mig_external kern_return_t S_io_reauthenticate |
1090 | (io_t auth_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t rendezvous2); |
1091 | |
1092 | const mach_msg_type_t rendezvous2Check = { |
1093 | /* msgt_name = */ 17, |
1094 | /* msgt_size = */ 32, |
1095 | /* msgt_number = */ 1, |
1096 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1097 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1098 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1099 | /* msgt_unused = */ 0 |
1100 | }; |
1101 | |
1102 | #if TypeCheck1 |
1103 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1104 | !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || !(In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1105 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1106 | #endif /* TypeCheck */ |
1107 | |
1108 | #if TypeCheck1 |
1109 | if (BAD_TYPECHECK(&In0P->rendezvous2Type, &rendezvous2Check)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->rendezvous2Type); _c.t = *(&rendezvous2Check);_t.w != _c.w; })), 0)) |
1110 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1111 | #endif /* TypeCheck */ |
1112 | |
1113 | OutP->RetCode = S_io_reauthenticate(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->rendezvous2); |
1114 | } |
1115 | |
1116 | /* Default implementation of S_io_reauthenticate */ |
1117 | #ifdef MIG_EOPNOTSUPP |
1118 | kern_return_t __attribute__ ((weak)) |
1119 | S_io_reauthenticate |
1120 | ( |
1121 | io_t auth_object, |
1122 | mach_port_t reply, |
1123 | mach_msg_type_name_t replyPoly, |
1124 | mach_port_t rendezvous2 |
1125 | ) { return MIG_EOPNOTSUPP; } |
1126 | #endif /* MIG_EOPNOTSUPP */ |
1127 | |
1128 | /* Routine io_restrict_auth */ |
1129 | mig_internalstatic void _Xio_restrict_auth |
1130 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1131 | { |
1132 | typedef struct { |
1133 | mach_msg_header_t Head; |
1134 | mach_msg_type_long_t uidsType; |
1135 | uid_t uids[512]; |
1136 | mach_msg_type_long_t gidsType; |
1137 | uid_t gids[512]; |
1138 | } Request; |
1139 | |
1140 | typedef struct { |
1141 | mach_msg_header_t Head; |
1142 | mach_msg_type_t RetCodeType; |
1143 | kern_return_t RetCode; |
1144 | mach_msg_type_t new_objectType; |
1145 | mach_port_t new_object; |
1146 | } Reply; |
1147 | |
1148 | Request *In0P = (Request *) InHeadP; |
1149 | Request *In1P; |
1150 | Reply *OutP = (Reply *) OutHeadP; |
1151 | mig_external kern_return_t S_io_restrict_auth |
1152 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *new_object, mach_msg_type_name_t *new_objectPoly, idarray_t uids, mach_msg_type_number_t uidsCnt, idarray_t gids, mach_msg_type_number_t gidsCnt); |
1153 | |
1154 | boolean_t msgh_simple = msgh_simple; |
1155 | unsigned int msgh_size; |
1156 | unsigned int msgh_size_delta; |
1157 | |
1158 | const mach_msg_type_t new_objectType = { |
1159 | /* msgt_name = */ -1, |
1160 | /* msgt_size = */ 32, |
1161 | /* msgt_number = */ 1, |
1162 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1163 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1164 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1165 | /* msgt_unused = */ 0 |
1166 | }; |
1167 | |
1168 | mach_msg_type_name_t new_objectPoly; |
1169 | |
1170 | #if TypeCheck1 |
1171 | msgh_size = In0P->Head.msgh_size; |
1172 | msgh_simple = !(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX0x80000000U); |
Value stored to 'msgh_simple' is never read | |
1173 | if (mig_unlikely ((msgh_size < 48))__builtin_expect (!! ((msgh_size < 48)), 0)) |
1174 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1175 | #endif /* TypeCheck */ |
1176 | |
1177 | #if TypeCheck1 |
1178 | if (mig_unlikely ((In0P->uidsType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0) |
1179 | (In0P->uidsType.msgtl_name != 2) ||__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0) |
1180 | (In0P->uidsType.msgtl_size != 32))__builtin_expect (!! ((In0P->uidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In0P->uidsType.msgtl_name != 2) || (In0P->uidsType.msgtl_size != 32)), 0)) |
1181 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1182 | #endif /* TypeCheck */ |
1183 | |
1184 | msgh_size_delta = (In0P->uidsType.msgtl_header.msgt_inline) ? 4 * In0P->uidsType.msgtl_number : sizeof(uid_t *); |
1185 | #if TypeCheck1 |
1186 | if (mig_unlikely (msgh_size < 48 + msgh_size_delta)__builtin_expect (!! (msgh_size < 48 + msgh_size_delta), 0 )) |
1187 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1188 | msgh_size -= msgh_size_delta; |
1189 | #endif /* TypeCheck */ |
1190 | |
1191 | In1P = (Request *) ((char *) In0P + msgh_size_delta - 2048); |
1192 | |
1193 | #if TypeCheck1 |
1194 | if (mig_unlikely ((In1P->gidsType.msgtl_header.msgt_longform != TRUE) ||__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0) |
1195 | (In1P->gidsType.msgtl_name != 2) ||__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0) |
1196 | (In1P->gidsType.msgtl_size != 32))__builtin_expect (!! ((In1P->gidsType.msgtl_header.msgt_longform != ((boolean_t) 1)) || (In1P->gidsType.msgtl_name != 2) || (In1P->gidsType.msgtl_size != 32)), 0)) |
1197 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1198 | #endif /* TypeCheck */ |
1199 | |
1200 | #if TypeCheck1 |
1201 | if (mig_unlikely (msgh_size != 48 + ((In1P->gidsType.msgtl_header.msgt_inline) ? 4 * In1P->gidsType.msgtl_number : sizeof(uid_t *)))__builtin_expect (!! (msgh_size != 48 + ((In1P->gidsType.msgtl_header .msgt_inline) ? 4 * In1P->gidsType.msgtl_number : sizeof(uid_t *))), 0)) |
1202 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1203 | #endif /* TypeCheck */ |
1204 | |
1205 | OutP->RetCode = S_io_restrict_auth(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->new_object, &new_objectPoly, (In0P->uidsType.msgtl_header.msgt_inline) ? In0P->uids : *((uid_t **)In0P->uids), In0P->uidsType.msgtl_number, (In1P->gidsType.msgtl_header.msgt_inline) ? In1P->gids : *((uid_t **)In1P->gids), In1P->gidsType.msgtl_number); |
1206 | if (OutP->RetCode == KERN_SUCCESS0) |
1207 | if (!In1P->gidsType.msgtl_header.msgt_inline) |
1208 | __mig_deallocate(* (vm_offset_t *) In1P->gids, 4 * In1P->gidsType.msgtl_number); |
1209 | if (OutP->RetCode == KERN_SUCCESS0) |
1210 | if (!In0P->uidsType.msgtl_header.msgt_inline) |
1211 | __mig_deallocate(* (vm_offset_t *) In0P->uids, 4 * In0P->uidsType.msgtl_number); |
1212 | if (OutP->RetCode != KERN_SUCCESS0) |
1213 | return; |
1214 | |
1215 | msgh_simple = TRUE((boolean_t) 1); |
1216 | OutP->Head.msgh_size = 40; |
1217 | |
1218 | OutP->new_objectType = new_objectType; |
1219 | |
1220 | if (MACH_MSG_TYPE_PORT_ANY(new_objectPoly)(((new_objectPoly) >= 16) && ((new_objectPoly) <= 21))) |
1221 | msgh_simple = FALSE((boolean_t) 0); |
1222 | |
1223 | OutP->new_objectType.msgt_name = new_objectPoly; |
1224 | |
1225 | if (!msgh_simple) |
1226 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1227 | } |
1228 | |
1229 | /* Default implementation of S_io_restrict_auth */ |
1230 | #ifdef MIG_EOPNOTSUPP |
1231 | kern_return_t __attribute__ ((weak)) |
1232 | S_io_restrict_auth |
1233 | ( |
1234 | io_t io_object, |
1235 | mach_port_t reply, |
1236 | mach_msg_type_name_t replyPoly, |
1237 | mach_port_t *new_object, |
1238 | mach_msg_type_name_t *new_objectPoly, |
1239 | idarray_t uids, |
1240 | mach_msg_type_number_t uidsCnt, |
1241 | idarray_t gids, |
1242 | mach_msg_type_number_t gidsCnt |
1243 | ) { return MIG_EOPNOTSUPP; } |
1244 | #endif /* MIG_EOPNOTSUPP */ |
1245 | |
1246 | /* Routine io_duplicate */ |
1247 | mig_internalstatic void _Xio_duplicate |
1248 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1249 | { |
1250 | typedef struct { |
1251 | mach_msg_header_t Head; |
1252 | } Request; |
1253 | |
1254 | typedef struct { |
1255 | mach_msg_header_t Head; |
1256 | mach_msg_type_t RetCodeType; |
1257 | kern_return_t RetCode; |
1258 | mach_msg_type_t newportType; |
1259 | mach_port_t newport; |
1260 | } Reply; |
1261 | |
1262 | Request *In0P = (Request *) InHeadP; |
1263 | Reply *OutP = (Reply *) OutHeadP; |
1264 | mig_external kern_return_t S_io_duplicate |
1265 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *newport, mach_msg_type_name_t *newportPoly); |
1266 | |
1267 | boolean_t msgh_simple = msgh_simple; |
1268 | const mach_msg_type_t newportType = { |
1269 | /* msgt_name = */ -1, |
1270 | /* msgt_size = */ 32, |
1271 | /* msgt_number = */ 1, |
1272 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1273 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1274 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1275 | /* msgt_unused = */ 0 |
1276 | }; |
1277 | |
1278 | mach_msg_type_name_t newportPoly; |
1279 | |
1280 | #if TypeCheck1 |
1281 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1282 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1283 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1284 | #endif /* TypeCheck */ |
1285 | |
1286 | OutP->RetCode = S_io_duplicate(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->newport, &newportPoly); |
1287 | if (OutP->RetCode != KERN_SUCCESS0) |
1288 | return; |
1289 | |
1290 | msgh_simple = TRUE((boolean_t) 1); |
1291 | OutP->Head.msgh_size = 40; |
1292 | |
1293 | OutP->newportType = newportType; |
1294 | |
1295 | if (MACH_MSG_TYPE_PORT_ANY(newportPoly)(((newportPoly) >= 16) && ((newportPoly) <= 21) )) |
1296 | msgh_simple = FALSE((boolean_t) 0); |
1297 | |
1298 | OutP->newportType.msgt_name = newportPoly; |
1299 | |
1300 | if (!msgh_simple) |
1301 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1302 | } |
1303 | |
1304 | /* Default implementation of S_io_duplicate */ |
1305 | #ifdef MIG_EOPNOTSUPP |
1306 | kern_return_t __attribute__ ((weak)) |
1307 | S_io_duplicate |
1308 | ( |
1309 | io_t io_object, |
1310 | mach_port_t reply, |
1311 | mach_msg_type_name_t replyPoly, |
1312 | mach_port_t *newport, |
1313 | mach_msg_type_name_t *newportPoly |
1314 | ) { return MIG_EOPNOTSUPP; } |
1315 | #endif /* MIG_EOPNOTSUPP */ |
1316 | |
1317 | /* Routine io_server_version */ |
1318 | mig_internalstatic void _Xio_server_version |
1319 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1320 | { |
1321 | typedef struct { |
1322 | mach_msg_header_t Head; |
1323 | } Request; |
1324 | |
1325 | typedef struct { |
1326 | mach_msg_header_t Head; |
1327 | mach_msg_type_t RetCodeType; |
1328 | kern_return_t RetCode; |
1329 | mach_msg_type_t server_nameType; |
1330 | string_t server_name; |
1331 | mach_msg_type_t server_major_versionType; |
1332 | int server_major_version; |
1333 | mach_msg_type_t server_minor_versionType; |
1334 | int server_minor_version; |
1335 | mach_msg_type_t server_edit_levelType; |
1336 | int server_edit_level; |
1337 | } Reply; |
1338 | |
1339 | Request *In0P = (Request *) InHeadP; |
1340 | Reply *OutP = (Reply *) OutHeadP; |
1341 | mig_external kern_return_t S_io_server_version |
1342 | (io_t vers_object, mach_port_t reply, mach_msg_type_name_t replyPoly, string_t server_name, int *server_major_version, int *server_minor_version, int *server_edit_level); |
1343 | |
1344 | const mach_msg_type_t server_nameType = { |
1345 | /* msgt_name = */ MACH_MSG_TYPE_STRING_C12, |
1346 | /* msgt_size = */ 8, |
1347 | /* msgt_number = */ 1024, |
1348 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1349 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1350 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1351 | /* msgt_unused = */ 0 |
1352 | }; |
1353 | |
1354 | const mach_msg_type_t server_major_versionType = { |
1355 | /* msgt_name = */ 2, |
1356 | /* msgt_size = */ 32, |
1357 | /* msgt_number = */ 1, |
1358 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1359 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1360 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1361 | /* msgt_unused = */ 0 |
1362 | }; |
1363 | |
1364 | const mach_msg_type_t server_minor_versionType = { |
1365 | /* msgt_name = */ 2, |
1366 | /* msgt_size = */ 32, |
1367 | /* msgt_number = */ 1, |
1368 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1369 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1370 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1371 | /* msgt_unused = */ 0 |
1372 | }; |
1373 | |
1374 | const mach_msg_type_t server_edit_levelType = { |
1375 | /* msgt_name = */ 2, |
1376 | /* msgt_size = */ 32, |
1377 | /* msgt_number = */ 1, |
1378 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1379 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1380 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1381 | /* msgt_unused = */ 0 |
1382 | }; |
1383 | |
1384 | #if TypeCheck1 |
1385 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1386 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1387 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1388 | #endif /* TypeCheck */ |
1389 | |
1390 | OutP->RetCode = S_io_server_version(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), OutP->server_name, &OutP->server_major_version, &OutP->server_minor_version, &OutP->server_edit_level); |
1391 | if (OutP->RetCode != KERN_SUCCESS0) |
1392 | return; |
1393 | |
1394 | OutP->Head.msgh_size = 1084; |
1395 | |
1396 | OutP->server_nameType = server_nameType; |
1397 | |
1398 | OutP->server_major_versionType = server_major_versionType; |
1399 | |
1400 | OutP->server_minor_versionType = server_minor_versionType; |
1401 | |
1402 | OutP->server_edit_levelType = server_edit_levelType; |
1403 | } |
1404 | |
1405 | /* Default implementation of S_io_server_version */ |
1406 | #ifdef MIG_EOPNOTSUPP |
1407 | kern_return_t __attribute__ ((weak)) |
1408 | S_io_server_version |
1409 | ( |
1410 | io_t vers_object, |
1411 | mach_port_t reply, |
1412 | mach_msg_type_name_t replyPoly, |
1413 | string_t server_name, |
1414 | int *server_major_version, |
1415 | int *server_minor_version, |
1416 | int *server_edit_level |
1417 | ) { return MIG_EOPNOTSUPP; } |
1418 | #endif /* MIG_EOPNOTSUPP */ |
1419 | |
1420 | /* Routine io_map */ |
1421 | mig_internalstatic void _Xio_map |
1422 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1423 | { |
1424 | typedef struct { |
1425 | mach_msg_header_t Head; |
1426 | } Request; |
1427 | |
1428 | typedef struct { |
1429 | mach_msg_header_t Head; |
1430 | mach_msg_type_t RetCodeType; |
1431 | kern_return_t RetCode; |
1432 | mach_msg_type_t memobjrdType; |
1433 | mach_port_t memobjrd; |
1434 | mach_msg_type_t memobjwtType; |
1435 | mach_port_t memobjwt; |
1436 | } Reply; |
1437 | |
1438 | Request *In0P = (Request *) InHeadP; |
1439 | Reply *OutP = (Reply *) OutHeadP; |
1440 | mig_external kern_return_t S_io_map |
1441 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *memobjrd, mach_msg_type_name_t *memobjrdPoly, mach_port_t *memobjwt, mach_msg_type_name_t *memobjwtPoly); |
1442 | |
1443 | boolean_t msgh_simple = msgh_simple; |
1444 | const mach_msg_type_t memobjrdType = { |
1445 | /* msgt_name = */ -1, |
1446 | /* msgt_size = */ 32, |
1447 | /* msgt_number = */ 1, |
1448 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1449 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1450 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1451 | /* msgt_unused = */ 0 |
1452 | }; |
1453 | |
1454 | const mach_msg_type_t memobjwtType = { |
1455 | /* msgt_name = */ -1, |
1456 | /* msgt_size = */ 32, |
1457 | /* msgt_number = */ 1, |
1458 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1459 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1460 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1461 | /* msgt_unused = */ 0 |
1462 | }; |
1463 | |
1464 | mach_msg_type_name_t memobjrdPoly; |
1465 | mach_msg_type_name_t memobjwtPoly; |
1466 | |
1467 | #if TypeCheck1 |
1468 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1469 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1470 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1471 | #endif /* TypeCheck */ |
1472 | |
1473 | OutP->RetCode = S_io_map(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->memobjrd, &memobjrdPoly, &OutP->memobjwt, &memobjwtPoly); |
1474 | if (OutP->RetCode != KERN_SUCCESS0) |
1475 | return; |
1476 | |
1477 | msgh_simple = TRUE((boolean_t) 1); |
1478 | OutP->Head.msgh_size = 48; |
1479 | |
1480 | OutP->memobjrdType = memobjrdType; |
1481 | |
1482 | if (MACH_MSG_TYPE_PORT_ANY(memobjrdPoly)(((memobjrdPoly) >= 16) && ((memobjrdPoly) <= 21 ))) |
1483 | msgh_simple = FALSE((boolean_t) 0); |
1484 | |
1485 | OutP->memobjrdType.msgt_name = memobjrdPoly; |
1486 | |
1487 | OutP->memobjwtType = memobjwtType; |
1488 | |
1489 | if (MACH_MSG_TYPE_PORT_ANY(memobjwtPoly)(((memobjwtPoly) >= 16) && ((memobjwtPoly) <= 21 ))) |
1490 | msgh_simple = FALSE((boolean_t) 0); |
1491 | |
1492 | OutP->memobjwtType.msgt_name = memobjwtPoly; |
1493 | |
1494 | if (!msgh_simple) |
1495 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1496 | } |
1497 | |
1498 | /* Default implementation of S_io_map */ |
1499 | #ifdef MIG_EOPNOTSUPP |
1500 | kern_return_t __attribute__ ((weak)) |
1501 | S_io_map |
1502 | ( |
1503 | io_t io_object, |
1504 | mach_port_t reply, |
1505 | mach_msg_type_name_t replyPoly, |
1506 | mach_port_t *memobjrd, |
1507 | mach_msg_type_name_t *memobjrdPoly, |
1508 | mach_port_t *memobjwt, |
1509 | mach_msg_type_name_t *memobjwtPoly |
1510 | ) { return MIG_EOPNOTSUPP; } |
1511 | #endif /* MIG_EOPNOTSUPP */ |
1512 | |
1513 | /* Routine io_map_cntl */ |
1514 | mig_internalstatic void _Xio_map_cntl |
1515 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1516 | { |
1517 | typedef struct { |
1518 | mach_msg_header_t Head; |
1519 | } Request; |
1520 | |
1521 | typedef struct { |
1522 | mach_msg_header_t Head; |
1523 | mach_msg_type_t RetCodeType; |
1524 | kern_return_t RetCode; |
1525 | mach_msg_type_t memobjType; |
1526 | mach_port_t memobj; |
1527 | } Reply; |
1528 | |
1529 | Request *In0P = (Request *) InHeadP; |
1530 | Reply *OutP = (Reply *) OutHeadP; |
1531 | mig_external kern_return_t S_io_map_cntl |
1532 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *memobj, mach_msg_type_name_t *memobjPoly); |
1533 | |
1534 | boolean_t msgh_simple = msgh_simple; |
1535 | const mach_msg_type_t memobjType = { |
1536 | /* msgt_name = */ -1, |
1537 | /* msgt_size = */ 32, |
1538 | /* msgt_number = */ 1, |
1539 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1540 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1541 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1542 | /* msgt_unused = */ 0 |
1543 | }; |
1544 | |
1545 | mach_msg_type_name_t memobjPoly; |
1546 | |
1547 | #if TypeCheck1 |
1548 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1549 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1550 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1551 | #endif /* TypeCheck */ |
1552 | |
1553 | OutP->RetCode = S_io_map_cntl(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->memobj, &memobjPoly); |
1554 | if (OutP->RetCode != KERN_SUCCESS0) |
1555 | return; |
1556 | |
1557 | msgh_simple = TRUE((boolean_t) 1); |
1558 | OutP->Head.msgh_size = 40; |
1559 | |
1560 | OutP->memobjType = memobjType; |
1561 | |
1562 | if (MACH_MSG_TYPE_PORT_ANY(memobjPoly)(((memobjPoly) >= 16) && ((memobjPoly) <= 21))) |
1563 | msgh_simple = FALSE((boolean_t) 0); |
1564 | |
1565 | OutP->memobjType.msgt_name = memobjPoly; |
1566 | |
1567 | if (!msgh_simple) |
1568 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
1569 | } |
1570 | |
1571 | /* Default implementation of S_io_map_cntl */ |
1572 | #ifdef MIG_EOPNOTSUPP |
1573 | kern_return_t __attribute__ ((weak)) |
1574 | S_io_map_cntl |
1575 | ( |
1576 | io_t io_object, |
1577 | mach_port_t reply, |
1578 | mach_msg_type_name_t replyPoly, |
1579 | mach_port_t *memobj, |
1580 | mach_msg_type_name_t *memobjPoly |
1581 | ) { return MIG_EOPNOTSUPP; } |
1582 | #endif /* MIG_EOPNOTSUPP */ |
1583 | |
1584 | /* Routine io_get_conch */ |
1585 | mig_internalstatic void _Xio_get_conch |
1586 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1587 | { |
1588 | typedef struct { |
1589 | mach_msg_header_t Head; |
1590 | } Request; |
1591 | |
1592 | typedef struct { |
1593 | mach_msg_header_t Head; |
1594 | mach_msg_type_t RetCodeType; |
1595 | kern_return_t RetCode; |
1596 | } Reply; |
1597 | |
1598 | Request *In0P = (Request *) InHeadP; |
1599 | Reply *OutP = (Reply *) OutHeadP; |
1600 | mig_external kern_return_t S_io_get_conch |
1601 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1602 | |
1603 | #if TypeCheck1 |
1604 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1605 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1606 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1607 | #endif /* TypeCheck */ |
1608 | |
1609 | OutP->RetCode = S_io_get_conch(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1610 | } |
1611 | |
1612 | /* Default implementation of S_io_get_conch */ |
1613 | #ifdef MIG_EOPNOTSUPP |
1614 | kern_return_t __attribute__ ((weak)) |
1615 | S_io_get_conch |
1616 | ( |
1617 | io_t io_object, |
1618 | mach_port_t reply, |
1619 | mach_msg_type_name_t replyPoly |
1620 | ) { return MIG_EOPNOTSUPP; } |
1621 | #endif /* MIG_EOPNOTSUPP */ |
1622 | |
1623 | /* Routine io_release_conch */ |
1624 | mig_internalstatic void _Xio_release_conch |
1625 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1626 | { |
1627 | typedef struct { |
1628 | mach_msg_header_t Head; |
1629 | } Request; |
1630 | |
1631 | typedef struct { |
1632 | mach_msg_header_t Head; |
1633 | mach_msg_type_t RetCodeType; |
1634 | kern_return_t RetCode; |
1635 | } Reply; |
1636 | |
1637 | Request *In0P = (Request *) InHeadP; |
1638 | Reply *OutP = (Reply *) OutHeadP; |
1639 | mig_external kern_return_t S_io_release_conch |
1640 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1641 | |
1642 | #if TypeCheck1 |
1643 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1644 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1645 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1646 | #endif /* TypeCheck */ |
1647 | |
1648 | OutP->RetCode = S_io_release_conch(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1649 | } |
1650 | |
1651 | /* Default implementation of S_io_release_conch */ |
1652 | #ifdef MIG_EOPNOTSUPP |
1653 | kern_return_t __attribute__ ((weak)) |
1654 | S_io_release_conch |
1655 | ( |
1656 | io_t io_object, |
1657 | mach_port_t reply, |
1658 | mach_msg_type_name_t replyPoly |
1659 | ) { return MIG_EOPNOTSUPP; } |
1660 | #endif /* MIG_EOPNOTSUPP */ |
1661 | |
1662 | /* Routine io_eofnotify */ |
1663 | mig_internalstatic void _Xio_eofnotify |
1664 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1665 | { |
1666 | typedef struct { |
1667 | mach_msg_header_t Head; |
1668 | } Request; |
1669 | |
1670 | typedef struct { |
1671 | mach_msg_header_t Head; |
1672 | mach_msg_type_t RetCodeType; |
1673 | kern_return_t RetCode; |
1674 | } Reply; |
1675 | |
1676 | Request *In0P = (Request *) InHeadP; |
1677 | Reply *OutP = (Reply *) OutHeadP; |
1678 | mig_external kern_return_t S_io_eofnotify |
1679 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1680 | |
1681 | #if TypeCheck1 |
1682 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1683 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1684 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1685 | #endif /* TypeCheck */ |
1686 | |
1687 | OutP->RetCode = S_io_eofnotify(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1688 | } |
1689 | |
1690 | /* Default implementation of S_io_eofnotify */ |
1691 | #ifdef MIG_EOPNOTSUPP |
1692 | kern_return_t __attribute__ ((weak)) |
1693 | S_io_eofnotify |
1694 | ( |
1695 | io_t io_object, |
1696 | mach_port_t reply, |
1697 | mach_msg_type_name_t replyPoly |
1698 | ) { return MIG_EOPNOTSUPP; } |
1699 | #endif /* MIG_EOPNOTSUPP */ |
1700 | |
1701 | /* Routine io_prenotify */ |
1702 | mig_internalstatic void _Xio_prenotify |
1703 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1704 | { |
1705 | typedef struct { |
1706 | mach_msg_header_t Head; |
1707 | mach_msg_type_t write_startType; |
1708 | vm_offset_t write_start; |
1709 | mach_msg_type_t write_endType; |
1710 | vm_offset_t write_end; |
1711 | } Request; |
1712 | |
1713 | typedef struct { |
1714 | mach_msg_header_t Head; |
1715 | mach_msg_type_t RetCodeType; |
1716 | kern_return_t RetCode; |
1717 | } Reply; |
1718 | |
1719 | Request *In0P = (Request *) InHeadP; |
1720 | Reply *OutP = (Reply *) OutHeadP; |
1721 | mig_external kern_return_t S_io_prenotify |
1722 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, vm_offset_t write_start, vm_offset_t write_end); |
1723 | |
1724 | const mach_msg_type_t write_startCheck = { |
1725 | /* msgt_name = */ 2, |
1726 | /* msgt_size = */ 32, |
1727 | /* msgt_number = */ 1, |
1728 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1729 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1730 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1731 | /* msgt_unused = */ 0 |
1732 | }; |
1733 | |
1734 | const mach_msg_type_t write_endCheck = { |
1735 | /* msgt_name = */ 2, |
1736 | /* msgt_size = */ 32, |
1737 | /* msgt_number = */ 1, |
1738 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1739 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1740 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1741 | /* msgt_unused = */ 0 |
1742 | }; |
1743 | |
1744 | #if TypeCheck1 |
1745 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1746 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1747 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1748 | #endif /* TypeCheck */ |
1749 | |
1750 | #if TypeCheck1 |
1751 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck);_t.w != _c.w; })), 0)) |
1752 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1753 | #endif /* TypeCheck */ |
1754 | |
1755 | #if TypeCheck1 |
1756 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = * (&write_endCheck);_t.w != _c.w; })), 0)) |
1757 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1758 | #endif /* TypeCheck */ |
1759 | |
1760 | OutP->RetCode = S_io_prenotify(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->write_start, In0P->write_end); |
1761 | } |
1762 | |
1763 | /* Default implementation of S_io_prenotify */ |
1764 | #ifdef MIG_EOPNOTSUPP |
1765 | kern_return_t __attribute__ ((weak)) |
1766 | S_io_prenotify |
1767 | ( |
1768 | io_t io_object, |
1769 | mach_port_t reply, |
1770 | mach_msg_type_name_t replyPoly, |
1771 | vm_offset_t write_start, |
1772 | vm_offset_t write_end |
1773 | ) { return MIG_EOPNOTSUPP; } |
1774 | #endif /* MIG_EOPNOTSUPP */ |
1775 | |
1776 | /* Routine io_postnotify */ |
1777 | mig_internalstatic void _Xio_postnotify |
1778 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1779 | { |
1780 | typedef struct { |
1781 | mach_msg_header_t Head; |
1782 | mach_msg_type_t write_startType; |
1783 | vm_offset_t write_start; |
1784 | mach_msg_type_t write_endType; |
1785 | vm_offset_t write_end; |
1786 | } Request; |
1787 | |
1788 | typedef struct { |
1789 | mach_msg_header_t Head; |
1790 | mach_msg_type_t RetCodeType; |
1791 | kern_return_t RetCode; |
1792 | } Reply; |
1793 | |
1794 | Request *In0P = (Request *) InHeadP; |
1795 | Reply *OutP = (Reply *) OutHeadP; |
1796 | mig_external kern_return_t S_io_postnotify |
1797 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, vm_offset_t write_start, vm_offset_t write_end); |
1798 | |
1799 | const mach_msg_type_t write_startCheck = { |
1800 | /* msgt_name = */ 2, |
1801 | /* msgt_size = */ 32, |
1802 | /* msgt_number = */ 1, |
1803 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1804 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1805 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1806 | /* msgt_unused = */ 0 |
1807 | }; |
1808 | |
1809 | const mach_msg_type_t write_endCheck = { |
1810 | /* msgt_name = */ 2, |
1811 | /* msgt_size = */ 32, |
1812 | /* msgt_number = */ 1, |
1813 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1814 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1815 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1816 | /* msgt_unused = */ 0 |
1817 | }; |
1818 | |
1819 | #if TypeCheck1 |
1820 | if (mig_unlikely ((In0P->Head.msgh_size != 40) ||__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1821 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 40) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1822 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1823 | #endif /* TypeCheck */ |
1824 | |
1825 | #if TypeCheck1 |
1826 | if (BAD_TYPECHECK(&In0P->write_startType, &write_startCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_startType); _c.t = *(&write_startCheck);_t.w != _c.w; })), 0)) |
1827 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1828 | #endif /* TypeCheck */ |
1829 | |
1830 | #if TypeCheck1 |
1831 | if (BAD_TYPECHECK(&In0P->write_endType, &write_endCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->write_endType); _c.t = * (&write_endCheck);_t.w != _c.w; })), 0)) |
1832 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1833 | #endif /* TypeCheck */ |
1834 | |
1835 | OutP->RetCode = S_io_postnotify(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->write_start, In0P->write_end); |
1836 | } |
1837 | |
1838 | /* Default implementation of S_io_postnotify */ |
1839 | #ifdef MIG_EOPNOTSUPP |
1840 | kern_return_t __attribute__ ((weak)) |
1841 | S_io_postnotify |
1842 | ( |
1843 | io_t io_object, |
1844 | mach_port_t reply, |
1845 | mach_msg_type_name_t replyPoly, |
1846 | vm_offset_t write_start, |
1847 | vm_offset_t write_end |
1848 | ) { return MIG_EOPNOTSUPP; } |
1849 | #endif /* MIG_EOPNOTSUPP */ |
1850 | |
1851 | /* Routine io_readnotify */ |
1852 | mig_internalstatic void _Xio_readnotify |
1853 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1854 | { |
1855 | typedef struct { |
1856 | mach_msg_header_t Head; |
1857 | } Request; |
1858 | |
1859 | typedef struct { |
1860 | mach_msg_header_t Head; |
1861 | mach_msg_type_t RetCodeType; |
1862 | kern_return_t RetCode; |
1863 | } Reply; |
1864 | |
1865 | Request *In0P = (Request *) InHeadP; |
1866 | Reply *OutP = (Reply *) OutHeadP; |
1867 | mig_external kern_return_t S_io_readnotify |
1868 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1869 | |
1870 | #if TypeCheck1 |
1871 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1872 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1873 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1874 | #endif /* TypeCheck */ |
1875 | |
1876 | OutP->RetCode = S_io_readnotify(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1877 | } |
1878 | |
1879 | /* Default implementation of S_io_readnotify */ |
1880 | #ifdef MIG_EOPNOTSUPP |
1881 | kern_return_t __attribute__ ((weak)) |
1882 | S_io_readnotify |
1883 | ( |
1884 | io_t io_object, |
1885 | mach_port_t reply, |
1886 | mach_msg_type_name_t replyPoly |
1887 | ) { return MIG_EOPNOTSUPP; } |
1888 | #endif /* MIG_EOPNOTSUPP */ |
1889 | |
1890 | /* Routine io_readsleep */ |
1891 | mig_internalstatic void _Xio_readsleep |
1892 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1893 | { |
1894 | typedef struct { |
1895 | mach_msg_header_t Head; |
1896 | } Request; |
1897 | |
1898 | typedef struct { |
1899 | mach_msg_header_t Head; |
1900 | mach_msg_type_t RetCodeType; |
1901 | kern_return_t RetCode; |
1902 | } Reply; |
1903 | |
1904 | Request *In0P = (Request *) InHeadP; |
1905 | Reply *OutP = (Reply *) OutHeadP; |
1906 | mig_external kern_return_t S_io_readsleep |
1907 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1908 | |
1909 | #if TypeCheck1 |
1910 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1911 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1912 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1913 | #endif /* TypeCheck */ |
1914 | |
1915 | OutP->RetCode = S_io_readsleep(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1916 | } |
1917 | |
1918 | /* Default implementation of S_io_readsleep */ |
1919 | #ifdef MIG_EOPNOTSUPP |
1920 | kern_return_t __attribute__ ((weak)) |
1921 | S_io_readsleep |
1922 | ( |
1923 | io_t io_object, |
1924 | mach_port_t reply, |
1925 | mach_msg_type_name_t replyPoly |
1926 | ) { return MIG_EOPNOTSUPP; } |
1927 | #endif /* MIG_EOPNOTSUPP */ |
1928 | |
1929 | /* Routine io_sigio */ |
1930 | mig_internalstatic void _Xio_sigio |
1931 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1932 | { |
1933 | typedef struct { |
1934 | mach_msg_header_t Head; |
1935 | } Request; |
1936 | |
1937 | typedef struct { |
1938 | mach_msg_header_t Head; |
1939 | mach_msg_type_t RetCodeType; |
1940 | kern_return_t RetCode; |
1941 | } Reply; |
1942 | |
1943 | Request *In0P = (Request *) InHeadP; |
1944 | Reply *OutP = (Reply *) OutHeadP; |
1945 | mig_external kern_return_t S_io_sigio |
1946 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
1947 | |
1948 | #if TypeCheck1 |
1949 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
1950 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
1951 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
1952 | #endif /* TypeCheck */ |
1953 | |
1954 | OutP->RetCode = S_io_sigio(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
1955 | } |
1956 | |
1957 | /* Default implementation of S_io_sigio */ |
1958 | #ifdef MIG_EOPNOTSUPP |
1959 | kern_return_t __attribute__ ((weak)) |
1960 | S_io_sigio |
1961 | ( |
1962 | io_t io_object, |
1963 | mach_port_t reply, |
1964 | mach_msg_type_name_t replyPoly |
1965 | ) { return MIG_EOPNOTSUPP; } |
1966 | #endif /* MIG_EOPNOTSUPP */ |
1967 | |
1968 | /* Routine io_pathconf */ |
1969 | mig_internalstatic void _Xio_pathconf |
1970 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
1971 | { |
1972 | typedef struct { |
1973 | mach_msg_header_t Head; |
1974 | mach_msg_type_t nameType; |
1975 | int name; |
1976 | } Request; |
1977 | |
1978 | typedef struct { |
1979 | mach_msg_header_t Head; |
1980 | mach_msg_type_t RetCodeType; |
1981 | kern_return_t RetCode; |
1982 | mach_msg_type_t valueType; |
1983 | int value; |
1984 | } Reply; |
1985 | |
1986 | Request *In0P = (Request *) InHeadP; |
1987 | Reply *OutP = (Reply *) OutHeadP; |
1988 | mig_external kern_return_t S_io_pathconf |
1989 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, int name, int *value); |
1990 | |
1991 | const mach_msg_type_t nameCheck = { |
1992 | /* msgt_name = */ 2, |
1993 | /* msgt_size = */ 32, |
1994 | /* msgt_number = */ 1, |
1995 | /* msgt_inline = */ TRUE((boolean_t) 1), |
1996 | /* msgt_longform = */ FALSE((boolean_t) 0), |
1997 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
1998 | /* msgt_unused = */ 0 |
1999 | }; |
2000 | |
2001 | const mach_msg_type_t valueType = { |
2002 | /* msgt_name = */ 2, |
2003 | /* msgt_size = */ 32, |
2004 | /* msgt_number = */ 1, |
2005 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2006 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2007 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2008 | /* msgt_unused = */ 0 |
2009 | }; |
2010 | |
2011 | #if TypeCheck1 |
2012 | if (mig_unlikely ((In0P->Head.msgh_size != 32) ||__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2013 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 32) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2014 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2015 | #endif /* TypeCheck */ |
2016 | |
2017 | #if TypeCheck1 |
2018 | if (BAD_TYPECHECK(&In0P->nameType, &nameCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->nameType); _c.t = *(& nameCheck);_t.w != _c.w; })), 0)) |
2019 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2020 | #endif /* TypeCheck */ |
2021 | |
2022 | OutP->RetCode = S_io_pathconf(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->name, &OutP->value); |
2023 | if (OutP->RetCode != KERN_SUCCESS0) |
2024 | return; |
2025 | |
2026 | OutP->Head.msgh_size = 40; |
2027 | |
2028 | OutP->valueType = valueType; |
2029 | } |
2030 | |
2031 | /* Default implementation of S_io_pathconf */ |
2032 | #ifdef MIG_EOPNOTSUPP |
2033 | kern_return_t __attribute__ ((weak)) |
2034 | S_io_pathconf |
2035 | ( |
2036 | io_t io_object, |
2037 | mach_port_t reply, |
2038 | mach_msg_type_name_t replyPoly, |
2039 | int name, |
2040 | int *value |
2041 | ) { return MIG_EOPNOTSUPP; } |
2042 | #endif /* MIG_EOPNOTSUPP */ |
2043 | |
2044 | /* Routine io_identity */ |
2045 | mig_internalstatic void _Xio_identity |
2046 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2047 | { |
2048 | typedef struct { |
2049 | mach_msg_header_t Head; |
2050 | } Request; |
2051 | |
2052 | typedef struct { |
2053 | mach_msg_header_t Head; |
2054 | mach_msg_type_t RetCodeType; |
2055 | kern_return_t RetCode; |
2056 | mach_msg_type_t idportType; |
2057 | mach_port_t idport; |
2058 | mach_msg_type_t fsidportType; |
2059 | mach_port_t fsidport; |
2060 | mach_msg_type_t filenoType; |
2061 | ino64_t fileno; |
2062 | } Reply; |
2063 | |
2064 | Request *In0P = (Request *) InHeadP; |
2065 | Reply *OutP = (Reply *) OutHeadP; |
2066 | mig_external kern_return_t S_io_identity |
2067 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, mach_port_t *idport, mach_msg_type_name_t *idportPoly, mach_port_t *fsidport, mach_msg_type_name_t *fsidportPoly, ino64_t *fileno); |
2068 | |
2069 | boolean_t msgh_simple = msgh_simple; |
2070 | const mach_msg_type_t idportType = { |
2071 | /* msgt_name = */ -1, |
2072 | /* msgt_size = */ 32, |
2073 | /* msgt_number = */ 1, |
2074 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2075 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2076 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2077 | /* msgt_unused = */ 0 |
2078 | }; |
2079 | |
2080 | const mach_msg_type_t fsidportType = { |
2081 | /* msgt_name = */ -1, |
2082 | /* msgt_size = */ 32, |
2083 | /* msgt_number = */ 1, |
2084 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2085 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2086 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2087 | /* msgt_unused = */ 0 |
2088 | }; |
2089 | |
2090 | const mach_msg_type_t filenoType = { |
2091 | /* msgt_name = */ 11, |
2092 | /* msgt_size = */ 64, |
2093 | /* msgt_number = */ 1, |
2094 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2095 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2096 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2097 | /* msgt_unused = */ 0 |
2098 | }; |
2099 | |
2100 | mach_msg_type_name_t idportPoly; |
2101 | mach_msg_type_name_t fsidportPoly; |
2102 | |
2103 | #if TypeCheck1 |
2104 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2105 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2106 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2107 | #endif /* TypeCheck */ |
2108 | |
2109 | OutP->RetCode = S_io_identity(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), &OutP->idport, &idportPoly, &OutP->fsidport, &fsidportPoly, &OutP->fileno); |
2110 | if (OutP->RetCode != KERN_SUCCESS0) |
2111 | return; |
2112 | |
2113 | msgh_simple = TRUE((boolean_t) 1); |
2114 | OutP->Head.msgh_size = 60; |
2115 | |
2116 | OutP->idportType = idportType; |
2117 | |
2118 | if (MACH_MSG_TYPE_PORT_ANY(idportPoly)(((idportPoly) >= 16) && ((idportPoly) <= 21))) |
2119 | msgh_simple = FALSE((boolean_t) 0); |
2120 | |
2121 | OutP->idportType.msgt_name = idportPoly; |
2122 | |
2123 | OutP->fsidportType = fsidportType; |
2124 | |
2125 | if (MACH_MSG_TYPE_PORT_ANY(fsidportPoly)(((fsidportPoly) >= 16) && ((fsidportPoly) <= 21 ))) |
2126 | msgh_simple = FALSE((boolean_t) 0); |
2127 | |
2128 | OutP->fsidportType.msgt_name = fsidportPoly; |
2129 | |
2130 | OutP->filenoType = filenoType; |
2131 | |
2132 | if (!msgh_simple) |
2133 | OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX0x80000000U; |
2134 | } |
2135 | |
2136 | /* Default implementation of S_io_identity */ |
2137 | #ifdef MIG_EOPNOTSUPP |
2138 | kern_return_t __attribute__ ((weak)) |
2139 | S_io_identity |
2140 | ( |
2141 | io_t io_object, |
2142 | mach_port_t reply, |
2143 | mach_msg_type_name_t replyPoly, |
2144 | mach_port_t *idport, |
2145 | mach_msg_type_name_t *idportPoly, |
2146 | mach_port_t *fsidport, |
2147 | mach_msg_type_name_t *fsidportPoly, |
2148 | ino64_t *fileno |
2149 | ) { return MIG_EOPNOTSUPP; } |
2150 | #endif /* MIG_EOPNOTSUPP */ |
2151 | |
2152 | /* Routine io_revoke */ |
2153 | mig_internalstatic void _Xio_revoke |
2154 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2155 | { |
2156 | typedef struct { |
2157 | mach_msg_header_t Head; |
2158 | } Request; |
2159 | |
2160 | typedef struct { |
2161 | mach_msg_header_t Head; |
2162 | mach_msg_type_t RetCodeType; |
2163 | kern_return_t RetCode; |
2164 | } Reply; |
2165 | |
2166 | Request *In0P = (Request *) InHeadP; |
2167 | Reply *OutP = (Reply *) OutHeadP; |
2168 | mig_external kern_return_t S_io_revoke |
2169 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly); |
2170 | |
2171 | #if TypeCheck1 |
2172 | if (mig_unlikely ((In0P->Head.msgh_size != 24) ||__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2173 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 24) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2174 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2175 | #endif /* TypeCheck */ |
2176 | |
2177 | OutP->RetCode = S_io_revoke(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff)); |
2178 | } |
2179 | |
2180 | /* Default implementation of S_io_revoke */ |
2181 | #ifdef MIG_EOPNOTSUPP |
2182 | kern_return_t __attribute__ ((weak)) |
2183 | S_io_revoke |
2184 | ( |
2185 | io_t io_object, |
2186 | mach_port_t reply, |
2187 | mach_msg_type_name_t replyPoly |
2188 | ) { return MIG_EOPNOTSUPP; } |
2189 | #endif /* MIG_EOPNOTSUPP */ |
2190 | |
2191 | /* Routine io_select_timeout */ |
2192 | mig_internalstatic void _Xio_select_timeout |
2193 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2194 | { |
2195 | typedef struct { |
2196 | mach_msg_header_t Head; |
2197 | mach_msg_type_t timeoutType; |
2198 | timespec_t timeout; |
2199 | mach_msg_type_t select_typeType; |
2200 | int select_type; |
2201 | } Request; |
2202 | |
2203 | typedef struct { |
2204 | mach_msg_header_t Head; |
2205 | mach_msg_type_t RetCodeType; |
2206 | kern_return_t RetCode; |
2207 | mach_msg_type_t select_typeType; |
2208 | int select_type; |
2209 | } Reply; |
2210 | |
2211 | Request *In0P = (Request *) InHeadP; |
2212 | Reply *OutP = (Reply *) OutHeadP; |
2213 | mig_external kern_return_t S_io_select_timeout |
2214 | (io_t io_object, mach_port_t reply, mach_msg_type_name_t replyPoly, timespec_t timeout, int *select_type); |
2215 | |
2216 | const mach_msg_type_t timeoutCheck = { |
2217 | /* msgt_name = */ 2, |
2218 | /* msgt_size = */ 32, |
2219 | /* msgt_number = */ 2, |
2220 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2221 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2222 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2223 | /* msgt_unused = */ 0 |
2224 | }; |
2225 | |
2226 | const mach_msg_type_t select_typeCheck = { |
2227 | /* msgt_name = */ 2, |
2228 | /* msgt_size = */ 32, |
2229 | /* msgt_number = */ 1, |
2230 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2231 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2232 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2233 | /* msgt_unused = */ 0 |
2234 | }; |
2235 | |
2236 | const mach_msg_type_t select_typeType = { |
2237 | /* msgt_name = */ 2, |
2238 | /* msgt_size = */ 32, |
2239 | /* msgt_number = */ 1, |
2240 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2241 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2242 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2243 | /* msgt_unused = */ 0 |
2244 | }; |
2245 | |
2246 | #if TypeCheck1 |
2247 | if (mig_unlikely ((In0P->Head.msgh_size != 44) ||__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0) |
2248 | (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX))__builtin_expect (!! ((In0P->Head.msgh_size != 44) || (In0P ->Head.msgh_bits & 0x80000000U)), 0)) |
2249 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2250 | #endif /* TypeCheck */ |
2251 | |
2252 | #if TypeCheck1 |
2253 | if (BAD_TYPECHECK(&In0P->timeoutType, &timeoutCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->timeoutType); _c.t = *(& timeoutCheck);_t.w != _c.w; })), 0)) |
2254 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2255 | #endif /* TypeCheck */ |
2256 | |
2257 | #if TypeCheck1 |
2258 | if (BAD_TYPECHECK(&In0P->select_typeType, &select_typeCheck)__builtin_expect (!! (({ union { mach_msg_type_t t; unsigned32_t w; } _t, _c; _t.t = *(&In0P->select_typeType); _c.t = *(&select_typeCheck);_t.w != _c.w; })), 0)) |
2259 | { OutP->RetCode = MIG_BAD_ARGUMENTS-304; return; } |
2260 | #endif /* TypeCheck */ |
2261 | |
2262 | OutP->RetCode = S_io_select_timeout(In0P->Head.msgh_request_portmsgh_local_port, In0P->Head.msgh_reply_portmsgh_remote_port, MACH_MSGH_BITS_REPLY(In0P->Head.msgh_bits)((In0P->Head.msgh_bits) & 0x000000ff), In0P->timeout, &In0P->select_type); |
2263 | if (OutP->RetCode != KERN_SUCCESS0) |
2264 | return; |
2265 | |
2266 | OutP->Head.msgh_size = 40; |
2267 | |
2268 | OutP->select_typeType = select_typeType; |
2269 | |
2270 | OutP->select_type = In0P->select_type; |
2271 | } |
2272 | |
2273 | /* Default implementation of S_io_select_timeout */ |
2274 | #ifdef MIG_EOPNOTSUPP |
2275 | kern_return_t __attribute__ ((weak)) |
2276 | S_io_select_timeout |
2277 | ( |
2278 | io_t io_object, |
2279 | mach_port_t reply, |
2280 | mach_msg_type_name_t replyPoly, |
2281 | timespec_t timeout, |
2282 | int *select_type |
2283 | ) { return MIG_EOPNOTSUPP; } |
2284 | #endif /* MIG_EOPNOTSUPP */ |
2285 | |
2286 | mig_routine_t io_server_routines[] = { |
2287 | _Xio_write, |
2288 | _Xio_read, |
2289 | _Xio_seek, |
2290 | _Xio_readable, |
2291 | _Xio_set_all_openmodes, |
2292 | _Xio_get_openmodes, |
2293 | _Xio_set_some_openmodes, |
2294 | _Xio_clear_some_openmodes, |
2295 | _Xio_async, |
2296 | _Xio_mod_owner, |
2297 | _Xio_get_owner, |
2298 | _Xio_get_icky_async_id, |
2299 | _Xio_select, |
2300 | _Xio_stat, |
2301 | _Xio_reauthenticate, |
2302 | _Xio_restrict_auth, |
2303 | _Xio_duplicate, |
2304 | _Xio_server_version, |
2305 | _Xio_map, |
2306 | _Xio_map_cntl, |
2307 | _Xio_get_conch, |
2308 | _Xio_release_conch, |
2309 | _Xio_eofnotify, |
2310 | _Xio_prenotify, |
2311 | _Xio_postnotify, |
2312 | _Xio_readnotify, |
2313 | _Xio_readsleep, |
2314 | _Xio_sigio, |
2315 | _Xio_pathconf, |
2316 | _Xio_identity, |
2317 | _Xio_revoke, |
2318 | _Xio_select_timeout, |
2319 | }; |
2320 | |
2321 | mig_external boolean_t io_server |
2322 | (mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP) |
2323 | { |
2324 | mach_msg_header_t *InP = InHeadP; |
2325 | mig_reply_header_t *OutP = (mig_reply_header_t *) OutHeadP; |
2326 | |
2327 | const mach_msg_type_t RetCodeType = { |
2328 | /* msgt_name = */ MACH_MSG_TYPE_INTEGER_322, |
2329 | /* msgt_size = */ 32, |
2330 | /* msgt_number = */ 1, |
2331 | /* msgt_inline = */ TRUE((boolean_t) 1), |
2332 | /* msgt_longform = */ FALSE((boolean_t) 0), |
2333 | /* msgt_deallocate = */ FALSE((boolean_t) 0), |
2334 | /* msgt_unused = */ 0 |
2335 | }; |
2336 | |
2337 | mig_routine_t routine; |
2338 | |
2339 | OutP->Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InP->msgh_bits), 0)((((InP->msgh_bits) & 0x000000ff)) | ((0) << 8)); |
2340 | OutP->Head.msgh_size = sizeof *OutP; |
2341 | OutP->Head.msgh_remote_port = InP->msgh_reply_portmsgh_remote_port; |
2342 | OutP->Head.msgh_local_port = MACH_PORT_NULL((mach_port_t) 0); |
2343 | OutP->Head.msgh_seqno = 0; |
2344 | OutP->Head.msgh_id = InP->msgh_id + 100; |
2345 | |
2346 | OutP->RetCodeType = RetCodeType; |
2347 | |
2348 | if ((InP->msgh_id > 21031) || (InP->msgh_id < 21000) || |
2349 | ((routine = io_server_routines[InP->msgh_id - 21000]) == 0)) { |
2350 | OutP->RetCode = MIG_BAD_ID-303; |
2351 | return FALSE((boolean_t) 0); |
2352 | } |
2353 | (*routine) (InP, &OutP->Head); |
2354 | return TRUE((boolean_t) 1); |
2355 | } |
2356 | |
2357 | mig_external mig_routine_t io_server_routine |
2358 | (const mach_msg_header_t *InHeadP) |
2359 | { |
2360 | int msgh_id; |
2361 | |
2362 | msgh_id = InHeadP->msgh_id - 21000; |
2363 | |
2364 | if ((msgh_id > 31) || (msgh_id < 0)) |
2365 | return 0; |
2366 | |
2367 | return io_server_routines[msgh_id]; |
2368 | } |
2369 |