8 #include <mach/boolean.h>
9 #include <mach/kern_return.h>
10 #include <mach/notify.h>
11 #include <mach/mach_types.h>
12 #include <mach/message.h>
13 #include <mach/mig_errors.h>
14 #include <mach/port.h>
17 #ifndef FUNCTION_PTR_T
18 #define FUNCTION_PTR_T
19 typedef void (*function_ptr_t
)(mach_port_t
, char *, mach_msg_type_number_t
);
22 function_ptr_t function
;
23 } function_table_entry
;
24 typedef function_table_entry
*function_table_t
;
25 #endif /* FUNCTION_PTR_T */
28 #ifndef mach_vm_MSG_COUNT
29 #define mach_vm_MSG_COUNT 20
30 #endif /* mach_vm_MSG_COUNT */
32 #include <mach/std_types.h>
35 #include <mach/mach_types.h>
36 #include <mach_debug/mach_debug_types.h>
38 #ifdef __BeforeMigUserHeader
40 #endif /* __BeforeMigUserHeader */
42 #include <sys/cdefs.h>
46 /* Routine mach_vm_allocate */
51 #endif /* mig_external */
52 kern_return_t mach_vm_allocate
55 mach_vm_address_t
*address
,
60 /* Routine mach_vm_deallocate */
65 #endif /* mig_external */
66 kern_return_t mach_vm_deallocate
69 mach_vm_address_t address
,
73 /* Routine mach_vm_protect */
78 #endif /* mig_external */
79 kern_return_t mach_vm_protect
82 mach_vm_address_t address
,
84 boolean_t set_maximum
,
85 vm_prot_t new_protection
88 /* Routine mach_vm_inherit */
93 #endif /* mig_external */
94 kern_return_t mach_vm_inherit
97 mach_vm_address_t address
,
99 vm_inherit_t new_inheritance
102 /* Routine mach_vm_read */
107 #endif /* mig_external */
108 kern_return_t mach_vm_read
110 vm_map_t target_task
,
111 mach_vm_address_t address
,
114 mach_msg_type_number_t
*dataCnt
117 /* Routine mach_vm_read_list */
122 #endif /* mig_external */
123 kern_return_t mach_vm_read_list
125 vm_map_t target_task
,
126 mach_vm_read_entry_t data_list
,
130 /* Routine mach_vm_write */
135 #endif /* mig_external */
136 kern_return_t mach_vm_write
138 vm_map_t target_task
,
139 mach_vm_address_t address
,
141 mach_msg_type_number_t dataCnt
144 /* Routine mach_vm_copy */
149 #endif /* mig_external */
150 kern_return_t mach_vm_copy
152 vm_map_t target_task
,
153 mach_vm_address_t source_address
,
155 mach_vm_address_t dest_address
158 /* Routine mach_vm_read_overwrite */
163 #endif /* mig_external */
164 kern_return_t mach_vm_read_overwrite
166 vm_map_t target_task
,
167 mach_vm_address_t address
,
169 mach_vm_address_t data
,
170 mach_vm_size_t
*outsize
173 /* Routine mach_vm_msync */
178 #endif /* mig_external */
179 kern_return_t mach_vm_msync
181 vm_map_t target_task
,
182 mach_vm_address_t address
,
187 /* Routine mach_vm_behavior_set */
192 #endif /* mig_external */
193 kern_return_t mach_vm_behavior_set
195 vm_map_t target_task
,
196 mach_vm_address_t address
,
198 vm_behavior_t new_behavior
201 /* Routine mach_vm_map */
206 #endif /* mig_external */
207 kern_return_t mach_vm_map
209 vm_map_t target_task
,
210 mach_vm_address_t
*address
,
212 mach_vm_offset_t mask
,
214 mem_entry_name_port_t object
,
215 memory_object_offset_t offset
,
217 vm_prot_t cur_protection
,
218 vm_prot_t max_protection
,
219 vm_inherit_t inheritance
222 /* Routine mach_vm_machine_attribute */
227 #endif /* mig_external */
228 kern_return_t mach_vm_machine_attribute
230 vm_map_t target_task
,
231 mach_vm_address_t address
,
233 vm_machine_attribute_t attribute
,
234 vm_machine_attribute_val_t
*value
237 /* Routine mach_vm_remap */
242 #endif /* mig_external */
243 kern_return_t mach_vm_remap
245 vm_map_t target_task
,
246 mach_vm_address_t
*target_address
,
248 mach_vm_offset_t mask
,
251 mach_vm_address_t src_address
,
253 vm_prot_t
*cur_protection
,
254 vm_prot_t
*max_protection
,
255 vm_inherit_t inheritance
258 /* Routine mach_vm_page_query */
263 #endif /* mig_external */
264 kern_return_t mach_vm_page_query
267 mach_vm_offset_t offset
,
268 integer_t
*disposition
,
272 /* Routine mach_vm_region_recurse */
277 #endif /* mig_external */
278 kern_return_t mach_vm_region_recurse
280 vm_map_t target_task
,
281 mach_vm_address_t
*address
,
282 mach_vm_size_t
*size
,
283 natural_t
*nesting_depth
,
284 vm_region_recurse_info_t info
,
285 mach_msg_type_number_t
*infoCnt
288 /* Routine mach_vm_region */
293 #endif /* mig_external */
294 kern_return_t mach_vm_region
296 vm_map_t target_task
,
297 mach_vm_address_t
*address
,
298 mach_vm_size_t
*size
,
299 vm_region_flavor_t flavor
,
300 vm_region_info_t info
,
301 mach_msg_type_number_t
*infoCnt
,
302 mach_port_t
*object_name
305 /* Routine _mach_make_memory_entry */
310 #endif /* mig_external */
311 kern_return_t _mach_make_memory_entry
313 vm_map_t target_task
,
314 memory_object_size_t
*size
,
315 memory_object_offset_t offset
,
316 vm_prot_t permission
,
317 mem_entry_name_port_t
*object_handle
,
318 mem_entry_name_port_t parent_handle
321 /* Routine mach_vm_purgable_control */
326 #endif /* mig_external */
327 kern_return_t mach_vm_purgable_control
329 vm_map_t target_task
,
330 mach_vm_address_t address
,
331 vm_purgable_t control
,
335 /* Routine mach_vm_page_info */
340 #endif /* mig_external */
341 kern_return_t mach_vm_page_info
343 vm_map_t target_task
,
344 mach_vm_address_t address
,
345 vm_page_info_flavor_t flavor
,
347 mach_msg_type_number_t
*infoCnt
352 /********************** Caution **************************/
353 /* The following data types should be used to calculate */
354 /* maximum message sizes only. The actual message may be */
355 /* smaller, and the position of the arguments within the */
356 /* message layout may vary from what is presented here. */
357 /* For example, if any of the arguments are variable- */
358 /* sized, and less than the maximum is sent, the data */
359 /* will be packed tight in the actual message to reduce */
360 /* the presence of holes. */
361 /********************** Caution **************************/
363 /* typedefs for all requests */
365 #ifndef __Request__mach_vm_subsystem__defined
366 #define __Request__mach_vm_subsystem__defined
368 #ifdef __MigPackStructs
372 mach_msg_header_t Head
;
374 mach_vm_address_t address
;
377 } __Request__mach_vm_allocate_t
;
378 #ifdef __MigPackStructs
382 #ifdef __MigPackStructs
386 mach_msg_header_t Head
;
388 mach_vm_address_t address
;
390 } __Request__mach_vm_deallocate_t
;
391 #ifdef __MigPackStructs
395 #ifdef __MigPackStructs
399 mach_msg_header_t Head
;
401 mach_vm_address_t address
;
403 boolean_t set_maximum
;
404 vm_prot_t new_protection
;
405 } __Request__mach_vm_protect_t
;
406 #ifdef __MigPackStructs
410 #ifdef __MigPackStructs
414 mach_msg_header_t Head
;
416 mach_vm_address_t address
;
418 vm_inherit_t new_inheritance
;
419 } __Request__mach_vm_inherit_t
;
420 #ifdef __MigPackStructs
424 #ifdef __MigPackStructs
428 mach_msg_header_t Head
;
430 mach_vm_address_t address
;
432 } __Request__mach_vm_read_t
;
433 #ifdef __MigPackStructs
437 #ifdef __MigPackStructs
441 mach_msg_header_t Head
;
443 mach_vm_read_entry_t data_list
;
445 } __Request__mach_vm_read_list_t
;
446 #ifdef __MigPackStructs
450 #ifdef __MigPackStructs
454 mach_msg_header_t Head
;
455 /* start of the kernel processed data */
456 mach_msg_body_t msgh_body
;
457 mach_msg_ool_descriptor_t data
;
458 /* end of the kernel processed data */
460 mach_vm_address_t address
;
461 mach_msg_type_number_t dataCnt
;
462 } __Request__mach_vm_write_t
;
463 #ifdef __MigPackStructs
467 #ifdef __MigPackStructs
471 mach_msg_header_t Head
;
473 mach_vm_address_t source_address
;
475 mach_vm_address_t dest_address
;
476 } __Request__mach_vm_copy_t
;
477 #ifdef __MigPackStructs
481 #ifdef __MigPackStructs
485 mach_msg_header_t Head
;
487 mach_vm_address_t address
;
489 mach_vm_address_t data
;
490 } __Request__mach_vm_read_overwrite_t
;
491 #ifdef __MigPackStructs
495 #ifdef __MigPackStructs
499 mach_msg_header_t Head
;
501 mach_vm_address_t address
;
503 vm_sync_t sync_flags
;
504 } __Request__mach_vm_msync_t
;
505 #ifdef __MigPackStructs
509 #ifdef __MigPackStructs
513 mach_msg_header_t Head
;
515 mach_vm_address_t address
;
517 vm_behavior_t new_behavior
;
518 } __Request__mach_vm_behavior_set_t
;
519 #ifdef __MigPackStructs
523 #ifdef __MigPackStructs
527 mach_msg_header_t Head
;
528 /* start of the kernel processed data */
529 mach_msg_body_t msgh_body
;
530 mach_msg_port_descriptor_t object
;
531 /* end of the kernel processed data */
533 mach_vm_address_t address
;
535 mach_vm_offset_t mask
;
537 memory_object_offset_t offset
;
539 vm_prot_t cur_protection
;
540 vm_prot_t max_protection
;
541 vm_inherit_t inheritance
;
542 } __Request__mach_vm_map_t
;
543 #ifdef __MigPackStructs
547 #ifdef __MigPackStructs
551 mach_msg_header_t Head
;
553 mach_vm_address_t address
;
555 vm_machine_attribute_t attribute
;
556 vm_machine_attribute_val_t value
;
557 } __Request__mach_vm_machine_attribute_t
;
558 #ifdef __MigPackStructs
562 #ifdef __MigPackStructs
566 mach_msg_header_t Head
;
567 /* start of the kernel processed data */
568 mach_msg_body_t msgh_body
;
569 mach_msg_port_descriptor_t src_task
;
570 /* end of the kernel processed data */
572 mach_vm_address_t target_address
;
574 mach_vm_offset_t mask
;
576 mach_vm_address_t src_address
;
578 vm_inherit_t inheritance
;
579 } __Request__mach_vm_remap_t
;
580 #ifdef __MigPackStructs
584 #ifdef __MigPackStructs
588 mach_msg_header_t Head
;
590 mach_vm_offset_t offset
;
591 } __Request__mach_vm_page_query_t
;
592 #ifdef __MigPackStructs
596 #ifdef __MigPackStructs
600 mach_msg_header_t Head
;
602 mach_vm_address_t address
;
603 natural_t nesting_depth
;
604 mach_msg_type_number_t infoCnt
;
605 } __Request__mach_vm_region_recurse_t
;
606 #ifdef __MigPackStructs
610 #ifdef __MigPackStructs
614 mach_msg_header_t Head
;
616 mach_vm_address_t address
;
617 vm_region_flavor_t flavor
;
618 mach_msg_type_number_t infoCnt
;
619 } __Request__mach_vm_region_t
;
620 #ifdef __MigPackStructs
624 #ifdef __MigPackStructs
628 mach_msg_header_t Head
;
629 /* start of the kernel processed data */
630 mach_msg_body_t msgh_body
;
631 mach_msg_port_descriptor_t parent_handle
;
632 /* end of the kernel processed data */
634 memory_object_size_t size
;
635 memory_object_offset_t offset
;
636 vm_prot_t permission
;
637 } __Request___mach_make_memory_entry_t
;
638 #ifdef __MigPackStructs
642 #ifdef __MigPackStructs
646 mach_msg_header_t Head
;
648 mach_vm_address_t address
;
649 vm_purgable_t control
;
651 } __Request__mach_vm_purgable_control_t
;
652 #ifdef __MigPackStructs
656 #ifdef __MigPackStructs
660 mach_msg_header_t Head
;
662 mach_vm_address_t address
;
663 vm_page_info_flavor_t flavor
;
664 mach_msg_type_number_t infoCnt
;
665 } __Request__mach_vm_page_info_t
;
666 #ifdef __MigPackStructs
669 #endif /* !__Request__mach_vm_subsystem__defined */
671 /* union of all requests */
673 #ifndef __RequestUnion__mach_vm_subsystem__defined
674 #define __RequestUnion__mach_vm_subsystem__defined
675 union __RequestUnion__mach_vm_subsystem
{
676 __Request__mach_vm_allocate_t Request_mach_vm_allocate
;
677 __Request__mach_vm_deallocate_t Request_mach_vm_deallocate
;
678 __Request__mach_vm_protect_t Request_mach_vm_protect
;
679 __Request__mach_vm_inherit_t Request_mach_vm_inherit
;
680 __Request__mach_vm_read_t Request_mach_vm_read
;
681 __Request__mach_vm_read_list_t Request_mach_vm_read_list
;
682 __Request__mach_vm_write_t Request_mach_vm_write
;
683 __Request__mach_vm_copy_t Request_mach_vm_copy
;
684 __Request__mach_vm_read_overwrite_t Request_mach_vm_read_overwrite
;
685 __Request__mach_vm_msync_t Request_mach_vm_msync
;
686 __Request__mach_vm_behavior_set_t Request_mach_vm_behavior_set
;
687 __Request__mach_vm_map_t Request_mach_vm_map
;
688 __Request__mach_vm_machine_attribute_t Request_mach_vm_machine_attribute
;
689 __Request__mach_vm_remap_t Request_mach_vm_remap
;
690 __Request__mach_vm_page_query_t Request_mach_vm_page_query
;
691 __Request__mach_vm_region_recurse_t Request_mach_vm_region_recurse
;
692 __Request__mach_vm_region_t Request_mach_vm_region
;
693 __Request___mach_make_memory_entry_t Request__mach_make_memory_entry
;
694 __Request__mach_vm_purgable_control_t Request_mach_vm_purgable_control
;
695 __Request__mach_vm_page_info_t Request_mach_vm_page_info
;
697 #endif /* !__RequestUnion__mach_vm_subsystem__defined */
698 /* typedefs for all replies */
700 #ifndef __Reply__mach_vm_subsystem__defined
701 #define __Reply__mach_vm_subsystem__defined
703 #ifdef __MigPackStructs
707 mach_msg_header_t Head
;
709 kern_return_t RetCode
;
710 mach_vm_address_t address
;
711 } __Reply__mach_vm_allocate_t
;
712 #ifdef __MigPackStructs
716 #ifdef __MigPackStructs
720 mach_msg_header_t Head
;
722 kern_return_t RetCode
;
723 } __Reply__mach_vm_deallocate_t
;
724 #ifdef __MigPackStructs
728 #ifdef __MigPackStructs
732 mach_msg_header_t Head
;
734 kern_return_t RetCode
;
735 } __Reply__mach_vm_protect_t
;
736 #ifdef __MigPackStructs
740 #ifdef __MigPackStructs
744 mach_msg_header_t Head
;
746 kern_return_t RetCode
;
747 } __Reply__mach_vm_inherit_t
;
748 #ifdef __MigPackStructs
752 #ifdef __MigPackStructs
756 mach_msg_header_t Head
;
757 /* start of the kernel processed data */
758 mach_msg_body_t msgh_body
;
759 mach_msg_ool_descriptor_t data
;
760 /* end of the kernel processed data */
762 mach_msg_type_number_t dataCnt
;
763 } __Reply__mach_vm_read_t
;
764 #ifdef __MigPackStructs
768 #ifdef __MigPackStructs
772 mach_msg_header_t Head
;
774 kern_return_t RetCode
;
775 mach_vm_read_entry_t data_list
;
776 } __Reply__mach_vm_read_list_t
;
777 #ifdef __MigPackStructs
781 #ifdef __MigPackStructs
785 mach_msg_header_t Head
;
787 kern_return_t RetCode
;
788 } __Reply__mach_vm_write_t
;
789 #ifdef __MigPackStructs
793 #ifdef __MigPackStructs
797 mach_msg_header_t Head
;
799 kern_return_t RetCode
;
800 } __Reply__mach_vm_copy_t
;
801 #ifdef __MigPackStructs
805 #ifdef __MigPackStructs
809 mach_msg_header_t Head
;
811 kern_return_t RetCode
;
812 mach_vm_size_t outsize
;
813 } __Reply__mach_vm_read_overwrite_t
;
814 #ifdef __MigPackStructs
818 #ifdef __MigPackStructs
822 mach_msg_header_t Head
;
824 kern_return_t RetCode
;
825 } __Reply__mach_vm_msync_t
;
826 #ifdef __MigPackStructs
830 #ifdef __MigPackStructs
834 mach_msg_header_t Head
;
836 kern_return_t RetCode
;
837 } __Reply__mach_vm_behavior_set_t
;
838 #ifdef __MigPackStructs
842 #ifdef __MigPackStructs
846 mach_msg_header_t Head
;
848 kern_return_t RetCode
;
849 mach_vm_address_t address
;
850 } __Reply__mach_vm_map_t
;
851 #ifdef __MigPackStructs
855 #ifdef __MigPackStructs
859 mach_msg_header_t Head
;
861 kern_return_t RetCode
;
862 vm_machine_attribute_val_t value
;
863 } __Reply__mach_vm_machine_attribute_t
;
864 #ifdef __MigPackStructs
868 #ifdef __MigPackStructs
872 mach_msg_header_t Head
;
874 kern_return_t RetCode
;
875 mach_vm_address_t target_address
;
876 vm_prot_t cur_protection
;
877 vm_prot_t max_protection
;
878 } __Reply__mach_vm_remap_t
;
879 #ifdef __MigPackStructs
883 #ifdef __MigPackStructs
887 mach_msg_header_t Head
;
889 kern_return_t RetCode
;
890 integer_t disposition
;
892 } __Reply__mach_vm_page_query_t
;
893 #ifdef __MigPackStructs
897 #ifdef __MigPackStructs
901 mach_msg_header_t Head
;
903 kern_return_t RetCode
;
904 mach_vm_address_t address
;
906 natural_t nesting_depth
;
907 mach_msg_type_number_t infoCnt
;
909 } __Reply__mach_vm_region_recurse_t
;
910 #ifdef __MigPackStructs
914 #ifdef __MigPackStructs
918 mach_msg_header_t Head
;
919 /* start of the kernel processed data */
920 mach_msg_body_t msgh_body
;
921 mach_msg_port_descriptor_t object_name
;
922 /* end of the kernel processed data */
924 mach_vm_address_t address
;
926 mach_msg_type_number_t infoCnt
;
928 } __Reply__mach_vm_region_t
;
929 #ifdef __MigPackStructs
933 #ifdef __MigPackStructs
937 mach_msg_header_t Head
;
938 /* start of the kernel processed data */
939 mach_msg_body_t msgh_body
;
940 mach_msg_port_descriptor_t object_handle
;
941 /* end of the kernel processed data */
943 memory_object_size_t size
;
944 } __Reply___mach_make_memory_entry_t
;
945 #ifdef __MigPackStructs
949 #ifdef __MigPackStructs
953 mach_msg_header_t Head
;
955 kern_return_t RetCode
;
957 } __Reply__mach_vm_purgable_control_t
;
958 #ifdef __MigPackStructs
962 #ifdef __MigPackStructs
966 mach_msg_header_t Head
;
968 kern_return_t RetCode
;
969 mach_msg_type_number_t infoCnt
;
971 } __Reply__mach_vm_page_info_t
;
972 #ifdef __MigPackStructs
975 #endif /* !__Reply__mach_vm_subsystem__defined */
977 /* union of all replies */
979 #ifndef __ReplyUnion__mach_vm_subsystem__defined
980 #define __ReplyUnion__mach_vm_subsystem__defined
981 union __ReplyUnion__mach_vm_subsystem
{
982 __Reply__mach_vm_allocate_t Reply_mach_vm_allocate
;
983 __Reply__mach_vm_deallocate_t Reply_mach_vm_deallocate
;
984 __Reply__mach_vm_protect_t Reply_mach_vm_protect
;
985 __Reply__mach_vm_inherit_t Reply_mach_vm_inherit
;
986 __Reply__mach_vm_read_t Reply_mach_vm_read
;
987 __Reply__mach_vm_read_list_t Reply_mach_vm_read_list
;
988 __Reply__mach_vm_write_t Reply_mach_vm_write
;
989 __Reply__mach_vm_copy_t Reply_mach_vm_copy
;
990 __Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite
;
991 __Reply__mach_vm_msync_t Reply_mach_vm_msync
;
992 __Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set
;
993 __Reply__mach_vm_map_t Reply_mach_vm_map
;
994 __Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute
;
995 __Reply__mach_vm_remap_t Reply_mach_vm_remap
;
996 __Reply__mach_vm_page_query_t Reply_mach_vm_page_query
;
997 __Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse
;
998 __Reply__mach_vm_region_t Reply_mach_vm_region
;
999 __Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry
;
1000 __Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control
;
1001 __Reply__mach_vm_page_info_t Reply_mach_vm_page_info
;
1003 #endif /* !__RequestUnion__mach_vm_subsystem__defined */
1005 #ifndef subsystem_to_name_map_mach_vm
1006 #define subsystem_to_name_map_mach_vm \
1007 { "mach_vm_allocate", 4800 },\
1008 { "mach_vm_deallocate", 4801 },\
1009 { "mach_vm_protect", 4802 },\
1010 { "mach_vm_inherit", 4803 },\
1011 { "mach_vm_read", 4804 },\
1012 { "mach_vm_read_list", 4805 },\
1013 { "mach_vm_write", 4806 },\
1014 { "mach_vm_copy", 4807 },\
1015 { "mach_vm_read_overwrite", 4808 },\
1016 { "mach_vm_msync", 4809 },\
1017 { "mach_vm_behavior_set", 4810 },\
1018 { "mach_vm_map", 4811 },\
1019 { "mach_vm_machine_attribute", 4812 },\
1020 { "mach_vm_remap", 4813 },\
1021 { "mach_vm_page_query", 4814 },\
1022 { "mach_vm_region_recurse", 4815 },\
1023 { "mach_vm_region", 4816 },\
1024 { "_mach_make_memory_entry", 4817 },\
1025 { "mach_vm_purgable_control", 4818 },\
1026 { "mach_vm_page_info", 4819 }
1029 #ifdef __AfterMigUserHeader
1030 __AfterMigUserHeader
1031 #endif /* __AfterMigUserHeader */
1033 #endif /* _mach_vm_user_ */