4 #include <bootstrap_priv.h>
8 #include <os/assumes.h>
12 #include <darwintest.h>
13 #include <darwintest_utils.h>
15 #include <mach/mach_time.h>
16 #include <mach/message.h>
17 #include <mach/mach_traps.h>
18 #include <mach/mach_vm.h>
20 #define VM_OP_NONE (0)
21 #define VM_OP_UNMAP (1)
22 #define VM_OP_EXIT (2)
23 #define VM_OP_COPY (3)
24 #define VM_OP_READ (4)
25 #define VM_OP_MEMENTRY (5)
26 #define VM_OP_REMAP (6)
27 #define VM_OP_READ_OVERWRITE (7)
28 #define VM_OP_WRITE (8)
29 #define VM_OP_EXIT_ERROR (9)
31 extern mach_port_t serverPort
;
32 extern mach_port_t persistentReplyPort
;
33 extern boolean_t debug
;
36 mach_msg_header_t header
;
38 mach_msg_port_descriptor_t port_descriptor
;
47 typedef struct ipc_message ipc_message_t
;
49 void mach_vm_client(mach_port_t
);
50 void mach_server_remap(mach_port_t
);
51 void mach_server_read(mach_port_t
, int);
52 void mach_server_make_memory_entry(mach_port_t
);
54 int mach_server_data_setup(void **);
55 void mach_server_data_cleanup(void *, mach_vm_address_t
, mach_vm_size_t
);
56 void mach_server_construct_header(ipc_message_t
*, mach_port_t
);
57 void mach_server_create_allocation(mach_vm_address_t
*, mach_vm_size_t
, void *);
58 void mach_server_contruct_payload(ipc_message_t
*, mach_vm_address_t
, mach_port_t
, mach_vm_size_t
, mach_vm_offset_t
, boolean_t
, int);
59 void server_error_out(mach_port_t
);
62 #define MACH_VM_TEST_SERVICE_NAME "com.apple.test.xnu.vm.machVMTest"
63 #define VM_SPAWN_TOOL "/AppleInternal/Tests/xnu/darwintests/tools/vm_spawn_tool"