| 1 | #ifndef _mach_vm_server_ |
| 2 | #define _mach_vm_server_ |
| 3 | |
| 4 | /* Module mach_vm */ |
| 5 | |
| 6 | #include <string.h> |
| 7 | #include <mach/ndr.h> |
| 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> |
| 15 | |
| 16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ |
| 17 | |
| 18 | #if defined(__has_include) |
| 19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) |
| 20 | #ifndef USING_MIG_STRNCPY_ZEROFILL |
| 21 | #define USING_MIG_STRNCPY_ZEROFILL |
| 22 | #endif |
| 23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
| 24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
| 25 | #ifdef __cplusplus |
| 26 | extern "C" { |
| 27 | #endif |
| 28 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); |
| 29 | #ifdef __cplusplus |
| 30 | } |
| 31 | #endif |
| 32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ |
| 33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ |
| 34 | #endif /* __has_include */ |
| 35 | |
| 36 | /* END MIG_STRNCPY_ZEROFILL CODE */ |
| 37 | |
| 38 | |
| 39 | #ifdef AUTOTEST |
| 40 | #ifndef FUNCTION_PTR_T |
| 41 | #define FUNCTION_PTR_T |
| 42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); |
| 43 | typedef struct { |
| 44 | char *name; |
| 45 | function_ptr_t function; |
| 46 | } function_table_entry; |
| 47 | typedef function_table_entry *function_table_t; |
| 48 | #endif /* FUNCTION_PTR_T */ |
| 49 | #endif /* AUTOTEST */ |
| 50 | |
| 51 | #ifndef mach_vm_MSG_COUNT |
| 52 | #define mach_vm_MSG_COUNT 21 |
| 53 | #endif /* mach_vm_MSG_COUNT */ |
| 54 | |
| 55 | #include <mach/std_types.h> |
| 56 | #include <mach/mig.h> |
| 57 | #include <ipc/ipc_voucher.h> |
| 58 | #include <kern/ipc_kobject.h> |
| 59 | #include <kern/ipc_tt.h> |
| 60 | #include <kern/ipc_host.h> |
| 61 | #include <kern/ipc_sync.h> |
| 62 | #include <kern/ledger.h> |
| 63 | #include <kern/processor.h> |
| 64 | #include <kern/sync_lock.h> |
| 65 | #include <kern/sync_sema.h> |
| 66 | #include <vm/memory_object.h> |
| 67 | #include <vm/vm_map.h> |
| 68 | #include <kern/ipc_mig.h> |
| 69 | #include <mach/mig.h> |
| 70 | #include <mach/mach_types.h> |
| 71 | #include <mach_debug/mach_debug_types.h> |
| 72 | |
| 73 | #ifdef __BeforeMigServerHeader |
| 74 | __BeforeMigServerHeader |
| 75 | #endif /* __BeforeMigServerHeader */ |
| 76 | |
| 77 | |
| 78 | /* Routine mach_vm_allocate_external */ |
| 79 | #ifdef mig_external |
| 80 | mig_external |
| 81 | #else |
| 82 | extern |
| 83 | #endif /* mig_external */ |
| 84 | kern_return_t mach_vm_allocate_external |
| 85 | ( |
| 86 | vm_map_t target, |
| 87 | mach_vm_address_t *address, |
| 88 | mach_vm_size_t size, |
| 89 | int flags |
| 90 | ); |
| 91 | |
| 92 | /* Routine mach_vm_deallocate */ |
| 93 | #ifdef mig_external |
| 94 | mig_external |
| 95 | #else |
| 96 | extern |
| 97 | #endif /* mig_external */ |
| 98 | kern_return_t mach_vm_deallocate |
| 99 | ( |
| 100 | vm_map_t target, |
| 101 | mach_vm_address_t address, |
| 102 | mach_vm_size_t size |
| 103 | ); |
| 104 | |
| 105 | /* Routine mach_vm_protect */ |
| 106 | #ifdef mig_external |
| 107 | mig_external |
| 108 | #else |
| 109 | extern |
| 110 | #endif /* mig_external */ |
| 111 | kern_return_t mach_vm_protect |
| 112 | ( |
| 113 | vm_map_t target_task, |
| 114 | mach_vm_address_t address, |
| 115 | mach_vm_size_t size, |
| 116 | boolean_t set_maximum, |
| 117 | vm_prot_t new_protection |
| 118 | ); |
| 119 | |
| 120 | /* Routine mach_vm_inherit */ |
| 121 | #ifdef mig_external |
| 122 | mig_external |
| 123 | #else |
| 124 | extern |
| 125 | #endif /* mig_external */ |
| 126 | kern_return_t mach_vm_inherit |
| 127 | ( |
| 128 | vm_map_t target_task, |
| 129 | mach_vm_address_t address, |
| 130 | mach_vm_size_t size, |
| 131 | vm_inherit_t new_inheritance |
| 132 | ); |
| 133 | |
| 134 | /* Routine mach_vm_read */ |
| 135 | #ifdef mig_external |
| 136 | mig_external |
| 137 | #else |
| 138 | extern |
| 139 | #endif /* mig_external */ |
| 140 | kern_return_t mach_vm_read |
| 141 | ( |
| 142 | vm_map_t target_task, |
| 143 | mach_vm_address_t address, |
| 144 | mach_vm_size_t size, |
| 145 | vm_offset_t *data, |
| 146 | mach_msg_type_number_t *dataCnt |
| 147 | ); |
| 148 | |
| 149 | /* Routine mach_vm_read_list */ |
| 150 | #ifdef mig_external |
| 151 | mig_external |
| 152 | #else |
| 153 | extern |
| 154 | #endif /* mig_external */ |
| 155 | kern_return_t mach_vm_read_list |
| 156 | ( |
| 157 | vm_map_t target_task, |
| 158 | mach_vm_read_entry_t data_list, |
| 159 | natural_t count |
| 160 | ); |
| 161 | |
| 162 | /* Routine mach_vm_write */ |
| 163 | #ifdef mig_external |
| 164 | mig_external |
| 165 | #else |
| 166 | extern |
| 167 | #endif /* mig_external */ |
| 168 | kern_return_t mach_vm_write |
| 169 | ( |
| 170 | vm_map_t target_task, |
| 171 | mach_vm_address_t address, |
| 172 | vm_offset_t data, |
| 173 | mach_msg_type_number_t dataCnt |
| 174 | ); |
| 175 | |
| 176 | /* Routine mach_vm_copy */ |
| 177 | #ifdef mig_external |
| 178 | mig_external |
| 179 | #else |
| 180 | extern |
| 181 | #endif /* mig_external */ |
| 182 | kern_return_t mach_vm_copy |
| 183 | ( |
| 184 | vm_map_t target_task, |
| 185 | mach_vm_address_t source_address, |
| 186 | mach_vm_size_t size, |
| 187 | mach_vm_address_t dest_address |
| 188 | ); |
| 189 | |
| 190 | /* Routine mach_vm_read_overwrite */ |
| 191 | #ifdef mig_external |
| 192 | mig_external |
| 193 | #else |
| 194 | extern |
| 195 | #endif /* mig_external */ |
| 196 | kern_return_t mach_vm_read_overwrite |
| 197 | ( |
| 198 | vm_map_t target_task, |
| 199 | mach_vm_address_t address, |
| 200 | mach_vm_size_t size, |
| 201 | mach_vm_address_t data, |
| 202 | mach_vm_size_t *outsize |
| 203 | ); |
| 204 | |
| 205 | /* Routine mach_vm_msync */ |
| 206 | #ifdef mig_external |
| 207 | mig_external |
| 208 | #else |
| 209 | extern |
| 210 | #endif /* mig_external */ |
| 211 | kern_return_t mach_vm_msync |
| 212 | ( |
| 213 | vm_map_t target_task, |
| 214 | mach_vm_address_t address, |
| 215 | mach_vm_size_t size, |
| 216 | vm_sync_t sync_flags |
| 217 | ); |
| 218 | |
| 219 | /* Routine mach_vm_behavior_set */ |
| 220 | #ifdef mig_external |
| 221 | mig_external |
| 222 | #else |
| 223 | extern |
| 224 | #endif /* mig_external */ |
| 225 | kern_return_t mach_vm_behavior_set |
| 226 | ( |
| 227 | vm_map_t target_task, |
| 228 | mach_vm_address_t address, |
| 229 | mach_vm_size_t size, |
| 230 | vm_behavior_t new_behavior |
| 231 | ); |
| 232 | |
| 233 | /* Routine mach_vm_map_external */ |
| 234 | #ifdef mig_external |
| 235 | mig_external |
| 236 | #else |
| 237 | extern |
| 238 | #endif /* mig_external */ |
| 239 | kern_return_t mach_vm_map_external |
| 240 | ( |
| 241 | vm_map_t target_task, |
| 242 | mach_vm_address_t *address, |
| 243 | mach_vm_size_t size, |
| 244 | mach_vm_offset_t mask, |
| 245 | int flags, |
| 246 | mem_entry_name_port_t object, |
| 247 | memory_object_offset_t offset, |
| 248 | boolean_t copy, |
| 249 | vm_prot_t cur_protection, |
| 250 | vm_prot_t max_protection, |
| 251 | vm_inherit_t inheritance |
| 252 | ); |
| 253 | |
| 254 | /* Routine mach_vm_machine_attribute */ |
| 255 | #ifdef mig_external |
| 256 | mig_external |
| 257 | #else |
| 258 | extern |
| 259 | #endif /* mig_external */ |
| 260 | kern_return_t mach_vm_machine_attribute |
| 261 | ( |
| 262 | vm_map_t target_task, |
| 263 | mach_vm_address_t address, |
| 264 | mach_vm_size_t size, |
| 265 | vm_machine_attribute_t attribute, |
| 266 | vm_machine_attribute_val_t *value |
| 267 | ); |
| 268 | |
| 269 | /* Routine mach_vm_remap_external */ |
| 270 | #ifdef mig_external |
| 271 | mig_external |
| 272 | #else |
| 273 | extern |
| 274 | #endif /* mig_external */ |
| 275 | kern_return_t mach_vm_remap_external |
| 276 | ( |
| 277 | vm_map_t target_task, |
| 278 | mach_vm_address_t *target_address, |
| 279 | mach_vm_size_t size, |
| 280 | mach_vm_offset_t mask, |
| 281 | int flags, |
| 282 | vm_map_t src_task, |
| 283 | mach_vm_address_t src_address, |
| 284 | boolean_t copy, |
| 285 | vm_prot_t *cur_protection, |
| 286 | vm_prot_t *max_protection, |
| 287 | vm_inherit_t inheritance |
| 288 | ); |
| 289 | |
| 290 | /* Routine mach_vm_page_query */ |
| 291 | #ifdef mig_external |
| 292 | mig_external |
| 293 | #else |
| 294 | extern |
| 295 | #endif /* mig_external */ |
| 296 | kern_return_t mach_vm_page_query |
| 297 | ( |
| 298 | vm_map_t target_map, |
| 299 | mach_vm_offset_t offset, |
| 300 | integer_t *disposition, |
| 301 | integer_t *ref_count |
| 302 | ); |
| 303 | |
| 304 | /* Routine mach_vm_region_recurse */ |
| 305 | #ifdef mig_external |
| 306 | mig_external |
| 307 | #else |
| 308 | extern |
| 309 | #endif /* mig_external */ |
| 310 | kern_return_t mach_vm_region_recurse |
| 311 | ( |
| 312 | vm_map_t target_task, |
| 313 | mach_vm_address_t *address, |
| 314 | mach_vm_size_t *size, |
| 315 | natural_t *nesting_depth, |
| 316 | vm_region_recurse_info_t info, |
| 317 | mach_msg_type_number_t *infoCnt |
| 318 | ); |
| 319 | |
| 320 | /* Routine mach_vm_region */ |
| 321 | #ifdef mig_external |
| 322 | mig_external |
| 323 | #else |
| 324 | extern |
| 325 | #endif /* mig_external */ |
| 326 | kern_return_t mach_vm_region |
| 327 | ( |
| 328 | vm_map_t target_task, |
| 329 | mach_vm_address_t *address, |
| 330 | mach_vm_size_t *size, |
| 331 | vm_region_flavor_t flavor, |
| 332 | vm_region_info_t info, |
| 333 | mach_msg_type_number_t *infoCnt, |
| 334 | mach_port_t *object_name |
| 335 | ); |
| 336 | |
| 337 | /* Routine _mach_make_memory_entry */ |
| 338 | #ifdef mig_external |
| 339 | mig_external |
| 340 | #else |
| 341 | extern |
| 342 | #endif /* mig_external */ |
| 343 | kern_return_t _mach_make_memory_entry |
| 344 | ( |
| 345 | vm_map_t target_task, |
| 346 | memory_object_size_t *size, |
| 347 | memory_object_offset_t offset, |
| 348 | vm_prot_t permission, |
| 349 | mem_entry_name_port_t *object_handle, |
| 350 | mem_entry_name_port_t parent_handle |
| 351 | ); |
| 352 | |
| 353 | /* Routine mach_vm_purgable_control */ |
| 354 | #ifdef mig_external |
| 355 | mig_external |
| 356 | #else |
| 357 | extern |
| 358 | #endif /* mig_external */ |
| 359 | kern_return_t mach_vm_purgable_control |
| 360 | ( |
| 361 | vm_map_t target_task, |
| 362 | mach_vm_address_t address, |
| 363 | vm_purgable_t control, |
| 364 | int *state |
| 365 | ); |
| 366 | |
| 367 | /* Routine mach_vm_page_info */ |
| 368 | #ifdef mig_external |
| 369 | mig_external |
| 370 | #else |
| 371 | extern |
| 372 | #endif /* mig_external */ |
| 373 | kern_return_t mach_vm_page_info |
| 374 | ( |
| 375 | vm_map_t target_task, |
| 376 | mach_vm_address_t address, |
| 377 | vm_page_info_flavor_t flavor, |
| 378 | vm_page_info_t info, |
| 379 | mach_msg_type_number_t *infoCnt |
| 380 | ); |
| 381 | |
| 382 | /* Routine mach_vm_page_range_query */ |
| 383 | #ifdef mig_external |
| 384 | mig_external |
| 385 | #else |
| 386 | extern |
| 387 | #endif /* mig_external */ |
| 388 | kern_return_t mach_vm_page_range_query |
| 389 | ( |
| 390 | vm_map_t target_map, |
| 391 | mach_vm_offset_t address, |
| 392 | mach_vm_size_t size, |
| 393 | mach_vm_address_t dispositions, |
| 394 | mach_vm_size_t *dispositions_count |
| 395 | ); |
| 396 | |
| 397 | #ifdef mig_external |
| 398 | mig_external |
| 399 | #else |
| 400 | extern |
| 401 | #endif /* mig_external */ |
| 402 | boolean_t mach_vm_server( |
| 403 | mach_msg_header_t *InHeadP, |
| 404 | mach_msg_header_t *OutHeadP); |
| 405 | |
| 406 | #ifdef mig_external |
| 407 | mig_external |
| 408 | #else |
| 409 | extern |
| 410 | #endif /* mig_external */ |
| 411 | mig_routine_t mach_vm_server_routine( |
| 412 | mach_msg_header_t *InHeadP); |
| 413 | |
| 414 | |
| 415 | /* Description of this subsystem, for use in direct RPC */ |
| 416 | extern const struct mach_vm_subsystem { |
| 417 | mig_server_routine_t server; /* Server routine */ |
| 418 | mach_msg_id_t start; /* Min routine number */ |
| 419 | mach_msg_id_t end; /* Max routine number + 1 */ |
| 420 | unsigned int maxsize; /* Max msg size */ |
| 421 | vm_address_t reserved; /* Reserved */ |
| 422 | struct routine_descriptor /*Array of routine descriptors */ |
| 423 | routine[21]; |
| 424 | } mach_vm_subsystem; |
| 425 | |
| 426 | /* typedefs for all requests */ |
| 427 | |
| 428 | #ifndef __Request__mach_vm_subsystem__defined |
| 429 | #define __Request__mach_vm_subsystem__defined |
| 430 | |
| 431 | #ifdef __MigPackStructs |
| 432 | #pragma pack(4) |
| 433 | #endif |
| 434 | typedef struct { |
| 435 | mach_msg_header_t Head; |
| 436 | NDR_record_t NDR; |
| 437 | mach_vm_address_t address; |
| 438 | mach_vm_size_t size; |
| 439 | int flags; |
| 440 | } __Request__mach_vm_allocate_external_t __attribute__((unused)); |
| 441 | #ifdef __MigPackStructs |
| 442 | #pragma pack() |
| 443 | #endif |
| 444 | |
| 445 | #ifdef __MigPackStructs |
| 446 | #pragma pack(4) |
| 447 | #endif |
| 448 | typedef struct { |
| 449 | mach_msg_header_t Head; |
| 450 | NDR_record_t NDR; |
| 451 | mach_vm_address_t address; |
| 452 | mach_vm_size_t size; |
| 453 | } __Request__mach_vm_deallocate_t __attribute__((unused)); |
| 454 | #ifdef __MigPackStructs |
| 455 | #pragma pack() |
| 456 | #endif |
| 457 | |
| 458 | #ifdef __MigPackStructs |
| 459 | #pragma pack(4) |
| 460 | #endif |
| 461 | typedef struct { |
| 462 | mach_msg_header_t Head; |
| 463 | NDR_record_t NDR; |
| 464 | mach_vm_address_t address; |
| 465 | mach_vm_size_t size; |
| 466 | boolean_t set_maximum; |
| 467 | vm_prot_t new_protection; |
| 468 | } __Request__mach_vm_protect_t __attribute__((unused)); |
| 469 | #ifdef __MigPackStructs |
| 470 | #pragma pack() |
| 471 | #endif |
| 472 | |
| 473 | #ifdef __MigPackStructs |
| 474 | #pragma pack(4) |
| 475 | #endif |
| 476 | typedef struct { |
| 477 | mach_msg_header_t Head; |
| 478 | NDR_record_t NDR; |
| 479 | mach_vm_address_t address; |
| 480 | mach_vm_size_t size; |
| 481 | vm_inherit_t new_inheritance; |
| 482 | } __Request__mach_vm_inherit_t __attribute__((unused)); |
| 483 | #ifdef __MigPackStructs |
| 484 | #pragma pack() |
| 485 | #endif |
| 486 | |
| 487 | #ifdef __MigPackStructs |
| 488 | #pragma pack(4) |
| 489 | #endif |
| 490 | typedef struct { |
| 491 | mach_msg_header_t Head; |
| 492 | NDR_record_t NDR; |
| 493 | mach_vm_address_t address; |
| 494 | mach_vm_size_t size; |
| 495 | } __Request__mach_vm_read_t __attribute__((unused)); |
| 496 | #ifdef __MigPackStructs |
| 497 | #pragma pack() |
| 498 | #endif |
| 499 | |
| 500 | #ifdef __MigPackStructs |
| 501 | #pragma pack(4) |
| 502 | #endif |
| 503 | typedef struct { |
| 504 | mach_msg_header_t Head; |
| 505 | NDR_record_t NDR; |
| 506 | mach_vm_read_entry_t data_list; |
| 507 | natural_t count; |
| 508 | } __Request__mach_vm_read_list_t __attribute__((unused)); |
| 509 | #ifdef __MigPackStructs |
| 510 | #pragma pack() |
| 511 | #endif |
| 512 | |
| 513 | #ifdef __MigPackStructs |
| 514 | #pragma pack(4) |
| 515 | #endif |
| 516 | typedef struct { |
| 517 | mach_msg_header_t Head; |
| 518 | /* start of the kernel processed data */ |
| 519 | mach_msg_body_t msgh_body; |
| 520 | mach_msg_ool_descriptor_t data; |
| 521 | /* end of the kernel processed data */ |
| 522 | NDR_record_t NDR; |
| 523 | mach_vm_address_t address; |
| 524 | mach_msg_type_number_t dataCnt; |
| 525 | } __Request__mach_vm_write_t __attribute__((unused)); |
| 526 | #ifdef __MigPackStructs |
| 527 | #pragma pack() |
| 528 | #endif |
| 529 | |
| 530 | #ifdef __MigPackStructs |
| 531 | #pragma pack(4) |
| 532 | #endif |
| 533 | typedef struct { |
| 534 | mach_msg_header_t Head; |
| 535 | NDR_record_t NDR; |
| 536 | mach_vm_address_t source_address; |
| 537 | mach_vm_size_t size; |
| 538 | mach_vm_address_t dest_address; |
| 539 | } __Request__mach_vm_copy_t __attribute__((unused)); |
| 540 | #ifdef __MigPackStructs |
| 541 | #pragma pack() |
| 542 | #endif |
| 543 | |
| 544 | #ifdef __MigPackStructs |
| 545 | #pragma pack(4) |
| 546 | #endif |
| 547 | typedef struct { |
| 548 | mach_msg_header_t Head; |
| 549 | NDR_record_t NDR; |
| 550 | mach_vm_address_t address; |
| 551 | mach_vm_size_t size; |
| 552 | mach_vm_address_t data; |
| 553 | } __Request__mach_vm_read_overwrite_t __attribute__((unused)); |
| 554 | #ifdef __MigPackStructs |
| 555 | #pragma pack() |
| 556 | #endif |
| 557 | |
| 558 | #ifdef __MigPackStructs |
| 559 | #pragma pack(4) |
| 560 | #endif |
| 561 | typedef struct { |
| 562 | mach_msg_header_t Head; |
| 563 | NDR_record_t NDR; |
| 564 | mach_vm_address_t address; |
| 565 | mach_vm_size_t size; |
| 566 | vm_sync_t sync_flags; |
| 567 | } __Request__mach_vm_msync_t __attribute__((unused)); |
| 568 | #ifdef __MigPackStructs |
| 569 | #pragma pack() |
| 570 | #endif |
| 571 | |
| 572 | #ifdef __MigPackStructs |
| 573 | #pragma pack(4) |
| 574 | #endif |
| 575 | typedef struct { |
| 576 | mach_msg_header_t Head; |
| 577 | NDR_record_t NDR; |
| 578 | mach_vm_address_t address; |
| 579 | mach_vm_size_t size; |
| 580 | vm_behavior_t new_behavior; |
| 581 | } __Request__mach_vm_behavior_set_t __attribute__((unused)); |
| 582 | #ifdef __MigPackStructs |
| 583 | #pragma pack() |
| 584 | #endif |
| 585 | |
| 586 | #ifdef __MigPackStructs |
| 587 | #pragma pack(4) |
| 588 | #endif |
| 589 | typedef struct { |
| 590 | mach_msg_header_t Head; |
| 591 | /* start of the kernel processed data */ |
| 592 | mach_msg_body_t msgh_body; |
| 593 | mach_msg_port_descriptor_t object; |
| 594 | /* end of the kernel processed data */ |
| 595 | NDR_record_t NDR; |
| 596 | mach_vm_address_t address; |
| 597 | mach_vm_size_t size; |
| 598 | mach_vm_offset_t mask; |
| 599 | int flags; |
| 600 | memory_object_offset_t offset; |
| 601 | boolean_t copy; |
| 602 | vm_prot_t cur_protection; |
| 603 | vm_prot_t max_protection; |
| 604 | vm_inherit_t inheritance; |
| 605 | } __Request__mach_vm_map_external_t __attribute__((unused)); |
| 606 | #ifdef __MigPackStructs |
| 607 | #pragma pack() |
| 608 | #endif |
| 609 | |
| 610 | #ifdef __MigPackStructs |
| 611 | #pragma pack(4) |
| 612 | #endif |
| 613 | typedef struct { |
| 614 | mach_msg_header_t Head; |
| 615 | NDR_record_t NDR; |
| 616 | mach_vm_address_t address; |
| 617 | mach_vm_size_t size; |
| 618 | vm_machine_attribute_t attribute; |
| 619 | vm_machine_attribute_val_t value; |
| 620 | } __Request__mach_vm_machine_attribute_t __attribute__((unused)); |
| 621 | #ifdef __MigPackStructs |
| 622 | #pragma pack() |
| 623 | #endif |
| 624 | |
| 625 | #ifdef __MigPackStructs |
| 626 | #pragma pack(4) |
| 627 | #endif |
| 628 | typedef struct { |
| 629 | mach_msg_header_t Head; |
| 630 | /* start of the kernel processed data */ |
| 631 | mach_msg_body_t msgh_body; |
| 632 | mach_msg_port_descriptor_t src_task; |
| 633 | /* end of the kernel processed data */ |
| 634 | NDR_record_t NDR; |
| 635 | mach_vm_address_t target_address; |
| 636 | mach_vm_size_t size; |
| 637 | mach_vm_offset_t mask; |
| 638 | int flags; |
| 639 | mach_vm_address_t src_address; |
| 640 | boolean_t copy; |
| 641 | vm_inherit_t inheritance; |
| 642 | } __Request__mach_vm_remap_external_t __attribute__((unused)); |
| 643 | #ifdef __MigPackStructs |
| 644 | #pragma pack() |
| 645 | #endif |
| 646 | |
| 647 | #ifdef __MigPackStructs |
| 648 | #pragma pack(4) |
| 649 | #endif |
| 650 | typedef struct { |
| 651 | mach_msg_header_t Head; |
| 652 | NDR_record_t NDR; |
| 653 | mach_vm_offset_t offset; |
| 654 | } __Request__mach_vm_page_query_t __attribute__((unused)); |
| 655 | #ifdef __MigPackStructs |
| 656 | #pragma pack() |
| 657 | #endif |
| 658 | |
| 659 | #ifdef __MigPackStructs |
| 660 | #pragma pack(4) |
| 661 | #endif |
| 662 | typedef struct { |
| 663 | mach_msg_header_t Head; |
| 664 | NDR_record_t NDR; |
| 665 | mach_vm_address_t address; |
| 666 | natural_t nesting_depth; |
| 667 | mach_msg_type_number_t infoCnt; |
| 668 | } __Request__mach_vm_region_recurse_t __attribute__((unused)); |
| 669 | #ifdef __MigPackStructs |
| 670 | #pragma pack() |
| 671 | #endif |
| 672 | |
| 673 | #ifdef __MigPackStructs |
| 674 | #pragma pack(4) |
| 675 | #endif |
| 676 | typedef struct { |
| 677 | mach_msg_header_t Head; |
| 678 | NDR_record_t NDR; |
| 679 | mach_vm_address_t address; |
| 680 | vm_region_flavor_t flavor; |
| 681 | mach_msg_type_number_t infoCnt; |
| 682 | } __Request__mach_vm_region_t __attribute__((unused)); |
| 683 | #ifdef __MigPackStructs |
| 684 | #pragma pack() |
| 685 | #endif |
| 686 | |
| 687 | #ifdef __MigPackStructs |
| 688 | #pragma pack(4) |
| 689 | #endif |
| 690 | typedef struct { |
| 691 | mach_msg_header_t Head; |
| 692 | /* start of the kernel processed data */ |
| 693 | mach_msg_body_t msgh_body; |
| 694 | mach_msg_port_descriptor_t parent_handle; |
| 695 | /* end of the kernel processed data */ |
| 696 | NDR_record_t NDR; |
| 697 | memory_object_size_t size; |
| 698 | memory_object_offset_t offset; |
| 699 | vm_prot_t permission; |
| 700 | } __Request___mach_make_memory_entry_t __attribute__((unused)); |
| 701 | #ifdef __MigPackStructs |
| 702 | #pragma pack() |
| 703 | #endif |
| 704 | |
| 705 | #ifdef __MigPackStructs |
| 706 | #pragma pack(4) |
| 707 | #endif |
| 708 | typedef struct { |
| 709 | mach_msg_header_t Head; |
| 710 | NDR_record_t NDR; |
| 711 | mach_vm_address_t address; |
| 712 | vm_purgable_t control; |
| 713 | int state; |
| 714 | } __Request__mach_vm_purgable_control_t __attribute__((unused)); |
| 715 | #ifdef __MigPackStructs |
| 716 | #pragma pack() |
| 717 | #endif |
| 718 | |
| 719 | #ifdef __MigPackStructs |
| 720 | #pragma pack(4) |
| 721 | #endif |
| 722 | typedef struct { |
| 723 | mach_msg_header_t Head; |
| 724 | NDR_record_t NDR; |
| 725 | mach_vm_address_t address; |
| 726 | vm_page_info_flavor_t flavor; |
| 727 | mach_msg_type_number_t infoCnt; |
| 728 | } __Request__mach_vm_page_info_t __attribute__((unused)); |
| 729 | #ifdef __MigPackStructs |
| 730 | #pragma pack() |
| 731 | #endif |
| 732 | |
| 733 | #ifdef __MigPackStructs |
| 734 | #pragma pack(4) |
| 735 | #endif |
| 736 | typedef struct { |
| 737 | mach_msg_header_t Head; |
| 738 | NDR_record_t NDR; |
| 739 | mach_vm_offset_t address; |
| 740 | mach_vm_size_t size; |
| 741 | mach_vm_address_t dispositions; |
| 742 | mach_vm_size_t dispositions_count; |
| 743 | } __Request__mach_vm_page_range_query_t __attribute__((unused)); |
| 744 | #ifdef __MigPackStructs |
| 745 | #pragma pack() |
| 746 | #endif |
| 747 | #endif /* !__Request__mach_vm_subsystem__defined */ |
| 748 | |
| 749 | |
| 750 | /* union of all requests */ |
| 751 | |
| 752 | #ifndef __RequestUnion__mach_vm_subsystem__defined |
| 753 | #define __RequestUnion__mach_vm_subsystem__defined |
| 754 | union __RequestUnion__mach_vm_subsystem { |
| 755 | __Request__mach_vm_allocate_external_t Request_mach_vm_allocate_external; |
| 756 | __Request__mach_vm_deallocate_t Request_mach_vm_deallocate; |
| 757 | __Request__mach_vm_protect_t Request_mach_vm_protect; |
| 758 | __Request__mach_vm_inherit_t Request_mach_vm_inherit; |
| 759 | __Request__mach_vm_read_t Request_mach_vm_read; |
| 760 | __Request__mach_vm_read_list_t Request_mach_vm_read_list; |
| 761 | __Request__mach_vm_write_t Request_mach_vm_write; |
| 762 | __Request__mach_vm_copy_t Request_mach_vm_copy; |
| 763 | __Request__mach_vm_read_overwrite_t Request_mach_vm_read_overwrite; |
| 764 | __Request__mach_vm_msync_t Request_mach_vm_msync; |
| 765 | __Request__mach_vm_behavior_set_t Request_mach_vm_behavior_set; |
| 766 | __Request__mach_vm_map_external_t Request_mach_vm_map_external; |
| 767 | __Request__mach_vm_machine_attribute_t Request_mach_vm_machine_attribute; |
| 768 | __Request__mach_vm_remap_external_t Request_mach_vm_remap_external; |
| 769 | __Request__mach_vm_page_query_t Request_mach_vm_page_query; |
| 770 | __Request__mach_vm_region_recurse_t Request_mach_vm_region_recurse; |
| 771 | __Request__mach_vm_region_t Request_mach_vm_region; |
| 772 | __Request___mach_make_memory_entry_t Request__mach_make_memory_entry; |
| 773 | __Request__mach_vm_purgable_control_t Request_mach_vm_purgable_control; |
| 774 | __Request__mach_vm_page_info_t Request_mach_vm_page_info; |
| 775 | __Request__mach_vm_page_range_query_t Request_mach_vm_page_range_query; |
| 776 | }; |
| 777 | #endif /* __RequestUnion__mach_vm_subsystem__defined */ |
| 778 | /* typedefs for all replies */ |
| 779 | |
| 780 | #ifndef __Reply__mach_vm_subsystem__defined |
| 781 | #define __Reply__mach_vm_subsystem__defined |
| 782 | |
| 783 | #ifdef __MigPackStructs |
| 784 | #pragma pack(4) |
| 785 | #endif |
| 786 | typedef struct { |
| 787 | mach_msg_header_t Head; |
| 788 | NDR_record_t NDR; |
| 789 | kern_return_t RetCode; |
| 790 | mach_vm_address_t address; |
| 791 | } __Reply__mach_vm_allocate_external_t __attribute__((unused)); |
| 792 | #ifdef __MigPackStructs |
| 793 | #pragma pack() |
| 794 | #endif |
| 795 | |
| 796 | #ifdef __MigPackStructs |
| 797 | #pragma pack(4) |
| 798 | #endif |
| 799 | typedef struct { |
| 800 | mach_msg_header_t Head; |
| 801 | NDR_record_t NDR; |
| 802 | kern_return_t RetCode; |
| 803 | } __Reply__mach_vm_deallocate_t __attribute__((unused)); |
| 804 | #ifdef __MigPackStructs |
| 805 | #pragma pack() |
| 806 | #endif |
| 807 | |
| 808 | #ifdef __MigPackStructs |
| 809 | #pragma pack(4) |
| 810 | #endif |
| 811 | typedef struct { |
| 812 | mach_msg_header_t Head; |
| 813 | NDR_record_t NDR; |
| 814 | kern_return_t RetCode; |
| 815 | } __Reply__mach_vm_protect_t __attribute__((unused)); |
| 816 | #ifdef __MigPackStructs |
| 817 | #pragma pack() |
| 818 | #endif |
| 819 | |
| 820 | #ifdef __MigPackStructs |
| 821 | #pragma pack(4) |
| 822 | #endif |
| 823 | typedef struct { |
| 824 | mach_msg_header_t Head; |
| 825 | NDR_record_t NDR; |
| 826 | kern_return_t RetCode; |
| 827 | } __Reply__mach_vm_inherit_t __attribute__((unused)); |
| 828 | #ifdef __MigPackStructs |
| 829 | #pragma pack() |
| 830 | #endif |
| 831 | |
| 832 | #ifdef __MigPackStructs |
| 833 | #pragma pack(4) |
| 834 | #endif |
| 835 | typedef struct { |
| 836 | mach_msg_header_t Head; |
| 837 | /* start of the kernel processed data */ |
| 838 | mach_msg_body_t msgh_body; |
| 839 | mach_msg_ool_descriptor_t data; |
| 840 | /* end of the kernel processed data */ |
| 841 | NDR_record_t NDR; |
| 842 | mach_msg_type_number_t dataCnt; |
| 843 | } __Reply__mach_vm_read_t __attribute__((unused)); |
| 844 | #ifdef __MigPackStructs |
| 845 | #pragma pack() |
| 846 | #endif |
| 847 | |
| 848 | #ifdef __MigPackStructs |
| 849 | #pragma pack(4) |
| 850 | #endif |
| 851 | typedef struct { |
| 852 | mach_msg_header_t Head; |
| 853 | NDR_record_t NDR; |
| 854 | kern_return_t RetCode; |
| 855 | mach_vm_read_entry_t data_list; |
| 856 | } __Reply__mach_vm_read_list_t __attribute__((unused)); |
| 857 | #ifdef __MigPackStructs |
| 858 | #pragma pack() |
| 859 | #endif |
| 860 | |
| 861 | #ifdef __MigPackStructs |
| 862 | #pragma pack(4) |
| 863 | #endif |
| 864 | typedef struct { |
| 865 | mach_msg_header_t Head; |
| 866 | NDR_record_t NDR; |
| 867 | kern_return_t RetCode; |
| 868 | } __Reply__mach_vm_write_t __attribute__((unused)); |
| 869 | #ifdef __MigPackStructs |
| 870 | #pragma pack() |
| 871 | #endif |
| 872 | |
| 873 | #ifdef __MigPackStructs |
| 874 | #pragma pack(4) |
| 875 | #endif |
| 876 | typedef struct { |
| 877 | mach_msg_header_t Head; |
| 878 | NDR_record_t NDR; |
| 879 | kern_return_t RetCode; |
| 880 | } __Reply__mach_vm_copy_t __attribute__((unused)); |
| 881 | #ifdef __MigPackStructs |
| 882 | #pragma pack() |
| 883 | #endif |
| 884 | |
| 885 | #ifdef __MigPackStructs |
| 886 | #pragma pack(4) |
| 887 | #endif |
| 888 | typedef struct { |
| 889 | mach_msg_header_t Head; |
| 890 | NDR_record_t NDR; |
| 891 | kern_return_t RetCode; |
| 892 | mach_vm_size_t outsize; |
| 893 | } __Reply__mach_vm_read_overwrite_t __attribute__((unused)); |
| 894 | #ifdef __MigPackStructs |
| 895 | #pragma pack() |
| 896 | #endif |
| 897 | |
| 898 | #ifdef __MigPackStructs |
| 899 | #pragma pack(4) |
| 900 | #endif |
| 901 | typedef struct { |
| 902 | mach_msg_header_t Head; |
| 903 | NDR_record_t NDR; |
| 904 | kern_return_t RetCode; |
| 905 | } __Reply__mach_vm_msync_t __attribute__((unused)); |
| 906 | #ifdef __MigPackStructs |
| 907 | #pragma pack() |
| 908 | #endif |
| 909 | |
| 910 | #ifdef __MigPackStructs |
| 911 | #pragma pack(4) |
| 912 | #endif |
| 913 | typedef struct { |
| 914 | mach_msg_header_t Head; |
| 915 | NDR_record_t NDR; |
| 916 | kern_return_t RetCode; |
| 917 | } __Reply__mach_vm_behavior_set_t __attribute__((unused)); |
| 918 | #ifdef __MigPackStructs |
| 919 | #pragma pack() |
| 920 | #endif |
| 921 | |
| 922 | #ifdef __MigPackStructs |
| 923 | #pragma pack(4) |
| 924 | #endif |
| 925 | typedef struct { |
| 926 | mach_msg_header_t Head; |
| 927 | NDR_record_t NDR; |
| 928 | kern_return_t RetCode; |
| 929 | mach_vm_address_t address; |
| 930 | } __Reply__mach_vm_map_external_t __attribute__((unused)); |
| 931 | #ifdef __MigPackStructs |
| 932 | #pragma pack() |
| 933 | #endif |
| 934 | |
| 935 | #ifdef __MigPackStructs |
| 936 | #pragma pack(4) |
| 937 | #endif |
| 938 | typedef struct { |
| 939 | mach_msg_header_t Head; |
| 940 | NDR_record_t NDR; |
| 941 | kern_return_t RetCode; |
| 942 | vm_machine_attribute_val_t value; |
| 943 | } __Reply__mach_vm_machine_attribute_t __attribute__((unused)); |
| 944 | #ifdef __MigPackStructs |
| 945 | #pragma pack() |
| 946 | #endif |
| 947 | |
| 948 | #ifdef __MigPackStructs |
| 949 | #pragma pack(4) |
| 950 | #endif |
| 951 | typedef struct { |
| 952 | mach_msg_header_t Head; |
| 953 | NDR_record_t NDR; |
| 954 | kern_return_t RetCode; |
| 955 | mach_vm_address_t target_address; |
| 956 | vm_prot_t cur_protection; |
| 957 | vm_prot_t max_protection; |
| 958 | } __Reply__mach_vm_remap_external_t __attribute__((unused)); |
| 959 | #ifdef __MigPackStructs |
| 960 | #pragma pack() |
| 961 | #endif |
| 962 | |
| 963 | #ifdef __MigPackStructs |
| 964 | #pragma pack(4) |
| 965 | #endif |
| 966 | typedef struct { |
| 967 | mach_msg_header_t Head; |
| 968 | NDR_record_t NDR; |
| 969 | kern_return_t RetCode; |
| 970 | integer_t disposition; |
| 971 | integer_t ref_count; |
| 972 | } __Reply__mach_vm_page_query_t __attribute__((unused)); |
| 973 | #ifdef __MigPackStructs |
| 974 | #pragma pack() |
| 975 | #endif |
| 976 | |
| 977 | #ifdef __MigPackStructs |
| 978 | #pragma pack(4) |
| 979 | #endif |
| 980 | typedef struct { |
| 981 | mach_msg_header_t Head; |
| 982 | NDR_record_t NDR; |
| 983 | kern_return_t RetCode; |
| 984 | mach_vm_address_t address; |
| 985 | mach_vm_size_t size; |
| 986 | natural_t nesting_depth; |
| 987 | mach_msg_type_number_t infoCnt; |
| 988 | int info[19]; |
| 989 | } __Reply__mach_vm_region_recurse_t __attribute__((unused)); |
| 990 | #ifdef __MigPackStructs |
| 991 | #pragma pack() |
| 992 | #endif |
| 993 | |
| 994 | #ifdef __MigPackStructs |
| 995 | #pragma pack(4) |
| 996 | #endif |
| 997 | typedef struct { |
| 998 | mach_msg_header_t Head; |
| 999 | /* start of the kernel processed data */ |
| 1000 | mach_msg_body_t msgh_body; |
| 1001 | mach_msg_port_descriptor_t object_name; |
| 1002 | /* end of the kernel processed data */ |
| 1003 | NDR_record_t NDR; |
| 1004 | mach_vm_address_t address; |
| 1005 | mach_vm_size_t size; |
| 1006 | mach_msg_type_number_t infoCnt; |
| 1007 | int info[10]; |
| 1008 | } __Reply__mach_vm_region_t __attribute__((unused)); |
| 1009 | #ifdef __MigPackStructs |
| 1010 | #pragma pack() |
| 1011 | #endif |
| 1012 | |
| 1013 | #ifdef __MigPackStructs |
| 1014 | #pragma pack(4) |
| 1015 | #endif |
| 1016 | typedef struct { |
| 1017 | mach_msg_header_t Head; |
| 1018 | /* start of the kernel processed data */ |
| 1019 | mach_msg_body_t msgh_body; |
| 1020 | mach_msg_port_descriptor_t object_handle; |
| 1021 | /* end of the kernel processed data */ |
| 1022 | NDR_record_t NDR; |
| 1023 | memory_object_size_t size; |
| 1024 | } __Reply___mach_make_memory_entry_t __attribute__((unused)); |
| 1025 | #ifdef __MigPackStructs |
| 1026 | #pragma pack() |
| 1027 | #endif |
| 1028 | |
| 1029 | #ifdef __MigPackStructs |
| 1030 | #pragma pack(4) |
| 1031 | #endif |
| 1032 | typedef struct { |
| 1033 | mach_msg_header_t Head; |
| 1034 | NDR_record_t NDR; |
| 1035 | kern_return_t RetCode; |
| 1036 | int state; |
| 1037 | } __Reply__mach_vm_purgable_control_t __attribute__((unused)); |
| 1038 | #ifdef __MigPackStructs |
| 1039 | #pragma pack() |
| 1040 | #endif |
| 1041 | |
| 1042 | #ifdef __MigPackStructs |
| 1043 | #pragma pack(4) |
| 1044 | #endif |
| 1045 | typedef struct { |
| 1046 | mach_msg_header_t Head; |
| 1047 | NDR_record_t NDR; |
| 1048 | kern_return_t RetCode; |
| 1049 | mach_msg_type_number_t infoCnt; |
| 1050 | int info[32]; |
| 1051 | } __Reply__mach_vm_page_info_t __attribute__((unused)); |
| 1052 | #ifdef __MigPackStructs |
| 1053 | #pragma pack() |
| 1054 | #endif |
| 1055 | |
| 1056 | #ifdef __MigPackStructs |
| 1057 | #pragma pack(4) |
| 1058 | #endif |
| 1059 | typedef struct { |
| 1060 | mach_msg_header_t Head; |
| 1061 | NDR_record_t NDR; |
| 1062 | kern_return_t RetCode; |
| 1063 | mach_vm_size_t dispositions_count; |
| 1064 | } __Reply__mach_vm_page_range_query_t __attribute__((unused)); |
| 1065 | #ifdef __MigPackStructs |
| 1066 | #pragma pack() |
| 1067 | #endif |
| 1068 | #endif /* !__Reply__mach_vm_subsystem__defined */ |
| 1069 | |
| 1070 | |
| 1071 | /* union of all replies */ |
| 1072 | |
| 1073 | #ifndef __ReplyUnion__mach_vm_subsystem__defined |
| 1074 | #define __ReplyUnion__mach_vm_subsystem__defined |
| 1075 | union __ReplyUnion__mach_vm_subsystem { |
| 1076 | __Reply__mach_vm_allocate_external_t Reply_mach_vm_allocate_external; |
| 1077 | __Reply__mach_vm_deallocate_t Reply_mach_vm_deallocate; |
| 1078 | __Reply__mach_vm_protect_t Reply_mach_vm_protect; |
| 1079 | __Reply__mach_vm_inherit_t Reply_mach_vm_inherit; |
| 1080 | __Reply__mach_vm_read_t Reply_mach_vm_read; |
| 1081 | __Reply__mach_vm_read_list_t Reply_mach_vm_read_list; |
| 1082 | __Reply__mach_vm_write_t Reply_mach_vm_write; |
| 1083 | __Reply__mach_vm_copy_t Reply_mach_vm_copy; |
| 1084 | __Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite; |
| 1085 | __Reply__mach_vm_msync_t Reply_mach_vm_msync; |
| 1086 | __Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set; |
| 1087 | __Reply__mach_vm_map_external_t Reply_mach_vm_map_external; |
| 1088 | __Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute; |
| 1089 | __Reply__mach_vm_remap_external_t Reply_mach_vm_remap_external; |
| 1090 | __Reply__mach_vm_page_query_t Reply_mach_vm_page_query; |
| 1091 | __Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse; |
| 1092 | __Reply__mach_vm_region_t Reply_mach_vm_region; |
| 1093 | __Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry; |
| 1094 | __Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control; |
| 1095 | __Reply__mach_vm_page_info_t Reply_mach_vm_page_info; |
| 1096 | __Reply__mach_vm_page_range_query_t Reply_mach_vm_page_range_query; |
| 1097 | }; |
| 1098 | #endif /* __RequestUnion__mach_vm_subsystem__defined */ |
| 1099 | |
| 1100 | #ifndef subsystem_to_name_map_mach_vm |
| 1101 | #define subsystem_to_name_map_mach_vm \ |
| 1102 | { "mach_vm_allocate_external", 4800 },\ |
| 1103 | { "mach_vm_deallocate", 4801 },\ |
| 1104 | { "mach_vm_protect", 4802 },\ |
| 1105 | { "mach_vm_inherit", 4803 },\ |
| 1106 | { "mach_vm_read", 4804 },\ |
| 1107 | { "mach_vm_read_list", 4805 },\ |
| 1108 | { "mach_vm_write", 4806 },\ |
| 1109 | { "mach_vm_copy", 4807 },\ |
| 1110 | { "mach_vm_read_overwrite", 4808 },\ |
| 1111 | { "mach_vm_msync", 4809 },\ |
| 1112 | { "mach_vm_behavior_set", 4810 },\ |
| 1113 | { "mach_vm_map_external", 4811 },\ |
| 1114 | { "mach_vm_machine_attribute", 4812 },\ |
| 1115 | { "mach_vm_remap_external", 4813 },\ |
| 1116 | { "mach_vm_page_query", 4814 },\ |
| 1117 | { "mach_vm_region_recurse", 4815 },\ |
| 1118 | { "mach_vm_region", 4816 },\ |
| 1119 | { "_mach_make_memory_entry", 4817 },\ |
| 1120 | { "mach_vm_purgable_control", 4818 },\ |
| 1121 | { "mach_vm_page_info", 4819 },\ |
| 1122 | { "mach_vm_page_range_query", 4820 } |
| 1123 | #endif |
| 1124 | |
| 1125 | #ifdef __AfterMigServerHeader |
| 1126 | __AfterMigServerHeader |
| 1127 | #endif /* __AfterMigServerHeader */ |
| 1128 | |
| 1129 | #endif /* _mach_vm_server_ */ |
| 1130 | |