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