user/lib/libsystem/src/sys/vm.c
/**
 * Translates a set of virtual addresses (in the current task's address space) to physical
 * addresses. The input addresses are read from one array, while the output addresses are written
 * to another, or unmodified if the virtual address could not be translated.
 */
Translates a set of virtual addresses (in the current task's address space) to physical
addresses. The input addresses are read from one array, while the output addresses are written
to another, or unmodified if the virtual address could not be translated.
Translates a set of virtual addresses ( in the current task ' s address space ) to physical addresses . The input addresses are read from one array while the output addresses are written to another or unmodified if the virtual address could not be translated .
int VirtualToPhysicalAddr(const uintptr_t *virtualAddrs, const size_t numAddrs,
        uintptr_t *outPhysAddrs) {
    if(!virtualAddrs || !numAddrs || !outPhysAddrs) return -1;
    return __do_syscall4(0, (uintptr_t) virtualAddrs, (uintptr_t) outPhysAddrs, numAddrs,
            SYS_VM_VIRT_TO_PHYS);
}
int VirtualToPhysicalAddr ( const uintptr_t * virtualAddrs , const size_t numAddrs , uintptr_t * outPhysAddrs ) { if ( ! virtualAddrs || ! numAddrs || ! outPhysAddrs ) return -1 ; return __do_syscall4 ( 0 , ( uintptr_t ) virtualAddrs , ( uintptr_t ) outPhysAddrs , numAddrs , SYS_VM_VIRT_TO_PHYS ) ; }
Translates a set of virtual addresses (in the current task's address space) to physical
 addresses.
Translates a set of virtual addresses ( in the current task ' s address space ) to physical addresses .
// super basic validation