user/lib/libsystem/src/sys/vm.c
/**
 * Creates a new virtual memory mapping backed by a contiguous range of physical addresses.
 */
Creates a new virtual memory mapping backed by a contiguous range of physical addresses.
Creates a new virtual memory mapping backed by a contiguous range of physical addresses .
int AllocVirtualPhysRegion(const uint64_t physAddr, const uintptr_t size, const uintptr_t inFlags,
        uintptr_t *outHandle) {
    intptr_t err;
    if(!outHandle) return -1;
    uintptr_t flags = 0;
    flags = BuildSyscallFlags(inFlags, true);
    err = __do_syscall3(physAddr, size, flags, SYS_VM_CREATE);
    if(err > 0) {
        *outHandle = err;
    }
    return (err < 0) ? err : 0;
}
int AllocVirtualPhysRegion ( const uint64_t physAddr , const uintptr_t size , const uintptr_t inFlags , uintptr_t * outHandle ) { intptr_t err ; if ( ! outHandle ) return -1 ; uintptr_t flags = 0 ; flags = BuildSyscallFlags ( inFlags , true ) ; err = __do_syscall3 ( physAddr , size , flags , SYS_VM_CREATE ) ; if ( err > 0 ) { * outHandle = err ; } return ( err < 0 ) ? err : 0 ; }
Creates a new virtual memory mapping backed by a contiguous range of physical addresses.
Creates a new virtual memory mapping backed by a contiguous range of physical addresses .
// build flags // perform syscall // return 0 for success, syscall error otherwise