]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/mach/mach_vm.c
xnu-4570.71.2.tar.gz
[apple/xnu.git] / libsyscall / mach / mach_vm.c
index 1b6d7f98e6e48bde4b8c3efb66dbfad228fd7caf..00bf511a20b9bb33532ec798cfafd13a3ddf3dff 100644 (file)
@@ -73,15 +73,15 @@ mach_vm_deallocate(
 {
        kern_return_t rv;
 
 {
        kern_return_t rv;
 
+       if (__syscall_logger) {
+               __syscall_logger(stack_logging_type_vm_deallocate, (uintptr_t)target, (uintptr_t)address, (uintptr_t)size, 0, 0);
+       }
+
        rv = _kernelrpc_mach_vm_deallocate_trap(target, address, size);
 
        if (rv == MACH_SEND_INVALID_DEST)
                rv = _kernelrpc_mach_vm_deallocate(target, address, size);
 
        rv = _kernelrpc_mach_vm_deallocate_trap(target, address, size);
 
        if (rv == MACH_SEND_INVALID_DEST)
                rv = _kernelrpc_mach_vm_deallocate(target, address, size);
 
-       if (__syscall_logger) {
-               __syscall_logger(stack_logging_type_vm_deallocate, (uintptr_t)target, (uintptr_t)address, size, 0, 0);
-       }
-
        return (rv);
 }
 
        return (rv);
 }
 
@@ -317,3 +317,33 @@ vm_read(
 
        return (rv);
 }
 
        return (rv);
 }
+
+kern_return_t
+mach_vm_purgable_control(
+       mach_port_name_t        target,
+       mach_vm_offset_t        address,
+       vm_purgable_t           control,
+       int                     *state)
+{
+       kern_return_t rv;
+
+       rv = _kernelrpc_mach_vm_purgable_control_trap(target, address, control, state);
+
+       if (rv == MACH_SEND_INVALID_DEST)
+               rv = _kernelrpc_mach_vm_purgable_control(target, address, control, state);
+
+       return (rv);
+}
+
+kern_return_t
+vm_purgable_control(
+       mach_port_name_t        task,
+       vm_offset_t             address,
+       vm_purgable_t           control,
+       int                     *state)
+{
+       return mach_vm_purgable_control(task,
+                                       (mach_vm_offset_t) address,
+                                       control,
+                                       state);
+}