1/*
2 * IDENTIFICATION:
3 * stub generated by bootstrap_cmds-133
4 * OPTIONS:
5 * KernelServer
6 */
7
8/* Module map */
9
10#define __MIG_check__Request__map_subsystem__ 1
11
12#include "vm32_map_server.h"
13
14#ifndef mig_internal
15#define mig_internal static __inline__
16#endif /* mig_internal */
17
18#ifndef mig_external
19#define mig_external
20#endif /* mig_external */
21
22#if !defined(__MigTypeCheck) && defined(TypeCheck)
23#define __MigTypeCheck TypeCheck /* Legacy setting */
24#endif /* !defined(__MigTypeCheck) */
25
26#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
27#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */
28#endif /* !defined(__MigKernelSpecificCode) */
29
30#ifndef LimitCheck
31#define LimitCheck 0
32#endif /* LimitCheck */
33
34#ifndef min
35#define min(a,b) ( ((a) < (b))? (a): (b) )
36#endif /* min */
37
38#if !defined(_WALIGN_)
39#define _WALIGN_(x) (((x) + 3) & ~3)
40#endif /* !defined(_WALIGN_) */
41
42#if !defined(_WALIGNSZ_)
43#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
44#endif /* !defined(_WALIGNSZ_) */
45
46#ifndef UseStaticTemplates
47#define UseStaticTemplates 0
48#endif /* UseStaticTemplates */
49
50#ifndef MIG_SERVER_ROUTINE
51#define MIG_SERVER_ROUTINE
52#endif
53
54#ifndef __DeclareRcvRpc
55#define __DeclareRcvRpc(_NUM_, _NAME_)
56#endif /* __DeclareRcvRpc */
57
58#ifndef __BeforeRcvRpc
59#define __BeforeRcvRpc(_NUM_, _NAME_)
60#endif /* __BeforeRcvRpc */
61
62#ifndef __AfterRcvRpc
63#define __AfterRcvRpc(_NUM_, _NAME_)
64#endif /* __AfterRcvRpc */
65
66#ifndef __DeclareRcvSimple
67#define __DeclareRcvSimple(_NUM_, _NAME_)
68#endif /* __DeclareRcvSimple */
69
70#ifndef __BeforeRcvSimple
71#define __BeforeRcvSimple(_NUM_, _NAME_)
72#endif /* __BeforeRcvSimple */
73
74#ifndef __AfterRcvSimple
75#define __AfterRcvSimple(_NUM_, _NAME_)
76#endif /* __AfterRcvSimple */
77
78#define novalue void
79
80#if __MigKernelSpecificCode
81#define msgh_request_port msgh_remote_port
82#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_REMOTE(bits)
83#define msgh_reply_port msgh_local_port
84#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_LOCAL(bits)
85#else
86#define msgh_request_port msgh_local_port
87#define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
88#define msgh_reply_port msgh_remote_port
89#define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
90#endif /* __MigKernelSpecificCode */
91
92#define MIG_RETURN_ERROR(X, code) {\
93 ((mig_reply_error_t *)X)->RetCode = code;\
94 ((mig_reply_error_t *)X)->NDR = NDR_record;\
95 return;\
96 }
97
98/* Forward Declarations */
99
100
101mig_internal novalue _Xregion
102 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
103
104mig_internal novalue _Xallocate
105 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
106
107mig_internal novalue _Xdeallocate
108 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
109
110mig_internal novalue _Xprotect
111 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
112
113mig_internal novalue _Xinherit
114 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
115
116mig_internal novalue _Xread
117 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
118
119mig_internal novalue _Xread_list
120 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
121
122mig_internal novalue _Xwrite
123 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
124
125mig_internal novalue _Xcopy
126 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
127
128mig_internal novalue _Xread_overwrite
129 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
130
131mig_internal novalue _Xmsync
132 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
133
134mig_internal novalue _Xbehavior_set
135 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
136
137mig_internal novalue _Xmap
138 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
139
140mig_internal novalue _Xmachine_attribute
141 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
142
143mig_internal novalue _Xremap
144 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
145
146mig_internal novalue _X_task_wire
147 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
148
149mig_internal novalue _Xmake_memory_entry
150 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
151
152mig_internal novalue _Xmap_page_query
153 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
154
155mig_internal novalue _Xregion_info
156 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
157
158mig_internal novalue _Xmapped_pages_info
159 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
160
161mig_internal novalue _Xregion_recurse
162 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
163
164mig_internal novalue _Xregion_recurse_64
165 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
166
167mig_internal novalue _Xregion_info_64
168 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
169
170mig_internal novalue _Xregion_64
171 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
172
173mig_internal novalue _Xmake_memory_entry_64
174 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
175
176mig_internal novalue _Xmap_64
177 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
178
179mig_internal novalue _Xpurgable_control
180 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
181
182mig_internal novalue _X_map_exec_lockdown
183 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP);
184
185
186#if ( __MigTypeCheck )
187#if __MIG_check__Request__map_subsystem__
188#if !defined(__MIG_check__Request__region_t__defined)
189#define __MIG_check__Request__region_t__defined
190
191mig_internal kern_return_t __MIG_check__Request__region_t(
192 __attribute__((__unused__)) __RequestKData__region_t *InKP,
193 __attribute__((__unused__)) __RequestUData__region_t *In0UP,
194 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
195{
196
197 typedef __Request__region_t __Request;
198 typedef __RequestUData__region_t __RequestU __attribute__((unused));
199#if __MigTypeCheck
200 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
201 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
202 return MIG_BAD_ARGUMENTS;
203#endif /* __MigTypeCheck */
204
205 return MACH_MSG_SUCCESS;
206}
207#endif /* !defined(__MIG_check__Request__region_t__defined) */
208#endif /* __MIG_check__Request__map_subsystem__ */
209#endif /* ( __MigTypeCheck ) */
210
211
212/* Routine region */
213mig_internal novalue _Xregion
214 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
215 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
216 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
217{
218
219#ifdef __MigPackStructs
220#pragma pack(push, 4)
221#endif
222 typedef struct {
223 NDR_record_t NDR;
224 vm32_address_t address;
225 vm_region_flavor_t flavor;
226 mach_msg_type_number_t infoCnt;
227 mach_msg_trailer_t trailer;
228 char padding[0]; /* Avoid generating empty UData structs */
229 } RequestU __attribute__((unused));
230#ifdef __MigPackStructs
231#pragma pack(pop)
232#endif
233 typedef __RequestKData__region_t RequestK;
234 typedef __RequestUData__region_t __RequestU;
235 typedef __ReplyKData__region_t ReplyK __attribute__((unused));
236 typedef __ReplyUData__region_t ReplyU __attribute__((unused));
237 typedef __Reply__region_t Reply __attribute__((unused));
238 typedef __Request__region_t __Request __attribute__((unused));
239
240 /*
241 * typedef struct {
242 * mach_msg_header_t Head;
243 * NDR_record_t NDR;
244 * kern_return_t RetCode;
245 * } mig_reply_error_t;
246 */
247
248 RequestK *InKP = (RequestK *) InHeadP;
249 RequestU *In0UP = (RequestU *) InDataP;
250 ReplyK *OutKP = (ReplyK *) OutHeadP;
251 ReplyU *OutUP = (ReplyU *) OutDataP;
252 (void)OutUP;
253#ifdef __MIG_check__Request__region_t__defined
254 kern_return_t check_result;
255#endif /* __MIG_check__Request__region_t__defined */
256
257#if __MigKernelSpecificCode
258#if UseStaticTemplates
259 const static mach_msg_port_descriptor_t object_nameTemplate = {
260 /* name = */ MACH_PORT_NULL,
261 /* pad1 = */ 0,
262 /* pad2 = */ 0,
263 /* disp = */ 17,
264 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
265 };
266#endif /* UseStaticTemplates */
267
268#else
269#if UseStaticTemplates
270 const static mach_msg_port_descriptor_t object_nameTemplate = {
271 /* name = */ MACH_PORT_NULL,
272 /* pad1 = */ 0,
273 /* pad2 = */ 0,
274 /* disp = */ 17,
275 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
276 };
277#endif /* UseStaticTemplates */
278
279#endif /* __MigKernelSpecificCode */
280 kern_return_t RetCode;
281 vm_map_read_t target_task;
282
283 __DeclareRcvRpc(3800, "region")
284 __BeforeRcvRpc(3800, "region")
285
286#if defined(__MIG_check__Request__region_t__defined)
287 check_result = __MIG_check__Request__region_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
288 if (check_result != MACH_MSG_SUCCESS)
289 { MIG_RETURN_ERROR(OutKP, check_result); }
290#endif /* defined(__MIG_check__Request__region_t__defined) */
291
292#if UseStaticTemplates
293 OutKP->object_name = object_nameTemplate;
294#else /* UseStaticTemplates */
295#if __MigKernelSpecificCode
296 OutKP->object_name.disposition = 17;
297#else
298 OutKP->object_name.disposition = 17;
299#endif /* __MigKernelSpecificCode */
300#if !(defined(KERNEL) && defined(__LP64__))
301 OutKP->object_name.pad1 = 0;
302#endif
303 OutKP->object_name.pad2 = 0;
304 OutKP->object_name.type = MACH_MSG_PORT_DESCRIPTOR;
305#if defined(KERNEL)
306 OutKP->object_name.pad_end = 0;
307#endif
308#endif /* UseStaticTemplates */
309
310
311 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
312
313 OutUP->infoCnt = 10;
314 if (In0UP->infoCnt < OutUP->infoCnt)
315 OutUP->infoCnt = In0UP->infoCnt;
316
317 RetCode = vm32_region(target_task, address: &In0UP->address, size: &OutUP->size, flavor: In0UP->flavor, info: OutUP->info, infoCnt: &OutUP->infoCnt, object_name: &OutKP->object_name.name);
318 vm_map_read_deallocate(map: target_task);
319 if (RetCode != KERN_SUCCESS) {
320 MIG_RETURN_ERROR(OutKP, RetCode);
321 }
322#if __MigKernelSpecificCode
323#endif /* __MigKernelSpecificCode */
324
325 OutUP->NDR = NDR_record;
326
327
328 OutUP->address = In0UP->address;
329 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 40) + (((4 * OutUP->infoCnt)));
330
331 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
332 OutKP->msgh_body.msgh_descriptor_count = 1;
333 __AfterRcvRpc(3800, "region")
334}
335
336#if ( __MigTypeCheck )
337#if __MIG_check__Request__map_subsystem__
338#if !defined(__MIG_check__Request__allocate_t__defined)
339#define __MIG_check__Request__allocate_t__defined
340
341mig_internal kern_return_t __MIG_check__Request__allocate_t(
342 __attribute__((__unused__)) __RequestKData__allocate_t *InKP,
343 __attribute__((__unused__)) __RequestUData__allocate_t *In0UP,
344 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
345{
346
347 typedef __Request__allocate_t __Request;
348 typedef __RequestUData__allocate_t __RequestU __attribute__((unused));
349#if __MigTypeCheck
350 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
351 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
352 return MIG_BAD_ARGUMENTS;
353#endif /* __MigTypeCheck */
354
355 return MACH_MSG_SUCCESS;
356}
357#endif /* !defined(__MIG_check__Request__allocate_t__defined) */
358#endif /* __MIG_check__Request__map_subsystem__ */
359#endif /* ( __MigTypeCheck ) */
360
361
362/* Routine allocate */
363mig_internal novalue _Xallocate
364 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
365 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
366 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
367{
368
369#ifdef __MigPackStructs
370#pragma pack(push, 4)
371#endif
372 typedef struct {
373 NDR_record_t NDR;
374 vm32_address_t address;
375 vm32_size_t size;
376 int flags;
377 mach_msg_trailer_t trailer;
378 char padding[0]; /* Avoid generating empty UData structs */
379 } RequestU __attribute__((unused));
380#ifdef __MigPackStructs
381#pragma pack(pop)
382#endif
383 typedef __RequestKData__allocate_t RequestK;
384 typedef __RequestUData__allocate_t __RequestU;
385 typedef __ReplyKData__allocate_t ReplyK __attribute__((unused));
386 typedef __ReplyUData__allocate_t ReplyU __attribute__((unused));
387 typedef __Reply__allocate_t Reply __attribute__((unused));
388 typedef __Request__allocate_t __Request __attribute__((unused));
389
390 /*
391 * typedef struct {
392 * mach_msg_header_t Head;
393 * NDR_record_t NDR;
394 * kern_return_t RetCode;
395 * } mig_reply_error_t;
396 */
397
398 RequestK *InKP = (RequestK *) InHeadP;
399 RequestU *In0UP = (RequestU *) InDataP;
400 ReplyK *OutKP = (ReplyK *) OutHeadP;
401 ReplyU *OutUP = (ReplyU *) OutDataP;
402 (void)OutUP;
403#ifdef __MIG_check__Request__allocate_t__defined
404 kern_return_t check_result;
405#endif /* __MIG_check__Request__allocate_t__defined */
406
407#if __MigKernelSpecificCode
408#else
409#endif /* __MigKernelSpecificCode */
410 vm_map_t target_task;
411
412 __DeclareRcvRpc(3801, "allocate")
413 __BeforeRcvRpc(3801, "allocate")
414
415#if defined(__MIG_check__Request__allocate_t__defined)
416 check_result = __MIG_check__Request__allocate_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
417 if (check_result != MACH_MSG_SUCCESS)
418 { MIG_RETURN_ERROR(OutKP, check_result); }
419#endif /* defined(__MIG_check__Request__allocate_t__defined) */
420
421 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
422
423 OutUP->RetCode = vm32_allocate(target_task, address: &In0UP->address, size: In0UP->size, flags: In0UP->flags);
424 vm_map_deallocate(map: target_task);
425 if (OutUP->RetCode != KERN_SUCCESS) {
426 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
427 }
428#if __MigKernelSpecificCode
429#endif /* __MigKernelSpecificCode */
430
431 OutUP->NDR = NDR_record;
432
433
434 OutUP->address = In0UP->address;
435
436 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
437 __AfterRcvRpc(3801, "allocate")
438}
439
440#if ( __MigTypeCheck )
441#if __MIG_check__Request__map_subsystem__
442#if !defined(__MIG_check__Request__deallocate_t__defined)
443#define __MIG_check__Request__deallocate_t__defined
444
445mig_internal kern_return_t __MIG_check__Request__deallocate_t(
446 __attribute__((__unused__)) __RequestKData__deallocate_t *InKP,
447 __attribute__((__unused__)) __RequestUData__deallocate_t *In0UP,
448 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
449{
450
451 typedef __Request__deallocate_t __Request;
452 typedef __RequestUData__deallocate_t __RequestU __attribute__((unused));
453#if __MigTypeCheck
454 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
455 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
456 return MIG_BAD_ARGUMENTS;
457#endif /* __MigTypeCheck */
458
459 return MACH_MSG_SUCCESS;
460}
461#endif /* !defined(__MIG_check__Request__deallocate_t__defined) */
462#endif /* __MIG_check__Request__map_subsystem__ */
463#endif /* ( __MigTypeCheck ) */
464
465
466/* Routine deallocate */
467mig_internal novalue _Xdeallocate
468 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
469 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
470 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
471{
472
473#ifdef __MigPackStructs
474#pragma pack(push, 4)
475#endif
476 typedef struct {
477 NDR_record_t NDR;
478 vm32_address_t address;
479 vm32_size_t size;
480 mach_msg_trailer_t trailer;
481 char padding[0]; /* Avoid generating empty UData structs */
482 } RequestU __attribute__((unused));
483#ifdef __MigPackStructs
484#pragma pack(pop)
485#endif
486 typedef __RequestKData__deallocate_t RequestK;
487 typedef __RequestUData__deallocate_t __RequestU;
488 typedef __ReplyKData__deallocate_t ReplyK __attribute__((unused));
489 typedef __ReplyUData__deallocate_t ReplyU __attribute__((unused));
490 typedef __Reply__deallocate_t Reply __attribute__((unused));
491 typedef __Request__deallocate_t __Request __attribute__((unused));
492
493 /*
494 * typedef struct {
495 * mach_msg_header_t Head;
496 * NDR_record_t NDR;
497 * kern_return_t RetCode;
498 * } mig_reply_error_t;
499 */
500
501 RequestK *InKP = (RequestK *) InHeadP;
502 RequestU *In0UP = (RequestU *) InDataP;
503 ReplyK *OutKP = (ReplyK *) OutHeadP;
504 ReplyU *OutUP = (ReplyU *) OutDataP;
505 (void)OutUP;
506#ifdef __MIG_check__Request__deallocate_t__defined
507 kern_return_t check_result;
508#endif /* __MIG_check__Request__deallocate_t__defined */
509
510#if __MigKernelSpecificCode
511#else
512#endif /* __MigKernelSpecificCode */
513 vm_map_t target_task;
514
515 __DeclareRcvRpc(3802, "deallocate")
516 __BeforeRcvRpc(3802, "deallocate")
517
518#if defined(__MIG_check__Request__deallocate_t__defined)
519 check_result = __MIG_check__Request__deallocate_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
520 if (check_result != MACH_MSG_SUCCESS)
521 { MIG_RETURN_ERROR(OutKP, check_result); }
522#endif /* defined(__MIG_check__Request__deallocate_t__defined) */
523
524 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
525
526 OutUP->RetCode = vm32_deallocate(target_task, address: In0UP->address, size: In0UP->size);
527 vm_map_deallocate(map: target_task);
528#if __MigKernelSpecificCode
529#endif /* __MigKernelSpecificCode */
530
531 OutUP->NDR = NDR_record;
532
533
534 __AfterRcvRpc(3802, "deallocate")
535}
536
537#if ( __MigTypeCheck )
538#if __MIG_check__Request__map_subsystem__
539#if !defined(__MIG_check__Request__protect_t__defined)
540#define __MIG_check__Request__protect_t__defined
541
542mig_internal kern_return_t __MIG_check__Request__protect_t(
543 __attribute__((__unused__)) __RequestKData__protect_t *InKP,
544 __attribute__((__unused__)) __RequestUData__protect_t *In0UP,
545 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
546{
547
548 typedef __Request__protect_t __Request;
549 typedef __RequestUData__protect_t __RequestU __attribute__((unused));
550#if __MigTypeCheck
551 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
552 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
553 return MIG_BAD_ARGUMENTS;
554#endif /* __MigTypeCheck */
555
556 return MACH_MSG_SUCCESS;
557}
558#endif /* !defined(__MIG_check__Request__protect_t__defined) */
559#endif /* __MIG_check__Request__map_subsystem__ */
560#endif /* ( __MigTypeCheck ) */
561
562
563/* Routine protect */
564mig_internal novalue _Xprotect
565 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
566 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
567 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
568{
569
570#ifdef __MigPackStructs
571#pragma pack(push, 4)
572#endif
573 typedef struct {
574 NDR_record_t NDR;
575 vm32_address_t address;
576 vm32_size_t size;
577 boolean_t set_maximum;
578 vm_prot_t new_protection;
579 mach_msg_trailer_t trailer;
580 char padding[0]; /* Avoid generating empty UData structs */
581 } RequestU __attribute__((unused));
582#ifdef __MigPackStructs
583#pragma pack(pop)
584#endif
585 typedef __RequestKData__protect_t RequestK;
586 typedef __RequestUData__protect_t __RequestU;
587 typedef __ReplyKData__protect_t ReplyK __attribute__((unused));
588 typedef __ReplyUData__protect_t ReplyU __attribute__((unused));
589 typedef __Reply__protect_t Reply __attribute__((unused));
590 typedef __Request__protect_t __Request __attribute__((unused));
591
592 /*
593 * typedef struct {
594 * mach_msg_header_t Head;
595 * NDR_record_t NDR;
596 * kern_return_t RetCode;
597 * } mig_reply_error_t;
598 */
599
600 RequestK *InKP = (RequestK *) InHeadP;
601 RequestU *In0UP = (RequestU *) InDataP;
602 ReplyK *OutKP = (ReplyK *) OutHeadP;
603 ReplyU *OutUP = (ReplyU *) OutDataP;
604 (void)OutUP;
605#ifdef __MIG_check__Request__protect_t__defined
606 kern_return_t check_result;
607#endif /* __MIG_check__Request__protect_t__defined */
608
609#if __MigKernelSpecificCode
610#else
611#endif /* __MigKernelSpecificCode */
612 vm_map_t target_task;
613
614 __DeclareRcvRpc(3803, "protect")
615 __BeforeRcvRpc(3803, "protect")
616
617#if defined(__MIG_check__Request__protect_t__defined)
618 check_result = __MIG_check__Request__protect_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
619 if (check_result != MACH_MSG_SUCCESS)
620 { MIG_RETURN_ERROR(OutKP, check_result); }
621#endif /* defined(__MIG_check__Request__protect_t__defined) */
622
623 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
624
625 OutUP->RetCode = vm32_protect(target_task, address: In0UP->address, size: In0UP->size, set_maximum: In0UP->set_maximum, new_protection: In0UP->new_protection);
626 vm_map_deallocate(map: target_task);
627#if __MigKernelSpecificCode
628#endif /* __MigKernelSpecificCode */
629
630 OutUP->NDR = NDR_record;
631
632
633 __AfterRcvRpc(3803, "protect")
634}
635
636#if ( __MigTypeCheck )
637#if __MIG_check__Request__map_subsystem__
638#if !defined(__MIG_check__Request__inherit_t__defined)
639#define __MIG_check__Request__inherit_t__defined
640
641mig_internal kern_return_t __MIG_check__Request__inherit_t(
642 __attribute__((__unused__)) __RequestKData__inherit_t *InKP,
643 __attribute__((__unused__)) __RequestUData__inherit_t *In0UP,
644 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
645{
646
647 typedef __Request__inherit_t __Request;
648 typedef __RequestUData__inherit_t __RequestU __attribute__((unused));
649#if __MigTypeCheck
650 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
651 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
652 return MIG_BAD_ARGUMENTS;
653#endif /* __MigTypeCheck */
654
655 return MACH_MSG_SUCCESS;
656}
657#endif /* !defined(__MIG_check__Request__inherit_t__defined) */
658#endif /* __MIG_check__Request__map_subsystem__ */
659#endif /* ( __MigTypeCheck ) */
660
661
662/* Routine inherit */
663mig_internal novalue _Xinherit
664 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
665 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
666 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
667{
668
669#ifdef __MigPackStructs
670#pragma pack(push, 4)
671#endif
672 typedef struct {
673 NDR_record_t NDR;
674 vm32_address_t address;
675 vm32_size_t size;
676 vm_inherit_t new_inheritance;
677 mach_msg_trailer_t trailer;
678 char padding[0]; /* Avoid generating empty UData structs */
679 } RequestU __attribute__((unused));
680#ifdef __MigPackStructs
681#pragma pack(pop)
682#endif
683 typedef __RequestKData__inherit_t RequestK;
684 typedef __RequestUData__inherit_t __RequestU;
685 typedef __ReplyKData__inherit_t ReplyK __attribute__((unused));
686 typedef __ReplyUData__inherit_t ReplyU __attribute__((unused));
687 typedef __Reply__inherit_t Reply __attribute__((unused));
688 typedef __Request__inherit_t __Request __attribute__((unused));
689
690 /*
691 * typedef struct {
692 * mach_msg_header_t Head;
693 * NDR_record_t NDR;
694 * kern_return_t RetCode;
695 * } mig_reply_error_t;
696 */
697
698 RequestK *InKP = (RequestK *) InHeadP;
699 RequestU *In0UP = (RequestU *) InDataP;
700 ReplyK *OutKP = (ReplyK *) OutHeadP;
701 ReplyU *OutUP = (ReplyU *) OutDataP;
702 (void)OutUP;
703#ifdef __MIG_check__Request__inherit_t__defined
704 kern_return_t check_result;
705#endif /* __MIG_check__Request__inherit_t__defined */
706
707#if __MigKernelSpecificCode
708#else
709#endif /* __MigKernelSpecificCode */
710 vm_map_t target_task;
711
712 __DeclareRcvRpc(3804, "inherit")
713 __BeforeRcvRpc(3804, "inherit")
714
715#if defined(__MIG_check__Request__inherit_t__defined)
716 check_result = __MIG_check__Request__inherit_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
717 if (check_result != MACH_MSG_SUCCESS)
718 { MIG_RETURN_ERROR(OutKP, check_result); }
719#endif /* defined(__MIG_check__Request__inherit_t__defined) */
720
721 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
722
723 OutUP->RetCode = vm32_inherit(target_task, address: In0UP->address, size: In0UP->size, new_inheritance: In0UP->new_inheritance);
724 vm_map_deallocate(map: target_task);
725#if __MigKernelSpecificCode
726#endif /* __MigKernelSpecificCode */
727
728 OutUP->NDR = NDR_record;
729
730
731 __AfterRcvRpc(3804, "inherit")
732}
733
734#if ( __MigTypeCheck )
735#if __MIG_check__Request__map_subsystem__
736#if !defined(__MIG_check__Request__read_t__defined)
737#define __MIG_check__Request__read_t__defined
738
739mig_internal kern_return_t __MIG_check__Request__read_t(
740 __attribute__((__unused__)) __RequestKData__read_t *InKP,
741 __attribute__((__unused__)) __RequestUData__read_t *In0UP,
742 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
743{
744
745 typedef __Request__read_t __Request;
746 typedef __RequestUData__read_t __RequestU __attribute__((unused));
747#if __MigTypeCheck
748 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
749 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
750 return MIG_BAD_ARGUMENTS;
751#endif /* __MigTypeCheck */
752
753 return MACH_MSG_SUCCESS;
754}
755#endif /* !defined(__MIG_check__Request__read_t__defined) */
756#endif /* __MIG_check__Request__map_subsystem__ */
757#endif /* ( __MigTypeCheck ) */
758
759
760/* Routine read */
761mig_internal novalue _Xread
762 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
763 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
764 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
765{
766
767#ifdef __MigPackStructs
768#pragma pack(push, 4)
769#endif
770 typedef struct {
771 NDR_record_t NDR;
772 vm32_address_t address;
773 vm32_size_t size;
774 mach_msg_trailer_t trailer;
775 char padding[0]; /* Avoid generating empty UData structs */
776 } RequestU __attribute__((unused));
777#ifdef __MigPackStructs
778#pragma pack(pop)
779#endif
780 typedef __RequestKData__read_t RequestK;
781 typedef __RequestUData__read_t __RequestU;
782 typedef __ReplyKData__read_t ReplyK __attribute__((unused));
783 typedef __ReplyUData__read_t ReplyU __attribute__((unused));
784 typedef __Reply__read_t Reply __attribute__((unused));
785 typedef __Request__read_t __Request __attribute__((unused));
786
787 /*
788 * typedef struct {
789 * mach_msg_header_t Head;
790 * NDR_record_t NDR;
791 * kern_return_t RetCode;
792 * } mig_reply_error_t;
793 */
794
795 RequestK *InKP = (RequestK *) InHeadP;
796 RequestU *In0UP = (RequestU *) InDataP;
797 ReplyK *OutKP = (ReplyK *) OutHeadP;
798 ReplyU *OutUP = (ReplyU *) OutDataP;
799 (void)OutUP;
800#ifdef __MIG_check__Request__read_t__defined
801 kern_return_t check_result;
802#endif /* __MIG_check__Request__read_t__defined */
803
804#if __MigKernelSpecificCode
805#if UseStaticTemplates
806 const static mach_msg_ool_descriptor_t dataTemplate = {
807 /* addr = */ (void *)0,
808 /* size = */ 0,
809 /* deal = */ FALSE,
810 /* copy = */ MACH_MSG_VIRTUAL_COPY,
811 /* pad2 = */ 0,
812 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
813 };
814#endif /* UseStaticTemplates */
815
816#else
817#if UseStaticTemplates
818 const static mach_msg_ool_descriptor_t dataTemplate = {
819 /* addr = */ (void *)0,
820 /* size = */ 0,
821 /* deal = */ FALSE,
822 /* copy = */ MACH_MSG_VIRTUAL_COPY,
823 /* pad2 = */ 0,
824 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
825 };
826#endif /* UseStaticTemplates */
827
828#endif /* __MigKernelSpecificCode */
829 kern_return_t RetCode;
830 vm_map_read_t target_task;
831
832 __DeclareRcvRpc(3805, "read")
833 __BeforeRcvRpc(3805, "read")
834
835#if defined(__MIG_check__Request__read_t__defined)
836 check_result = __MIG_check__Request__read_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
837 if (check_result != MACH_MSG_SUCCESS)
838 { MIG_RETURN_ERROR(OutKP, check_result); }
839#endif /* defined(__MIG_check__Request__read_t__defined) */
840
841#if UseStaticTemplates
842 OutKP->data = dataTemplate;
843#else /* UseStaticTemplates */
844 OutKP->data.deallocate = FALSE;
845 OutKP->data.copy = MACH_MSG_VIRTUAL_COPY;
846 OutKP->data.pad1 = 0;
847 OutKP->data.type = MACH_MSG_OOL_DESCRIPTOR;
848#if defined(KERNEL) && !defined(__LP64__)
849 OutKP->data.pad_end = 0;
850#endif
851#endif /* UseStaticTemplates */
852
853
854 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
855
856 RetCode = vm32_read(target_task, address: In0UP->address, size: In0UP->size, data: (vm_offset_t *)&(OutKP->data.address), dataCnt: &OutUP->dataCnt);
857 vm_map_read_deallocate(map: target_task);
858 if (RetCode != KERN_SUCCESS) {
859 MIG_RETURN_ERROR(OutKP, RetCode);
860 }
861#if __MigKernelSpecificCode
862#endif /* __MigKernelSpecificCode */
863 OutKP->data.size = OutUP->dataCnt;
864
865
866 OutUP->NDR = NDR_record;
867
868
869 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
870 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
871 OutKP->msgh_body.msgh_descriptor_count = 1;
872 __AfterRcvRpc(3805, "read")
873}
874
875#if ( __MigTypeCheck )
876#if __MIG_check__Request__map_subsystem__
877#if !defined(__MIG_check__Request__read_list_t__defined)
878#define __MIG_check__Request__read_list_t__defined
879
880mig_internal kern_return_t __MIG_check__Request__read_list_t(
881 __attribute__((__unused__)) __RequestKData__read_list_t *InKP,
882 __attribute__((__unused__)) __RequestUData__read_list_t *In0UP,
883 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
884{
885
886 typedef __Request__read_list_t __Request;
887 typedef __RequestUData__read_list_t __RequestU __attribute__((unused));
888#if __MigTypeCheck
889 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
890 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
891 return MIG_BAD_ARGUMENTS;
892#endif /* __MigTypeCheck */
893
894 return MACH_MSG_SUCCESS;
895}
896#endif /* !defined(__MIG_check__Request__read_list_t__defined) */
897#endif /* __MIG_check__Request__map_subsystem__ */
898#endif /* ( __MigTypeCheck ) */
899
900
901/* Routine read_list */
902mig_internal novalue _Xread_list
903 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
904 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
905 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
906{
907
908#ifdef __MigPackStructs
909#pragma pack(push, 4)
910#endif
911 typedef struct {
912 NDR_record_t NDR;
913 vm32_read_entry_t data_list;
914 natural_t count;
915 mach_msg_trailer_t trailer;
916 char padding[0]; /* Avoid generating empty UData structs */
917 } RequestU __attribute__((unused));
918#ifdef __MigPackStructs
919#pragma pack(pop)
920#endif
921 typedef __RequestKData__read_list_t RequestK;
922 typedef __RequestUData__read_list_t __RequestU;
923 typedef __ReplyKData__read_list_t ReplyK __attribute__((unused));
924 typedef __ReplyUData__read_list_t ReplyU __attribute__((unused));
925 typedef __Reply__read_list_t Reply __attribute__((unused));
926 typedef __Request__read_list_t __Request __attribute__((unused));
927
928 /*
929 * typedef struct {
930 * mach_msg_header_t Head;
931 * NDR_record_t NDR;
932 * kern_return_t RetCode;
933 * } mig_reply_error_t;
934 */
935
936 RequestK *InKP = (RequestK *) InHeadP;
937 RequestU *In0UP = (RequestU *) InDataP;
938 ReplyK *OutKP = (ReplyK *) OutHeadP;
939 ReplyU *OutUP = (ReplyU *) OutDataP;
940 (void)OutUP;
941#ifdef __MIG_check__Request__read_list_t__defined
942 kern_return_t check_result;
943#endif /* __MIG_check__Request__read_list_t__defined */
944
945#if __MigKernelSpecificCode
946#else
947#endif /* __MigKernelSpecificCode */
948 vm_map_read_t target_task;
949
950 __DeclareRcvRpc(3806, "read_list")
951 __BeforeRcvRpc(3806, "read_list")
952
953#if defined(__MIG_check__Request__read_list_t__defined)
954 check_result = __MIG_check__Request__read_list_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
955 if (check_result != MACH_MSG_SUCCESS)
956 { MIG_RETURN_ERROR(OutKP, check_result); }
957#endif /* defined(__MIG_check__Request__read_list_t__defined) */
958
959 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
960
961 OutUP->RetCode = vm32_read_list(target_task, data_list: In0UP->data_list, count: In0UP->count);
962 vm_map_read_deallocate(map: target_task);
963 if (OutUP->RetCode != KERN_SUCCESS) {
964 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
965 }
966#if __MigKernelSpecificCode
967#endif /* __MigKernelSpecificCode */
968
969 OutUP->NDR = NDR_record;
970
971
972 { typedef struct { char data[2048]; } *sp;
973 * (sp) OutUP->data_list = * (sp) In0UP->data_list;
974 }
975
976 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
977 __AfterRcvRpc(3806, "read_list")
978}
979
980#if ( __MigTypeCheck )
981#if __MIG_check__Request__map_subsystem__
982#if !defined(__MIG_check__Request__write_t__defined)
983#define __MIG_check__Request__write_t__defined
984
985mig_internal kern_return_t __MIG_check__Request__write_t(
986 __attribute__((__unused__)) __RequestKData__write_t *InKP,
987 __attribute__((__unused__)) __RequestUData__write_t *In0UP,
988 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
989{
990
991 typedef __Request__write_t __Request;
992 typedef __RequestUData__write_t __RequestU __attribute__((unused));
993#if __MigTypeCheck
994 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
995 (InKP->msgh_body.msgh_descriptor_count != 1) ||
996 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
997 return MIG_BAD_ARGUMENTS;
998#endif /* __MigTypeCheck */
999
1000#if __MigTypeCheck
1001 if (InKP->data.type != MACH_MSG_OOL_DESCRIPTOR)
1002 return MIG_TYPE_ERROR;
1003#endif /* __MigTypeCheck */
1004
1005#if __MigTypeCheck
1006 if (InKP->data.size != In0UP->dataCnt)
1007 return MIG_TYPE_ERROR;
1008#endif /* __MigTypeCheck */
1009
1010 return MACH_MSG_SUCCESS;
1011}
1012#endif /* !defined(__MIG_check__Request__write_t__defined) */
1013#endif /* __MIG_check__Request__map_subsystem__ */
1014#endif /* ( __MigTypeCheck ) */
1015
1016
1017/* Routine write */
1018mig_internal novalue _Xwrite
1019 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1020 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1021 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1022{
1023
1024#ifdef __MigPackStructs
1025#pragma pack(push, 4)
1026#endif
1027 typedef struct {
1028 NDR_record_t NDR;
1029 vm32_address_t address;
1030 mach_msg_type_number_t dataCnt;
1031 mach_msg_trailer_t trailer;
1032 char padding[0]; /* Avoid generating empty UData structs */
1033 } RequestU __attribute__((unused));
1034#ifdef __MigPackStructs
1035#pragma pack(pop)
1036#endif
1037 typedef __RequestKData__write_t RequestK;
1038 typedef __RequestUData__write_t __RequestU;
1039 typedef __ReplyKData__write_t ReplyK __attribute__((unused));
1040 typedef __ReplyUData__write_t ReplyU __attribute__((unused));
1041 typedef __Reply__write_t Reply __attribute__((unused));
1042 typedef __Request__write_t __Request __attribute__((unused));
1043
1044 /*
1045 * typedef struct {
1046 * mach_msg_header_t Head;
1047 * NDR_record_t NDR;
1048 * kern_return_t RetCode;
1049 * } mig_reply_error_t;
1050 */
1051
1052 RequestK *InKP = (RequestK *) InHeadP;
1053 RequestU *In0UP = (RequestU *) InDataP;
1054 ReplyK *OutKP = (ReplyK *) OutHeadP;
1055 ReplyU *OutUP = (ReplyU *) OutDataP;
1056 (void)OutUP;
1057#ifdef __MIG_check__Request__write_t__defined
1058 kern_return_t check_result;
1059#endif /* __MIG_check__Request__write_t__defined */
1060
1061#if __MigKernelSpecificCode
1062#else
1063#endif /* __MigKernelSpecificCode */
1064 vm_map_t target_task;
1065
1066 __DeclareRcvRpc(3807, "write")
1067 __BeforeRcvRpc(3807, "write")
1068
1069#if defined(__MIG_check__Request__write_t__defined)
1070 check_result = __MIG_check__Request__write_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1071 if (check_result != MACH_MSG_SUCCESS)
1072 { MIG_RETURN_ERROR(OutKP, check_result); }
1073#endif /* defined(__MIG_check__Request__write_t__defined) */
1074
1075 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1076
1077 OutUP->RetCode = vm32_write(target_task, address: In0UP->address, data: (vm_offset_t)(InKP->data.address), dataCnt: InKP->data.size);
1078 vm_map_deallocate(map: target_task);
1079#if __MigKernelSpecificCode
1080#endif /* __MigKernelSpecificCode */
1081
1082 OutUP->NDR = NDR_record;
1083
1084
1085 __AfterRcvRpc(3807, "write")
1086}
1087
1088#if ( __MigTypeCheck )
1089#if __MIG_check__Request__map_subsystem__
1090#if !defined(__MIG_check__Request__copy_t__defined)
1091#define __MIG_check__Request__copy_t__defined
1092
1093mig_internal kern_return_t __MIG_check__Request__copy_t(
1094 __attribute__((__unused__)) __RequestKData__copy_t *InKP,
1095 __attribute__((__unused__)) __RequestUData__copy_t *In0UP,
1096 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1097{
1098
1099 typedef __Request__copy_t __Request;
1100 typedef __RequestUData__copy_t __RequestU __attribute__((unused));
1101#if __MigTypeCheck
1102 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1103 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1104 return MIG_BAD_ARGUMENTS;
1105#endif /* __MigTypeCheck */
1106
1107 return MACH_MSG_SUCCESS;
1108}
1109#endif /* !defined(__MIG_check__Request__copy_t__defined) */
1110#endif /* __MIG_check__Request__map_subsystem__ */
1111#endif /* ( __MigTypeCheck ) */
1112
1113
1114/* Routine copy */
1115mig_internal novalue _Xcopy
1116 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1117 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1118 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1119{
1120
1121#ifdef __MigPackStructs
1122#pragma pack(push, 4)
1123#endif
1124 typedef struct {
1125 NDR_record_t NDR;
1126 vm32_address_t source_address;
1127 vm32_size_t size;
1128 vm32_address_t dest_address;
1129 mach_msg_trailer_t trailer;
1130 char padding[0]; /* Avoid generating empty UData structs */
1131 } RequestU __attribute__((unused));
1132#ifdef __MigPackStructs
1133#pragma pack(pop)
1134#endif
1135 typedef __RequestKData__copy_t RequestK;
1136 typedef __RequestUData__copy_t __RequestU;
1137 typedef __ReplyKData__copy_t ReplyK __attribute__((unused));
1138 typedef __ReplyUData__copy_t ReplyU __attribute__((unused));
1139 typedef __Reply__copy_t Reply __attribute__((unused));
1140 typedef __Request__copy_t __Request __attribute__((unused));
1141
1142 /*
1143 * typedef struct {
1144 * mach_msg_header_t Head;
1145 * NDR_record_t NDR;
1146 * kern_return_t RetCode;
1147 * } mig_reply_error_t;
1148 */
1149
1150 RequestK *InKP = (RequestK *) InHeadP;
1151 RequestU *In0UP = (RequestU *) InDataP;
1152 ReplyK *OutKP = (ReplyK *) OutHeadP;
1153 ReplyU *OutUP = (ReplyU *) OutDataP;
1154 (void)OutUP;
1155#ifdef __MIG_check__Request__copy_t__defined
1156 kern_return_t check_result;
1157#endif /* __MIG_check__Request__copy_t__defined */
1158
1159#if __MigKernelSpecificCode
1160#else
1161#endif /* __MigKernelSpecificCode */
1162 vm_map_t target_task;
1163
1164 __DeclareRcvRpc(3808, "copy")
1165 __BeforeRcvRpc(3808, "copy")
1166
1167#if defined(__MIG_check__Request__copy_t__defined)
1168 check_result = __MIG_check__Request__copy_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1169 if (check_result != MACH_MSG_SUCCESS)
1170 { MIG_RETURN_ERROR(OutKP, check_result); }
1171#endif /* defined(__MIG_check__Request__copy_t__defined) */
1172
1173 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1174
1175 OutUP->RetCode = vm32_copy(target_task, source_address: In0UP->source_address, size: In0UP->size, dest_address: In0UP->dest_address);
1176 vm_map_deallocate(map: target_task);
1177#if __MigKernelSpecificCode
1178#endif /* __MigKernelSpecificCode */
1179
1180 OutUP->NDR = NDR_record;
1181
1182
1183 __AfterRcvRpc(3808, "copy")
1184}
1185
1186#if ( __MigTypeCheck )
1187#if __MIG_check__Request__map_subsystem__
1188#if !defined(__MIG_check__Request__read_overwrite_t__defined)
1189#define __MIG_check__Request__read_overwrite_t__defined
1190
1191mig_internal kern_return_t __MIG_check__Request__read_overwrite_t(
1192 __attribute__((__unused__)) __RequestKData__read_overwrite_t *InKP,
1193 __attribute__((__unused__)) __RequestUData__read_overwrite_t *In0UP,
1194 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1195{
1196
1197 typedef __Request__read_overwrite_t __Request;
1198 typedef __RequestUData__read_overwrite_t __RequestU __attribute__((unused));
1199#if __MigTypeCheck
1200 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1201 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1202 return MIG_BAD_ARGUMENTS;
1203#endif /* __MigTypeCheck */
1204
1205 return MACH_MSG_SUCCESS;
1206}
1207#endif /* !defined(__MIG_check__Request__read_overwrite_t__defined) */
1208#endif /* __MIG_check__Request__map_subsystem__ */
1209#endif /* ( __MigTypeCheck ) */
1210
1211
1212/* Routine read_overwrite */
1213mig_internal novalue _Xread_overwrite
1214 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1215 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1216 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1217{
1218
1219#ifdef __MigPackStructs
1220#pragma pack(push, 4)
1221#endif
1222 typedef struct {
1223 NDR_record_t NDR;
1224 vm32_address_t address;
1225 vm32_size_t size;
1226 vm32_address_t data;
1227 mach_msg_trailer_t trailer;
1228 char padding[0]; /* Avoid generating empty UData structs */
1229 } RequestU __attribute__((unused));
1230#ifdef __MigPackStructs
1231#pragma pack(pop)
1232#endif
1233 typedef __RequestKData__read_overwrite_t RequestK;
1234 typedef __RequestUData__read_overwrite_t __RequestU;
1235 typedef __ReplyKData__read_overwrite_t ReplyK __attribute__((unused));
1236 typedef __ReplyUData__read_overwrite_t ReplyU __attribute__((unused));
1237 typedef __Reply__read_overwrite_t Reply __attribute__((unused));
1238 typedef __Request__read_overwrite_t __Request __attribute__((unused));
1239
1240 /*
1241 * typedef struct {
1242 * mach_msg_header_t Head;
1243 * NDR_record_t NDR;
1244 * kern_return_t RetCode;
1245 * } mig_reply_error_t;
1246 */
1247
1248 RequestK *InKP = (RequestK *) InHeadP;
1249 RequestU *In0UP = (RequestU *) InDataP;
1250 ReplyK *OutKP = (ReplyK *) OutHeadP;
1251 ReplyU *OutUP = (ReplyU *) OutDataP;
1252 (void)OutUP;
1253#ifdef __MIG_check__Request__read_overwrite_t__defined
1254 kern_return_t check_result;
1255#endif /* __MIG_check__Request__read_overwrite_t__defined */
1256
1257#if __MigKernelSpecificCode
1258#else
1259#endif /* __MigKernelSpecificCode */
1260 vm_map_read_t target_task;
1261
1262 __DeclareRcvRpc(3809, "read_overwrite")
1263 __BeforeRcvRpc(3809, "read_overwrite")
1264
1265#if defined(__MIG_check__Request__read_overwrite_t__defined)
1266 check_result = __MIG_check__Request__read_overwrite_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1267 if (check_result != MACH_MSG_SUCCESS)
1268 { MIG_RETURN_ERROR(OutKP, check_result); }
1269#endif /* defined(__MIG_check__Request__read_overwrite_t__defined) */
1270
1271 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
1272
1273 OutUP->RetCode = vm32_read_overwrite(target_task, address: In0UP->address, size: In0UP->size, data: In0UP->data, outsize: &OutUP->outsize);
1274 vm_map_read_deallocate(map: target_task);
1275 if (OutUP->RetCode != KERN_SUCCESS) {
1276 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
1277 }
1278#if __MigKernelSpecificCode
1279#endif /* __MigKernelSpecificCode */
1280
1281 OutUP->NDR = NDR_record;
1282
1283
1284 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1285 __AfterRcvRpc(3809, "read_overwrite")
1286}
1287
1288#if ( __MigTypeCheck )
1289#if __MIG_check__Request__map_subsystem__
1290#if !defined(__MIG_check__Request__msync_t__defined)
1291#define __MIG_check__Request__msync_t__defined
1292
1293mig_internal kern_return_t __MIG_check__Request__msync_t(
1294 __attribute__((__unused__)) __RequestKData__msync_t *InKP,
1295 __attribute__((__unused__)) __RequestUData__msync_t *In0UP,
1296 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1297{
1298
1299 typedef __Request__msync_t __Request;
1300 typedef __RequestUData__msync_t __RequestU __attribute__((unused));
1301#if __MigTypeCheck
1302 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1303 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1304 return MIG_BAD_ARGUMENTS;
1305#endif /* __MigTypeCheck */
1306
1307 return MACH_MSG_SUCCESS;
1308}
1309#endif /* !defined(__MIG_check__Request__msync_t__defined) */
1310#endif /* __MIG_check__Request__map_subsystem__ */
1311#endif /* ( __MigTypeCheck ) */
1312
1313
1314/* Routine msync */
1315mig_internal novalue _Xmsync
1316 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1317 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1318 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1319{
1320
1321#ifdef __MigPackStructs
1322#pragma pack(push, 4)
1323#endif
1324 typedef struct {
1325 NDR_record_t NDR;
1326 vm32_address_t address;
1327 vm32_size_t size;
1328 vm_sync_t sync_flags;
1329 mach_msg_trailer_t trailer;
1330 char padding[0]; /* Avoid generating empty UData structs */
1331 } RequestU __attribute__((unused));
1332#ifdef __MigPackStructs
1333#pragma pack(pop)
1334#endif
1335 typedef __RequestKData__msync_t RequestK;
1336 typedef __RequestUData__msync_t __RequestU;
1337 typedef __ReplyKData__msync_t ReplyK __attribute__((unused));
1338 typedef __ReplyUData__msync_t ReplyU __attribute__((unused));
1339 typedef __Reply__msync_t Reply __attribute__((unused));
1340 typedef __Request__msync_t __Request __attribute__((unused));
1341
1342 /*
1343 * typedef struct {
1344 * mach_msg_header_t Head;
1345 * NDR_record_t NDR;
1346 * kern_return_t RetCode;
1347 * } mig_reply_error_t;
1348 */
1349
1350 RequestK *InKP = (RequestK *) InHeadP;
1351 RequestU *In0UP = (RequestU *) InDataP;
1352 ReplyK *OutKP = (ReplyK *) OutHeadP;
1353 ReplyU *OutUP = (ReplyU *) OutDataP;
1354 (void)OutUP;
1355#ifdef __MIG_check__Request__msync_t__defined
1356 kern_return_t check_result;
1357#endif /* __MIG_check__Request__msync_t__defined */
1358
1359#if __MigKernelSpecificCode
1360#else
1361#endif /* __MigKernelSpecificCode */
1362 vm_map_t target_task;
1363
1364 __DeclareRcvRpc(3810, "msync")
1365 __BeforeRcvRpc(3810, "msync")
1366
1367#if defined(__MIG_check__Request__msync_t__defined)
1368 check_result = __MIG_check__Request__msync_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1369 if (check_result != MACH_MSG_SUCCESS)
1370 { MIG_RETURN_ERROR(OutKP, check_result); }
1371#endif /* defined(__MIG_check__Request__msync_t__defined) */
1372
1373 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1374
1375 OutUP->RetCode = vm32_msync(target_task, address: In0UP->address, size: In0UP->size, sync_flags: In0UP->sync_flags);
1376 vm_map_deallocate(map: target_task);
1377#if __MigKernelSpecificCode
1378#endif /* __MigKernelSpecificCode */
1379
1380 OutUP->NDR = NDR_record;
1381
1382
1383 __AfterRcvRpc(3810, "msync")
1384}
1385
1386#if ( __MigTypeCheck )
1387#if __MIG_check__Request__map_subsystem__
1388#if !defined(__MIG_check__Request__behavior_set_t__defined)
1389#define __MIG_check__Request__behavior_set_t__defined
1390
1391mig_internal kern_return_t __MIG_check__Request__behavior_set_t(
1392 __attribute__((__unused__)) __RequestKData__behavior_set_t *InKP,
1393 __attribute__((__unused__)) __RequestUData__behavior_set_t *In0UP,
1394 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1395{
1396
1397 typedef __Request__behavior_set_t __Request;
1398 typedef __RequestUData__behavior_set_t __RequestU __attribute__((unused));
1399#if __MigTypeCheck
1400 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1401 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1402 return MIG_BAD_ARGUMENTS;
1403#endif /* __MigTypeCheck */
1404
1405 return MACH_MSG_SUCCESS;
1406}
1407#endif /* !defined(__MIG_check__Request__behavior_set_t__defined) */
1408#endif /* __MIG_check__Request__map_subsystem__ */
1409#endif /* ( __MigTypeCheck ) */
1410
1411
1412/* Routine behavior_set */
1413mig_internal novalue _Xbehavior_set
1414 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1415 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1416 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1417{
1418
1419#ifdef __MigPackStructs
1420#pragma pack(push, 4)
1421#endif
1422 typedef struct {
1423 NDR_record_t NDR;
1424 vm32_address_t address;
1425 vm32_size_t size;
1426 vm_behavior_t new_behavior;
1427 mach_msg_trailer_t trailer;
1428 char padding[0]; /* Avoid generating empty UData structs */
1429 } RequestU __attribute__((unused));
1430#ifdef __MigPackStructs
1431#pragma pack(pop)
1432#endif
1433 typedef __RequestKData__behavior_set_t RequestK;
1434 typedef __RequestUData__behavior_set_t __RequestU;
1435 typedef __ReplyKData__behavior_set_t ReplyK __attribute__((unused));
1436 typedef __ReplyUData__behavior_set_t ReplyU __attribute__((unused));
1437 typedef __Reply__behavior_set_t Reply __attribute__((unused));
1438 typedef __Request__behavior_set_t __Request __attribute__((unused));
1439
1440 /*
1441 * typedef struct {
1442 * mach_msg_header_t Head;
1443 * NDR_record_t NDR;
1444 * kern_return_t RetCode;
1445 * } mig_reply_error_t;
1446 */
1447
1448 RequestK *InKP = (RequestK *) InHeadP;
1449 RequestU *In0UP = (RequestU *) InDataP;
1450 ReplyK *OutKP = (ReplyK *) OutHeadP;
1451 ReplyU *OutUP = (ReplyU *) OutDataP;
1452 (void)OutUP;
1453#ifdef __MIG_check__Request__behavior_set_t__defined
1454 kern_return_t check_result;
1455#endif /* __MIG_check__Request__behavior_set_t__defined */
1456
1457#if __MigKernelSpecificCode
1458#else
1459#endif /* __MigKernelSpecificCode */
1460 vm_map_t target_task;
1461
1462 __DeclareRcvRpc(3811, "behavior_set")
1463 __BeforeRcvRpc(3811, "behavior_set")
1464
1465#if defined(__MIG_check__Request__behavior_set_t__defined)
1466 check_result = __MIG_check__Request__behavior_set_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1467 if (check_result != MACH_MSG_SUCCESS)
1468 { MIG_RETURN_ERROR(OutKP, check_result); }
1469#endif /* defined(__MIG_check__Request__behavior_set_t__defined) */
1470
1471 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1472
1473 OutUP->RetCode = vm32_behavior_set(target_task, address: In0UP->address, size: In0UP->size, new_behavior: In0UP->new_behavior);
1474 vm_map_deallocate(map: target_task);
1475#if __MigKernelSpecificCode
1476#endif /* __MigKernelSpecificCode */
1477
1478 OutUP->NDR = NDR_record;
1479
1480
1481 __AfterRcvRpc(3811, "behavior_set")
1482}
1483
1484#if ( __MigTypeCheck )
1485#if __MIG_check__Request__map_subsystem__
1486#if !defined(__MIG_check__Request__map_t__defined)
1487#define __MIG_check__Request__map_t__defined
1488
1489mig_internal kern_return_t __MIG_check__Request__map_t(
1490 __attribute__((__unused__)) __RequestKData__map_t *InKP,
1491 __attribute__((__unused__)) __RequestUData__map_t *In0UP,
1492 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1493{
1494
1495 typedef __Request__map_t __Request;
1496 typedef __RequestUData__map_t __RequestU __attribute__((unused));
1497#if __MigTypeCheck
1498 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1499 (InKP->msgh_body.msgh_descriptor_count != 1) ||
1500 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1501 return MIG_BAD_ARGUMENTS;
1502#endif /* __MigTypeCheck */
1503
1504#if __MigTypeCheck
1505 if (InKP->object.type != MACH_MSG_PORT_DESCRIPTOR ||
1506 InKP->object.disposition != 17)
1507 return MIG_TYPE_ERROR;
1508#endif /* __MigTypeCheck */
1509
1510 return MACH_MSG_SUCCESS;
1511}
1512#endif /* !defined(__MIG_check__Request__map_t__defined) */
1513#endif /* __MIG_check__Request__map_subsystem__ */
1514#endif /* ( __MigTypeCheck ) */
1515
1516
1517/* Routine map */
1518mig_internal novalue _Xmap
1519 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1520 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1521 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1522{
1523
1524#ifdef __MigPackStructs
1525#pragma pack(push, 4)
1526#endif
1527 typedef struct {
1528 NDR_record_t NDR;
1529 vm32_address_t address;
1530 vm32_size_t size;
1531 vm32_address_t mask;
1532 int flags;
1533 vm32_offset_t offset;
1534 boolean_t copy;
1535 vm_prot_t cur_protection;
1536 vm_prot_t max_protection;
1537 vm_inherit_t inheritance;
1538 mach_msg_trailer_t trailer;
1539 char padding[0]; /* Avoid generating empty UData structs */
1540 } RequestU __attribute__((unused));
1541#ifdef __MigPackStructs
1542#pragma pack(pop)
1543#endif
1544 typedef __RequestKData__map_t RequestK;
1545 typedef __RequestUData__map_t __RequestU;
1546 typedef __ReplyKData__map_t ReplyK __attribute__((unused));
1547 typedef __ReplyUData__map_t ReplyU __attribute__((unused));
1548 typedef __Reply__map_t Reply __attribute__((unused));
1549 typedef __Request__map_t __Request __attribute__((unused));
1550
1551 /*
1552 * typedef struct {
1553 * mach_msg_header_t Head;
1554 * NDR_record_t NDR;
1555 * kern_return_t RetCode;
1556 * } mig_reply_error_t;
1557 */
1558
1559 RequestK *InKP = (RequestK *) InHeadP;
1560 RequestU *In0UP = (RequestU *) InDataP;
1561 ReplyK *OutKP = (ReplyK *) OutHeadP;
1562 ReplyU *OutUP = (ReplyU *) OutDataP;
1563 (void)OutUP;
1564#ifdef __MIG_check__Request__map_t__defined
1565 kern_return_t check_result;
1566#endif /* __MIG_check__Request__map_t__defined */
1567
1568#if __MigKernelSpecificCode
1569#else
1570#endif /* __MigKernelSpecificCode */
1571 vm_map_t target_task;
1572
1573 __DeclareRcvRpc(3812, "map")
1574 __BeforeRcvRpc(3812, "map")
1575
1576#if defined(__MIG_check__Request__map_t__defined)
1577 check_result = __MIG_check__Request__map_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1578 if (check_result != MACH_MSG_SUCCESS)
1579 { MIG_RETURN_ERROR(OutKP, check_result); }
1580#endif /* defined(__MIG_check__Request__map_t__defined) */
1581
1582 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
1583
1584 OutUP->RetCode = vm32_map(target_task, address: &In0UP->address, size: In0UP->size, mask: In0UP->mask, flags: In0UP->flags, null_conversion(InKP->object.name), offset: In0UP->offset, copy: In0UP->copy, cur_protection: In0UP->cur_protection, max_protection: In0UP->max_protection, inheritance: In0UP->inheritance);
1585 vm_map_deallocate(map: target_task);
1586 if (OutUP->RetCode != KERN_SUCCESS) {
1587 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
1588 }
1589#if __MigKernelSpecificCode
1590 ipc_port_release_send(port: (ipc_port_t)InKP->object.name);
1591#endif /* __MigKernelSpecificCode */
1592
1593 OutUP->NDR = NDR_record;
1594
1595
1596 OutUP->address = In0UP->address;
1597
1598 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1599 __AfterRcvRpc(3812, "map")
1600}
1601
1602#if ( __MigTypeCheck )
1603#if __MIG_check__Request__map_subsystem__
1604#if !defined(__MIG_check__Request__machine_attribute_t__defined)
1605#define __MIG_check__Request__machine_attribute_t__defined
1606
1607mig_internal kern_return_t __MIG_check__Request__machine_attribute_t(
1608 __attribute__((__unused__)) __RequestKData__machine_attribute_t *InKP,
1609 __attribute__((__unused__)) __RequestUData__machine_attribute_t *In0UP,
1610 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1611{
1612
1613 typedef __Request__machine_attribute_t __Request;
1614 typedef __RequestUData__machine_attribute_t __RequestU __attribute__((unused));
1615#if __MigTypeCheck
1616 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1617 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1618 return MIG_BAD_ARGUMENTS;
1619#endif /* __MigTypeCheck */
1620
1621 return MACH_MSG_SUCCESS;
1622}
1623#endif /* !defined(__MIG_check__Request__machine_attribute_t__defined) */
1624#endif /* __MIG_check__Request__map_subsystem__ */
1625#endif /* ( __MigTypeCheck ) */
1626
1627
1628/* Routine machine_attribute */
1629mig_internal novalue _Xmachine_attribute
1630 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1631 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1632 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1633{
1634
1635#ifdef __MigPackStructs
1636#pragma pack(push, 4)
1637#endif
1638 typedef struct {
1639 NDR_record_t NDR;
1640 vm32_address_t address;
1641 vm32_size_t size;
1642 vm_machine_attribute_t attribute;
1643 vm_machine_attribute_val_t value;
1644 mach_msg_trailer_t trailer;
1645 char padding[0]; /* Avoid generating empty UData structs */
1646 } RequestU __attribute__((unused));
1647#ifdef __MigPackStructs
1648#pragma pack(pop)
1649#endif
1650 typedef __RequestKData__machine_attribute_t RequestK;
1651 typedef __RequestUData__machine_attribute_t __RequestU;
1652 typedef __ReplyKData__machine_attribute_t ReplyK __attribute__((unused));
1653 typedef __ReplyUData__machine_attribute_t ReplyU __attribute__((unused));
1654 typedef __Reply__machine_attribute_t Reply __attribute__((unused));
1655 typedef __Request__machine_attribute_t __Request __attribute__((unused));
1656
1657 /*
1658 * typedef struct {
1659 * mach_msg_header_t Head;
1660 * NDR_record_t NDR;
1661 * kern_return_t RetCode;
1662 * } mig_reply_error_t;
1663 */
1664
1665 RequestK *InKP = (RequestK *) InHeadP;
1666 RequestU *In0UP = (RequestU *) InDataP;
1667 ReplyK *OutKP = (ReplyK *) OutHeadP;
1668 ReplyU *OutUP = (ReplyU *) OutDataP;
1669 (void)OutUP;
1670#ifdef __MIG_check__Request__machine_attribute_t__defined
1671 kern_return_t check_result;
1672#endif /* __MIG_check__Request__machine_attribute_t__defined */
1673
1674#if __MigKernelSpecificCode
1675#else
1676#endif /* __MigKernelSpecificCode */
1677 vm_map_t target_task;
1678
1679 __DeclareRcvRpc(3813, "machine_attribute")
1680 __BeforeRcvRpc(3813, "machine_attribute")
1681
1682#if defined(__MIG_check__Request__machine_attribute_t__defined)
1683 check_result = __MIG_check__Request__machine_attribute_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1684 if (check_result != MACH_MSG_SUCCESS)
1685 { MIG_RETURN_ERROR(OutKP, check_result); }
1686#endif /* defined(__MIG_check__Request__machine_attribute_t__defined) */
1687
1688 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1689
1690 OutUP->RetCode = vm32_machine_attribute(target_task, address: In0UP->address, size: In0UP->size, attribute: In0UP->attribute, value: &In0UP->value);
1691 vm_map_deallocate(map: target_task);
1692 if (OutUP->RetCode != KERN_SUCCESS) {
1693 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
1694 }
1695#if __MigKernelSpecificCode
1696#endif /* __MigKernelSpecificCode */
1697
1698 OutUP->NDR = NDR_record;
1699
1700
1701 OutUP->value = In0UP->value;
1702
1703 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1704 __AfterRcvRpc(3813, "machine_attribute")
1705}
1706
1707#if ( __MigTypeCheck )
1708#if __MIG_check__Request__map_subsystem__
1709#if !defined(__MIG_check__Request__remap_t__defined)
1710#define __MIG_check__Request__remap_t__defined
1711
1712mig_internal kern_return_t __MIG_check__Request__remap_t(
1713 __attribute__((__unused__)) __RequestKData__remap_t *InKP,
1714 __attribute__((__unused__)) __RequestUData__remap_t *In0UP,
1715 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1716{
1717
1718 typedef __Request__remap_t __Request;
1719 typedef __RequestUData__remap_t __RequestU __attribute__((unused));
1720#if __MigTypeCheck
1721 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1722 (InKP->msgh_body.msgh_descriptor_count != 1) ||
1723 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1724 return MIG_BAD_ARGUMENTS;
1725#endif /* __MigTypeCheck */
1726
1727#if __MigTypeCheck
1728 if (InKP->src_task.type != MACH_MSG_PORT_DESCRIPTOR ||
1729 InKP->src_task.disposition != 17)
1730 return MIG_TYPE_ERROR;
1731#endif /* __MigTypeCheck */
1732
1733 return MACH_MSG_SUCCESS;
1734}
1735#endif /* !defined(__MIG_check__Request__remap_t__defined) */
1736#endif /* __MIG_check__Request__map_subsystem__ */
1737#endif /* ( __MigTypeCheck ) */
1738
1739
1740/* Routine remap */
1741mig_internal novalue _Xremap
1742 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1743 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1744 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1745{
1746
1747#ifdef __MigPackStructs
1748#pragma pack(push, 4)
1749#endif
1750 typedef struct {
1751 NDR_record_t NDR;
1752 vm32_address_t target_address;
1753 vm32_size_t size;
1754 vm32_address_t mask;
1755 boolean_t anywhere;
1756 vm32_address_t src_address;
1757 boolean_t copy;
1758 vm_inherit_t inheritance;
1759 mach_msg_trailer_t trailer;
1760 char padding[0]; /* Avoid generating empty UData structs */
1761 } RequestU __attribute__((unused));
1762#ifdef __MigPackStructs
1763#pragma pack(pop)
1764#endif
1765 typedef __RequestKData__remap_t RequestK;
1766 typedef __RequestUData__remap_t __RequestU;
1767 typedef __ReplyKData__remap_t ReplyK __attribute__((unused));
1768 typedef __ReplyUData__remap_t ReplyU __attribute__((unused));
1769 typedef __Reply__remap_t Reply __attribute__((unused));
1770 typedef __Request__remap_t __Request __attribute__((unused));
1771
1772 /*
1773 * typedef struct {
1774 * mach_msg_header_t Head;
1775 * NDR_record_t NDR;
1776 * kern_return_t RetCode;
1777 * } mig_reply_error_t;
1778 */
1779
1780 RequestK *InKP = (RequestK *) InHeadP;
1781 RequestU *In0UP = (RequestU *) InDataP;
1782 ReplyK *OutKP = (ReplyK *) OutHeadP;
1783 ReplyU *OutUP = (ReplyU *) OutDataP;
1784 (void)OutUP;
1785#ifdef __MIG_check__Request__remap_t__defined
1786 kern_return_t check_result;
1787#endif /* __MIG_check__Request__remap_t__defined */
1788
1789#if __MigKernelSpecificCode
1790#else
1791#endif /* __MigKernelSpecificCode */
1792 vm_map_t target_task;
1793 vm_map_t src_task;
1794
1795 __DeclareRcvRpc(3814, "remap")
1796 __BeforeRcvRpc(3814, "remap")
1797
1798#if defined(__MIG_check__Request__remap_t__defined)
1799 check_result = __MIG_check__Request__remap_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1800 if (check_result != MACH_MSG_SUCCESS)
1801 { MIG_RETURN_ERROR(OutKP, check_result); }
1802#endif /* defined(__MIG_check__Request__remap_t__defined) */
1803
1804 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1805
1806 src_task = convert_port_to_map(port: InKP->src_task.name);
1807
1808 OutUP->RetCode = vm32_remap(target_task, target_address: &In0UP->target_address, size: In0UP->size, mask: In0UP->mask, anywhere: In0UP->anywhere, src_task, src_address: In0UP->src_address, copy: In0UP->copy, cur_protection: &OutUP->cur_protection, max_protection: &OutUP->max_protection, inheritance: In0UP->inheritance);
1809 vm_map_deallocate(map: src_task);
1810 vm_map_deallocate(map: target_task);
1811 if (OutUP->RetCode != KERN_SUCCESS) {
1812 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
1813 }
1814#if __MigKernelSpecificCode
1815 ipc_port_release_send(port: (ipc_port_t)InKP->src_task.name);
1816#endif /* __MigKernelSpecificCode */
1817
1818 OutUP->NDR = NDR_record;
1819
1820
1821 OutUP->target_address = In0UP->target_address;
1822
1823 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
1824 __AfterRcvRpc(3814, "remap")
1825}
1826
1827#if ( __MigTypeCheck )
1828#if __MIG_check__Request__map_subsystem__
1829#if !defined(__MIG_check__Request___task_wire_t__defined)
1830#define __MIG_check__Request___task_wire_t__defined
1831
1832mig_internal kern_return_t __MIG_check__Request___task_wire_t(
1833 __attribute__((__unused__)) __RequestKData___task_wire_t *InKP,
1834 __attribute__((__unused__)) __RequestUData___task_wire_t *In0UP,
1835 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1836{
1837
1838 typedef __Request___task_wire_t __Request;
1839 typedef __RequestUData___task_wire_t __RequestU __attribute__((unused));
1840#if __MigTypeCheck
1841 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1842 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1843 return MIG_BAD_ARGUMENTS;
1844#endif /* __MigTypeCheck */
1845
1846 return MACH_MSG_SUCCESS;
1847}
1848#endif /* !defined(__MIG_check__Request___task_wire_t__defined) */
1849#endif /* __MIG_check__Request__map_subsystem__ */
1850#endif /* ( __MigTypeCheck ) */
1851
1852
1853/* Routine _task_wire */
1854mig_internal novalue _X_task_wire
1855 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1856 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1857 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1858{
1859
1860#ifdef __MigPackStructs
1861#pragma pack(push, 4)
1862#endif
1863 typedef struct {
1864 NDR_record_t NDR;
1865 boolean_t must_wire;
1866 mach_msg_trailer_t trailer;
1867 char padding[0]; /* Avoid generating empty UData structs */
1868 } RequestU __attribute__((unused));
1869#ifdef __MigPackStructs
1870#pragma pack(pop)
1871#endif
1872 typedef __RequestKData___task_wire_t RequestK;
1873 typedef __RequestUData___task_wire_t __RequestU;
1874 typedef __ReplyKData___task_wire_t ReplyK __attribute__((unused));
1875 typedef __ReplyUData___task_wire_t ReplyU __attribute__((unused));
1876 typedef __Reply___task_wire_t Reply __attribute__((unused));
1877 typedef __Request___task_wire_t __Request __attribute__((unused));
1878
1879 /*
1880 * typedef struct {
1881 * mach_msg_header_t Head;
1882 * NDR_record_t NDR;
1883 * kern_return_t RetCode;
1884 * } mig_reply_error_t;
1885 */
1886
1887 RequestK *InKP = (RequestK *) InHeadP;
1888 RequestU *In0UP = (RequestU *) InDataP;
1889 ReplyK *OutKP = (ReplyK *) OutHeadP;
1890 ReplyU *OutUP = (ReplyU *) OutDataP;
1891 (void)OutUP;
1892#ifdef __MIG_check__Request___task_wire_t__defined
1893 kern_return_t check_result;
1894#endif /* __MIG_check__Request___task_wire_t__defined */
1895
1896#if __MigKernelSpecificCode
1897#else
1898#endif /* __MigKernelSpecificCode */
1899 vm_map_t target_task;
1900
1901 __DeclareRcvRpc(3815, "_task_wire")
1902 __BeforeRcvRpc(3815, "_task_wire")
1903
1904#if defined(__MIG_check__Request___task_wire_t__defined)
1905 check_result = __MIG_check__Request___task_wire_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
1906 if (check_result != MACH_MSG_SUCCESS)
1907 { MIG_RETURN_ERROR(OutKP, check_result); }
1908#endif /* defined(__MIG_check__Request___task_wire_t__defined) */
1909
1910 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
1911
1912 OutUP->RetCode = vm32__task_wire(target_task, must_wire: In0UP->must_wire);
1913 vm_map_deallocate(map: target_task);
1914#if __MigKernelSpecificCode
1915#endif /* __MigKernelSpecificCode */
1916
1917 OutUP->NDR = NDR_record;
1918
1919
1920 __AfterRcvRpc(3815, "_task_wire")
1921}
1922
1923#if ( __MigTypeCheck )
1924#if __MIG_check__Request__map_subsystem__
1925#if !defined(__MIG_check__Request__make_memory_entry_t__defined)
1926#define __MIG_check__Request__make_memory_entry_t__defined
1927
1928mig_internal kern_return_t __MIG_check__Request__make_memory_entry_t(
1929 __attribute__((__unused__)) __RequestKData__make_memory_entry_t *InKP,
1930 __attribute__((__unused__)) __RequestUData__make_memory_entry_t *In0UP,
1931 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
1932{
1933
1934 typedef __Request__make_memory_entry_t __Request;
1935 typedef __RequestUData__make_memory_entry_t __RequestU __attribute__((unused));
1936#if __MigTypeCheck
1937 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1938 (InKP->msgh_body.msgh_descriptor_count != 1) ||
1939 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1940 return MIG_BAD_ARGUMENTS;
1941#endif /* __MigTypeCheck */
1942
1943#if __MigTypeCheck
1944 if (InKP->parent_entry.type != MACH_MSG_PORT_DESCRIPTOR ||
1945 InKP->parent_entry.disposition != 17)
1946 return MIG_TYPE_ERROR;
1947#endif /* __MigTypeCheck */
1948
1949 return MACH_MSG_SUCCESS;
1950}
1951#endif /* !defined(__MIG_check__Request__make_memory_entry_t__defined) */
1952#endif /* __MIG_check__Request__map_subsystem__ */
1953#endif /* ( __MigTypeCheck ) */
1954
1955
1956/* Routine make_memory_entry */
1957mig_internal novalue _Xmake_memory_entry
1958 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
1959 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
1960 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
1961{
1962
1963#ifdef __MigPackStructs
1964#pragma pack(push, 4)
1965#endif
1966 typedef struct {
1967 NDR_record_t NDR;
1968 vm32_size_t size;
1969 vm32_offset_t offset;
1970 vm_prot_t permission;
1971 mach_msg_trailer_t trailer;
1972 char padding[0]; /* Avoid generating empty UData structs */
1973 } RequestU __attribute__((unused));
1974#ifdef __MigPackStructs
1975#pragma pack(pop)
1976#endif
1977 typedef __RequestKData__make_memory_entry_t RequestK;
1978 typedef __RequestUData__make_memory_entry_t __RequestU;
1979 typedef __ReplyKData__make_memory_entry_t ReplyK __attribute__((unused));
1980 typedef __ReplyUData__make_memory_entry_t ReplyU __attribute__((unused));
1981 typedef __Reply__make_memory_entry_t Reply __attribute__((unused));
1982 typedef __Request__make_memory_entry_t __Request __attribute__((unused));
1983
1984 /*
1985 * typedef struct {
1986 * mach_msg_header_t Head;
1987 * NDR_record_t NDR;
1988 * kern_return_t RetCode;
1989 * } mig_reply_error_t;
1990 */
1991
1992 RequestK *InKP = (RequestK *) InHeadP;
1993 RequestU *In0UP = (RequestU *) InDataP;
1994 ReplyK *OutKP = (ReplyK *) OutHeadP;
1995 ReplyU *OutUP = (ReplyU *) OutDataP;
1996 (void)OutUP;
1997#ifdef __MIG_check__Request__make_memory_entry_t__defined
1998 kern_return_t check_result;
1999#endif /* __MIG_check__Request__make_memory_entry_t__defined */
2000
2001#if __MigKernelSpecificCode
2002#if UseStaticTemplates
2003 const static mach_msg_port_descriptor_t object_handleTemplate = {
2004 /* name = */ MACH_PORT_NULL,
2005 /* pad1 = */ 0,
2006 /* pad2 = */ 0,
2007 /* disp = */ 17,
2008 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2009 };
2010#endif /* UseStaticTemplates */
2011
2012#else
2013#if UseStaticTemplates
2014 const static mach_msg_port_descriptor_t object_handleTemplate = {
2015 /* name = */ MACH_PORT_NULL,
2016 /* pad1 = */ 0,
2017 /* pad2 = */ 0,
2018 /* disp = */ 17,
2019 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2020 };
2021#endif /* UseStaticTemplates */
2022
2023#endif /* __MigKernelSpecificCode */
2024 kern_return_t RetCode;
2025 vm_map_t target_task;
2026 mem_entry_name_port_t object_handle;
2027
2028 __DeclareRcvRpc(3816, "make_memory_entry")
2029 __BeforeRcvRpc(3816, "make_memory_entry")
2030
2031#if defined(__MIG_check__Request__make_memory_entry_t__defined)
2032 check_result = __MIG_check__Request__make_memory_entry_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2033 if (check_result != MACH_MSG_SUCCESS)
2034 { MIG_RETURN_ERROR(OutKP, check_result); }
2035#endif /* defined(__MIG_check__Request__make_memory_entry_t__defined) */
2036
2037#if UseStaticTemplates
2038 OutKP->object_handle = object_handleTemplate;
2039#else /* UseStaticTemplates */
2040#if __MigKernelSpecificCode
2041 OutKP->object_handle.disposition = 17;
2042#else
2043 OutKP->object_handle.disposition = 17;
2044#endif /* __MigKernelSpecificCode */
2045#if !(defined(KERNEL) && defined(__LP64__))
2046 OutKP->object_handle.pad1 = 0;
2047#endif
2048 OutKP->object_handle.pad2 = 0;
2049 OutKP->object_handle.type = MACH_MSG_PORT_DESCRIPTOR;
2050#if defined(KERNEL)
2051 OutKP->object_handle.pad_end = 0;
2052#endif
2053#endif /* UseStaticTemplates */
2054
2055
2056 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
2057
2058 RetCode = vm32_make_memory_entry(target_task, size: &In0UP->size, offset: In0UP->offset, permission: In0UP->permission, object_handle: &object_handle, null_conversion(InKP->parent_entry.name));
2059 vm_map_deallocate(map: target_task);
2060 if (RetCode != KERN_SUCCESS) {
2061 MIG_RETURN_ERROR(OutKP, RetCode);
2062 }
2063#if __MigKernelSpecificCode
2064 ipc_port_release_send(port: (ipc_port_t)InKP->parent_entry.name);
2065#endif /* __MigKernelSpecificCode */
2066 OutKP->object_handle.name = (mach_port_t)null_conversion(object_handle);
2067
2068
2069 OutUP->NDR = NDR_record;
2070
2071
2072 OutUP->size = In0UP->size;
2073
2074 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2075 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2076 OutKP->msgh_body.msgh_descriptor_count = 1;
2077 __AfterRcvRpc(3816, "make_memory_entry")
2078}
2079
2080#if ( __MigTypeCheck )
2081#if __MIG_check__Request__map_subsystem__
2082#if !defined(__MIG_check__Request__map_page_query_t__defined)
2083#define __MIG_check__Request__map_page_query_t__defined
2084
2085mig_internal kern_return_t __MIG_check__Request__map_page_query_t(
2086 __attribute__((__unused__)) __RequestKData__map_page_query_t *InKP,
2087 __attribute__((__unused__)) __RequestUData__map_page_query_t *In0UP,
2088 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2089{
2090
2091 typedef __Request__map_page_query_t __Request;
2092 typedef __RequestUData__map_page_query_t __RequestU __attribute__((unused));
2093#if __MigTypeCheck
2094 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2095 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2096 return MIG_BAD_ARGUMENTS;
2097#endif /* __MigTypeCheck */
2098
2099 return MACH_MSG_SUCCESS;
2100}
2101#endif /* !defined(__MIG_check__Request__map_page_query_t__defined) */
2102#endif /* __MIG_check__Request__map_subsystem__ */
2103#endif /* ( __MigTypeCheck ) */
2104
2105
2106/* Routine map_page_query */
2107mig_internal novalue _Xmap_page_query
2108 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2109 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2110 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2111{
2112
2113#ifdef __MigPackStructs
2114#pragma pack(push, 4)
2115#endif
2116 typedef struct {
2117 NDR_record_t NDR;
2118 vm32_offset_t offset;
2119 mach_msg_trailer_t trailer;
2120 char padding[0]; /* Avoid generating empty UData structs */
2121 } RequestU __attribute__((unused));
2122#ifdef __MigPackStructs
2123#pragma pack(pop)
2124#endif
2125 typedef __RequestKData__map_page_query_t RequestK;
2126 typedef __RequestUData__map_page_query_t __RequestU;
2127 typedef __ReplyKData__map_page_query_t ReplyK __attribute__((unused));
2128 typedef __ReplyUData__map_page_query_t ReplyU __attribute__((unused));
2129 typedef __Reply__map_page_query_t Reply __attribute__((unused));
2130 typedef __Request__map_page_query_t __Request __attribute__((unused));
2131
2132 /*
2133 * typedef struct {
2134 * mach_msg_header_t Head;
2135 * NDR_record_t NDR;
2136 * kern_return_t RetCode;
2137 * } mig_reply_error_t;
2138 */
2139
2140 RequestK *InKP = (RequestK *) InHeadP;
2141 RequestU *In0UP = (RequestU *) InDataP;
2142 ReplyK *OutKP = (ReplyK *) OutHeadP;
2143 ReplyU *OutUP = (ReplyU *) OutDataP;
2144 (void)OutUP;
2145#ifdef __MIG_check__Request__map_page_query_t__defined
2146 kern_return_t check_result;
2147#endif /* __MIG_check__Request__map_page_query_t__defined */
2148
2149#if __MigKernelSpecificCode
2150#else
2151#endif /* __MigKernelSpecificCode */
2152 vm_map_read_t target_map;
2153
2154 __DeclareRcvRpc(3817, "map_page_query")
2155 __BeforeRcvRpc(3817, "map_page_query")
2156
2157#if defined(__MIG_check__Request__map_page_query_t__defined)
2158 check_result = __MIG_check__Request__map_page_query_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2159 if (check_result != MACH_MSG_SUCCESS)
2160 { MIG_RETURN_ERROR(OutKP, check_result); }
2161#endif /* defined(__MIG_check__Request__map_page_query_t__defined) */
2162
2163 target_map = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2164
2165 OutUP->RetCode = vm32_map_page_query(target_map, offset: In0UP->offset, disposition: &OutUP->disposition, ref_count: &OutUP->ref_count);
2166 vm_map_read_deallocate(map: target_map);
2167 if (OutUP->RetCode != KERN_SUCCESS) {
2168 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
2169 }
2170#if __MigKernelSpecificCode
2171#endif /* __MigKernelSpecificCode */
2172
2173 OutUP->NDR = NDR_record;
2174
2175
2176 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2177 __AfterRcvRpc(3817, "map_page_query")
2178}
2179
2180#if ( __MigTypeCheck )
2181#if __MIG_check__Request__map_subsystem__
2182#if !defined(__MIG_check__Request__region_info_t__defined)
2183#define __MIG_check__Request__region_info_t__defined
2184
2185mig_internal kern_return_t __MIG_check__Request__region_info_t(
2186 __attribute__((__unused__)) __RequestKData__region_info_t *InKP,
2187 __attribute__((__unused__)) __RequestUData__region_info_t *In0UP,
2188 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2189{
2190
2191 typedef __Request__region_info_t __Request;
2192 typedef __RequestUData__region_info_t __RequestU __attribute__((unused));
2193#if __MigTypeCheck
2194 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2195 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2196 return MIG_BAD_ARGUMENTS;
2197#endif /* __MigTypeCheck */
2198
2199 return MACH_MSG_SUCCESS;
2200}
2201#endif /* !defined(__MIG_check__Request__region_info_t__defined) */
2202#endif /* __MIG_check__Request__map_subsystem__ */
2203#endif /* ( __MigTypeCheck ) */
2204
2205
2206/* Routine region_info */
2207mig_internal novalue _Xregion_info
2208 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2209 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2210 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2211{
2212
2213#ifdef __MigPackStructs
2214#pragma pack(push, 4)
2215#endif
2216 typedef struct {
2217 NDR_record_t NDR;
2218 vm32_address_t address;
2219 mach_msg_trailer_t trailer;
2220 char padding[0]; /* Avoid generating empty UData structs */
2221 } RequestU __attribute__((unused));
2222#ifdef __MigPackStructs
2223#pragma pack(pop)
2224#endif
2225 typedef __RequestKData__region_info_t RequestK;
2226 typedef __RequestUData__region_info_t __RequestU;
2227 typedef __ReplyKData__region_info_t ReplyK __attribute__((unused));
2228 typedef __ReplyUData__region_info_t ReplyU __attribute__((unused));
2229 typedef __Reply__region_info_t Reply __attribute__((unused));
2230 typedef __Request__region_info_t __Request __attribute__((unused));
2231
2232 /*
2233 * typedef struct {
2234 * mach_msg_header_t Head;
2235 * NDR_record_t NDR;
2236 * kern_return_t RetCode;
2237 * } mig_reply_error_t;
2238 */
2239
2240 RequestK *InKP = (RequestK *) InHeadP;
2241 RequestU *In0UP = (RequestU *) InDataP;
2242 ReplyK *OutKP = (ReplyK *) OutHeadP;
2243 ReplyU *OutUP = (ReplyU *) OutDataP;
2244 (void)OutUP;
2245#ifdef __MIG_check__Request__region_info_t__defined
2246 kern_return_t check_result;
2247#endif /* __MIG_check__Request__region_info_t__defined */
2248
2249#if __MigKernelSpecificCode
2250#if UseStaticTemplates
2251 const static mach_msg_ool_descriptor_t objectsTemplate = {
2252 /* addr = */ (void *)0,
2253 /* size = */ 0,
2254 /* deal = */ FALSE,
2255 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2256 /* pad2 = */ 0,
2257 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2258 };
2259#endif /* UseStaticTemplates */
2260
2261#else
2262#if UseStaticTemplates
2263 const static mach_msg_ool_descriptor_t objectsTemplate = {
2264 /* addr = */ (void *)0,
2265 /* size = */ 0,
2266 /* deal = */ FALSE,
2267 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2268 /* pad2 = */ 0,
2269 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2270 };
2271#endif /* UseStaticTemplates */
2272
2273#endif /* __MigKernelSpecificCode */
2274 kern_return_t RetCode;
2275 vm_map_read_t task;
2276
2277 __DeclareRcvRpc(3818, "region_info")
2278 __BeforeRcvRpc(3818, "region_info")
2279
2280#if defined(__MIG_check__Request__region_info_t__defined)
2281 check_result = __MIG_check__Request__region_info_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2282 if (check_result != MACH_MSG_SUCCESS)
2283 { MIG_RETURN_ERROR(OutKP, check_result); }
2284#endif /* defined(__MIG_check__Request__region_info_t__defined) */
2285
2286#if UseStaticTemplates
2287 OutKP->objects = objectsTemplate;
2288#else /* UseStaticTemplates */
2289 OutKP->objects.deallocate = FALSE;
2290 OutKP->objects.copy = MACH_MSG_VIRTUAL_COPY;
2291 OutKP->objects.pad1 = 0;
2292 OutKP->objects.type = MACH_MSG_OOL_DESCRIPTOR;
2293#if defined(KERNEL) && !defined(__LP64__)
2294 OutKP->objects.pad_end = 0;
2295#endif
2296#endif /* UseStaticTemplates */
2297
2298
2299 task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2300
2301 RetCode = vm32_region_info(task, address: In0UP->address, region: &OutUP->region, objects: (vm_info_object_array_t *)&(OutKP->objects.address), objectsCnt: &OutUP->objectsCnt);
2302 vm_map_read_deallocate(map: task);
2303 if (RetCode != KERN_SUCCESS) {
2304 MIG_RETURN_ERROR(OutKP, RetCode);
2305 }
2306#if __MigKernelSpecificCode
2307#endif /* __MigKernelSpecificCode */
2308 OutKP->objects.size = OutUP->objectsCnt * 84;
2309
2310
2311 OutUP->NDR = NDR_record;
2312
2313
2314 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2315 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2316 OutKP->msgh_body.msgh_descriptor_count = 1;
2317 __AfterRcvRpc(3818, "region_info")
2318}
2319
2320#if ( __MigTypeCheck )
2321#if __MIG_check__Request__map_subsystem__
2322#if !defined(__MIG_check__Request__mapped_pages_info_t__defined)
2323#define __MIG_check__Request__mapped_pages_info_t__defined
2324
2325mig_internal kern_return_t __MIG_check__Request__mapped_pages_info_t(
2326 __attribute__((__unused__)) __RequestKData__mapped_pages_info_t *InKP,
2327 __attribute__((__unused__)) __RequestUData__mapped_pages_info_t *In0UP,
2328 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2329{
2330
2331 typedef __Request__mapped_pages_info_t __Request;
2332 typedef __RequestUData__mapped_pages_info_t __RequestU __attribute__((unused));
2333#if __MigTypeCheck
2334 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2335 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2336 return MIG_BAD_ARGUMENTS;
2337#endif /* __MigTypeCheck */
2338
2339 return MACH_MSG_SUCCESS;
2340}
2341#endif /* !defined(__MIG_check__Request__mapped_pages_info_t__defined) */
2342#endif /* __MIG_check__Request__map_subsystem__ */
2343#endif /* ( __MigTypeCheck ) */
2344
2345
2346/* Routine mapped_pages_info */
2347mig_internal novalue _Xmapped_pages_info
2348 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2349 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2350 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2351{
2352
2353#ifdef __MigPackStructs
2354#pragma pack(push, 4)
2355#endif
2356 typedef struct {
2357 mach_msg_trailer_t trailer;
2358 char padding[0]; /* Avoid generating empty UData structs */
2359 } RequestU __attribute__((unused));
2360#ifdef __MigPackStructs
2361#pragma pack(pop)
2362#endif
2363 typedef __RequestKData__mapped_pages_info_t RequestK;
2364 typedef __RequestUData__mapped_pages_info_t __RequestU;
2365 typedef __ReplyKData__mapped_pages_info_t ReplyK __attribute__((unused));
2366 typedef __ReplyUData__mapped_pages_info_t ReplyU __attribute__((unused));
2367 typedef __Reply__mapped_pages_info_t Reply __attribute__((unused));
2368 typedef __Request__mapped_pages_info_t __Request __attribute__((unused));
2369
2370 /*
2371 * typedef struct {
2372 * mach_msg_header_t Head;
2373 * NDR_record_t NDR;
2374 * kern_return_t RetCode;
2375 * } mig_reply_error_t;
2376 */
2377
2378 RequestK *InKP = (RequestK *) InHeadP;
2379 RequestU *In0UP = (RequestU *) InDataP;
2380 ReplyK *OutKP = (ReplyK *) OutHeadP;
2381 ReplyU *OutUP = (ReplyU *) OutDataP;
2382 (void)OutUP;
2383#ifdef __MIG_check__Request__mapped_pages_info_t__defined
2384 kern_return_t check_result;
2385#endif /* __MIG_check__Request__mapped_pages_info_t__defined */
2386
2387#if __MigKernelSpecificCode
2388#if UseStaticTemplates
2389 const static mach_msg_ool_descriptor_t pagesTemplate = {
2390 /* addr = */ (void *)0,
2391 /* size = */ 0,
2392 /* deal = */ FALSE,
2393 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2394 /* pad2 = */ 0,
2395 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2396 };
2397#endif /* UseStaticTemplates */
2398
2399#else
2400#if UseStaticTemplates
2401 const static mach_msg_ool_descriptor_t pagesTemplate = {
2402 /* addr = */ (void *)0,
2403 /* size = */ 0,
2404 /* deal = */ FALSE,
2405 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2406 /* pad2 = */ 0,
2407 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2408 };
2409#endif /* UseStaticTemplates */
2410
2411#endif /* __MigKernelSpecificCode */
2412 kern_return_t RetCode;
2413 vm_map_read_t task;
2414
2415 __DeclareRcvRpc(3819, "mapped_pages_info")
2416 __BeforeRcvRpc(3819, "mapped_pages_info")
2417
2418#if defined(__MIG_check__Request__mapped_pages_info_t__defined)
2419 check_result = __MIG_check__Request__mapped_pages_info_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2420 if (check_result != MACH_MSG_SUCCESS)
2421 { MIG_RETURN_ERROR(OutKP, check_result); }
2422#endif /* defined(__MIG_check__Request__mapped_pages_info_t__defined) */
2423
2424#if UseStaticTemplates
2425 OutKP->pages = pagesTemplate;
2426#else /* UseStaticTemplates */
2427 OutKP->pages.deallocate = FALSE;
2428 OutKP->pages.copy = MACH_MSG_VIRTUAL_COPY;
2429 OutKP->pages.pad1 = 0;
2430 OutKP->pages.type = MACH_MSG_OOL_DESCRIPTOR;
2431#if defined(KERNEL) && !defined(__LP64__)
2432 OutKP->pages.pad_end = 0;
2433#endif
2434#endif /* UseStaticTemplates */
2435
2436
2437 task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2438
2439 RetCode = vm32_mapped_pages_info(task, pages: (page_address_array_t *)&(OutKP->pages.address), pagesCnt: &OutUP->pagesCnt);
2440 vm_map_read_deallocate(map: task);
2441 if (RetCode != KERN_SUCCESS) {
2442 MIG_RETURN_ERROR(OutKP, RetCode);
2443 }
2444#if __MigKernelSpecificCode
2445#endif /* __MigKernelSpecificCode */
2446 OutKP->pages.size = OutUP->pagesCnt * 4;
2447
2448
2449 OutUP->NDR = NDR_record;
2450
2451
2452 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2453 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2454 OutKP->msgh_body.msgh_descriptor_count = 1;
2455 __AfterRcvRpc(3819, "mapped_pages_info")
2456}
2457
2458#if ( __MigTypeCheck )
2459#if __MIG_check__Request__map_subsystem__
2460#if !defined(__MIG_check__Request__region_recurse_t__defined)
2461#define __MIG_check__Request__region_recurse_t__defined
2462
2463mig_internal kern_return_t __MIG_check__Request__region_recurse_t(
2464 __attribute__((__unused__)) __RequestKData__region_recurse_t *InKP,
2465 __attribute__((__unused__)) __RequestUData__region_recurse_t *In0UP,
2466 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2467{
2468
2469 typedef __Request__region_recurse_t __Request;
2470 typedef __RequestUData__region_recurse_t __RequestU __attribute__((unused));
2471#if __MigTypeCheck
2472 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2473 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2474 return MIG_BAD_ARGUMENTS;
2475#endif /* __MigTypeCheck */
2476
2477 return MACH_MSG_SUCCESS;
2478}
2479#endif /* !defined(__MIG_check__Request__region_recurse_t__defined) */
2480#endif /* __MIG_check__Request__map_subsystem__ */
2481#endif /* ( __MigTypeCheck ) */
2482
2483
2484/* Routine region_recurse */
2485mig_internal novalue _Xregion_recurse
2486 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2487 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2488 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2489{
2490
2491#ifdef __MigPackStructs
2492#pragma pack(push, 4)
2493#endif
2494 typedef struct {
2495 NDR_record_t NDR;
2496 vm32_address_t address;
2497 natural_t nesting_depth;
2498 mach_msg_type_number_t infoCnt;
2499 mach_msg_trailer_t trailer;
2500 char padding[0]; /* Avoid generating empty UData structs */
2501 } RequestU __attribute__((unused));
2502#ifdef __MigPackStructs
2503#pragma pack(pop)
2504#endif
2505 typedef __RequestKData__region_recurse_t RequestK;
2506 typedef __RequestUData__region_recurse_t __RequestU;
2507 typedef __ReplyKData__region_recurse_t ReplyK __attribute__((unused));
2508 typedef __ReplyUData__region_recurse_t ReplyU __attribute__((unused));
2509 typedef __Reply__region_recurse_t Reply __attribute__((unused));
2510 typedef __Request__region_recurse_t __Request __attribute__((unused));
2511
2512 /*
2513 * typedef struct {
2514 * mach_msg_header_t Head;
2515 * NDR_record_t NDR;
2516 * kern_return_t RetCode;
2517 * } mig_reply_error_t;
2518 */
2519
2520 RequestK *InKP = (RequestK *) InHeadP;
2521 RequestU *In0UP = (RequestU *) InDataP;
2522 ReplyK *OutKP = (ReplyK *) OutHeadP;
2523 ReplyU *OutUP = (ReplyU *) OutDataP;
2524 (void)OutUP;
2525#ifdef __MIG_check__Request__region_recurse_t__defined
2526 kern_return_t check_result;
2527#endif /* __MIG_check__Request__region_recurse_t__defined */
2528
2529#if __MigKernelSpecificCode
2530#else
2531#endif /* __MigKernelSpecificCode */
2532 vm_map_read_t target_task;
2533
2534 __DeclareRcvRpc(3821, "region_recurse")
2535 __BeforeRcvRpc(3821, "region_recurse")
2536
2537#if defined(__MIG_check__Request__region_recurse_t__defined)
2538 check_result = __MIG_check__Request__region_recurse_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2539 if (check_result != MACH_MSG_SUCCESS)
2540 { MIG_RETURN_ERROR(OutKP, check_result); }
2541#endif /* defined(__MIG_check__Request__region_recurse_t__defined) */
2542
2543 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2544
2545 OutUP->infoCnt = 19;
2546 if (In0UP->infoCnt < OutUP->infoCnt)
2547 OutUP->infoCnt = In0UP->infoCnt;
2548
2549 OutUP->RetCode = vm32_region_recurse(target_task, address: &In0UP->address, size: &OutUP->size, nesting_depth: &In0UP->nesting_depth, info: OutUP->info, infoCnt: &OutUP->infoCnt);
2550 vm_map_read_deallocate(map: target_task);
2551 if (OutUP->RetCode != KERN_SUCCESS) {
2552 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
2553 }
2554#if __MigKernelSpecificCode
2555#endif /* __MigKernelSpecificCode */
2556
2557 OutUP->NDR = NDR_record;
2558
2559
2560 OutUP->address = In0UP->address;
2561
2562 OutUP->nesting_depth = In0UP->nesting_depth;
2563 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 76) + (((4 * OutUP->infoCnt)));
2564
2565 __AfterRcvRpc(3821, "region_recurse")
2566}
2567
2568#if ( __MigTypeCheck )
2569#if __MIG_check__Request__map_subsystem__
2570#if !defined(__MIG_check__Request__region_recurse_64_t__defined)
2571#define __MIG_check__Request__region_recurse_64_t__defined
2572
2573mig_internal kern_return_t __MIG_check__Request__region_recurse_64_t(
2574 __attribute__((__unused__)) __RequestKData__region_recurse_64_t *InKP,
2575 __attribute__((__unused__)) __RequestUData__region_recurse_64_t *In0UP,
2576 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2577{
2578
2579 typedef __Request__region_recurse_64_t __Request;
2580 typedef __RequestUData__region_recurse_64_t __RequestU __attribute__((unused));
2581#if __MigTypeCheck
2582 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2583 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2584 return MIG_BAD_ARGUMENTS;
2585#endif /* __MigTypeCheck */
2586
2587 return MACH_MSG_SUCCESS;
2588}
2589#endif /* !defined(__MIG_check__Request__region_recurse_64_t__defined) */
2590#endif /* __MIG_check__Request__map_subsystem__ */
2591#endif /* ( __MigTypeCheck ) */
2592
2593
2594/* Routine region_recurse_64 */
2595mig_internal novalue _Xregion_recurse_64
2596 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2597 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2598 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2599{
2600
2601#ifdef __MigPackStructs
2602#pragma pack(push, 4)
2603#endif
2604 typedef struct {
2605 NDR_record_t NDR;
2606 vm32_address_t address;
2607 natural_t nesting_depth;
2608 mach_msg_type_number_t infoCnt;
2609 mach_msg_trailer_t trailer;
2610 char padding[0]; /* Avoid generating empty UData structs */
2611 } RequestU __attribute__((unused));
2612#ifdef __MigPackStructs
2613#pragma pack(pop)
2614#endif
2615 typedef __RequestKData__region_recurse_64_t RequestK;
2616 typedef __RequestUData__region_recurse_64_t __RequestU;
2617 typedef __ReplyKData__region_recurse_64_t ReplyK __attribute__((unused));
2618 typedef __ReplyUData__region_recurse_64_t ReplyU __attribute__((unused));
2619 typedef __Reply__region_recurse_64_t Reply __attribute__((unused));
2620 typedef __Request__region_recurse_64_t __Request __attribute__((unused));
2621
2622 /*
2623 * typedef struct {
2624 * mach_msg_header_t Head;
2625 * NDR_record_t NDR;
2626 * kern_return_t RetCode;
2627 * } mig_reply_error_t;
2628 */
2629
2630 RequestK *InKP = (RequestK *) InHeadP;
2631 RequestU *In0UP = (RequestU *) InDataP;
2632 ReplyK *OutKP = (ReplyK *) OutHeadP;
2633 ReplyU *OutUP = (ReplyU *) OutDataP;
2634 (void)OutUP;
2635#ifdef __MIG_check__Request__region_recurse_64_t__defined
2636 kern_return_t check_result;
2637#endif /* __MIG_check__Request__region_recurse_64_t__defined */
2638
2639#if __MigKernelSpecificCode
2640#else
2641#endif /* __MigKernelSpecificCode */
2642 vm_map_read_t target_task;
2643
2644 __DeclareRcvRpc(3822, "region_recurse_64")
2645 __BeforeRcvRpc(3822, "region_recurse_64")
2646
2647#if defined(__MIG_check__Request__region_recurse_64_t__defined)
2648 check_result = __MIG_check__Request__region_recurse_64_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2649 if (check_result != MACH_MSG_SUCCESS)
2650 { MIG_RETURN_ERROR(OutKP, check_result); }
2651#endif /* defined(__MIG_check__Request__region_recurse_64_t__defined) */
2652
2653 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2654
2655 OutUP->infoCnt = 19;
2656 if (In0UP->infoCnt < OutUP->infoCnt)
2657 OutUP->infoCnt = In0UP->infoCnt;
2658
2659 OutUP->RetCode = vm32_region_recurse_64(target_task, address: &In0UP->address, size: &OutUP->size, nesting_depth: &In0UP->nesting_depth, info: OutUP->info, infoCnt: &OutUP->infoCnt);
2660 vm_map_read_deallocate(map: target_task);
2661 if (OutUP->RetCode != KERN_SUCCESS) {
2662 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
2663 }
2664#if __MigKernelSpecificCode
2665#endif /* __MigKernelSpecificCode */
2666
2667 OutUP->NDR = NDR_record;
2668
2669
2670 OutUP->address = In0UP->address;
2671
2672 OutUP->nesting_depth = In0UP->nesting_depth;
2673 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 76) + (((4 * OutUP->infoCnt)));
2674
2675 __AfterRcvRpc(3822, "region_recurse_64")
2676}
2677
2678#if ( __MigTypeCheck )
2679#if __MIG_check__Request__map_subsystem__
2680#if !defined(__MIG_check__Request__region_info_64_t__defined)
2681#define __MIG_check__Request__region_info_64_t__defined
2682
2683mig_internal kern_return_t __MIG_check__Request__region_info_64_t(
2684 __attribute__((__unused__)) __RequestKData__region_info_64_t *InKP,
2685 __attribute__((__unused__)) __RequestUData__region_info_64_t *In0UP,
2686 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2687{
2688
2689 typedef __Request__region_info_64_t __Request;
2690 typedef __RequestUData__region_info_64_t __RequestU __attribute__((unused));
2691#if __MigTypeCheck
2692 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2693 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2694 return MIG_BAD_ARGUMENTS;
2695#endif /* __MigTypeCheck */
2696
2697 return MACH_MSG_SUCCESS;
2698}
2699#endif /* !defined(__MIG_check__Request__region_info_64_t__defined) */
2700#endif /* __MIG_check__Request__map_subsystem__ */
2701#endif /* ( __MigTypeCheck ) */
2702
2703
2704/* Routine region_info_64 */
2705mig_internal novalue _Xregion_info_64
2706 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2707 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2708 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2709{
2710
2711#ifdef __MigPackStructs
2712#pragma pack(push, 4)
2713#endif
2714 typedef struct {
2715 NDR_record_t NDR;
2716 vm32_address_t address;
2717 mach_msg_trailer_t trailer;
2718 char padding[0]; /* Avoid generating empty UData structs */
2719 } RequestU __attribute__((unused));
2720#ifdef __MigPackStructs
2721#pragma pack(pop)
2722#endif
2723 typedef __RequestKData__region_info_64_t RequestK;
2724 typedef __RequestUData__region_info_64_t __RequestU;
2725 typedef __ReplyKData__region_info_64_t ReplyK __attribute__((unused));
2726 typedef __ReplyUData__region_info_64_t ReplyU __attribute__((unused));
2727 typedef __Reply__region_info_64_t Reply __attribute__((unused));
2728 typedef __Request__region_info_64_t __Request __attribute__((unused));
2729
2730 /*
2731 * typedef struct {
2732 * mach_msg_header_t Head;
2733 * NDR_record_t NDR;
2734 * kern_return_t RetCode;
2735 * } mig_reply_error_t;
2736 */
2737
2738 RequestK *InKP = (RequestK *) InHeadP;
2739 RequestU *In0UP = (RequestU *) InDataP;
2740 ReplyK *OutKP = (ReplyK *) OutHeadP;
2741 ReplyU *OutUP = (ReplyU *) OutDataP;
2742 (void)OutUP;
2743#ifdef __MIG_check__Request__region_info_64_t__defined
2744 kern_return_t check_result;
2745#endif /* __MIG_check__Request__region_info_64_t__defined */
2746
2747#if __MigKernelSpecificCode
2748#if UseStaticTemplates
2749 const static mach_msg_ool_descriptor_t objectsTemplate = {
2750 /* addr = */ (void *)0,
2751 /* size = */ 0,
2752 /* deal = */ FALSE,
2753 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2754 /* pad2 = */ 0,
2755 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2756 };
2757#endif /* UseStaticTemplates */
2758
2759#else
2760#if UseStaticTemplates
2761 const static mach_msg_ool_descriptor_t objectsTemplate = {
2762 /* addr = */ (void *)0,
2763 /* size = */ 0,
2764 /* deal = */ FALSE,
2765 /* copy = */ MACH_MSG_VIRTUAL_COPY,
2766 /* pad2 = */ 0,
2767 /* type = */ MACH_MSG_OOL_DESCRIPTOR,
2768 };
2769#endif /* UseStaticTemplates */
2770
2771#endif /* __MigKernelSpecificCode */
2772 kern_return_t RetCode;
2773 vm_map_read_t task;
2774
2775 __DeclareRcvRpc(3823, "region_info_64")
2776 __BeforeRcvRpc(3823, "region_info_64")
2777
2778#if defined(__MIG_check__Request__region_info_64_t__defined)
2779 check_result = __MIG_check__Request__region_info_64_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2780 if (check_result != MACH_MSG_SUCCESS)
2781 { MIG_RETURN_ERROR(OutKP, check_result); }
2782#endif /* defined(__MIG_check__Request__region_info_64_t__defined) */
2783
2784#if UseStaticTemplates
2785 OutKP->objects = objectsTemplate;
2786#else /* UseStaticTemplates */
2787 OutKP->objects.deallocate = FALSE;
2788 OutKP->objects.copy = MACH_MSG_VIRTUAL_COPY;
2789 OutKP->objects.pad1 = 0;
2790 OutKP->objects.type = MACH_MSG_OOL_DESCRIPTOR;
2791#if defined(KERNEL) && !defined(__LP64__)
2792 OutKP->objects.pad_end = 0;
2793#endif
2794#endif /* UseStaticTemplates */
2795
2796
2797 task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2798
2799 RetCode = vm32_region_info_64(task, address: In0UP->address, region: &OutUP->region, objects: (vm_info_object_array_t *)&(OutKP->objects.address), objectsCnt: &OutUP->objectsCnt);
2800 vm_map_read_deallocate(map: task);
2801 if (RetCode != KERN_SUCCESS) {
2802 MIG_RETURN_ERROR(OutKP, RetCode);
2803 }
2804#if __MigKernelSpecificCode
2805#endif /* __MigKernelSpecificCode */
2806 OutKP->objects.size = OutUP->objectsCnt * 84;
2807
2808
2809 OutUP->NDR = NDR_record;
2810
2811
2812 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2813 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
2814 OutKP->msgh_body.msgh_descriptor_count = 1;
2815 __AfterRcvRpc(3823, "region_info_64")
2816}
2817
2818#if ( __MigTypeCheck )
2819#if __MIG_check__Request__map_subsystem__
2820#if !defined(__MIG_check__Request__region_64_t__defined)
2821#define __MIG_check__Request__region_64_t__defined
2822
2823mig_internal kern_return_t __MIG_check__Request__region_64_t(
2824 __attribute__((__unused__)) __RequestKData__region_64_t *InKP,
2825 __attribute__((__unused__)) __RequestUData__region_64_t *In0UP,
2826 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2827{
2828
2829 typedef __Request__region_64_t __Request;
2830 typedef __RequestUData__region_64_t __RequestU __attribute__((unused));
2831#if __MigTypeCheck
2832 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2833 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2834 return MIG_BAD_ARGUMENTS;
2835#endif /* __MigTypeCheck */
2836
2837 return MACH_MSG_SUCCESS;
2838}
2839#endif /* !defined(__MIG_check__Request__region_64_t__defined) */
2840#endif /* __MIG_check__Request__map_subsystem__ */
2841#endif /* ( __MigTypeCheck ) */
2842
2843
2844/* Routine region_64 */
2845mig_internal novalue _Xregion_64
2846 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
2847 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
2848 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
2849{
2850
2851#ifdef __MigPackStructs
2852#pragma pack(push, 4)
2853#endif
2854 typedef struct {
2855 NDR_record_t NDR;
2856 vm32_address_t address;
2857 vm_region_flavor_t flavor;
2858 mach_msg_type_number_t infoCnt;
2859 mach_msg_trailer_t trailer;
2860 char padding[0]; /* Avoid generating empty UData structs */
2861 } RequestU __attribute__((unused));
2862#ifdef __MigPackStructs
2863#pragma pack(pop)
2864#endif
2865 typedef __RequestKData__region_64_t RequestK;
2866 typedef __RequestUData__region_64_t __RequestU;
2867 typedef __ReplyKData__region_64_t ReplyK __attribute__((unused));
2868 typedef __ReplyUData__region_64_t ReplyU __attribute__((unused));
2869 typedef __Reply__region_64_t Reply __attribute__((unused));
2870 typedef __Request__region_64_t __Request __attribute__((unused));
2871
2872 /*
2873 * typedef struct {
2874 * mach_msg_header_t Head;
2875 * NDR_record_t NDR;
2876 * kern_return_t RetCode;
2877 * } mig_reply_error_t;
2878 */
2879
2880 RequestK *InKP = (RequestK *) InHeadP;
2881 RequestU *In0UP = (RequestU *) InDataP;
2882 ReplyK *OutKP = (ReplyK *) OutHeadP;
2883 ReplyU *OutUP = (ReplyU *) OutDataP;
2884 (void)OutUP;
2885#ifdef __MIG_check__Request__region_64_t__defined
2886 kern_return_t check_result;
2887#endif /* __MIG_check__Request__region_64_t__defined */
2888
2889#if __MigKernelSpecificCode
2890#if UseStaticTemplates
2891 const static mach_msg_port_descriptor_t object_nameTemplate = {
2892 /* name = */ MACH_PORT_NULL,
2893 /* pad1 = */ 0,
2894 /* pad2 = */ 0,
2895 /* disp = */ 17,
2896 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2897 };
2898#endif /* UseStaticTemplates */
2899
2900#else
2901#if UseStaticTemplates
2902 const static mach_msg_port_descriptor_t object_nameTemplate = {
2903 /* name = */ MACH_PORT_NULL,
2904 /* pad1 = */ 0,
2905 /* pad2 = */ 0,
2906 /* disp = */ 17,
2907 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
2908 };
2909#endif /* UseStaticTemplates */
2910
2911#endif /* __MigKernelSpecificCode */
2912 kern_return_t RetCode;
2913 vm_map_read_t target_task;
2914
2915 __DeclareRcvRpc(3824, "region_64")
2916 __BeforeRcvRpc(3824, "region_64")
2917
2918#if defined(__MIG_check__Request__region_64_t__defined)
2919 check_result = __MIG_check__Request__region_64_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
2920 if (check_result != MACH_MSG_SUCCESS)
2921 { MIG_RETURN_ERROR(OutKP, check_result); }
2922#endif /* defined(__MIG_check__Request__region_64_t__defined) */
2923
2924#if UseStaticTemplates
2925 OutKP->object_name = object_nameTemplate;
2926#else /* UseStaticTemplates */
2927#if __MigKernelSpecificCode
2928 OutKP->object_name.disposition = 17;
2929#else
2930 OutKP->object_name.disposition = 17;
2931#endif /* __MigKernelSpecificCode */
2932#if !(defined(KERNEL) && defined(__LP64__))
2933 OutKP->object_name.pad1 = 0;
2934#endif
2935 OutKP->object_name.pad2 = 0;
2936 OutKP->object_name.type = MACH_MSG_PORT_DESCRIPTOR;
2937#if defined(KERNEL)
2938 OutKP->object_name.pad_end = 0;
2939#endif
2940#endif /* UseStaticTemplates */
2941
2942
2943 target_task = convert_port_to_map_read(port: InKP->Head.msgh_request_port);
2944
2945 OutUP->infoCnt = 10;
2946 if (In0UP->infoCnt < OutUP->infoCnt)
2947 OutUP->infoCnt = In0UP->infoCnt;
2948
2949 RetCode = vm32_region_64(target_task, address: &In0UP->address, size: &OutUP->size, flavor: In0UP->flavor, info: OutUP->info, infoCnt: &OutUP->infoCnt, object_name: &OutKP->object_name.name);
2950 vm_map_read_deallocate(map: target_task);
2951 if (RetCode != KERN_SUCCESS) {
2952 MIG_RETURN_ERROR(OutKP, RetCode);
2953 }
2954#if __MigKernelSpecificCode
2955#endif /* __MigKernelSpecificCode */
2956
2957 OutUP->NDR = NDR_record;
2958
2959
2960 OutUP->address = In0UP->address;
2961 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply) - 40) + (((4 * OutUP->infoCnt)));
2962
2963 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2964 OutKP->msgh_body.msgh_descriptor_count = 1;
2965 __AfterRcvRpc(3824, "region_64")
2966}
2967
2968#if ( __MigTypeCheck )
2969#if __MIG_check__Request__map_subsystem__
2970#if !defined(__MIG_check__Request__make_memory_entry_64_t__defined)
2971#define __MIG_check__Request__make_memory_entry_64_t__defined
2972
2973mig_internal kern_return_t __MIG_check__Request__make_memory_entry_64_t(
2974 __attribute__((__unused__)) __RequestKData__make_memory_entry_64_t *InKP,
2975 __attribute__((__unused__)) __RequestUData__make_memory_entry_64_t *In0UP,
2976 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
2977{
2978
2979 typedef __Request__make_memory_entry_64_t __Request;
2980 typedef __RequestUData__make_memory_entry_64_t __RequestU __attribute__((unused));
2981#if __MigTypeCheck
2982 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2983 (InKP->msgh_body.msgh_descriptor_count != 1) ||
2984 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2985 return MIG_BAD_ARGUMENTS;
2986#endif /* __MigTypeCheck */
2987
2988#if __MigTypeCheck
2989 if (InKP->parent_entry.type != MACH_MSG_PORT_DESCRIPTOR ||
2990 InKP->parent_entry.disposition != 17)
2991 return MIG_TYPE_ERROR;
2992#endif /* __MigTypeCheck */
2993
2994 return MACH_MSG_SUCCESS;
2995}
2996#endif /* !defined(__MIG_check__Request__make_memory_entry_64_t__defined) */
2997#endif /* __MIG_check__Request__map_subsystem__ */
2998#endif /* ( __MigTypeCheck ) */
2999
3000
3001/* Routine make_memory_entry_64 */
3002mig_internal novalue _Xmake_memory_entry_64
3003 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3004 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3005 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3006{
3007
3008#ifdef __MigPackStructs
3009#pragma pack(push, 4)
3010#endif
3011 typedef struct {
3012 NDR_record_t NDR;
3013 memory_object_size_t size;
3014 memory_object_offset_t offset;
3015 vm_prot_t permission;
3016 mach_msg_trailer_t trailer;
3017 char padding[0]; /* Avoid generating empty UData structs */
3018 } RequestU __attribute__((unused));
3019#ifdef __MigPackStructs
3020#pragma pack(pop)
3021#endif
3022 typedef __RequestKData__make_memory_entry_64_t RequestK;
3023 typedef __RequestUData__make_memory_entry_64_t __RequestU;
3024 typedef __ReplyKData__make_memory_entry_64_t ReplyK __attribute__((unused));
3025 typedef __ReplyUData__make_memory_entry_64_t ReplyU __attribute__((unused));
3026 typedef __Reply__make_memory_entry_64_t Reply __attribute__((unused));
3027 typedef __Request__make_memory_entry_64_t __Request __attribute__((unused));
3028
3029 /*
3030 * typedef struct {
3031 * mach_msg_header_t Head;
3032 * NDR_record_t NDR;
3033 * kern_return_t RetCode;
3034 * } mig_reply_error_t;
3035 */
3036
3037 RequestK *InKP = (RequestK *) InHeadP;
3038 RequestU *In0UP = (RequestU *) InDataP;
3039 ReplyK *OutKP = (ReplyK *) OutHeadP;
3040 ReplyU *OutUP = (ReplyU *) OutDataP;
3041 (void)OutUP;
3042#ifdef __MIG_check__Request__make_memory_entry_64_t__defined
3043 kern_return_t check_result;
3044#endif /* __MIG_check__Request__make_memory_entry_64_t__defined */
3045
3046#if __MigKernelSpecificCode
3047#if UseStaticTemplates
3048 const static mach_msg_port_descriptor_t object_handleTemplate = {
3049 /* name = */ MACH_PORT_NULL,
3050 /* pad1 = */ 0,
3051 /* pad2 = */ 0,
3052 /* disp = */ 17,
3053 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
3054 };
3055#endif /* UseStaticTemplates */
3056
3057#else
3058#if UseStaticTemplates
3059 const static mach_msg_port_descriptor_t object_handleTemplate = {
3060 /* name = */ MACH_PORT_NULL,
3061 /* pad1 = */ 0,
3062 /* pad2 = */ 0,
3063 /* disp = */ 17,
3064 /* type = */ MACH_MSG_PORT_DESCRIPTOR,
3065 };
3066#endif /* UseStaticTemplates */
3067
3068#endif /* __MigKernelSpecificCode */
3069 kern_return_t RetCode;
3070 vm_map_t target_task;
3071
3072 __DeclareRcvRpc(3825, "make_memory_entry_64")
3073 __BeforeRcvRpc(3825, "make_memory_entry_64")
3074
3075#if defined(__MIG_check__Request__make_memory_entry_64_t__defined)
3076 check_result = __MIG_check__Request__make_memory_entry_64_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3077 if (check_result != MACH_MSG_SUCCESS)
3078 { MIG_RETURN_ERROR(OutKP, check_result); }
3079#endif /* defined(__MIG_check__Request__make_memory_entry_64_t__defined) */
3080
3081#if UseStaticTemplates
3082 OutKP->object_handle = object_handleTemplate;
3083#else /* UseStaticTemplates */
3084#if __MigKernelSpecificCode
3085 OutKP->object_handle.disposition = 17;
3086#else
3087 OutKP->object_handle.disposition = 17;
3088#endif /* __MigKernelSpecificCode */
3089#if !(defined(KERNEL) && defined(__LP64__))
3090 OutKP->object_handle.pad1 = 0;
3091#endif
3092 OutKP->object_handle.pad2 = 0;
3093 OutKP->object_handle.type = MACH_MSG_PORT_DESCRIPTOR;
3094#if defined(KERNEL)
3095 OutKP->object_handle.pad_end = 0;
3096#endif
3097#endif /* UseStaticTemplates */
3098
3099
3100 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
3101
3102 RetCode = vm32_make_memory_entry_64(target_task, size: &In0UP->size, offset: In0UP->offset, permission: In0UP->permission, object_handle: &OutKP->object_handle.name, null_conversion(InKP->parent_entry.name));
3103 vm_map_deallocate(map: target_task);
3104 if (RetCode != KERN_SUCCESS) {
3105 MIG_RETURN_ERROR(OutKP, RetCode);
3106 }
3107#if __MigKernelSpecificCode
3108 ipc_port_release_send(port: (ipc_port_t)InKP->parent_entry.name);
3109#endif /* __MigKernelSpecificCode */
3110
3111 OutUP->NDR = NDR_record;
3112
3113
3114 OutUP->size = In0UP->size;
3115
3116 OutKP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
3117 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3118 OutKP->msgh_body.msgh_descriptor_count = 1;
3119 __AfterRcvRpc(3825, "make_memory_entry_64")
3120}
3121
3122#if ( __MigTypeCheck )
3123#if __MIG_check__Request__map_subsystem__
3124#if !defined(__MIG_check__Request__map_64_t__defined)
3125#define __MIG_check__Request__map_64_t__defined
3126
3127mig_internal kern_return_t __MIG_check__Request__map_64_t(
3128 __attribute__((__unused__)) __RequestKData__map_64_t *InKP,
3129 __attribute__((__unused__)) __RequestUData__map_64_t *In0UP,
3130 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
3131{
3132
3133 typedef __Request__map_64_t __Request;
3134 typedef __RequestUData__map_64_t __RequestU __attribute__((unused));
3135#if __MigTypeCheck
3136 if (!(InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3137 (InKP->msgh_body.msgh_descriptor_count != 1) ||
3138 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3139 return MIG_BAD_ARGUMENTS;
3140#endif /* __MigTypeCheck */
3141
3142#if __MigTypeCheck
3143 if (InKP->object.type != MACH_MSG_PORT_DESCRIPTOR ||
3144 InKP->object.disposition != 17)
3145 return MIG_TYPE_ERROR;
3146#endif /* __MigTypeCheck */
3147
3148 return MACH_MSG_SUCCESS;
3149}
3150#endif /* !defined(__MIG_check__Request__map_64_t__defined) */
3151#endif /* __MIG_check__Request__map_subsystem__ */
3152#endif /* ( __MigTypeCheck ) */
3153
3154
3155/* Routine map_64 */
3156mig_internal novalue _Xmap_64
3157 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3158 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3159 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3160{
3161
3162#ifdef __MigPackStructs
3163#pragma pack(push, 4)
3164#endif
3165 typedef struct {
3166 NDR_record_t NDR;
3167 vm32_address_t address;
3168 vm32_size_t size;
3169 vm32_address_t mask;
3170 int flags;
3171 memory_object_offset_t offset;
3172 boolean_t copy;
3173 vm_prot_t cur_protection;
3174 vm_prot_t max_protection;
3175 vm_inherit_t inheritance;
3176 mach_msg_trailer_t trailer;
3177 char padding[0]; /* Avoid generating empty UData structs */
3178 } RequestU __attribute__((unused));
3179#ifdef __MigPackStructs
3180#pragma pack(pop)
3181#endif
3182 typedef __RequestKData__map_64_t RequestK;
3183 typedef __RequestUData__map_64_t __RequestU;
3184 typedef __ReplyKData__map_64_t ReplyK __attribute__((unused));
3185 typedef __ReplyUData__map_64_t ReplyU __attribute__((unused));
3186 typedef __Reply__map_64_t Reply __attribute__((unused));
3187 typedef __Request__map_64_t __Request __attribute__((unused));
3188
3189 /*
3190 * typedef struct {
3191 * mach_msg_header_t Head;
3192 * NDR_record_t NDR;
3193 * kern_return_t RetCode;
3194 * } mig_reply_error_t;
3195 */
3196
3197 RequestK *InKP = (RequestK *) InHeadP;
3198 RequestU *In0UP = (RequestU *) InDataP;
3199 ReplyK *OutKP = (ReplyK *) OutHeadP;
3200 ReplyU *OutUP = (ReplyU *) OutDataP;
3201 (void)OutUP;
3202#ifdef __MIG_check__Request__map_64_t__defined
3203 kern_return_t check_result;
3204#endif /* __MIG_check__Request__map_64_t__defined */
3205
3206#if __MigKernelSpecificCode
3207#else
3208#endif /* __MigKernelSpecificCode */
3209 vm_map_t target_task;
3210
3211 __DeclareRcvRpc(3826, "map_64")
3212 __BeforeRcvRpc(3826, "map_64")
3213
3214#if defined(__MIG_check__Request__map_64_t__defined)
3215 check_result = __MIG_check__Request__map_64_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3216 if (check_result != MACH_MSG_SUCCESS)
3217 { MIG_RETURN_ERROR(OutKP, check_result); }
3218#endif /* defined(__MIG_check__Request__map_64_t__defined) */
3219
3220 target_task = convert_port_entry_to_map(port: InKP->Head.msgh_request_port);
3221
3222 OutUP->RetCode = vm32_map_64(target_task, address: &In0UP->address, size: In0UP->size, mask: In0UP->mask, flags: In0UP->flags, null_conversion(InKP->object.name), offset: In0UP->offset, copy: In0UP->copy, cur_protection: In0UP->cur_protection, max_protection: In0UP->max_protection, inheritance: In0UP->inheritance);
3223 vm_map_deallocate(map: target_task);
3224 if (OutUP->RetCode != KERN_SUCCESS) {
3225 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3226 }
3227#if __MigKernelSpecificCode
3228 ipc_port_release_send(port: (ipc_port_t)InKP->object.name);
3229#endif /* __MigKernelSpecificCode */
3230
3231 OutUP->NDR = NDR_record;
3232
3233
3234 OutUP->address = In0UP->address;
3235
3236 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3237 __AfterRcvRpc(3826, "map_64")
3238}
3239
3240#if ( __MigTypeCheck )
3241#if __MIG_check__Request__map_subsystem__
3242#if !defined(__MIG_check__Request__purgable_control_t__defined)
3243#define __MIG_check__Request__purgable_control_t__defined
3244
3245mig_internal kern_return_t __MIG_check__Request__purgable_control_t(
3246 __attribute__((__unused__)) __RequestKData__purgable_control_t *InKP,
3247 __attribute__((__unused__)) __RequestUData__purgable_control_t *In0UP,
3248 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
3249{
3250
3251 typedef __Request__purgable_control_t __Request;
3252 typedef __RequestUData__purgable_control_t __RequestU __attribute__((unused));
3253#if __MigTypeCheck
3254 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3255 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3256 return MIG_BAD_ARGUMENTS;
3257#endif /* __MigTypeCheck */
3258
3259 return MACH_MSG_SUCCESS;
3260}
3261#endif /* !defined(__MIG_check__Request__purgable_control_t__defined) */
3262#endif /* __MIG_check__Request__map_subsystem__ */
3263#endif /* ( __MigTypeCheck ) */
3264
3265
3266/* Routine purgable_control */
3267mig_internal novalue _Xpurgable_control
3268 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3269 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3270 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3271{
3272
3273#ifdef __MigPackStructs
3274#pragma pack(push, 4)
3275#endif
3276 typedef struct {
3277 NDR_record_t NDR;
3278 vm32_address_t address;
3279 vm_purgable_t control;
3280 int state;
3281 mach_msg_trailer_t trailer;
3282 char padding[0]; /* Avoid generating empty UData structs */
3283 } RequestU __attribute__((unused));
3284#ifdef __MigPackStructs
3285#pragma pack(pop)
3286#endif
3287 typedef __RequestKData__purgable_control_t RequestK;
3288 typedef __RequestUData__purgable_control_t __RequestU;
3289 typedef __ReplyKData__purgable_control_t ReplyK __attribute__((unused));
3290 typedef __ReplyUData__purgable_control_t ReplyU __attribute__((unused));
3291 typedef __Reply__purgable_control_t Reply __attribute__((unused));
3292 typedef __Request__purgable_control_t __Request __attribute__((unused));
3293
3294 /*
3295 * typedef struct {
3296 * mach_msg_header_t Head;
3297 * NDR_record_t NDR;
3298 * kern_return_t RetCode;
3299 * } mig_reply_error_t;
3300 */
3301
3302 RequestK *InKP = (RequestK *) InHeadP;
3303 RequestU *In0UP = (RequestU *) InDataP;
3304 ReplyK *OutKP = (ReplyK *) OutHeadP;
3305 ReplyU *OutUP = (ReplyU *) OutDataP;
3306 (void)OutUP;
3307#ifdef __MIG_check__Request__purgable_control_t__defined
3308 kern_return_t check_result;
3309#endif /* __MIG_check__Request__purgable_control_t__defined */
3310
3311#if __MigKernelSpecificCode
3312#else
3313#endif /* __MigKernelSpecificCode */
3314 vm_map_t target_task;
3315
3316 __DeclareRcvRpc(3830, "purgable_control")
3317 __BeforeRcvRpc(3830, "purgable_control")
3318
3319#if defined(__MIG_check__Request__purgable_control_t__defined)
3320 check_result = __MIG_check__Request__purgable_control_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3321 if (check_result != MACH_MSG_SUCCESS)
3322 { MIG_RETURN_ERROR(OutKP, check_result); }
3323#endif /* defined(__MIG_check__Request__purgable_control_t__defined) */
3324
3325 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
3326
3327 OutUP->RetCode = vm32_purgable_control(target_task, address: In0UP->address, control: In0UP->control, state: &In0UP->state);
3328 vm_map_deallocate(map: target_task);
3329 if (OutUP->RetCode != KERN_SUCCESS) {
3330 MIG_RETURN_ERROR(OutKP, OutUP->RetCode);
3331 }
3332#if __MigKernelSpecificCode
3333#endif /* __MigKernelSpecificCode */
3334
3335 OutUP->NDR = NDR_record;
3336
3337
3338 OutUP->state = In0UP->state;
3339
3340 OutKP->Head.msgh_size = (mach_msg_size_t)(sizeof(Reply));
3341 __AfterRcvRpc(3830, "purgable_control")
3342}
3343
3344#if ( __MigTypeCheck )
3345#if __MIG_check__Request__map_subsystem__
3346#if !defined(__MIG_check__Request___map_exec_lockdown_t__defined)
3347#define __MIG_check__Request___map_exec_lockdown_t__defined
3348
3349mig_internal kern_return_t __MIG_check__Request___map_exec_lockdown_t(
3350 __attribute__((__unused__)) __RequestKData___map_exec_lockdown_t *InKP,
3351 __attribute__((__unused__)) __RequestUData___map_exec_lockdown_t *In0UP,
3352 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP)
3353{
3354
3355 typedef __Request___map_exec_lockdown_t __Request;
3356 typedef __RequestUData___map_exec_lockdown_t __RequestU __attribute__((unused));
3357#if __MigTypeCheck
3358 if ((InKP->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
3359 (InKP->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
3360 return MIG_BAD_ARGUMENTS;
3361#endif /* __MigTypeCheck */
3362
3363 return MACH_MSG_SUCCESS;
3364}
3365#endif /* !defined(__MIG_check__Request___map_exec_lockdown_t__defined) */
3366#endif /* __MIG_check__Request__map_subsystem__ */
3367#endif /* ( __MigTypeCheck ) */
3368
3369
3370/* Routine _map_exec_lockdown */
3371mig_internal novalue _X_map_exec_lockdown
3372 (mach_msg_header_t *InHeadP, __attribute__((__unused__)) void *InDataP,
3373 __attribute__((__unused__)) mach_msg_max_trailer_t *InTrailerP,
3374 mach_msg_header_t *OutHeadP, __attribute__((__unused__)) void *OutDataP)
3375{
3376
3377#ifdef __MigPackStructs
3378#pragma pack(push, 4)
3379#endif
3380 typedef struct {
3381 mach_msg_trailer_t trailer;
3382 char padding[0]; /* Avoid generating empty UData structs */
3383 } RequestU __attribute__((unused));
3384#ifdef __MigPackStructs
3385#pragma pack(pop)
3386#endif
3387 typedef __RequestKData___map_exec_lockdown_t RequestK;
3388 typedef __RequestUData___map_exec_lockdown_t __RequestU;
3389 typedef __ReplyKData___map_exec_lockdown_t ReplyK __attribute__((unused));
3390 typedef __ReplyUData___map_exec_lockdown_t ReplyU __attribute__((unused));
3391 typedef __Reply___map_exec_lockdown_t Reply __attribute__((unused));
3392 typedef __Request___map_exec_lockdown_t __Request __attribute__((unused));
3393
3394 /*
3395 * typedef struct {
3396 * mach_msg_header_t Head;
3397 * NDR_record_t NDR;
3398 * kern_return_t RetCode;
3399 * } mig_reply_error_t;
3400 */
3401
3402 RequestK *InKP = (RequestK *) InHeadP;
3403 RequestU *In0UP = (RequestU *) InDataP;
3404 ReplyK *OutKP = (ReplyK *) OutHeadP;
3405 ReplyU *OutUP = (ReplyU *) OutDataP;
3406 (void)OutUP;
3407#ifdef __MIG_check__Request___map_exec_lockdown_t__defined
3408 kern_return_t check_result;
3409#endif /* __MIG_check__Request___map_exec_lockdown_t__defined */
3410
3411#if __MigKernelSpecificCode
3412#else
3413#endif /* __MigKernelSpecificCode */
3414 vm_map_t target_task;
3415
3416 __DeclareRcvRpc(3831, "_map_exec_lockdown")
3417 __BeforeRcvRpc(3831, "_map_exec_lockdown")
3418
3419#if defined(__MIG_check__Request___map_exec_lockdown_t__defined)
3420 check_result = __MIG_check__Request___map_exec_lockdown_t(InKP: (RequestK *)InKP, In0UP: (__RequestU *)In0UP, InTrailerP);
3421 if (check_result != MACH_MSG_SUCCESS)
3422 { MIG_RETURN_ERROR(OutKP, check_result); }
3423#endif /* defined(__MIG_check__Request___map_exec_lockdown_t__defined) */
3424
3425 target_task = convert_port_to_map(port: InKP->Head.msgh_request_port);
3426
3427 OutUP->RetCode = vm32__map_exec_lockdown(target_task);
3428 vm_map_deallocate(map: target_task);
3429#if __MigKernelSpecificCode
3430#endif /* __MigKernelSpecificCode */
3431
3432 OutUP->NDR = NDR_record;
3433
3434
3435 __AfterRcvRpc(3831, "_map_exec_lockdown")
3436}
3437
3438
3439
3440/* Description of this kernel subsystem, for use in direct RPC */
3441const struct vm32_map_subsystem vm32_map_subsystem = {
3442 map_server_routine,
3443 3800,
3444 3832,
3445 (mach_msg_size_t)sizeof(union __ReplyUnion__vm32_map_subsystem),
3446 (vm_address_t)0,
3447 {
3448 { (mig_impl_routine_t) 0,
3449 (mig_stub_kern_routine_t) _Xregion, 7, 0, 1, (mach_msg_size_t)sizeof(__Reply__region_t)},
3450 { .impl_routine: (mig_impl_routine_t) 0,
3451 .kstub_routine: (mig_stub_kern_routine_t) _Xallocate, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__allocate_t)},
3452 { .impl_routine: (mig_impl_routine_t) 0,
3453 .kstub_routine: (mig_stub_kern_routine_t) _Xdeallocate, .argc: 3, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__deallocate_t)},
3454 { .impl_routine: (mig_impl_routine_t) 0,
3455 .kstub_routine: (mig_stub_kern_routine_t) _Xprotect, .argc: 5, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__protect_t)},
3456 { .impl_routine: (mig_impl_routine_t) 0,
3457 .kstub_routine: (mig_stub_kern_routine_t) _Xinherit, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__inherit_t)},
3458 { .impl_routine: (mig_impl_routine_t) 0,
3459 .kstub_routine: (mig_stub_kern_routine_t) _Xread, .argc: 5, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__read_t)},
3460 { .impl_routine: (mig_impl_routine_t) 0,
3461 .kstub_routine: (mig_stub_kern_routine_t) _Xread_list, .argc: 3, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__read_list_t)},
3462 { .impl_routine: (mig_impl_routine_t) 0,
3463 .kstub_routine: (mig_stub_kern_routine_t) _Xwrite, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__write_t)},
3464 { .impl_routine: (mig_impl_routine_t) 0,
3465 .kstub_routine: (mig_stub_kern_routine_t) _Xcopy, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__copy_t)},
3466 { .impl_routine: (mig_impl_routine_t) 0,
3467 .kstub_routine: (mig_stub_kern_routine_t) _Xread_overwrite, .argc: 5, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__read_overwrite_t)},
3468 { .impl_routine: (mig_impl_routine_t) 0,
3469 .kstub_routine: (mig_stub_kern_routine_t) _Xmsync, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__msync_t)},
3470 { .impl_routine: (mig_impl_routine_t) 0,
3471 .kstub_routine: (mig_stub_kern_routine_t) _Xbehavior_set, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__behavior_set_t)},
3472 { .impl_routine: (mig_impl_routine_t) 0,
3473 .kstub_routine: (mig_stub_kern_routine_t) _Xmap, .argc: 11, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__map_t)},
3474 { .impl_routine: (mig_impl_routine_t) 0,
3475 .kstub_routine: (mig_stub_kern_routine_t) _Xmachine_attribute, .argc: 5, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__machine_attribute_t)},
3476 { .impl_routine: (mig_impl_routine_t) 0,
3477 .kstub_routine: (mig_stub_kern_routine_t) _Xremap, .argc: 11, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__remap_t)},
3478 { .impl_routine: (mig_impl_routine_t) 0,
3479 .kstub_routine: (mig_stub_kern_routine_t) _X_task_wire, .argc: 2, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply___task_wire_t)},
3480 { .impl_routine: (mig_impl_routine_t) 0,
3481 .kstub_routine: (mig_stub_kern_routine_t) _Xmake_memory_entry, .argc: 6, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__make_memory_entry_t)},
3482 { .impl_routine: (mig_impl_routine_t) 0,
3483 .kstub_routine: (mig_stub_kern_routine_t) _Xmap_page_query, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__map_page_query_t)},
3484 { .impl_routine: (mig_impl_routine_t) 0,
3485 .kstub_routine: (mig_stub_kern_routine_t) _Xregion_info, .argc: 5, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__region_info_t)},
3486 { .impl_routine: (mig_impl_routine_t) 0,
3487 .kstub_routine: (mig_stub_kern_routine_t) _Xmapped_pages_info, .argc: 3, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__mapped_pages_info_t)},
3488 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
3489 { .impl_routine: (mig_impl_routine_t) 0,
3490 .kstub_routine: (mig_stub_kern_routine_t) _Xregion_recurse, .argc: 6, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__region_recurse_t)},
3491 { .impl_routine: (mig_impl_routine_t) 0,
3492 .kstub_routine: (mig_stub_kern_routine_t) _Xregion_recurse_64, .argc: 6, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__region_recurse_64_t)},
3493 { .impl_routine: (mig_impl_routine_t) 0,
3494 .kstub_routine: (mig_stub_kern_routine_t) _Xregion_info_64, .argc: 5, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__region_info_64_t)},
3495 { .impl_routine: (mig_impl_routine_t) 0,
3496 .kstub_routine: (mig_stub_kern_routine_t) _Xregion_64, .argc: 7, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__region_64_t)},
3497 { .impl_routine: (mig_impl_routine_t) 0,
3498 .kstub_routine: (mig_stub_kern_routine_t) _Xmake_memory_entry_64, .argc: 7, .descr_count: 0, .reply_descr_count: 1, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__make_memory_entry_64_t)},
3499 { .impl_routine: (mig_impl_routine_t) 0,
3500 .kstub_routine: (mig_stub_kern_routine_t) _Xmap_64, .argc: 12, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__map_64_t)},
3501 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
3502 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
3503 {.impl_routine: 0, .kstub_routine: 0, .argc: 0, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: 0},
3504 { .impl_routine: (mig_impl_routine_t) 0,
3505 .kstub_routine: (mig_stub_kern_routine_t) _Xpurgable_control, .argc: 4, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply__purgable_control_t)},
3506 { .impl_routine: (mig_impl_routine_t) 0,
3507 .kstub_routine: (mig_stub_kern_routine_t) _X_map_exec_lockdown, .argc: 1, .descr_count: 0, .reply_descr_count: 0, .max_reply_msg: (mach_msg_size_t)sizeof(__Reply___map_exec_lockdown_t)},
3508 }
3509};
3510
3511mig_external boolean_t map_server
3512 (mach_msg_header_t *InHeadP, void *InDataP, mach_msg_max_trailer_t *InTrailerP, mach_msg_header_t *OutHeadP, void *OutDataP)
3513{
3514 /*
3515 * typedef struct {
3516 * mach_msg_header_t Head;
3517 * NDR_record_t NDR;
3518 * kern_return_t RetCode;
3519 * } mig_reply_error_t;
3520 */
3521
3522 mig_kern_routine_t routine;
3523
3524 OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
3525 OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
3526 /* Minimal size: routine() will update it if different */
3527 OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
3528 OutHeadP->msgh_local_port = MACH_PORT_NULL;
3529 OutHeadP->msgh_id = InHeadP->msgh_id + 100;
3530 OutHeadP->msgh_reserved = 0;
3531
3532 if ((InHeadP->msgh_id > 3831) || (InHeadP->msgh_id < 3800) ||
3533 ((routine = vm32_map_subsystem.kroutine[InHeadP->msgh_id - 3800].kstub_routine) == 0)) {
3534 ((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
3535 ((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
3536 return FALSE;
3537 }
3538 (*routine) (InHeadP, InDataP, InTrailerP, OutHeadP, OutDataP);
3539 return TRUE;
3540}
3541
3542mig_external mig_kern_routine_t map_server_routine
3543 (mach_msg_header_t *InHeadP)
3544{
3545 int msgh_id;
3546
3547 msgh_id = InHeadP->msgh_id - 3800;
3548
3549 if ((msgh_id > 31) || (msgh_id < 0))
3550 return 0;
3551
3552 return vm32_map_subsystem.kroutine[msgh_id].kstub_routine;
3553}
3554