xref: /NextBSD/sys/compat/mach/mach_vm_server.c (revision 33da5adc555b3bc29986eeadca03829e4ad06b1e)
1 /*
2  * IDENTIFICATION:
3  * stub generated Thu Jun 11 18:17:45 2015
4  * with a MiG generated Thu Jun 11 16:16:11 PDT 2015 by kmacy@serenity
5  * OPTIONS:
6  *	KernelServer
7  */
8 
9 /* Module mach_vm */
10 
11 #define	__MIG_check__Request__mach_vm_subsystem__ 1
12 
13 #include <sys/cdefs.h>
14 #include <sys/types.h>
15 #ifdef _KERNEL
16 #include <sys/mach/ndr.h>
17 #include <sys/mach/kern_return.h>
18 #include <sys/mach/notify.h>
19 #include <sys/mach/mach_types.h>
20 #include <sys/mach/message.h>
21 #include <sys/mach/mig_errors.h>
22 #else /* !_KERNEL */
23 #include <string.h>
24 #include <mach/ndr.h>
25 #include <mach/boolean.h>
26 #include <mach/kern_return.h>
27 #include <mach/notify.h>
28 #include <mach/mach_types.h>
29 #include <mach/message.h>
30 #include <mach/mig_errors.h>
31 #endif /*_KERNEL */
32 
33 #include <sys/mach/std_types.h>
34 #include <sys/mach/mig.h>
35 #include <sys/mach/ipc_sync.h>
36 #include <sys/mach/ipc/ipc_voucher.h>
37 #include <sys/mach/ipc_host.h>
38 #include <sys/mach/ipc_tt.h>
39 #include <sys/mach/ipc_mig.h>
40 #include <sys/mach/mig.h>
41 #include <sys/mach/mach_types.h>
42 #include <sys/mach_debug/mach_debug_types.h>
43 
44 #ifndef	mig_internal
45 #define	mig_internal	static __inline__
46 #endif	/* mig_internal */
47 
48 #ifndef	mig_external
49 #define mig_external
50 #endif	/* mig_external */
51 
52 #if	!defined(__MigTypeCheck) && defined(TypeCheck)
53 #define	__MigTypeCheck		TypeCheck	/* Legacy setting */
54 #endif	/* !defined(__MigTypeCheck) */
55 
56 #if	!defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
57 #define	__MigKernelSpecificCode	_MIG_KERNEL_SPECIFIC_CODE_	/* Legacy setting */
58 #endif	/* !defined(__MigKernelSpecificCode) */
59 
60 #ifndef	LimitCheck
61 #define	LimitCheck 0
62 #endif	/* LimitCheck */
63 
64 #ifndef	min
65 #define	min(a,b)  ( ((a) < (b))? (a): (b) )
66 #endif	/* min */
67 
68 #if !defined(_WALIGN_)
69 #define _WALIGN_(x) (((x) + 7) & ~7)
70 #endif /* !defined(_WALIGN_) */
71 
72 #if !defined(_WALIGNSZ_)
73 #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
74 #endif /* !defined(_WALIGNSZ_) */
75 
76 #ifndef	UseStaticTemplates
77 #define	UseStaticTemplates	1
78 #endif	/* UseStaticTemplates */
79 
80 #define _WALIGN_(x) (((x) + 7) & ~7)
81 #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
82 #ifndef	__DeclareRcvRpc
83 #define	__DeclareRcvRpc(_NUM_, _NAME_)
84 #endif	/* __DeclareRcvRpc */
85 
86 #ifndef	__BeforeRcvRpc
87 #define	__BeforeRcvRpc(_NUM_, _NAME_)
88 #endif	/* __BeforeRcvRpc */
89 
90 #ifndef	__AfterRcvRpc
91 #define	__AfterRcvRpc(_NUM_, _NAME_)
92 #endif	/* __AfterRcvRpc */
93 
94 #ifndef	__DeclareRcvSimple
95 #define	__DeclareRcvSimple(_NUM_, _NAME_)
96 #endif	/* __DeclareRcvSimple */
97 
98 #ifndef	__BeforeRcvSimple
99 #define	__BeforeRcvSimple(_NUM_, _NAME_)
100 #endif	/* __BeforeRcvSimple */
101 
102 #ifndef	__AfterRcvSimple
103 #define	__AfterRcvSimple(_NUM_, _NAME_)
104 #endif	/* __AfterRcvSimple */
105 
106 #define novalue void
107 #if	__MigKernelSpecificCode
108 #define msgh_request_port	msgh_remote_port
109 #define MACH_MSGH_BITS_REQUEST(bits)	MACH_MSGH_BITS_REMOTE(bits)
110 #define msgh_reply_port		msgh_local_port
111 #define MACH_MSGH_BITS_REPLY(bits)	MACH_MSGH_BITS_LOCAL(bits)
112 #else
113 #define msgh_request_port	msgh_local_port
114 #define MACH_MSGH_BITS_REQUEST(bits)	MACH_MSGH_BITS_LOCAL(bits)
115 #define msgh_reply_port		msgh_remote_port
116 #define MACH_MSGH_BITS_REPLY(bits)	MACH_MSGH_BITS_REMOTE(bits)
117 #endif /* __MigKernelSpecificCode */
118 
119 #define MIG_RETURN_ERROR(X, code)	{\
120 				((mig_reply_error_t *)X)->RetCode = code;\
121 				((mig_reply_error_t *)X)->NDR = NDR_record;\
122 				return;\
123 				}
124 
125 /* typedefs for all requests */
126 
127 #ifndef __Request__mach_vm_subsystem__defined
128 #define __Request__mach_vm_subsystem__defined
129 
130 #ifdef  __MigPackStructs
131 #pragma pack(4)
132 #endif
133 	typedef struct {
134 		mach_msg_header_t Head;
135 		/* start of the kernel processed data */
136 		mach_msg_body_t msgh_body;
137 		/* end of the kernel processed data */
138 		NDR_record_t NDR;
139 		mach_vm_address_t address;
140 		mach_vm_size_t size;
141 		boolean_t set_maximum;
142 		vm_prot_t new_protection;
143 	} __Request__mach_vm_protect_t;
144 #ifdef  __MigPackStructs
145 #pragma pack()
146 #endif
147 
148 #ifdef  __MigPackStructs
149 #pragma pack(4)
150 #endif
151 	typedef struct {
152 		mach_msg_header_t Head;
153 		/* start of the kernel processed data */
154 		mach_msg_body_t msgh_body;
155 		/* end of the kernel processed data */
156 		NDR_record_t NDR;
157 		mach_vm_address_t address;
158 		mach_vm_size_t size;
159 		vm_inherit_t new_inheritance;
160 	} __Request__mach_vm_inherit_t;
161 #ifdef  __MigPackStructs
162 #pragma pack()
163 #endif
164 
165 #ifdef  __MigPackStructs
166 #pragma pack(4)
167 #endif
168 	typedef struct {
169 		mach_msg_header_t Head;
170 		/* start of the kernel processed data */
171 		mach_msg_body_t msgh_body;
172 		/* end of the kernel processed data */
173 		NDR_record_t NDR;
174 		mach_vm_address_t address;
175 		mach_vm_size_t size;
176 	} __Request__mach_vm_read_t;
177 #ifdef  __MigPackStructs
178 #pragma pack()
179 #endif
180 
181 #ifdef  __MigPackStructs
182 #pragma pack(4)
183 #endif
184 	typedef struct {
185 		mach_msg_header_t Head;
186 		/* start of the kernel processed data */
187 		mach_msg_body_t msgh_body;
188 		/* end of the kernel processed data */
189 		NDR_record_t NDR;
190 		mach_vm_read_entry_t data_list;
191 		natural_t count;
192 	} __Request__mach_vm_read_list_t;
193 #ifdef  __MigPackStructs
194 #pragma pack()
195 #endif
196 
197 #ifdef  __MigPackStructs
198 #pragma pack(4)
199 #endif
200 	typedef struct {
201 		mach_msg_header_t Head;
202 		/* start of the kernel processed data */
203 		mach_msg_body_t msgh_body;
204 		mach_msg_ool_descriptor_t data;
205 		/* end of the kernel processed data */
206 		NDR_record_t NDR;
207 		mach_vm_address_t address;
208 		mach_msg_type_number_t dataCnt;
209 	} __Request__mach_vm_write_t;
210 #ifdef  __MigPackStructs
211 #pragma pack()
212 #endif
213 
214 #ifdef  __MigPackStructs
215 #pragma pack(4)
216 #endif
217 	typedef struct {
218 		mach_msg_header_t Head;
219 		/* start of the kernel processed data */
220 		mach_msg_body_t msgh_body;
221 		/* end of the kernel processed data */
222 		NDR_record_t NDR;
223 		mach_vm_address_t source_address;
224 		mach_vm_size_t size;
225 		mach_vm_address_t dest_address;
226 	} __Request__mach_vm_copy_t;
227 #ifdef  __MigPackStructs
228 #pragma pack()
229 #endif
230 
231 #ifdef  __MigPackStructs
232 #pragma pack(4)
233 #endif
234 	typedef struct {
235 		mach_msg_header_t Head;
236 		/* start of the kernel processed data */
237 		mach_msg_body_t msgh_body;
238 		/* end of the kernel processed data */
239 		NDR_record_t NDR;
240 		mach_vm_address_t address;
241 		mach_vm_size_t size;
242 		mach_vm_address_t data;
243 	} __Request__mach_vm_read_overwrite_t;
244 #ifdef  __MigPackStructs
245 #pragma pack()
246 #endif
247 
248 #ifdef  __MigPackStructs
249 #pragma pack(4)
250 #endif
251 	typedef struct {
252 		mach_msg_header_t Head;
253 		/* start of the kernel processed data */
254 		mach_msg_body_t msgh_body;
255 		/* end of the kernel processed data */
256 		NDR_record_t NDR;
257 		mach_vm_address_t address;
258 		mach_vm_size_t size;
259 		vm_sync_t sync_flags;
260 	} __Request__mach_vm_msync_t;
261 #ifdef  __MigPackStructs
262 #pragma pack()
263 #endif
264 
265 #ifdef  __MigPackStructs
266 #pragma pack(4)
267 #endif
268 	typedef struct {
269 		mach_msg_header_t Head;
270 		/* start of the kernel processed data */
271 		mach_msg_body_t msgh_body;
272 		/* end of the kernel processed data */
273 		NDR_record_t NDR;
274 		mach_vm_address_t address;
275 		mach_vm_size_t size;
276 		vm_behavior_t new_behavior;
277 	} __Request__mach_vm_behavior_set_t;
278 #ifdef  __MigPackStructs
279 #pragma pack()
280 #endif
281 
282 #ifdef  __MigPackStructs
283 #pragma pack(4)
284 #endif
285 	typedef struct {
286 		mach_msg_header_t Head;
287 		/* start of the kernel processed data */
288 		mach_msg_body_t msgh_body;
289 		/* end of the kernel processed data */
290 		NDR_record_t NDR;
291 		mach_vm_address_t address;
292 		mach_vm_size_t size;
293 		vm_machine_attribute_t attribute;
294 		vm_machine_attribute_val_t value;
295 	} __Request__mach_vm_machine_attribute_t;
296 #ifdef  __MigPackStructs
297 #pragma pack()
298 #endif
299 
300 #ifdef  __MigPackStructs
301 #pragma pack(4)
302 #endif
303 	typedef struct {
304 		mach_msg_header_t Head;
305 		/* start of the kernel processed data */
306 		mach_msg_body_t msgh_body;
307 		mach_msg_port_descriptor_t src_task;
308 		/* end of the kernel processed data */
309 		NDR_record_t NDR;
310 		mach_vm_address_t target_address;
311 		mach_vm_size_t size;
312 		mach_vm_offset_t mask;
313 		int flags;
314 		mach_vm_address_t src_address;
315 		boolean_t copy;
316 		vm_inherit_t inheritance;
317 	} __Request__mach_vm_remap_t;
318 #ifdef  __MigPackStructs
319 #pragma pack()
320 #endif
321 
322 #ifdef  __MigPackStructs
323 #pragma pack(4)
324 #endif
325 	typedef struct {
326 		mach_msg_header_t Head;
327 		/* start of the kernel processed data */
328 		mach_msg_body_t msgh_body;
329 		/* end of the kernel processed data */
330 		NDR_record_t NDR;
331 		mach_vm_offset_t offset;
332 	} __Request__mach_vm_page_query_t;
333 #ifdef  __MigPackStructs
334 #pragma pack()
335 #endif
336 
337 #ifdef  __MigPackStructs
338 #pragma pack(4)
339 #endif
340 	typedef struct {
341 		mach_msg_header_t Head;
342 		/* start of the kernel processed data */
343 		mach_msg_body_t msgh_body;
344 		/* end of the kernel processed data */
345 		NDR_record_t NDR;
346 		mach_vm_address_t address;
347 		natural_t nesting_depth;
348 		mach_msg_type_number_t infoCnt;
349 	} __Request__mach_vm_region_recurse_t;
350 #ifdef  __MigPackStructs
351 #pragma pack()
352 #endif
353 
354 #ifdef  __MigPackStructs
355 #pragma pack(4)
356 #endif
357 	typedef struct {
358 		mach_msg_header_t Head;
359 		/* start of the kernel processed data */
360 		mach_msg_body_t msgh_body;
361 		/* end of the kernel processed data */
362 		NDR_record_t NDR;
363 		mach_vm_address_t address;
364 		vm_region_flavor_t flavor;
365 		mach_msg_type_number_t infoCnt;
366 	} __Request__mach_vm_region_t;
367 #ifdef  __MigPackStructs
368 #pragma pack()
369 #endif
370 
371 #ifdef  __MigPackStructs
372 #pragma pack(4)
373 #endif
374 	typedef struct {
375 		mach_msg_header_t Head;
376 		/* start of the kernel processed data */
377 		mach_msg_body_t msgh_body;
378 		mach_msg_port_descriptor_t parent_handle;
379 		/* end of the kernel processed data */
380 		NDR_record_t NDR;
381 		memory_object_size_t size;
382 		memory_object_offset_t offset;
383 		vm_prot_t permission;
384 	} __Request___mach_make_memory_entry_t;
385 #ifdef  __MigPackStructs
386 #pragma pack()
387 #endif
388 
389 #ifdef  __MigPackStructs
390 #pragma pack(4)
391 #endif
392 	typedef struct {
393 		mach_msg_header_t Head;
394 		/* start of the kernel processed data */
395 		mach_msg_body_t msgh_body;
396 		/* end of the kernel processed data */
397 		NDR_record_t NDR;
398 		mach_vm_address_t address;
399 		vm_purgable_t control;
400 		int state;
401 	} __Request__mach_vm_purgable_control_t;
402 #ifdef  __MigPackStructs
403 #pragma pack()
404 #endif
405 
406 #ifdef  __MigPackStructs
407 #pragma pack(4)
408 #endif
409 	typedef struct {
410 		mach_msg_header_t Head;
411 		/* start of the kernel processed data */
412 		mach_msg_body_t msgh_body;
413 		/* end of the kernel processed data */
414 		NDR_record_t NDR;
415 		mach_vm_address_t address;
416 		vm_page_info_flavor_t flavor;
417 		mach_msg_type_number_t infoCnt;
418 	} __Request__mach_vm_page_info_t;
419 #ifdef  __MigPackStructs
420 #pragma pack()
421 #endif
422 #endif /* !__Request__mach_vm_subsystem__defined */
423 
424 /* typedefs for all replies */
425 
426 #ifndef __Reply__mach_vm_subsystem__defined
427 #define __Reply__mach_vm_subsystem__defined
428 
429 #ifdef  __MigPackStructs
430 #pragma pack(4)
431 #endif
432 	typedef struct {
433 		mach_msg_header_t Head;
434 		NDR_record_t NDR;
435 		kern_return_t RetCode;
436 	} __Reply__mach_vm_protect_t;
437 #ifdef  __MigPackStructs
438 #pragma pack()
439 #endif
440 
441 #ifdef  __MigPackStructs
442 #pragma pack(4)
443 #endif
444 	typedef struct {
445 		mach_msg_header_t Head;
446 		NDR_record_t NDR;
447 		kern_return_t RetCode;
448 	} __Reply__mach_vm_inherit_t;
449 #ifdef  __MigPackStructs
450 #pragma pack()
451 #endif
452 
453 #ifdef  __MigPackStructs
454 #pragma pack(4)
455 #endif
456 	typedef struct {
457 		mach_msg_header_t Head;
458 		/* start of the kernel processed data */
459 		mach_msg_body_t msgh_body;
460 		mach_msg_ool_descriptor_t data;
461 		/* end of the kernel processed data */
462 		NDR_record_t NDR;
463 		mach_msg_type_number_t dataCnt;
464 	} __Reply__mach_vm_read_t;
465 #ifdef  __MigPackStructs
466 #pragma pack()
467 #endif
468 
469 #ifdef  __MigPackStructs
470 #pragma pack(4)
471 #endif
472 	typedef struct {
473 		mach_msg_header_t Head;
474 		NDR_record_t NDR;
475 		kern_return_t RetCode;
476 		mach_vm_read_entry_t data_list;
477 	} __Reply__mach_vm_read_list_t;
478 #ifdef  __MigPackStructs
479 #pragma pack()
480 #endif
481 
482 #ifdef  __MigPackStructs
483 #pragma pack(4)
484 #endif
485 	typedef struct {
486 		mach_msg_header_t Head;
487 		NDR_record_t NDR;
488 		kern_return_t RetCode;
489 	} __Reply__mach_vm_write_t;
490 #ifdef  __MigPackStructs
491 #pragma pack()
492 #endif
493 
494 #ifdef  __MigPackStructs
495 #pragma pack(4)
496 #endif
497 	typedef struct {
498 		mach_msg_header_t Head;
499 		NDR_record_t NDR;
500 		kern_return_t RetCode;
501 	} __Reply__mach_vm_copy_t;
502 #ifdef  __MigPackStructs
503 #pragma pack()
504 #endif
505 
506 #ifdef  __MigPackStructs
507 #pragma pack(4)
508 #endif
509 	typedef struct {
510 		mach_msg_header_t Head;
511 		NDR_record_t NDR;
512 		kern_return_t RetCode;
513 		mach_vm_size_t outsize;
514 	} __Reply__mach_vm_read_overwrite_t;
515 #ifdef  __MigPackStructs
516 #pragma pack()
517 #endif
518 
519 #ifdef  __MigPackStructs
520 #pragma pack(4)
521 #endif
522 	typedef struct {
523 		mach_msg_header_t Head;
524 		NDR_record_t NDR;
525 		kern_return_t RetCode;
526 	} __Reply__mach_vm_msync_t;
527 #ifdef  __MigPackStructs
528 #pragma pack()
529 #endif
530 
531 #ifdef  __MigPackStructs
532 #pragma pack(4)
533 #endif
534 	typedef struct {
535 		mach_msg_header_t Head;
536 		NDR_record_t NDR;
537 		kern_return_t RetCode;
538 	} __Reply__mach_vm_behavior_set_t;
539 #ifdef  __MigPackStructs
540 #pragma pack()
541 #endif
542 
543 #ifdef  __MigPackStructs
544 #pragma pack(4)
545 #endif
546 	typedef struct {
547 		mach_msg_header_t Head;
548 		NDR_record_t NDR;
549 		kern_return_t RetCode;
550 		vm_machine_attribute_val_t value;
551 	} __Reply__mach_vm_machine_attribute_t;
552 #ifdef  __MigPackStructs
553 #pragma pack()
554 #endif
555 
556 #ifdef  __MigPackStructs
557 #pragma pack(4)
558 #endif
559 	typedef struct {
560 		mach_msg_header_t Head;
561 		NDR_record_t NDR;
562 		kern_return_t RetCode;
563 		mach_vm_address_t target_address;
564 		vm_prot_t cur_protection;
565 		vm_prot_t max_protection;
566 	} __Reply__mach_vm_remap_t;
567 #ifdef  __MigPackStructs
568 #pragma pack()
569 #endif
570 
571 #ifdef  __MigPackStructs
572 #pragma pack(4)
573 #endif
574 	typedef struct {
575 		mach_msg_header_t Head;
576 		NDR_record_t NDR;
577 		kern_return_t RetCode;
578 		integer_t disposition;
579 		integer_t ref_count;
580 	} __Reply__mach_vm_page_query_t;
581 #ifdef  __MigPackStructs
582 #pragma pack()
583 #endif
584 
585 #ifdef  __MigPackStructs
586 #pragma pack(4)
587 #endif
588 	typedef struct {
589 		mach_msg_header_t Head;
590 		NDR_record_t NDR;
591 		kern_return_t RetCode;
592 		mach_vm_address_t address;
593 		mach_vm_size_t size;
594 		natural_t nesting_depth;
595 		mach_msg_type_number_t infoCnt;
596 		int info[19];
597 	} __Reply__mach_vm_region_recurse_t;
598 #ifdef  __MigPackStructs
599 #pragma pack()
600 #endif
601 
602 #ifdef  __MigPackStructs
603 #pragma pack(4)
604 #endif
605 	typedef struct {
606 		mach_msg_header_t Head;
607 		/* start of the kernel processed data */
608 		mach_msg_body_t msgh_body;
609 		mach_msg_port_descriptor_t object_name;
610 		/* end of the kernel processed data */
611 		NDR_record_t NDR;
612 		mach_vm_address_t address;
613 		mach_vm_size_t size;
614 		mach_msg_type_number_t infoCnt;
615 		int info[10];
616 	} __Reply__mach_vm_region_t;
617 #ifdef  __MigPackStructs
618 #pragma pack()
619 #endif
620 
621 #ifdef  __MigPackStructs
622 #pragma pack(4)
623 #endif
624 	typedef struct {
625 		mach_msg_header_t Head;
626 		/* start of the kernel processed data */
627 		mach_msg_body_t msgh_body;
628 		mach_msg_port_descriptor_t object_handle;
629 		/* end of the kernel processed data */
630 		NDR_record_t NDR;
631 		memory_object_size_t size;
632 	} __Reply___mach_make_memory_entry_t;
633 #ifdef  __MigPackStructs
634 #pragma pack()
635 #endif
636 
637 #ifdef  __MigPackStructs
638 #pragma pack(4)
639 #endif
640 	typedef struct {
641 		mach_msg_header_t Head;
642 		NDR_record_t NDR;
643 		kern_return_t RetCode;
644 		int state;
645 	} __Reply__mach_vm_purgable_control_t;
646 #ifdef  __MigPackStructs
647 #pragma pack()
648 #endif
649 
650 #ifdef  __MigPackStructs
651 #pragma pack(4)
652 #endif
653 	typedef struct {
654 		mach_msg_header_t Head;
655 		NDR_record_t NDR;
656 		kern_return_t RetCode;
657 		mach_msg_type_number_t infoCnt;
658 		int info[32];
659 	} __Reply__mach_vm_page_info_t;
660 #ifdef  __MigPackStructs
661 #pragma pack()
662 #endif
663 #endif /* !__Reply__mach_vm_subsystem__defined */
664 
665 
666 /* union of all replies */
667 
668 #ifndef __ReplyUnion__mach_vm_subsystem__defined
669 #define __ReplyUnion__mach_vm_subsystem__defined
670 union __ReplyUnion__mach_vm_subsystem {
671 	__Reply__mach_vm_protect_t Reply_mach_vm_protect;
672 	__Reply__mach_vm_inherit_t Reply_mach_vm_inherit;
673 	__Reply__mach_vm_read_t Reply_mach_vm_read;
674 	__Reply__mach_vm_read_list_t Reply_mach_vm_read_list;
675 	__Reply__mach_vm_write_t Reply_mach_vm_write;
676 	__Reply__mach_vm_copy_t Reply_mach_vm_copy;
677 	__Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite;
678 	__Reply__mach_vm_msync_t Reply_mach_vm_msync;
679 	__Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set;
680 	__Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute;
681 	__Reply__mach_vm_remap_t Reply_mach_vm_remap;
682 	__Reply__mach_vm_page_query_t Reply_mach_vm_page_query;
683 	__Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse;
684 	__Reply__mach_vm_region_t Reply_mach_vm_region;
685 	__Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry;
686 	__Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control;
687 	__Reply__mach_vm_page_info_t Reply_mach_vm_page_info;
688 };
689 #endif /* __RequestUnion__mach_vm_subsystem__defined */
690 /* Forward Declarations */
691 
692 
693 mig_internal novalue _Xmach_vm_protect
694 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
695 
696 mig_internal novalue _Xmach_vm_inherit
697 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
698 
699 mig_internal novalue _Xmach_vm_read
700 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
701 
702 mig_internal novalue _Xmach_vm_read_list
703 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
704 
705 mig_internal novalue _Xmach_vm_write
706 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
707 
708 mig_internal novalue _Xmach_vm_copy
709 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
710 
711 mig_internal novalue _Xmach_vm_read_overwrite
712 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
713 
714 mig_internal novalue _Xmach_vm_msync
715 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
716 
717 mig_internal novalue _Xmach_vm_behavior_set
718 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
719 
720 mig_internal novalue _Xmach_vm_machine_attribute
721 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
722 
723 mig_internal novalue _Xmach_vm_remap
724 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
725 
726 mig_internal novalue _Xmach_vm_page_query
727 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
728 
729 mig_internal novalue _Xmach_vm_region_recurse
730 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
731 
732 mig_internal novalue _Xmach_vm_region
733 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
734 
735 mig_internal novalue _X_mach_make_memory_entry
736 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
737 
738 mig_internal novalue _Xmach_vm_purgable_control
739 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
740 
741 mig_internal novalue _Xmach_vm_page_info
742 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP);
743 
744 
745 #if ( __MigTypeCheck )
746 #if __MIG_check__Request__mach_vm_subsystem__
747 #if !defined(__MIG_check__Request__mach_vm_protect_t__defined)
748 #define __MIG_check__Request__mach_vm_protect_t__defined
749 
__MIG_check__Request__mach_vm_protect_t(__Request__mach_vm_protect_t * In0P)750 mig_internal kern_return_t __MIG_check__Request__mach_vm_protect_t(__attribute__((__unused__)) __Request__mach_vm_protect_t *In0P)
751 {
752 
753 	typedef __Request__mach_vm_protect_t __Request;
754 #if	__MigTypeCheck
755 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
756 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
757 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
758 		return MIG_BAD_ARGUMENTS;
759 #endif	/* __MigTypeCheck */
760 
761 	return MACH_MSG_SUCCESS;
762 }
763 #endif /* !defined(__MIG_check__Request__mach_vm_protect_t__defined) */
764 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
765 #endif /* ( __MigTypeCheck ) */
766 
767 
768 /* Routine mach_vm_protect */
769 #ifdef	mig_external
770 mig_external
771 #else
772 extern
773 #endif	/* mig_external */
mach_vm_protect(target_task,address,size,set_maximum,new_protection)774 kern_return_t mach_vm_protect
775 #if	defined(LINTLIBRARY)
776     (target_task, address, size, set_maximum, new_protection)
777 	vm_map_t target_task;
778 	mach_vm_address_t address;
779 	mach_vm_size_t size;
780 	boolean_t set_maximum;
781 	vm_prot_t new_protection;
782 { return mach_vm_protect(target_task, address, size, set_maximum, new_protection); }
783 #else
784 (
785 	vm_map_t target_task,
786 	mach_vm_address_t address,
787 	mach_vm_size_t size,
788 	boolean_t set_maximum,
789 	vm_prot_t new_protection
790 );
791 #endif	/* defined(LINTLIBRARY) */
792 
793 /* Routine mach_vm_protect */
_Xmach_vm_protect(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)794 mig_internal novalue _Xmach_vm_protect
795 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
796 {
797 
798 #ifdef  __MigPackStructs
799 #pragma pack(4)
800 #endif
801 	typedef struct {
802 		mach_msg_header_t Head;
803 		/* start of the kernel processed data */
804 		mach_msg_body_t msgh_body;
805 		/* end of the kernel processed data */
806 		NDR_record_t NDR;
807 		mach_vm_address_t address;
808 		mach_vm_size_t size;
809 		boolean_t set_maximum;
810 		vm_prot_t new_protection;
811 		mach_msg_trailer_t trailer;
812 	} Request;
813 #ifdef  __MigPackStructs
814 #pragma pack()
815 #endif
816 	typedef __Request__mach_vm_protect_t __Request;
817 	typedef __Reply__mach_vm_protect_t Reply;
818 
819 	/*
820 	 * typedef struct {
821 	 * 	mach_msg_header_t Head;
822 	 * 	NDR_record_t NDR;
823 	 * 	kern_return_t RetCode;
824 	 * } mig_reply_error_t;
825 	 */
826 
827 	Request *In0P = (Request *) InHeadP;
828 	Reply *OutP = (Reply *) OutHeadP;
829 #ifdef	__MIG_check__Request__mach_vm_protect_t__defined
830 	kern_return_t check_result;
831 #endif	/* __MIG_check__Request__mach_vm_protect_t__defined */
832 
833 #if	__MigKernelSpecificCode
834 #else
835 #endif /* __MigKernelSpecificCode */
836 	vm_map_t target_task;
837 
838 	__DeclareRcvRpc(4802, "mach_vm_protect")
839 	__BeforeRcvRpc(4802, "mach_vm_protect")
840 /* RetCArg=0x0 rtSimpleRequest=0 */
841 
842 #if	defined(__MIG_check__Request__mach_vm_protect_t__defined)
843 	check_result = __MIG_check__Request__mach_vm_protect_t((__Request *)In0P);
844 	if (check_result != MACH_MSG_SUCCESS)
845 		{ MIG_RETURN_ERROR(OutP, check_result); }
846 #endif	/* defined(__MIG_check__Request__mach_vm_protect_t__defined) */
847 
848 	target_task = convert_port_entry_to_map(In0P->Head.msgh_request_port);
849 
850 	OutP->RetCode = mach_vm_protect(target_task, In0P->address, In0P->size, In0P->set_maximum, In0P->new_protection);
851 	vm_map_deallocate(target_task);
852 #if	__MigKernelSpecificCode
853 #endif /* __MigKernelSpecificCode */
854 
855 	OutP->NDR = NDR_record;
856 
857 
858 	__AfterRcvRpc(4802, "mach_vm_protect")
859 }
860 
861 #if ( __MigTypeCheck )
862 #if __MIG_check__Request__mach_vm_subsystem__
863 #if !defined(__MIG_check__Request__mach_vm_inherit_t__defined)
864 #define __MIG_check__Request__mach_vm_inherit_t__defined
865 
__MIG_check__Request__mach_vm_inherit_t(__Request__mach_vm_inherit_t * In0P)866 mig_internal kern_return_t __MIG_check__Request__mach_vm_inherit_t(__attribute__((__unused__)) __Request__mach_vm_inherit_t *In0P)
867 {
868 
869 	typedef __Request__mach_vm_inherit_t __Request;
870 #if	__MigTypeCheck
871 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
872 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
873 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
874 		return MIG_BAD_ARGUMENTS;
875 #endif	/* __MigTypeCheck */
876 
877 	return MACH_MSG_SUCCESS;
878 }
879 #endif /* !defined(__MIG_check__Request__mach_vm_inherit_t__defined) */
880 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
881 #endif /* ( __MigTypeCheck ) */
882 
883 
884 /* Routine mach_vm_inherit */
885 #ifdef	mig_external
886 mig_external
887 #else
888 extern
889 #endif	/* mig_external */
mach_vm_inherit(target_task,address,size,new_inheritance)890 kern_return_t mach_vm_inherit
891 #if	defined(LINTLIBRARY)
892     (target_task, address, size, new_inheritance)
893 	vm_map_t target_task;
894 	mach_vm_address_t address;
895 	mach_vm_size_t size;
896 	vm_inherit_t new_inheritance;
897 { return mach_vm_inherit(target_task, address, size, new_inheritance); }
898 #else
899 (
900 	vm_map_t target_task,
901 	mach_vm_address_t address,
902 	mach_vm_size_t size,
903 	vm_inherit_t new_inheritance
904 );
905 #endif	/* defined(LINTLIBRARY) */
906 
907 /* Routine mach_vm_inherit */
_Xmach_vm_inherit(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)908 mig_internal novalue _Xmach_vm_inherit
909 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
910 {
911 
912 #ifdef  __MigPackStructs
913 #pragma pack(4)
914 #endif
915 	typedef struct {
916 		mach_msg_header_t Head;
917 		/* start of the kernel processed data */
918 		mach_msg_body_t msgh_body;
919 		/* end of the kernel processed data */
920 		NDR_record_t NDR;
921 		mach_vm_address_t address;
922 		mach_vm_size_t size;
923 		vm_inherit_t new_inheritance;
924 		mach_msg_trailer_t trailer;
925 	} Request;
926 #ifdef  __MigPackStructs
927 #pragma pack()
928 #endif
929 	typedef __Request__mach_vm_inherit_t __Request;
930 	typedef __Reply__mach_vm_inherit_t Reply;
931 
932 	/*
933 	 * typedef struct {
934 	 * 	mach_msg_header_t Head;
935 	 * 	NDR_record_t NDR;
936 	 * 	kern_return_t RetCode;
937 	 * } mig_reply_error_t;
938 	 */
939 
940 	Request *In0P = (Request *) InHeadP;
941 	Reply *OutP = (Reply *) OutHeadP;
942 #ifdef	__MIG_check__Request__mach_vm_inherit_t__defined
943 	kern_return_t check_result;
944 #endif	/* __MIG_check__Request__mach_vm_inherit_t__defined */
945 
946 #if	__MigKernelSpecificCode
947 #else
948 #endif /* __MigKernelSpecificCode */
949 	vm_map_t target_task;
950 
951 	__DeclareRcvRpc(4803, "mach_vm_inherit")
952 	__BeforeRcvRpc(4803, "mach_vm_inherit")
953 /* RetCArg=0x0 rtSimpleRequest=0 */
954 
955 #if	defined(__MIG_check__Request__mach_vm_inherit_t__defined)
956 	check_result = __MIG_check__Request__mach_vm_inherit_t((__Request *)In0P);
957 	if (check_result != MACH_MSG_SUCCESS)
958 		{ MIG_RETURN_ERROR(OutP, check_result); }
959 #endif	/* defined(__MIG_check__Request__mach_vm_inherit_t__defined) */
960 
961 	target_task = convert_port_entry_to_map(In0P->Head.msgh_request_port);
962 
963 	OutP->RetCode = mach_vm_inherit(target_task, In0P->address, In0P->size, In0P->new_inheritance);
964 	vm_map_deallocate(target_task);
965 #if	__MigKernelSpecificCode
966 #endif /* __MigKernelSpecificCode */
967 
968 	OutP->NDR = NDR_record;
969 
970 
971 	__AfterRcvRpc(4803, "mach_vm_inherit")
972 }
973 
974 #if ( __MigTypeCheck )
975 #if __MIG_check__Request__mach_vm_subsystem__
976 #if !defined(__MIG_check__Request__mach_vm_read_t__defined)
977 #define __MIG_check__Request__mach_vm_read_t__defined
978 
__MIG_check__Request__mach_vm_read_t(__Request__mach_vm_read_t * In0P)979 mig_internal kern_return_t __MIG_check__Request__mach_vm_read_t(__attribute__((__unused__)) __Request__mach_vm_read_t *In0P)
980 {
981 
982 	typedef __Request__mach_vm_read_t __Request;
983 #if	__MigTypeCheck
984 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
985 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
986 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
987 		return MIG_BAD_ARGUMENTS;
988 #endif	/* __MigTypeCheck */
989 
990 	return MACH_MSG_SUCCESS;
991 }
992 #endif /* !defined(__MIG_check__Request__mach_vm_read_t__defined) */
993 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
994 #endif /* ( __MigTypeCheck ) */
995 
996 
997 /* Routine mach_vm_read */
998 #ifdef	mig_external
999 mig_external
1000 #else
1001 extern
1002 #endif	/* mig_external */
mach_vm_read(target_task,address,size,data,dataCnt)1003 kern_return_t mach_vm_read
1004 #if	defined(LINTLIBRARY)
1005     (target_task, address, size, data, dataCnt)
1006 	vm_map_t target_task;
1007 	mach_vm_address_t address;
1008 	mach_vm_size_t size;
1009 	vm_offset_t *data;
1010 	mach_msg_type_number_t *dataCnt;
1011 { return mach_vm_read(target_task, address, size, data, dataCnt); }
1012 #else
1013 (
1014 	vm_map_t target_task,
1015 	mach_vm_address_t address,
1016 	mach_vm_size_t size,
1017 	vm_offset_t *data,
1018 	mach_msg_type_number_t *dataCnt
1019 );
1020 #endif	/* defined(LINTLIBRARY) */
1021 
1022 /* Routine mach_vm_read */
_Xmach_vm_read(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1023 mig_internal novalue _Xmach_vm_read
1024 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1025 {
1026 
1027 #ifdef  __MigPackStructs
1028 #pragma pack(4)
1029 #endif
1030 	typedef struct {
1031 		mach_msg_header_t Head;
1032 		/* start of the kernel processed data */
1033 		mach_msg_body_t msgh_body;
1034 		/* end of the kernel processed data */
1035 		NDR_record_t NDR;
1036 		mach_vm_address_t address;
1037 		mach_vm_size_t size;
1038 		mach_msg_trailer_t trailer;
1039 	} Request;
1040 #ifdef  __MigPackStructs
1041 #pragma pack()
1042 #endif
1043 	typedef __Request__mach_vm_read_t __Request;
1044 	typedef __Reply__mach_vm_read_t Reply;
1045 
1046 	/*
1047 	 * typedef struct {
1048 	 * 	mach_msg_header_t Head;
1049 	 * 	NDR_record_t NDR;
1050 	 * 	kern_return_t RetCode;
1051 	 * } mig_reply_error_t;
1052 	 */
1053 
1054 	Request *In0P = (Request *) InHeadP;
1055 	Reply *OutP = (Reply *) OutHeadP;
1056 #ifdef	__MIG_check__Request__mach_vm_read_t__defined
1057 	kern_return_t check_result;
1058 #endif	/* __MIG_check__Request__mach_vm_read_t__defined */
1059 
1060 #if	__MigKernelSpecificCode
1061 #if	UseStaticTemplates
1062 	const static mach_msg_ool_descriptor_t dataTemplate = {
1063 		.address = (void *)0,
1064 		.size = 0,
1065 		.deallocate = FALSE,
1066 		.copy = MACH_MSG_VIRTUAL_COPY,
1067 		.type = MACH_MSG_OOL_DESCRIPTOR,
1068 	};
1069 #endif	/* UseStaticTemplates */
1070 
1071 #else
1072 #if	UseStaticTemplates
1073 	const static mach_msg_ool_descriptor_t dataTemplate = {
1074 		.address = (void *)0,
1075 		.size = 0,
1076 		.deallocate = FALSE,
1077 		.copy = MACH_MSG_VIRTUAL_COPY,
1078 		.type = MACH_MSG_OOL_DESCRIPTOR,
1079 	};
1080 #endif	/* UseStaticTemplates */
1081 
1082 #endif /* __MigKernelSpecificCode */
1083 	kern_return_t RetCode;
1084 	vm_map_t target_task;
1085 
1086 	__DeclareRcvRpc(4804, "mach_vm_read")
1087 	__BeforeRcvRpc(4804, "mach_vm_read")
1088 /* RetCArg=0x0 rtSimpleRequest=0 */
1089 
1090 #if	defined(__MIG_check__Request__mach_vm_read_t__defined)
1091 	check_result = __MIG_check__Request__mach_vm_read_t((__Request *)In0P);
1092 	if (check_result != MACH_MSG_SUCCESS)
1093 		{ MIG_RETURN_ERROR(OutP, check_result); }
1094 #endif	/* defined(__MIG_check__Request__mach_vm_read_t__defined) */
1095 
1096 #if	UseStaticTemplates
1097 	OutP->data = dataTemplate;
1098 #else	/* UseStaticTemplates */
1099 	OutP->data.deallocate =  FALSE;
1100 	OutP->data.copy = MACH_MSG_VIRTUAL_COPY;
1101 	OutP->data.type = MACH_MSG_OOL_DESCRIPTOR;
1102 #endif	/* UseStaticTemplates */
1103 
1104 
1105 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1106 
1107 	RetCode = mach_vm_read(target_task, In0P->address, In0P->size, (vm_offset_t *)&(OutP->data.address), &OutP->dataCnt);
1108 	vm_map_deallocate(target_task);
1109 	if (RetCode != KERN_SUCCESS) {
1110 		MIG_RETURN_ERROR(OutP, RetCode);
1111 	}
1112 #if	__MigKernelSpecificCode
1113 #endif /* __MigKernelSpecificCode */
1114 	OutP->data.size = OutP->dataCnt;
1115 
1116 
1117 	OutP->NDR = NDR_record;
1118 
1119 
1120 	OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
1121 	OutP->Head.msgh_size = (sizeof(Reply));
1122 	OutP->msgh_body.msgh_descriptor_count = 1;
1123 	__AfterRcvRpc(4804, "mach_vm_read")
1124 }
1125 
1126 #if ( __MigTypeCheck )
1127 #if __MIG_check__Request__mach_vm_subsystem__
1128 #if !defined(__MIG_check__Request__mach_vm_read_list_t__defined)
1129 #define __MIG_check__Request__mach_vm_read_list_t__defined
1130 
__MIG_check__Request__mach_vm_read_list_t(__Request__mach_vm_read_list_t * In0P)1131 mig_internal kern_return_t __MIG_check__Request__mach_vm_read_list_t(__attribute__((__unused__)) __Request__mach_vm_read_list_t *In0P)
1132 {
1133 
1134 	typedef __Request__mach_vm_read_list_t __Request;
1135 #if	__MigTypeCheck
1136 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1137 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1138 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1139 		return MIG_BAD_ARGUMENTS;
1140 #endif	/* __MigTypeCheck */
1141 
1142 	return MACH_MSG_SUCCESS;
1143 }
1144 #endif /* !defined(__MIG_check__Request__mach_vm_read_list_t__defined) */
1145 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1146 #endif /* ( __MigTypeCheck ) */
1147 
1148 
1149 /* Routine mach_vm_read_list */
1150 #ifdef	mig_external
1151 mig_external
1152 #else
1153 extern
1154 #endif	/* mig_external */
mach_vm_read_list(target_task,data_list,count)1155 kern_return_t mach_vm_read_list
1156 #if	defined(LINTLIBRARY)
1157     (target_task, data_list, count)
1158 	vm_map_t target_task;
1159 	mach_vm_read_entry_t data_list;
1160 	natural_t count;
1161 { return mach_vm_read_list(target_task, data_list, count); }
1162 #else
1163 (
1164 	vm_map_t target_task,
1165 	mach_vm_read_entry_t data_list,
1166 	natural_t count
1167 );
1168 #endif	/* defined(LINTLIBRARY) */
1169 
1170 /* Routine mach_vm_read_list */
_Xmach_vm_read_list(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1171 mig_internal novalue _Xmach_vm_read_list
1172 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1173 {
1174 
1175 #ifdef  __MigPackStructs
1176 #pragma pack(4)
1177 #endif
1178 	typedef struct {
1179 		mach_msg_header_t Head;
1180 		/* start of the kernel processed data */
1181 		mach_msg_body_t msgh_body;
1182 		/* end of the kernel processed data */
1183 		NDR_record_t NDR;
1184 		mach_vm_read_entry_t data_list;
1185 		natural_t count;
1186 		mach_msg_trailer_t trailer;
1187 	} Request;
1188 #ifdef  __MigPackStructs
1189 #pragma pack()
1190 #endif
1191 	typedef __Request__mach_vm_read_list_t __Request;
1192 	typedef __Reply__mach_vm_read_list_t Reply;
1193 
1194 	/*
1195 	 * typedef struct {
1196 	 * 	mach_msg_header_t Head;
1197 	 * 	NDR_record_t NDR;
1198 	 * 	kern_return_t RetCode;
1199 	 * } mig_reply_error_t;
1200 	 */
1201 
1202 	Request *In0P = (Request *) InHeadP;
1203 	Reply *OutP = (Reply *) OutHeadP;
1204 #ifdef	__MIG_check__Request__mach_vm_read_list_t__defined
1205 	kern_return_t check_result;
1206 #endif	/* __MIG_check__Request__mach_vm_read_list_t__defined */
1207 
1208 #if	__MigKernelSpecificCode
1209 #else
1210 #endif /* __MigKernelSpecificCode */
1211 	vm_map_t target_task;
1212 
1213 	__DeclareRcvRpc(4805, "mach_vm_read_list")
1214 	__BeforeRcvRpc(4805, "mach_vm_read_list")
1215 /* RetCArg=0x0 rtSimpleRequest=0 */
1216 
1217 #if	defined(__MIG_check__Request__mach_vm_read_list_t__defined)
1218 	check_result = __MIG_check__Request__mach_vm_read_list_t((__Request *)In0P);
1219 	if (check_result != MACH_MSG_SUCCESS)
1220 		{ MIG_RETURN_ERROR(OutP, check_result); }
1221 #endif	/* defined(__MIG_check__Request__mach_vm_read_list_t__defined) */
1222 
1223 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1224 
1225 	OutP->RetCode = mach_vm_read_list(target_task, In0P->data_list, In0P->count);
1226 	vm_map_deallocate(target_task);
1227 	if (OutP->RetCode != KERN_SUCCESS) {
1228 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
1229 	}
1230 #if	__MigKernelSpecificCode
1231 #endif /* __MigKernelSpecificCode */
1232 
1233 	OutP->NDR = NDR_record;
1234 
1235 
1236 	{   typedef struct { char data[4096]; } *sp;
1237 	    * (sp) OutP->data_list = * (sp) In0P->data_list;
1238 	}
1239 
1240 	OutP->Head.msgh_size = (sizeof(Reply));
1241 	__AfterRcvRpc(4805, "mach_vm_read_list")
1242 }
1243 
1244 #if ( __MigTypeCheck )
1245 #if __MIG_check__Request__mach_vm_subsystem__
1246 #if !defined(__MIG_check__Request__mach_vm_write_t__defined)
1247 #define __MIG_check__Request__mach_vm_write_t__defined
1248 
__MIG_check__Request__mach_vm_write_t(__Request__mach_vm_write_t * In0P)1249 mig_internal kern_return_t __MIG_check__Request__mach_vm_write_t(__attribute__((__unused__)) __Request__mach_vm_write_t *In0P)
1250 {
1251 
1252 	typedef __Request__mach_vm_write_t __Request;
1253 #if	__MigTypeCheck
1254 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1255 	    (In0P->msgh_body.msgh_descriptor_count != 1) ||
1256 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1257 		return MIG_BAD_ARGUMENTS;
1258 #endif	/* __MigTypeCheck */
1259 
1260 #if	__MigTypeCheck
1261 	if (In0P->data.type != MACH_MSG_OOL_DESCRIPTOR)
1262 		return MIG_TYPE_ERROR;
1263 #endif	/* __MigTypeCheck */
1264 
1265 #if __MigTypeCheck
1266 	if (In0P->data.size != In0P->dataCnt)
1267 		return MIG_TYPE_ERROR;
1268 #endif	/* __MigTypeCheck */
1269 
1270 	return MACH_MSG_SUCCESS;
1271 }
1272 #endif /* !defined(__MIG_check__Request__mach_vm_write_t__defined) */
1273 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1274 #endif /* ( __MigTypeCheck ) */
1275 
1276 
1277 /* Routine mach_vm_write */
1278 #ifdef	mig_external
1279 mig_external
1280 #else
1281 extern
1282 #endif	/* mig_external */
mach_vm_write(target_task,address,data,dataCnt)1283 kern_return_t mach_vm_write
1284 #if	defined(LINTLIBRARY)
1285     (target_task, address, data, dataCnt)
1286 	vm_map_t target_task;
1287 	mach_vm_address_t address;
1288 	vm_offset_t data;
1289 	mach_msg_type_number_t dataCnt;
1290 { return mach_vm_write(target_task, address, data, dataCnt); }
1291 #else
1292 (
1293 	vm_map_t target_task,
1294 	mach_vm_address_t address,
1295 	vm_offset_t data,
1296 	mach_msg_type_number_t dataCnt
1297 );
1298 #endif	/* defined(LINTLIBRARY) */
1299 
1300 /* Routine mach_vm_write */
_Xmach_vm_write(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1301 mig_internal novalue _Xmach_vm_write
1302 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1303 {
1304 
1305 #ifdef  __MigPackStructs
1306 #pragma pack(4)
1307 #endif
1308 	typedef struct {
1309 		mach_msg_header_t Head;
1310 		/* start of the kernel processed data */
1311 		mach_msg_body_t msgh_body;
1312 		mach_msg_ool_descriptor_t data;
1313 		/* end of the kernel processed data */
1314 		NDR_record_t NDR;
1315 		mach_vm_address_t address;
1316 		mach_msg_type_number_t dataCnt;
1317 		mach_msg_trailer_t trailer;
1318 	} Request;
1319 #ifdef  __MigPackStructs
1320 #pragma pack()
1321 #endif
1322 	typedef __Request__mach_vm_write_t __Request;
1323 	typedef __Reply__mach_vm_write_t Reply;
1324 
1325 	/*
1326 	 * typedef struct {
1327 	 * 	mach_msg_header_t Head;
1328 	 * 	NDR_record_t NDR;
1329 	 * 	kern_return_t RetCode;
1330 	 * } mig_reply_error_t;
1331 	 */
1332 
1333 	Request *In0P = (Request *) InHeadP;
1334 	Reply *OutP = (Reply *) OutHeadP;
1335 #ifdef	__MIG_check__Request__mach_vm_write_t__defined
1336 	kern_return_t check_result;
1337 #endif	/* __MIG_check__Request__mach_vm_write_t__defined */
1338 
1339 #if	__MigKernelSpecificCode
1340 #else
1341 #endif /* __MigKernelSpecificCode */
1342 	vm_map_t target_task;
1343 
1344 	__DeclareRcvRpc(4806, "mach_vm_write")
1345 	__BeforeRcvRpc(4806, "mach_vm_write")
1346 /* RetCArg=0x0 rtSimpleRequest=0 */
1347 
1348 #if	defined(__MIG_check__Request__mach_vm_write_t__defined)
1349 	check_result = __MIG_check__Request__mach_vm_write_t((__Request *)In0P);
1350 	if (check_result != MACH_MSG_SUCCESS)
1351 		{ MIG_RETURN_ERROR(OutP, check_result); }
1352 #endif	/* defined(__MIG_check__Request__mach_vm_write_t__defined) */
1353 
1354 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1355 
1356 	OutP->RetCode = mach_vm_write(target_task, In0P->address, (vm_offset_t)(In0P->data.address), In0P->dataCnt);
1357 	vm_map_deallocate(target_task);
1358 #if	__MigKernelSpecificCode
1359 #endif /* __MigKernelSpecificCode */
1360 
1361 	OutP->NDR = NDR_record;
1362 
1363 
1364 	__AfterRcvRpc(4806, "mach_vm_write")
1365 }
1366 
1367 #if ( __MigTypeCheck )
1368 #if __MIG_check__Request__mach_vm_subsystem__
1369 #if !defined(__MIG_check__Request__mach_vm_copy_t__defined)
1370 #define __MIG_check__Request__mach_vm_copy_t__defined
1371 
__MIG_check__Request__mach_vm_copy_t(__Request__mach_vm_copy_t * In0P)1372 mig_internal kern_return_t __MIG_check__Request__mach_vm_copy_t(__attribute__((__unused__)) __Request__mach_vm_copy_t *In0P)
1373 {
1374 
1375 	typedef __Request__mach_vm_copy_t __Request;
1376 #if	__MigTypeCheck
1377 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1378 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1379 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1380 		return MIG_BAD_ARGUMENTS;
1381 #endif	/* __MigTypeCheck */
1382 
1383 	return MACH_MSG_SUCCESS;
1384 }
1385 #endif /* !defined(__MIG_check__Request__mach_vm_copy_t__defined) */
1386 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1387 #endif /* ( __MigTypeCheck ) */
1388 
1389 
1390 /* Routine mach_vm_copy */
1391 #ifdef	mig_external
1392 mig_external
1393 #else
1394 extern
1395 #endif	/* mig_external */
mach_vm_copy(target_task,source_address,size,dest_address)1396 kern_return_t mach_vm_copy
1397 #if	defined(LINTLIBRARY)
1398     (target_task, source_address, size, dest_address)
1399 	vm_map_t target_task;
1400 	mach_vm_address_t source_address;
1401 	mach_vm_size_t size;
1402 	mach_vm_address_t dest_address;
1403 { return mach_vm_copy(target_task, source_address, size, dest_address); }
1404 #else
1405 (
1406 	vm_map_t target_task,
1407 	mach_vm_address_t source_address,
1408 	mach_vm_size_t size,
1409 	mach_vm_address_t dest_address
1410 );
1411 #endif	/* defined(LINTLIBRARY) */
1412 
1413 /* Routine mach_vm_copy */
_Xmach_vm_copy(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1414 mig_internal novalue _Xmach_vm_copy
1415 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1416 {
1417 
1418 #ifdef  __MigPackStructs
1419 #pragma pack(4)
1420 #endif
1421 	typedef struct {
1422 		mach_msg_header_t Head;
1423 		/* start of the kernel processed data */
1424 		mach_msg_body_t msgh_body;
1425 		/* end of the kernel processed data */
1426 		NDR_record_t NDR;
1427 		mach_vm_address_t source_address;
1428 		mach_vm_size_t size;
1429 		mach_vm_address_t dest_address;
1430 		mach_msg_trailer_t trailer;
1431 	} Request;
1432 #ifdef  __MigPackStructs
1433 #pragma pack()
1434 #endif
1435 	typedef __Request__mach_vm_copy_t __Request;
1436 	typedef __Reply__mach_vm_copy_t Reply;
1437 
1438 	/*
1439 	 * typedef struct {
1440 	 * 	mach_msg_header_t Head;
1441 	 * 	NDR_record_t NDR;
1442 	 * 	kern_return_t RetCode;
1443 	 * } mig_reply_error_t;
1444 	 */
1445 
1446 	Request *In0P = (Request *) InHeadP;
1447 	Reply *OutP = (Reply *) OutHeadP;
1448 #ifdef	__MIG_check__Request__mach_vm_copy_t__defined
1449 	kern_return_t check_result;
1450 #endif	/* __MIG_check__Request__mach_vm_copy_t__defined */
1451 
1452 #if	__MigKernelSpecificCode
1453 #else
1454 #endif /* __MigKernelSpecificCode */
1455 	vm_map_t target_task;
1456 
1457 	__DeclareRcvRpc(4807, "mach_vm_copy")
1458 	__BeforeRcvRpc(4807, "mach_vm_copy")
1459 /* RetCArg=0x0 rtSimpleRequest=0 */
1460 
1461 #if	defined(__MIG_check__Request__mach_vm_copy_t__defined)
1462 	check_result = __MIG_check__Request__mach_vm_copy_t((__Request *)In0P);
1463 	if (check_result != MACH_MSG_SUCCESS)
1464 		{ MIG_RETURN_ERROR(OutP, check_result); }
1465 #endif	/* defined(__MIG_check__Request__mach_vm_copy_t__defined) */
1466 
1467 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1468 
1469 	OutP->RetCode = mach_vm_copy(target_task, In0P->source_address, In0P->size, In0P->dest_address);
1470 	vm_map_deallocate(target_task);
1471 #if	__MigKernelSpecificCode
1472 #endif /* __MigKernelSpecificCode */
1473 
1474 	OutP->NDR = NDR_record;
1475 
1476 
1477 	__AfterRcvRpc(4807, "mach_vm_copy")
1478 }
1479 
1480 #if ( __MigTypeCheck )
1481 #if __MIG_check__Request__mach_vm_subsystem__
1482 #if !defined(__MIG_check__Request__mach_vm_read_overwrite_t__defined)
1483 #define __MIG_check__Request__mach_vm_read_overwrite_t__defined
1484 
__MIG_check__Request__mach_vm_read_overwrite_t(__Request__mach_vm_read_overwrite_t * In0P)1485 mig_internal kern_return_t __MIG_check__Request__mach_vm_read_overwrite_t(__attribute__((__unused__)) __Request__mach_vm_read_overwrite_t *In0P)
1486 {
1487 
1488 	typedef __Request__mach_vm_read_overwrite_t __Request;
1489 #if	__MigTypeCheck
1490 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1491 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1492 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1493 		return MIG_BAD_ARGUMENTS;
1494 #endif	/* __MigTypeCheck */
1495 
1496 	return MACH_MSG_SUCCESS;
1497 }
1498 #endif /* !defined(__MIG_check__Request__mach_vm_read_overwrite_t__defined) */
1499 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1500 #endif /* ( __MigTypeCheck ) */
1501 
1502 
1503 /* Routine mach_vm_read_overwrite */
1504 #ifdef	mig_external
1505 mig_external
1506 #else
1507 extern
1508 #endif	/* mig_external */
mach_vm_read_overwrite(target_task,address,size,data,outsize)1509 kern_return_t mach_vm_read_overwrite
1510 #if	defined(LINTLIBRARY)
1511     (target_task, address, size, data, outsize)
1512 	vm_map_t target_task;
1513 	mach_vm_address_t address;
1514 	mach_vm_size_t size;
1515 	mach_vm_address_t data;
1516 	mach_vm_size_t *outsize;
1517 { return mach_vm_read_overwrite(target_task, address, size, data, outsize); }
1518 #else
1519 (
1520 	vm_map_t target_task,
1521 	mach_vm_address_t address,
1522 	mach_vm_size_t size,
1523 	mach_vm_address_t data,
1524 	mach_vm_size_t *outsize
1525 );
1526 #endif	/* defined(LINTLIBRARY) */
1527 
1528 /* Routine mach_vm_read_overwrite */
_Xmach_vm_read_overwrite(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1529 mig_internal novalue _Xmach_vm_read_overwrite
1530 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1531 {
1532 
1533 #ifdef  __MigPackStructs
1534 #pragma pack(4)
1535 #endif
1536 	typedef struct {
1537 		mach_msg_header_t Head;
1538 		/* start of the kernel processed data */
1539 		mach_msg_body_t msgh_body;
1540 		/* end of the kernel processed data */
1541 		NDR_record_t NDR;
1542 		mach_vm_address_t address;
1543 		mach_vm_size_t size;
1544 		mach_vm_address_t data;
1545 		mach_msg_trailer_t trailer;
1546 	} Request;
1547 #ifdef  __MigPackStructs
1548 #pragma pack()
1549 #endif
1550 	typedef __Request__mach_vm_read_overwrite_t __Request;
1551 	typedef __Reply__mach_vm_read_overwrite_t Reply;
1552 
1553 	/*
1554 	 * typedef struct {
1555 	 * 	mach_msg_header_t Head;
1556 	 * 	NDR_record_t NDR;
1557 	 * 	kern_return_t RetCode;
1558 	 * } mig_reply_error_t;
1559 	 */
1560 
1561 	Request *In0P = (Request *) InHeadP;
1562 	Reply *OutP = (Reply *) OutHeadP;
1563 #ifdef	__MIG_check__Request__mach_vm_read_overwrite_t__defined
1564 	kern_return_t check_result;
1565 #endif	/* __MIG_check__Request__mach_vm_read_overwrite_t__defined */
1566 
1567 #if	__MigKernelSpecificCode
1568 #else
1569 #endif /* __MigKernelSpecificCode */
1570 	vm_map_t target_task;
1571 
1572 	__DeclareRcvRpc(4808, "mach_vm_read_overwrite")
1573 	__BeforeRcvRpc(4808, "mach_vm_read_overwrite")
1574 /* RetCArg=0x0 rtSimpleRequest=0 */
1575 
1576 #if	defined(__MIG_check__Request__mach_vm_read_overwrite_t__defined)
1577 	check_result = __MIG_check__Request__mach_vm_read_overwrite_t((__Request *)In0P);
1578 	if (check_result != MACH_MSG_SUCCESS)
1579 		{ MIG_RETURN_ERROR(OutP, check_result); }
1580 #endif	/* defined(__MIG_check__Request__mach_vm_read_overwrite_t__defined) */
1581 
1582 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1583 
1584 	OutP->RetCode = mach_vm_read_overwrite(target_task, In0P->address, In0P->size, In0P->data, &OutP->outsize);
1585 	vm_map_deallocate(target_task);
1586 	if (OutP->RetCode != KERN_SUCCESS) {
1587 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
1588 	}
1589 #if	__MigKernelSpecificCode
1590 #endif /* __MigKernelSpecificCode */
1591 
1592 	OutP->NDR = NDR_record;
1593 
1594 
1595 	OutP->Head.msgh_size = (sizeof(Reply));
1596 	__AfterRcvRpc(4808, "mach_vm_read_overwrite")
1597 }
1598 
1599 #if ( __MigTypeCheck )
1600 #if __MIG_check__Request__mach_vm_subsystem__
1601 #if !defined(__MIG_check__Request__mach_vm_msync_t__defined)
1602 #define __MIG_check__Request__mach_vm_msync_t__defined
1603 
__MIG_check__Request__mach_vm_msync_t(__Request__mach_vm_msync_t * In0P)1604 mig_internal kern_return_t __MIG_check__Request__mach_vm_msync_t(__attribute__((__unused__)) __Request__mach_vm_msync_t *In0P)
1605 {
1606 
1607 	typedef __Request__mach_vm_msync_t __Request;
1608 #if	__MigTypeCheck
1609 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1610 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1611 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1612 		return MIG_BAD_ARGUMENTS;
1613 #endif	/* __MigTypeCheck */
1614 
1615 	return MACH_MSG_SUCCESS;
1616 }
1617 #endif /* !defined(__MIG_check__Request__mach_vm_msync_t__defined) */
1618 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1619 #endif /* ( __MigTypeCheck ) */
1620 
1621 
1622 /* Routine mach_vm_msync */
1623 #ifdef	mig_external
1624 mig_external
1625 #else
1626 extern
1627 #endif	/* mig_external */
mach_vm_msync(target_task,address,size,sync_flags)1628 kern_return_t mach_vm_msync
1629 #if	defined(LINTLIBRARY)
1630     (target_task, address, size, sync_flags)
1631 	vm_map_t target_task;
1632 	mach_vm_address_t address;
1633 	mach_vm_size_t size;
1634 	vm_sync_t sync_flags;
1635 { return mach_vm_msync(target_task, address, size, sync_flags); }
1636 #else
1637 (
1638 	vm_map_t target_task,
1639 	mach_vm_address_t address,
1640 	mach_vm_size_t size,
1641 	vm_sync_t sync_flags
1642 );
1643 #endif	/* defined(LINTLIBRARY) */
1644 
1645 /* Routine mach_vm_msync */
_Xmach_vm_msync(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1646 mig_internal novalue _Xmach_vm_msync
1647 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1648 {
1649 
1650 #ifdef  __MigPackStructs
1651 #pragma pack(4)
1652 #endif
1653 	typedef struct {
1654 		mach_msg_header_t Head;
1655 		/* start of the kernel processed data */
1656 		mach_msg_body_t msgh_body;
1657 		/* end of the kernel processed data */
1658 		NDR_record_t NDR;
1659 		mach_vm_address_t address;
1660 		mach_vm_size_t size;
1661 		vm_sync_t sync_flags;
1662 		mach_msg_trailer_t trailer;
1663 	} Request;
1664 #ifdef  __MigPackStructs
1665 #pragma pack()
1666 #endif
1667 	typedef __Request__mach_vm_msync_t __Request;
1668 	typedef __Reply__mach_vm_msync_t Reply;
1669 
1670 	/*
1671 	 * typedef struct {
1672 	 * 	mach_msg_header_t Head;
1673 	 * 	NDR_record_t NDR;
1674 	 * 	kern_return_t RetCode;
1675 	 * } mig_reply_error_t;
1676 	 */
1677 
1678 	Request *In0P = (Request *) InHeadP;
1679 	Reply *OutP = (Reply *) OutHeadP;
1680 #ifdef	__MIG_check__Request__mach_vm_msync_t__defined
1681 	kern_return_t check_result;
1682 #endif	/* __MIG_check__Request__mach_vm_msync_t__defined */
1683 
1684 #if	__MigKernelSpecificCode
1685 #else
1686 #endif /* __MigKernelSpecificCode */
1687 	vm_map_t target_task;
1688 
1689 	__DeclareRcvRpc(4809, "mach_vm_msync")
1690 	__BeforeRcvRpc(4809, "mach_vm_msync")
1691 /* RetCArg=0x0 rtSimpleRequest=0 */
1692 
1693 #if	defined(__MIG_check__Request__mach_vm_msync_t__defined)
1694 	check_result = __MIG_check__Request__mach_vm_msync_t((__Request *)In0P);
1695 	if (check_result != MACH_MSG_SUCCESS)
1696 		{ MIG_RETURN_ERROR(OutP, check_result); }
1697 #endif	/* defined(__MIG_check__Request__mach_vm_msync_t__defined) */
1698 
1699 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1700 
1701 	OutP->RetCode = mach_vm_msync(target_task, In0P->address, In0P->size, In0P->sync_flags);
1702 	vm_map_deallocate(target_task);
1703 #if	__MigKernelSpecificCode
1704 #endif /* __MigKernelSpecificCode */
1705 
1706 	OutP->NDR = NDR_record;
1707 
1708 
1709 	__AfterRcvRpc(4809, "mach_vm_msync")
1710 }
1711 
1712 #if ( __MigTypeCheck )
1713 #if __MIG_check__Request__mach_vm_subsystem__
1714 #if !defined(__MIG_check__Request__mach_vm_behavior_set_t__defined)
1715 #define __MIG_check__Request__mach_vm_behavior_set_t__defined
1716 
__MIG_check__Request__mach_vm_behavior_set_t(__Request__mach_vm_behavior_set_t * In0P)1717 mig_internal kern_return_t __MIG_check__Request__mach_vm_behavior_set_t(__attribute__((__unused__)) __Request__mach_vm_behavior_set_t *In0P)
1718 {
1719 
1720 	typedef __Request__mach_vm_behavior_set_t __Request;
1721 #if	__MigTypeCheck
1722 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1723 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1724 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1725 		return MIG_BAD_ARGUMENTS;
1726 #endif	/* __MigTypeCheck */
1727 
1728 	return MACH_MSG_SUCCESS;
1729 }
1730 #endif /* !defined(__MIG_check__Request__mach_vm_behavior_set_t__defined) */
1731 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1732 #endif /* ( __MigTypeCheck ) */
1733 
1734 
1735 /* Routine mach_vm_behavior_set */
1736 #ifdef	mig_external
1737 mig_external
1738 #else
1739 extern
1740 #endif	/* mig_external */
mach_vm_behavior_set(target_task,address,size,new_behavior)1741 kern_return_t mach_vm_behavior_set
1742 #if	defined(LINTLIBRARY)
1743     (target_task, address, size, new_behavior)
1744 	vm_map_t target_task;
1745 	mach_vm_address_t address;
1746 	mach_vm_size_t size;
1747 	vm_behavior_t new_behavior;
1748 { return mach_vm_behavior_set(target_task, address, size, new_behavior); }
1749 #else
1750 (
1751 	vm_map_t target_task,
1752 	mach_vm_address_t address,
1753 	mach_vm_size_t size,
1754 	vm_behavior_t new_behavior
1755 );
1756 #endif	/* defined(LINTLIBRARY) */
1757 
1758 /* Routine mach_vm_behavior_set */
_Xmach_vm_behavior_set(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1759 mig_internal novalue _Xmach_vm_behavior_set
1760 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1761 {
1762 
1763 #ifdef  __MigPackStructs
1764 #pragma pack(4)
1765 #endif
1766 	typedef struct {
1767 		mach_msg_header_t Head;
1768 		/* start of the kernel processed data */
1769 		mach_msg_body_t msgh_body;
1770 		/* end of the kernel processed data */
1771 		NDR_record_t NDR;
1772 		mach_vm_address_t address;
1773 		mach_vm_size_t size;
1774 		vm_behavior_t new_behavior;
1775 		mach_msg_trailer_t trailer;
1776 	} Request;
1777 #ifdef  __MigPackStructs
1778 #pragma pack()
1779 #endif
1780 	typedef __Request__mach_vm_behavior_set_t __Request;
1781 	typedef __Reply__mach_vm_behavior_set_t Reply;
1782 
1783 	/*
1784 	 * typedef struct {
1785 	 * 	mach_msg_header_t Head;
1786 	 * 	NDR_record_t NDR;
1787 	 * 	kern_return_t RetCode;
1788 	 * } mig_reply_error_t;
1789 	 */
1790 
1791 	Request *In0P = (Request *) InHeadP;
1792 	Reply *OutP = (Reply *) OutHeadP;
1793 #ifdef	__MIG_check__Request__mach_vm_behavior_set_t__defined
1794 	kern_return_t check_result;
1795 #endif	/* __MIG_check__Request__mach_vm_behavior_set_t__defined */
1796 
1797 #if	__MigKernelSpecificCode
1798 #else
1799 #endif /* __MigKernelSpecificCode */
1800 	vm_map_t target_task;
1801 
1802 	__DeclareRcvRpc(4810, "mach_vm_behavior_set")
1803 	__BeforeRcvRpc(4810, "mach_vm_behavior_set")
1804 /* RetCArg=0x0 rtSimpleRequest=0 */
1805 
1806 #if	defined(__MIG_check__Request__mach_vm_behavior_set_t__defined)
1807 	check_result = __MIG_check__Request__mach_vm_behavior_set_t((__Request *)In0P);
1808 	if (check_result != MACH_MSG_SUCCESS)
1809 		{ MIG_RETURN_ERROR(OutP, check_result); }
1810 #endif	/* defined(__MIG_check__Request__mach_vm_behavior_set_t__defined) */
1811 
1812 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1813 
1814 	OutP->RetCode = mach_vm_behavior_set(target_task, In0P->address, In0P->size, In0P->new_behavior);
1815 	vm_map_deallocate(target_task);
1816 #if	__MigKernelSpecificCode
1817 #endif /* __MigKernelSpecificCode */
1818 
1819 	OutP->NDR = NDR_record;
1820 
1821 
1822 	__AfterRcvRpc(4810, "mach_vm_behavior_set")
1823 }
1824 
1825 #if ( __MigTypeCheck )
1826 #if __MIG_check__Request__mach_vm_subsystem__
1827 #if !defined(__MIG_check__Request__mach_vm_machine_attribute_t__defined)
1828 #define __MIG_check__Request__mach_vm_machine_attribute_t__defined
1829 
__MIG_check__Request__mach_vm_machine_attribute_t(__Request__mach_vm_machine_attribute_t * In0P)1830 mig_internal kern_return_t __MIG_check__Request__mach_vm_machine_attribute_t(__attribute__((__unused__)) __Request__mach_vm_machine_attribute_t *In0P)
1831 {
1832 
1833 	typedef __Request__mach_vm_machine_attribute_t __Request;
1834 #if	__MigTypeCheck
1835 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1836 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
1837 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1838 		return MIG_BAD_ARGUMENTS;
1839 #endif	/* __MigTypeCheck */
1840 
1841 	return MACH_MSG_SUCCESS;
1842 }
1843 #endif /* !defined(__MIG_check__Request__mach_vm_machine_attribute_t__defined) */
1844 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1845 #endif /* ( __MigTypeCheck ) */
1846 
1847 
1848 /* Routine mach_vm_machine_attribute */
1849 #ifdef	mig_external
1850 mig_external
1851 #else
1852 extern
1853 #endif	/* mig_external */
mach_vm_machine_attribute(target_task,address,size,attribute,value)1854 kern_return_t mach_vm_machine_attribute
1855 #if	defined(LINTLIBRARY)
1856     (target_task, address, size, attribute, value)
1857 	vm_map_t target_task;
1858 	mach_vm_address_t address;
1859 	mach_vm_size_t size;
1860 	vm_machine_attribute_t attribute;
1861 	vm_machine_attribute_val_t *value;
1862 { return mach_vm_machine_attribute(target_task, address, size, attribute, value); }
1863 #else
1864 (
1865 	vm_map_t target_task,
1866 	mach_vm_address_t address,
1867 	mach_vm_size_t size,
1868 	vm_machine_attribute_t attribute,
1869 	vm_machine_attribute_val_t *value
1870 );
1871 #endif	/* defined(LINTLIBRARY) */
1872 
1873 /* Routine mach_vm_machine_attribute */
_Xmach_vm_machine_attribute(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)1874 mig_internal novalue _Xmach_vm_machine_attribute
1875 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
1876 {
1877 
1878 #ifdef  __MigPackStructs
1879 #pragma pack(4)
1880 #endif
1881 	typedef struct {
1882 		mach_msg_header_t Head;
1883 		/* start of the kernel processed data */
1884 		mach_msg_body_t msgh_body;
1885 		/* end of the kernel processed data */
1886 		NDR_record_t NDR;
1887 		mach_vm_address_t address;
1888 		mach_vm_size_t size;
1889 		vm_machine_attribute_t attribute;
1890 		vm_machine_attribute_val_t value;
1891 		mach_msg_trailer_t trailer;
1892 	} Request;
1893 #ifdef  __MigPackStructs
1894 #pragma pack()
1895 #endif
1896 	typedef __Request__mach_vm_machine_attribute_t __Request;
1897 	typedef __Reply__mach_vm_machine_attribute_t Reply;
1898 
1899 	/*
1900 	 * typedef struct {
1901 	 * 	mach_msg_header_t Head;
1902 	 * 	NDR_record_t NDR;
1903 	 * 	kern_return_t RetCode;
1904 	 * } mig_reply_error_t;
1905 	 */
1906 
1907 	Request *In0P = (Request *) InHeadP;
1908 	Reply *OutP = (Reply *) OutHeadP;
1909 #ifdef	__MIG_check__Request__mach_vm_machine_attribute_t__defined
1910 	kern_return_t check_result;
1911 #endif	/* __MIG_check__Request__mach_vm_machine_attribute_t__defined */
1912 
1913 #if	__MigKernelSpecificCode
1914 #else
1915 #endif /* __MigKernelSpecificCode */
1916 	vm_map_t target_task;
1917 
1918 	__DeclareRcvRpc(4812, "mach_vm_machine_attribute")
1919 	__BeforeRcvRpc(4812, "mach_vm_machine_attribute")
1920 /* RetCArg=0x0 rtSimpleRequest=0 */
1921 
1922 #if	defined(__MIG_check__Request__mach_vm_machine_attribute_t__defined)
1923 	check_result = __MIG_check__Request__mach_vm_machine_attribute_t((__Request *)In0P);
1924 	if (check_result != MACH_MSG_SUCCESS)
1925 		{ MIG_RETURN_ERROR(OutP, check_result); }
1926 #endif	/* defined(__MIG_check__Request__mach_vm_machine_attribute_t__defined) */
1927 
1928 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
1929 
1930 	OutP->RetCode = mach_vm_machine_attribute(target_task, In0P->address, In0P->size, In0P->attribute, &In0P->value);
1931 	vm_map_deallocate(target_task);
1932 	if (OutP->RetCode != KERN_SUCCESS) {
1933 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
1934 	}
1935 #if	__MigKernelSpecificCode
1936 #endif /* __MigKernelSpecificCode */
1937 
1938 	OutP->NDR = NDR_record;
1939 
1940 
1941 	OutP->value = In0P->value;
1942 
1943 	OutP->Head.msgh_size = (sizeof(Reply));
1944 	__AfterRcvRpc(4812, "mach_vm_machine_attribute")
1945 }
1946 
1947 #if ( __MigTypeCheck )
1948 #if __MIG_check__Request__mach_vm_subsystem__
1949 #if !defined(__MIG_check__Request__mach_vm_remap_t__defined)
1950 #define __MIG_check__Request__mach_vm_remap_t__defined
1951 
__MIG_check__Request__mach_vm_remap_t(__Request__mach_vm_remap_t * In0P)1952 mig_internal kern_return_t __MIG_check__Request__mach_vm_remap_t(__attribute__((__unused__)) __Request__mach_vm_remap_t *In0P)
1953 {
1954 
1955 	typedef __Request__mach_vm_remap_t __Request;
1956 #if	__MigTypeCheck
1957 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
1958 	    (In0P->msgh_body.msgh_descriptor_count != 1) ||
1959 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
1960 		return MIG_BAD_ARGUMENTS;
1961 #endif	/* __MigTypeCheck */
1962 
1963 #if	__MigTypeCheck
1964 	if (In0P->src_task.type != MACH_MSG_PORT_DESCRIPTOR ||
1965 	    In0P->src_task.disposition != 17)
1966 		return MIG_TYPE_ERROR;
1967 #endif	/* __MigTypeCheck */
1968 
1969 	return MACH_MSG_SUCCESS;
1970 }
1971 #endif /* !defined(__MIG_check__Request__mach_vm_remap_t__defined) */
1972 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
1973 #endif /* ( __MigTypeCheck ) */
1974 
1975 
1976 /* Routine mach_vm_remap */
1977 #ifdef	mig_external
1978 mig_external
1979 #else
1980 extern
1981 #endif	/* mig_external */
mach_vm_remap(target_task,target_address,size,mask,flags,src_task,src_address,copy,cur_protection,max_protection,inheritance)1982 kern_return_t mach_vm_remap
1983 #if	defined(LINTLIBRARY)
1984     (target_task, target_address, size, mask, flags, src_task, src_address, copy, cur_protection, max_protection, inheritance)
1985 	vm_map_t target_task;
1986 	mach_vm_address_t *target_address;
1987 	mach_vm_size_t size;
1988 	mach_vm_offset_t mask;
1989 	int flags;
1990 	vm_map_t src_task;
1991 	mach_vm_address_t src_address;
1992 	boolean_t copy;
1993 	vm_prot_t *cur_protection;
1994 	vm_prot_t *max_protection;
1995 	vm_inherit_t inheritance;
1996 { return mach_vm_remap(target_task, target_address, size, mask, flags, src_task, src_address, copy, cur_protection, max_protection, inheritance); }
1997 #else
1998 (
1999 	vm_map_t target_task,
2000 	mach_vm_address_t *target_address,
2001 	mach_vm_size_t size,
2002 	mach_vm_offset_t mask,
2003 	int flags,
2004 	vm_map_t src_task,
2005 	mach_vm_address_t src_address,
2006 	boolean_t copy,
2007 	vm_prot_t *cur_protection,
2008 	vm_prot_t *max_protection,
2009 	vm_inherit_t inheritance
2010 );
2011 #endif	/* defined(LINTLIBRARY) */
2012 
2013 /* Routine mach_vm_remap */
_Xmach_vm_remap(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2014 mig_internal novalue _Xmach_vm_remap
2015 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2016 {
2017 
2018 #ifdef  __MigPackStructs
2019 #pragma pack(4)
2020 #endif
2021 	typedef struct {
2022 		mach_msg_header_t Head;
2023 		/* start of the kernel processed data */
2024 		mach_msg_body_t msgh_body;
2025 		mach_msg_port_descriptor_t src_task;
2026 		/* end of the kernel processed data */
2027 		NDR_record_t NDR;
2028 		mach_vm_address_t target_address;
2029 		mach_vm_size_t size;
2030 		mach_vm_offset_t mask;
2031 		int flags;
2032 		mach_vm_address_t src_address;
2033 		boolean_t copy;
2034 		vm_inherit_t inheritance;
2035 		mach_msg_trailer_t trailer;
2036 	} Request;
2037 #ifdef  __MigPackStructs
2038 #pragma pack()
2039 #endif
2040 	typedef __Request__mach_vm_remap_t __Request;
2041 	typedef __Reply__mach_vm_remap_t Reply;
2042 
2043 	/*
2044 	 * typedef struct {
2045 	 * 	mach_msg_header_t Head;
2046 	 * 	NDR_record_t NDR;
2047 	 * 	kern_return_t RetCode;
2048 	 * } mig_reply_error_t;
2049 	 */
2050 
2051 	Request *In0P = (Request *) InHeadP;
2052 	Reply *OutP = (Reply *) OutHeadP;
2053 #ifdef	__MIG_check__Request__mach_vm_remap_t__defined
2054 	kern_return_t check_result;
2055 #endif	/* __MIG_check__Request__mach_vm_remap_t__defined */
2056 
2057 #if	__MigKernelSpecificCode
2058 #else
2059 #endif /* __MigKernelSpecificCode */
2060 	vm_map_t target_task;
2061 	vm_map_t src_task;
2062 
2063 	__DeclareRcvRpc(4813, "mach_vm_remap")
2064 	__BeforeRcvRpc(4813, "mach_vm_remap")
2065 /* RetCArg=0x0 rtSimpleRequest=0 */
2066 
2067 #if	defined(__MIG_check__Request__mach_vm_remap_t__defined)
2068 	check_result = __MIG_check__Request__mach_vm_remap_t((__Request *)In0P);
2069 	if (check_result != MACH_MSG_SUCCESS)
2070 		{ MIG_RETURN_ERROR(OutP, check_result); }
2071 #endif	/* defined(__MIG_check__Request__mach_vm_remap_t__defined) */
2072 
2073 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2074 
2075 	src_task = convert_port_to_map(In0P->src_task.name);
2076 
2077 	OutP->RetCode = mach_vm_remap(target_task, &In0P->target_address, In0P->size, In0P->mask, In0P->flags, src_task, In0P->src_address, In0P->copy, &OutP->cur_protection, &OutP->max_protection, In0P->inheritance);
2078 	vm_map_deallocate(src_task);
2079 	vm_map_deallocate(target_task);
2080 	if (OutP->RetCode != KERN_SUCCESS) {
2081 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
2082 	}
2083 #if	__MigKernelSpecificCode
2084 
2085 	if (IP_VALID((ipc_port_t)In0P->src_task.name))
2086 		ipc_port_release_send((ipc_port_t)In0P->src_task.name);
2087 #endif /* __MigKernelSpecificCode */
2088 
2089 	OutP->NDR = NDR_record;
2090 
2091 
2092 	OutP->target_address = In0P->target_address;
2093 
2094 	OutP->Head.msgh_size = (sizeof(Reply));
2095 	__AfterRcvRpc(4813, "mach_vm_remap")
2096 }
2097 
2098 #if ( __MigTypeCheck )
2099 #if __MIG_check__Request__mach_vm_subsystem__
2100 #if !defined(__MIG_check__Request__mach_vm_page_query_t__defined)
2101 #define __MIG_check__Request__mach_vm_page_query_t__defined
2102 
__MIG_check__Request__mach_vm_page_query_t(__Request__mach_vm_page_query_t * In0P)2103 mig_internal kern_return_t __MIG_check__Request__mach_vm_page_query_t(__attribute__((__unused__)) __Request__mach_vm_page_query_t *In0P)
2104 {
2105 
2106 	typedef __Request__mach_vm_page_query_t __Request;
2107 #if	__MigTypeCheck
2108 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2109 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
2110 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2111 		return MIG_BAD_ARGUMENTS;
2112 #endif	/* __MigTypeCheck */
2113 
2114 	return MACH_MSG_SUCCESS;
2115 }
2116 #endif /* !defined(__MIG_check__Request__mach_vm_page_query_t__defined) */
2117 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2118 #endif /* ( __MigTypeCheck ) */
2119 
2120 
2121 /* Routine mach_vm_page_query */
2122 #ifdef	mig_external
2123 mig_external
2124 #else
2125 extern
2126 #endif	/* mig_external */
mach_vm_page_query(target_map,offset,disposition,ref_count)2127 kern_return_t mach_vm_page_query
2128 #if	defined(LINTLIBRARY)
2129     (target_map, offset, disposition, ref_count)
2130 	vm_map_t target_map;
2131 	mach_vm_offset_t offset;
2132 	integer_t *disposition;
2133 	integer_t *ref_count;
2134 { return mach_vm_page_query(target_map, offset, disposition, ref_count); }
2135 #else
2136 (
2137 	vm_map_t target_map,
2138 	mach_vm_offset_t offset,
2139 	integer_t *disposition,
2140 	integer_t *ref_count
2141 );
2142 #endif	/* defined(LINTLIBRARY) */
2143 
2144 /* Routine mach_vm_page_query */
_Xmach_vm_page_query(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2145 mig_internal novalue _Xmach_vm_page_query
2146 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2147 {
2148 
2149 #ifdef  __MigPackStructs
2150 #pragma pack(4)
2151 #endif
2152 	typedef struct {
2153 		mach_msg_header_t Head;
2154 		/* start of the kernel processed data */
2155 		mach_msg_body_t msgh_body;
2156 		/* end of the kernel processed data */
2157 		NDR_record_t NDR;
2158 		mach_vm_offset_t offset;
2159 		mach_msg_trailer_t trailer;
2160 	} Request;
2161 #ifdef  __MigPackStructs
2162 #pragma pack()
2163 #endif
2164 	typedef __Request__mach_vm_page_query_t __Request;
2165 	typedef __Reply__mach_vm_page_query_t Reply;
2166 
2167 	/*
2168 	 * typedef struct {
2169 	 * 	mach_msg_header_t Head;
2170 	 * 	NDR_record_t NDR;
2171 	 * 	kern_return_t RetCode;
2172 	 * } mig_reply_error_t;
2173 	 */
2174 
2175 	Request *In0P = (Request *) InHeadP;
2176 	Reply *OutP = (Reply *) OutHeadP;
2177 #ifdef	__MIG_check__Request__mach_vm_page_query_t__defined
2178 	kern_return_t check_result;
2179 #endif	/* __MIG_check__Request__mach_vm_page_query_t__defined */
2180 
2181 #if	__MigKernelSpecificCode
2182 #else
2183 #endif /* __MigKernelSpecificCode */
2184 	vm_map_t target_map;
2185 
2186 	__DeclareRcvRpc(4814, "mach_vm_page_query")
2187 	__BeforeRcvRpc(4814, "mach_vm_page_query")
2188 /* RetCArg=0x0 rtSimpleRequest=0 */
2189 
2190 #if	defined(__MIG_check__Request__mach_vm_page_query_t__defined)
2191 	check_result = __MIG_check__Request__mach_vm_page_query_t((__Request *)In0P);
2192 	if (check_result != MACH_MSG_SUCCESS)
2193 		{ MIG_RETURN_ERROR(OutP, check_result); }
2194 #endif	/* defined(__MIG_check__Request__mach_vm_page_query_t__defined) */
2195 
2196 	target_map = convert_port_to_map(In0P->Head.msgh_request_port);
2197 
2198 	OutP->RetCode = mach_vm_page_query(target_map, In0P->offset, &OutP->disposition, &OutP->ref_count);
2199 	vm_map_deallocate(target_map);
2200 	if (OutP->RetCode != KERN_SUCCESS) {
2201 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
2202 	}
2203 #if	__MigKernelSpecificCode
2204 #endif /* __MigKernelSpecificCode */
2205 
2206 	OutP->NDR = NDR_record;
2207 
2208 
2209 	OutP->Head.msgh_size = (sizeof(Reply));
2210 	__AfterRcvRpc(4814, "mach_vm_page_query")
2211 }
2212 
2213 #if ( __MigTypeCheck )
2214 #if __MIG_check__Request__mach_vm_subsystem__
2215 #if !defined(__MIG_check__Request__mach_vm_region_recurse_t__defined)
2216 #define __MIG_check__Request__mach_vm_region_recurse_t__defined
2217 
__MIG_check__Request__mach_vm_region_recurse_t(__Request__mach_vm_region_recurse_t * In0P)2218 mig_internal kern_return_t __MIG_check__Request__mach_vm_region_recurse_t(__attribute__((__unused__)) __Request__mach_vm_region_recurse_t *In0P)
2219 {
2220 
2221 	typedef __Request__mach_vm_region_recurse_t __Request;
2222 #if	__MigTypeCheck
2223 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2224 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
2225 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2226 		return MIG_BAD_ARGUMENTS;
2227 #endif	/* __MigTypeCheck */
2228 
2229 	return MACH_MSG_SUCCESS;
2230 }
2231 #endif /* !defined(__MIG_check__Request__mach_vm_region_recurse_t__defined) */
2232 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2233 #endif /* ( __MigTypeCheck ) */
2234 
2235 
2236 /* Routine mach_vm_region_recurse */
2237 #ifdef	mig_external
2238 mig_external
2239 #else
2240 extern
2241 #endif	/* mig_external */
mach_vm_region_recurse(target_task,address,size,nesting_depth,info,infoCnt)2242 kern_return_t mach_vm_region_recurse
2243 #if	defined(LINTLIBRARY)
2244     (target_task, address, size, nesting_depth, info, infoCnt)
2245 	vm_map_t target_task;
2246 	mach_vm_address_t *address;
2247 	mach_vm_size_t *size;
2248 	natural_t *nesting_depth;
2249 	vm_region_recurse_info_t info;
2250 	mach_msg_type_number_t *infoCnt;
2251 { return mach_vm_region_recurse(target_task, address, size, nesting_depth, info, infoCnt); }
2252 #else
2253 (
2254 	vm_map_t target_task,
2255 	mach_vm_address_t *address,
2256 	mach_vm_size_t *size,
2257 	natural_t *nesting_depth,
2258 	vm_region_recurse_info_t info,
2259 	mach_msg_type_number_t *infoCnt
2260 );
2261 #endif	/* defined(LINTLIBRARY) */
2262 
2263 /* Routine mach_vm_region_recurse */
_Xmach_vm_region_recurse(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2264 mig_internal novalue _Xmach_vm_region_recurse
2265 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2266 {
2267 
2268 #ifdef  __MigPackStructs
2269 #pragma pack(4)
2270 #endif
2271 	typedef struct {
2272 		mach_msg_header_t Head;
2273 		/* start of the kernel processed data */
2274 		mach_msg_body_t msgh_body;
2275 		/* end of the kernel processed data */
2276 		NDR_record_t NDR;
2277 		mach_vm_address_t address;
2278 		natural_t nesting_depth;
2279 		mach_msg_type_number_t infoCnt;
2280 		mach_msg_trailer_t trailer;
2281 	} Request;
2282 #ifdef  __MigPackStructs
2283 #pragma pack()
2284 #endif
2285 	typedef __Request__mach_vm_region_recurse_t __Request;
2286 	typedef __Reply__mach_vm_region_recurse_t Reply;
2287 
2288 	/*
2289 	 * typedef struct {
2290 	 * 	mach_msg_header_t Head;
2291 	 * 	NDR_record_t NDR;
2292 	 * 	kern_return_t RetCode;
2293 	 * } mig_reply_error_t;
2294 	 */
2295 
2296 	Request *In0P = (Request *) InHeadP;
2297 	Reply *OutP = (Reply *) OutHeadP;
2298 #ifdef	__MIG_check__Request__mach_vm_region_recurse_t__defined
2299 	kern_return_t check_result;
2300 #endif	/* __MIG_check__Request__mach_vm_region_recurse_t__defined */
2301 
2302 #if	__MigKernelSpecificCode
2303 #else
2304 #endif /* __MigKernelSpecificCode */
2305 	vm_map_t target_task;
2306 
2307 	__DeclareRcvRpc(4815, "mach_vm_region_recurse")
2308 	__BeforeRcvRpc(4815, "mach_vm_region_recurse")
2309 /* RetCArg=0x0 rtSimpleRequest=0 */
2310 
2311 #if	defined(__MIG_check__Request__mach_vm_region_recurse_t__defined)
2312 	check_result = __MIG_check__Request__mach_vm_region_recurse_t((__Request *)In0P);
2313 	if (check_result != MACH_MSG_SUCCESS)
2314 		{ MIG_RETURN_ERROR(OutP, check_result); }
2315 #endif	/* defined(__MIG_check__Request__mach_vm_region_recurse_t__defined) */
2316 
2317 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2318 
2319 	OutP->infoCnt = 19;
2320 	if (In0P->infoCnt < OutP->infoCnt)
2321 		OutP->infoCnt = In0P->infoCnt;
2322 
2323 	OutP->RetCode = mach_vm_region_recurse(target_task, &In0P->address, &OutP->size, &In0P->nesting_depth, OutP->info, &OutP->infoCnt);
2324 	vm_map_deallocate(target_task);
2325 	if (OutP->RetCode != KERN_SUCCESS) {
2326 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
2327 	}
2328 #if	__MigKernelSpecificCode
2329 #endif /* __MigKernelSpecificCode */
2330 
2331 	OutP->NDR = NDR_record;
2332 
2333 
2334 	OutP->address = In0P->address;
2335 
2336 	OutP->nesting_depth = In0P->nesting_depth;
2337 	OutP->Head.msgh_size = (sizeof(Reply) - 76) + (_WALIGN_((4 * OutP->infoCnt)));
2338 
2339 	__AfterRcvRpc(4815, "mach_vm_region_recurse")
2340 }
2341 
2342 #if ( __MigTypeCheck )
2343 #if __MIG_check__Request__mach_vm_subsystem__
2344 #if !defined(__MIG_check__Request__mach_vm_region_t__defined)
2345 #define __MIG_check__Request__mach_vm_region_t__defined
2346 
__MIG_check__Request__mach_vm_region_t(__Request__mach_vm_region_t * In0P)2347 mig_internal kern_return_t __MIG_check__Request__mach_vm_region_t(__attribute__((__unused__)) __Request__mach_vm_region_t *In0P)
2348 {
2349 
2350 	typedef __Request__mach_vm_region_t __Request;
2351 #if	__MigTypeCheck
2352 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2353 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
2354 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2355 		return MIG_BAD_ARGUMENTS;
2356 #endif	/* __MigTypeCheck */
2357 
2358 	return MACH_MSG_SUCCESS;
2359 }
2360 #endif /* !defined(__MIG_check__Request__mach_vm_region_t__defined) */
2361 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2362 #endif /* ( __MigTypeCheck ) */
2363 
2364 
2365 /* Routine mach_vm_region */
2366 #ifdef	mig_external
2367 mig_external
2368 #else
2369 extern
2370 #endif	/* mig_external */
mach_vm_region(target_task,address,size,flavor,info,infoCnt,object_name)2371 kern_return_t mach_vm_region
2372 #if	defined(LINTLIBRARY)
2373     (target_task, address, size, flavor, info, infoCnt, object_name)
2374 	vm_map_t target_task;
2375 	mach_vm_address_t *address;
2376 	mach_vm_size_t *size;
2377 	vm_region_flavor_t flavor;
2378 	vm_region_info_t info;
2379 	mach_msg_type_number_t *infoCnt;
2380 	mach_port_t *object_name;
2381 { return mach_vm_region(target_task, address, size, flavor, info, infoCnt, object_name); }
2382 #else
2383 (
2384 	vm_map_t target_task,
2385 	mach_vm_address_t *address,
2386 	mach_vm_size_t *size,
2387 	vm_region_flavor_t flavor,
2388 	vm_region_info_t info,
2389 	mach_msg_type_number_t *infoCnt,
2390 	mach_port_t *object_name
2391 );
2392 #endif	/* defined(LINTLIBRARY) */
2393 
2394 /* Routine mach_vm_region */
_Xmach_vm_region(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2395 mig_internal novalue _Xmach_vm_region
2396 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2397 {
2398 
2399 #ifdef  __MigPackStructs
2400 #pragma pack(4)
2401 #endif
2402 	typedef struct {
2403 		mach_msg_header_t Head;
2404 		/* start of the kernel processed data */
2405 		mach_msg_body_t msgh_body;
2406 		/* end of the kernel processed data */
2407 		NDR_record_t NDR;
2408 		mach_vm_address_t address;
2409 		vm_region_flavor_t flavor;
2410 		mach_msg_type_number_t infoCnt;
2411 		mach_msg_trailer_t trailer;
2412 	} Request;
2413 #ifdef  __MigPackStructs
2414 #pragma pack()
2415 #endif
2416 	typedef __Request__mach_vm_region_t __Request;
2417 	typedef __Reply__mach_vm_region_t Reply;
2418 
2419 	/*
2420 	 * typedef struct {
2421 	 * 	mach_msg_header_t Head;
2422 	 * 	NDR_record_t NDR;
2423 	 * 	kern_return_t RetCode;
2424 	 * } mig_reply_error_t;
2425 	 */
2426 
2427 	Request *In0P = (Request *) InHeadP;
2428 	Reply *OutP = (Reply *) OutHeadP;
2429 #ifdef	__MIG_check__Request__mach_vm_region_t__defined
2430 	kern_return_t check_result;
2431 #endif	/* __MIG_check__Request__mach_vm_region_t__defined */
2432 
2433 #if	__MigKernelSpecificCode
2434 #if	UseStaticTemplates
2435 	const static mach_msg_port_descriptor_t object_nameTemplate = {
2436 		.name = MACH_PORT_NULL,
2437 		.disposition = 17,
2438 		.type = MACH_MSG_PORT_DESCRIPTOR,
2439 	};
2440 #endif	/* UseStaticTemplates */
2441 
2442 #else
2443 #if	UseStaticTemplates
2444 	const static mach_msg_port_descriptor_t object_nameTemplate = {
2445 		.name = MACH_PORT_NULL,
2446 		.disposition = 17,
2447 		.type = MACH_MSG_PORT_DESCRIPTOR,
2448 	};
2449 #endif	/* UseStaticTemplates */
2450 
2451 #endif /* __MigKernelSpecificCode */
2452 	kern_return_t RetCode;
2453 	vm_map_t target_task;
2454 
2455 	__DeclareRcvRpc(4816, "mach_vm_region")
2456 	__BeforeRcvRpc(4816, "mach_vm_region")
2457 /* RetCArg=0x0 rtSimpleRequest=0 */
2458 
2459 #if	defined(__MIG_check__Request__mach_vm_region_t__defined)
2460 	check_result = __MIG_check__Request__mach_vm_region_t((__Request *)In0P);
2461 	if (check_result != MACH_MSG_SUCCESS)
2462 		{ MIG_RETURN_ERROR(OutP, check_result); }
2463 #endif	/* defined(__MIG_check__Request__mach_vm_region_t__defined) */
2464 
2465 #if	UseStaticTemplates
2466 	OutP->object_name = object_nameTemplate;
2467 #else	/* UseStaticTemplates */
2468 #if __MigKernelSpecificCode
2469 	OutP->object_name.disposition = 17;
2470 #else
2471 	OutP->object_name.disposition = 17;
2472 #endif /* __MigKernelSpecificCode */
2473 	OutP->object_name.type = MACH_MSG_PORT_DESCRIPTOR;
2474 #endif	/* UseStaticTemplates */
2475 
2476 
2477 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2478 
2479 	OutP->infoCnt = 10;
2480 	if (In0P->infoCnt < OutP->infoCnt)
2481 		OutP->infoCnt = In0P->infoCnt;
2482 
2483 	RetCode = mach_vm_region(target_task, &In0P->address, &OutP->size, In0P->flavor, OutP->info, &OutP->infoCnt, &OutP->object_name.name);
2484 	vm_map_deallocate(target_task);
2485 	if (RetCode != KERN_SUCCESS) {
2486 		MIG_RETURN_ERROR(OutP, RetCode);
2487 	}
2488 #if	__MigKernelSpecificCode
2489 #endif /* __MigKernelSpecificCode */
2490 
2491 	OutP->NDR = NDR_record;
2492 
2493 
2494 	OutP->address = In0P->address;
2495 	OutP->Head.msgh_size = (sizeof(Reply) - 40) + (_WALIGN_((4 * OutP->infoCnt)));
2496 
2497 	OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2498 	OutP->msgh_body.msgh_descriptor_count = 1;
2499 	__AfterRcvRpc(4816, "mach_vm_region")
2500 }
2501 
2502 #if ( __MigTypeCheck )
2503 #if __MIG_check__Request__mach_vm_subsystem__
2504 #if !defined(__MIG_check__Request___mach_make_memory_entry_t__defined)
2505 #define __MIG_check__Request___mach_make_memory_entry_t__defined
2506 
__MIG_check__Request___mach_make_memory_entry_t(__Request___mach_make_memory_entry_t * In0P)2507 mig_internal kern_return_t __MIG_check__Request___mach_make_memory_entry_t(__attribute__((__unused__)) __Request___mach_make_memory_entry_t *In0P)
2508 {
2509 
2510 	typedef __Request___mach_make_memory_entry_t __Request;
2511 #if	__MigTypeCheck
2512 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2513 	    (In0P->msgh_body.msgh_descriptor_count != 1) ||
2514 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2515 		return MIG_BAD_ARGUMENTS;
2516 #endif	/* __MigTypeCheck */
2517 
2518 #if	__MigTypeCheck
2519 	if (In0P->parent_handle.type != MACH_MSG_PORT_DESCRIPTOR ||
2520 	    In0P->parent_handle.disposition != 17)
2521 		return MIG_TYPE_ERROR;
2522 #endif	/* __MigTypeCheck */
2523 
2524 	return MACH_MSG_SUCCESS;
2525 }
2526 #endif /* !defined(__MIG_check__Request___mach_make_memory_entry_t__defined) */
2527 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2528 #endif /* ( __MigTypeCheck ) */
2529 
2530 
2531 /* Routine _mach_make_memory_entry */
2532 #ifdef	mig_external
2533 mig_external
2534 #else
2535 extern
2536 #endif	/* mig_external */
_mach_make_memory_entry(target_task,size,offset,permission,object_handle,parent_handle)2537 kern_return_t _mach_make_memory_entry
2538 #if	defined(LINTLIBRARY)
2539     (target_task, size, offset, permission, object_handle, parent_handle)
2540 	vm_map_t target_task;
2541 	memory_object_size_t *size;
2542 	memory_object_offset_t offset;
2543 	vm_prot_t permission;
2544 	mem_entry_name_port_t *object_handle;
2545 	mem_entry_name_port_t parent_handle;
2546 { return _mach_make_memory_entry(target_task, size, offset, permission, object_handle, parent_handle); }
2547 #else
2548 (
2549 	vm_map_t target_task,
2550 	memory_object_size_t *size,
2551 	memory_object_offset_t offset,
2552 	vm_prot_t permission,
2553 	mem_entry_name_port_t *object_handle,
2554 	mem_entry_name_port_t parent_handle
2555 );
2556 #endif	/* defined(LINTLIBRARY) */
2557 
2558 /* Routine _mach_make_memory_entry */
_X_mach_make_memory_entry(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2559 mig_internal novalue _X_mach_make_memory_entry
2560 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2561 {
2562 
2563 #ifdef  __MigPackStructs
2564 #pragma pack(4)
2565 #endif
2566 	typedef struct {
2567 		mach_msg_header_t Head;
2568 		/* start of the kernel processed data */
2569 		mach_msg_body_t msgh_body;
2570 		mach_msg_port_descriptor_t parent_handle;
2571 		/* end of the kernel processed data */
2572 		NDR_record_t NDR;
2573 		memory_object_size_t size;
2574 		memory_object_offset_t offset;
2575 		vm_prot_t permission;
2576 		mach_msg_trailer_t trailer;
2577 	} Request;
2578 #ifdef  __MigPackStructs
2579 #pragma pack()
2580 #endif
2581 	typedef __Request___mach_make_memory_entry_t __Request;
2582 	typedef __Reply___mach_make_memory_entry_t Reply;
2583 
2584 	/*
2585 	 * typedef struct {
2586 	 * 	mach_msg_header_t Head;
2587 	 * 	NDR_record_t NDR;
2588 	 * 	kern_return_t RetCode;
2589 	 * } mig_reply_error_t;
2590 	 */
2591 
2592 	Request *In0P = (Request *) InHeadP;
2593 	Reply *OutP = (Reply *) OutHeadP;
2594 #ifdef	__MIG_check__Request___mach_make_memory_entry_t__defined
2595 	kern_return_t check_result;
2596 #endif	/* __MIG_check__Request___mach_make_memory_entry_t__defined */
2597 
2598 #if	__MigKernelSpecificCode
2599 #if	UseStaticTemplates
2600 	const static mach_msg_port_descriptor_t object_handleTemplate = {
2601 		.name = MACH_PORT_NULL,
2602 		.disposition = 17,
2603 		.type = MACH_MSG_PORT_DESCRIPTOR,
2604 	};
2605 #endif	/* UseStaticTemplates */
2606 
2607 #else
2608 #if	UseStaticTemplates
2609 	const static mach_msg_port_descriptor_t object_handleTemplate = {
2610 		.name = MACH_PORT_NULL,
2611 		.disposition = 17,
2612 		.type = MACH_MSG_PORT_DESCRIPTOR,
2613 	};
2614 #endif	/* UseStaticTemplates */
2615 
2616 #endif /* __MigKernelSpecificCode */
2617 	kern_return_t RetCode;
2618 	vm_map_t target_task;
2619 	mem_entry_name_port_t object_handle;
2620 
2621 	__DeclareRcvRpc(4817, "_mach_make_memory_entry")
2622 	__BeforeRcvRpc(4817, "_mach_make_memory_entry")
2623 /* RetCArg=0x0 rtSimpleRequest=0 */
2624 
2625 #if	defined(__MIG_check__Request___mach_make_memory_entry_t__defined)
2626 	check_result = __MIG_check__Request___mach_make_memory_entry_t((__Request *)In0P);
2627 	if (check_result != MACH_MSG_SUCCESS)
2628 		{ MIG_RETURN_ERROR(OutP, check_result); }
2629 #endif	/* defined(__MIG_check__Request___mach_make_memory_entry_t__defined) */
2630 
2631 #if	UseStaticTemplates
2632 	OutP->object_handle = object_handleTemplate;
2633 #else	/* UseStaticTemplates */
2634 #if __MigKernelSpecificCode
2635 	OutP->object_handle.disposition = 17;
2636 #else
2637 	OutP->object_handle.disposition = 17;
2638 #endif /* __MigKernelSpecificCode */
2639 	OutP->object_handle.type = MACH_MSG_PORT_DESCRIPTOR;
2640 #endif	/* UseStaticTemplates */
2641 
2642 
2643 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2644 
2645 	RetCode = _mach_make_memory_entry(target_task, &In0P->size, In0P->offset, In0P->permission, &object_handle, null_conversion(In0P->parent_handle.name));
2646 	vm_map_deallocate(target_task);
2647 	if (RetCode != KERN_SUCCESS) {
2648 		MIG_RETURN_ERROR(OutP, RetCode);
2649 	}
2650 #if	__MigKernelSpecificCode
2651 
2652 	if (IP_VALID((ipc_port_t)In0P->parent_handle.name))
2653 		ipc_port_release_send((ipc_port_t)In0P->parent_handle.name);
2654 #endif /* __MigKernelSpecificCode */
2655 	OutP->object_handle.name = (mach_port_t)null_conversion(object_handle);
2656 
2657 
2658 	OutP->NDR = NDR_record;
2659 
2660 
2661 	OutP->size = In0P->size;
2662 
2663 	OutP->Head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
2664 	OutP->Head.msgh_size = (sizeof(Reply));
2665 	OutP->msgh_body.msgh_descriptor_count = 1;
2666 	__AfterRcvRpc(4817, "_mach_make_memory_entry")
2667 }
2668 
2669 #if ( __MigTypeCheck )
2670 #if __MIG_check__Request__mach_vm_subsystem__
2671 #if !defined(__MIG_check__Request__mach_vm_purgable_control_t__defined)
2672 #define __MIG_check__Request__mach_vm_purgable_control_t__defined
2673 
__MIG_check__Request__mach_vm_purgable_control_t(__Request__mach_vm_purgable_control_t * In0P)2674 mig_internal kern_return_t __MIG_check__Request__mach_vm_purgable_control_t(__attribute__((__unused__)) __Request__mach_vm_purgable_control_t *In0P)
2675 {
2676 
2677 	typedef __Request__mach_vm_purgable_control_t __Request;
2678 #if	__MigTypeCheck
2679 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2680 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
2681 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2682 		return MIG_BAD_ARGUMENTS;
2683 #endif	/* __MigTypeCheck */
2684 
2685 	return MACH_MSG_SUCCESS;
2686 }
2687 #endif /* !defined(__MIG_check__Request__mach_vm_purgable_control_t__defined) */
2688 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2689 #endif /* ( __MigTypeCheck ) */
2690 
2691 
2692 /* Routine mach_vm_purgable_control */
2693 #ifdef	mig_external
2694 mig_external
2695 #else
2696 extern
2697 #endif	/* mig_external */
mach_vm_purgable_control(target_task,address,control,state)2698 kern_return_t mach_vm_purgable_control
2699 #if	defined(LINTLIBRARY)
2700     (target_task, address, control, state)
2701 	vm_map_t target_task;
2702 	mach_vm_address_t address;
2703 	vm_purgable_t control;
2704 	int *state;
2705 { return mach_vm_purgable_control(target_task, address, control, state); }
2706 #else
2707 (
2708 	vm_map_t target_task,
2709 	mach_vm_address_t address,
2710 	vm_purgable_t control,
2711 	int *state
2712 );
2713 #endif	/* defined(LINTLIBRARY) */
2714 
2715 /* Routine mach_vm_purgable_control */
_Xmach_vm_purgable_control(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2716 mig_internal novalue _Xmach_vm_purgable_control
2717 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2718 {
2719 
2720 #ifdef  __MigPackStructs
2721 #pragma pack(4)
2722 #endif
2723 	typedef struct {
2724 		mach_msg_header_t Head;
2725 		/* start of the kernel processed data */
2726 		mach_msg_body_t msgh_body;
2727 		/* end of the kernel processed data */
2728 		NDR_record_t NDR;
2729 		mach_vm_address_t address;
2730 		vm_purgable_t control;
2731 		int state;
2732 		mach_msg_trailer_t trailer;
2733 	} Request;
2734 #ifdef  __MigPackStructs
2735 #pragma pack()
2736 #endif
2737 	typedef __Request__mach_vm_purgable_control_t __Request;
2738 	typedef __Reply__mach_vm_purgable_control_t Reply;
2739 
2740 	/*
2741 	 * typedef struct {
2742 	 * 	mach_msg_header_t Head;
2743 	 * 	NDR_record_t NDR;
2744 	 * 	kern_return_t RetCode;
2745 	 * } mig_reply_error_t;
2746 	 */
2747 
2748 	Request *In0P = (Request *) InHeadP;
2749 	Reply *OutP = (Reply *) OutHeadP;
2750 #ifdef	__MIG_check__Request__mach_vm_purgable_control_t__defined
2751 	kern_return_t check_result;
2752 #endif	/* __MIG_check__Request__mach_vm_purgable_control_t__defined */
2753 
2754 #if	__MigKernelSpecificCode
2755 #else
2756 #endif /* __MigKernelSpecificCode */
2757 	vm_map_t target_task;
2758 
2759 	__DeclareRcvRpc(4818, "mach_vm_purgable_control")
2760 	__BeforeRcvRpc(4818, "mach_vm_purgable_control")
2761 /* RetCArg=0x0 rtSimpleRequest=0 */
2762 
2763 #if	defined(__MIG_check__Request__mach_vm_purgable_control_t__defined)
2764 	check_result = __MIG_check__Request__mach_vm_purgable_control_t((__Request *)In0P);
2765 	if (check_result != MACH_MSG_SUCCESS)
2766 		{ MIG_RETURN_ERROR(OutP, check_result); }
2767 #endif	/* defined(__MIG_check__Request__mach_vm_purgable_control_t__defined) */
2768 
2769 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2770 
2771 	OutP->RetCode = mach_vm_purgable_control(target_task, In0P->address, In0P->control, &In0P->state);
2772 	vm_map_deallocate(target_task);
2773 	if (OutP->RetCode != KERN_SUCCESS) {
2774 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
2775 	}
2776 #if	__MigKernelSpecificCode
2777 #endif /* __MigKernelSpecificCode */
2778 
2779 	OutP->NDR = NDR_record;
2780 
2781 
2782 	OutP->state = In0P->state;
2783 
2784 	OutP->Head.msgh_size = (sizeof(Reply));
2785 	__AfterRcvRpc(4818, "mach_vm_purgable_control")
2786 }
2787 
2788 #if ( __MigTypeCheck )
2789 #if __MIG_check__Request__mach_vm_subsystem__
2790 #if !defined(__MIG_check__Request__mach_vm_page_info_t__defined)
2791 #define __MIG_check__Request__mach_vm_page_info_t__defined
2792 
__MIG_check__Request__mach_vm_page_info_t(__Request__mach_vm_page_info_t * In0P)2793 mig_internal kern_return_t __MIG_check__Request__mach_vm_page_info_t(__attribute__((__unused__)) __Request__mach_vm_page_info_t *In0P)
2794 {
2795 
2796 	typedef __Request__mach_vm_page_info_t __Request;
2797 #if	__MigTypeCheck
2798 	if (!(In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) ||
2799 	    (In0P->msgh_body.msgh_descriptor_count != 0) ||
2800 	    (In0P->Head.msgh_size != (mach_msg_size_t)sizeof(__Request)))
2801 		return MIG_BAD_ARGUMENTS;
2802 #endif	/* __MigTypeCheck */
2803 
2804 	return MACH_MSG_SUCCESS;
2805 }
2806 #endif /* !defined(__MIG_check__Request__mach_vm_page_info_t__defined) */
2807 #endif /* __MIG_check__Request__mach_vm_subsystem__ */
2808 #endif /* ( __MigTypeCheck ) */
2809 
2810 
2811 /* Routine mach_vm_page_info */
2812 #ifdef	mig_external
2813 mig_external
2814 #else
2815 extern
2816 #endif	/* mig_external */
mach_vm_page_info(target_task,address,flavor,info,infoCnt)2817 kern_return_t mach_vm_page_info
2818 #if	defined(LINTLIBRARY)
2819     (target_task, address, flavor, info, infoCnt)
2820 	vm_map_t target_task;
2821 	mach_vm_address_t address;
2822 	vm_page_info_flavor_t flavor;
2823 	vm_page_info_t info;
2824 	mach_msg_type_number_t *infoCnt;
2825 { return mach_vm_page_info(target_task, address, flavor, info, infoCnt); }
2826 #else
2827 (
2828 	vm_map_t target_task,
2829 	mach_vm_address_t address,
2830 	vm_page_info_flavor_t flavor,
2831 	vm_page_info_t info,
2832 	mach_msg_type_number_t *infoCnt
2833 );
2834 #endif	/* defined(LINTLIBRARY) */
2835 
2836 /* Routine mach_vm_page_info */
_Xmach_vm_page_info(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2837 mig_internal novalue _Xmach_vm_page_info
2838 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2839 {
2840 
2841 #ifdef  __MigPackStructs
2842 #pragma pack(4)
2843 #endif
2844 	typedef struct {
2845 		mach_msg_header_t Head;
2846 		/* start of the kernel processed data */
2847 		mach_msg_body_t msgh_body;
2848 		/* end of the kernel processed data */
2849 		NDR_record_t NDR;
2850 		mach_vm_address_t address;
2851 		vm_page_info_flavor_t flavor;
2852 		mach_msg_type_number_t infoCnt;
2853 		mach_msg_trailer_t trailer;
2854 	} Request;
2855 #ifdef  __MigPackStructs
2856 #pragma pack()
2857 #endif
2858 	typedef __Request__mach_vm_page_info_t __Request;
2859 	typedef __Reply__mach_vm_page_info_t Reply;
2860 
2861 	/*
2862 	 * typedef struct {
2863 	 * 	mach_msg_header_t Head;
2864 	 * 	NDR_record_t NDR;
2865 	 * 	kern_return_t RetCode;
2866 	 * } mig_reply_error_t;
2867 	 */
2868 
2869 	Request *In0P = (Request *) InHeadP;
2870 	Reply *OutP = (Reply *) OutHeadP;
2871 #ifdef	__MIG_check__Request__mach_vm_page_info_t__defined
2872 	kern_return_t check_result;
2873 #endif	/* __MIG_check__Request__mach_vm_page_info_t__defined */
2874 
2875 #if	__MigKernelSpecificCode
2876 #else
2877 #endif /* __MigKernelSpecificCode */
2878 	vm_map_t target_task;
2879 
2880 	__DeclareRcvRpc(4819, "mach_vm_page_info")
2881 	__BeforeRcvRpc(4819, "mach_vm_page_info")
2882 /* RetCArg=0x0 rtSimpleRequest=0 */
2883 
2884 #if	defined(__MIG_check__Request__mach_vm_page_info_t__defined)
2885 	check_result = __MIG_check__Request__mach_vm_page_info_t((__Request *)In0P);
2886 	if (check_result != MACH_MSG_SUCCESS)
2887 		{ MIG_RETURN_ERROR(OutP, check_result); }
2888 #endif	/* defined(__MIG_check__Request__mach_vm_page_info_t__defined) */
2889 
2890 	target_task = convert_port_to_map(In0P->Head.msgh_request_port);
2891 
2892 	OutP->infoCnt = 32;
2893 	if (In0P->infoCnt < OutP->infoCnt)
2894 		OutP->infoCnt = In0P->infoCnt;
2895 
2896 	OutP->RetCode = mach_vm_page_info(target_task, In0P->address, In0P->flavor, OutP->info, &OutP->infoCnt);
2897 	vm_map_deallocate(target_task);
2898 	if (OutP->RetCode != KERN_SUCCESS) {
2899 		MIG_RETURN_ERROR(OutP, OutP->RetCode);
2900 	}
2901 #if	__MigKernelSpecificCode
2902 #endif /* __MigKernelSpecificCode */
2903 
2904 	OutP->NDR = NDR_record;
2905 
2906 	OutP->Head.msgh_size = (sizeof(Reply) - 128) + (_WALIGN_((4 * OutP->infoCnt)));
2907 
2908 	__AfterRcvRpc(4819, "mach_vm_page_info")
2909 }
2910 
2911 
2912 #ifdef	mig_external
2913 mig_external
2914 #else
2915 extern
2916 #endif	/* mig_external */
2917 boolean_t mach_vm_server(
2918 		mach_msg_header_t *InHeadP,
2919 		mach_msg_header_t *OutHeadP);
2920 
2921 #ifdef	mig_external
2922 mig_external
2923 #else
2924 extern
2925 #endif	/* mig_external */
2926 mig_routine_t mach_vm_server_routine(
2927 		mach_msg_header_t *InHeadP);
2928 
2929 
2930 /* Description of this subsystem, for use in direct RPC */
2931 extern const struct mach_vm_subsystem mach_vm_subsystem;
2932 const struct mach_vm_subsystem {
2933 	mig_server_routine_t 	server;	/* Server routine */
2934 	mach_msg_id_t	start;	/* Min routine number */
2935 	mach_msg_id_t	end;	/* Max routine number + 1 */
2936 	unsigned int	maxsize;	/* Max msg size */
2937 	vm_address_t	reserved;	/* Reserved */
2938 	struct routine_descriptor	/*Array of routine descriptors */
2939 		routine[20];
2940 } mach_vm_subsystem = {
2941 	mach_vm_server_routine,
2942 	4800,
2943 	4820,
2944 	(mach_msg_size_t)sizeof(union __ReplyUnion__mach_vm_subsystem),
2945 	(vm_address_t)0,
2946 	{
2947 		{0, 0, 0, 0, 0, 0},
2948 		{0, 0, 0, 0, 0, 0},
2949           { (mig_impl_routine_t) 0,
2950             (mig_stub_routine_t) _Xmach_vm_protect, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_protect_t) },
2951           { (mig_impl_routine_t) 0,
2952             (mig_stub_routine_t) _Xmach_vm_inherit, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_inherit_t) },
2953           { (mig_impl_routine_t) 0,
2954             (mig_stub_routine_t) _Xmach_vm_read, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_read_t) },
2955           { (mig_impl_routine_t) 0,
2956             (mig_stub_routine_t) _Xmach_vm_read_list, 3, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_read_list_t) },
2957           { (mig_impl_routine_t) 0,
2958             (mig_stub_routine_t) _Xmach_vm_write, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_write_t) },
2959           { (mig_impl_routine_t) 0,
2960             (mig_stub_routine_t) _Xmach_vm_copy, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_copy_t) },
2961           { (mig_impl_routine_t) 0,
2962             (mig_stub_routine_t) _Xmach_vm_read_overwrite, 8, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_read_overwrite_t) },
2963           { (mig_impl_routine_t) 0,
2964             (mig_stub_routine_t) _Xmach_vm_msync, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_msync_t) },
2965           { (mig_impl_routine_t) 0,
2966             (mig_stub_routine_t) _Xmach_vm_behavior_set, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_behavior_set_t) },
2967 		{0, 0, 0, 0, 0, 0},
2968           { (mig_impl_routine_t) 0,
2969             (mig_stub_routine_t) _Xmach_vm_machine_attribute, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_machine_attribute_t) },
2970           { (mig_impl_routine_t) 0,
2971             (mig_stub_routine_t) _Xmach_vm_remap, 14, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_remap_t) },
2972           { (mig_impl_routine_t) 0,
2973             (mig_stub_routine_t) _Xmach_vm_page_query, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_page_query_t) },
2974           { (mig_impl_routine_t) 0,
2975             (mig_stub_routine_t) _Xmach_vm_region_recurse, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_region_recurse_t) },
2976           { (mig_impl_routine_t) 0,
2977             (mig_stub_routine_t) _Xmach_vm_region, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_region_t) },
2978           { (mig_impl_routine_t) 0,
2979             (mig_stub_routine_t) _X_mach_make_memory_entry, 7, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply___mach_make_memory_entry_t) },
2980           { (mig_impl_routine_t) 0,
2981             (mig_stub_routine_t) _Xmach_vm_purgable_control, 5, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_purgable_control_t) },
2982           { (mig_impl_routine_t) 0,
2983             (mig_stub_routine_t) _Xmach_vm_page_info, 6, 0, (routine_arg_descriptor_t)0, (mach_msg_size_t)sizeof(__Reply__mach_vm_page_info_t) },
2984 	}
2985 };
2986 
mach_vm_server(mach_msg_header_t * InHeadP,mach_msg_header_t * OutHeadP)2987 mig_external boolean_t mach_vm_server
2988 	(mach_msg_header_t *InHeadP, mach_msg_header_t *OutHeadP)
2989 {
2990 	/*
2991 	 * typedef struct {
2992 	 * 	mach_msg_header_t Head;
2993 	 * 	NDR_record_t NDR;
2994 	 * 	kern_return_t RetCode;
2995 	 * } mig_reply_error_t;
2996 	 */
2997 
2998 	register mig_routine_t routine;
2999 
3000 	OutHeadP->msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP->msgh_bits), 0);
3001 	OutHeadP->msgh_remote_port = InHeadP->msgh_reply_port;
3002 	/* Minimal size: routine() will update it if different */
3003 	OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
3004 	OutHeadP->msgh_local_port = MACH_PORT_NULL;
3005 	OutHeadP->msgh_id = InHeadP->msgh_id + 100;
3006 
3007 	if ((InHeadP->msgh_id > 4819) || (InHeadP->msgh_id < 4800) ||
3008 	    ((routine = mach_vm_subsystem.routine[InHeadP->msgh_id - 4800].stub_routine) == 0)) {
3009 		((mig_reply_error_t *)OutHeadP)->NDR = NDR_record;
3010 		((mig_reply_error_t *)OutHeadP)->RetCode = MIG_BAD_ID;
3011 		return FALSE;
3012 	}
3013 	(*routine) (InHeadP, OutHeadP);
3014 	return TRUE;
3015 }
3016 
mach_vm_server_routine(mach_msg_header_t * InHeadP)3017 mig_external mig_routine_t mach_vm_server_routine
3018 	(mach_msg_header_t *InHeadP)
3019 {
3020 	register int msgh_id;
3021 
3022 	msgh_id = InHeadP->msgh_id - 4800;
3023 
3024 	if ((msgh_id > 19) || (msgh_id < 0))
3025 		return 0;
3026 
3027 	return mach_vm_subsystem.routine[msgh_id].stub_routine;
3028 }
3029