Bug Summary

File:obj-scan-build/libdiskfs/ioServer.c
Location:line 112, column 2
Description:Value stored to 'msgh_simple' is never read

Annotated Source Code

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