user/lib/libsystem/src/sys/vm.c
/**
 * Builds a syscall flag value.
 *
 * You may notice this is the same as the ones defined in the header; therefore no real translation
 * is taking place here. This allows us flexibility to change the flags without changing the actual
 * programs later.
 *
 * @param create When set, extra flags allowed only for VM region creation are produced. Otherwise,
 * they are simply ignored.
 */
Builds a syscall flag value.
You may notice this is the same as the ones defined in the header; therefore no real translation
is taking place here. This allows us flexibility to change the flags without changing the actual
programs later.

@param create When set, extra flags allowed only for VM region creation are produced. Otherwise,
they are simply ignored.
Builds a syscall flag value . You may notice this is the same as the ones defined in the header ; therefore no real translation is taking place here . This allows us flexibility to change the flags without changing the actual programs later . @param create When set extra flags allowed only for VM region creation are produced . Otherwise they are simply ignored .
static uintptr_t BuildSyscallFlags(const uintptr_t inFlags, bool create) {
    uintptr_t temp = 0;
    if(create && inFlags & VM_REGION_FORCE_ALLOC) {
        temp |= (1 << 0);
    }
    if(create && (inFlags & VM_REGION_LOCKED)) {
        temp |= (1 << 8);
    }
    if(inFlags & VM_REGION_READ) {
        temp |= (1 << 10);
    }
    if(inFlags & VM_REGION_WRITE) {
        temp |= (1 << 11);
    }
    if(inFlags & VM_REGION_EXEC) {
        temp |= (1 << 12);
    }
    if(inFlags & VM_REGION_MMIO) {
        temp |= (1 << 13);
    }
    if(inFlags & VM_REGION_WRITETHRU) {
        temp |= (1 << 14);
    }
    return temp;
}
static uintptr_t BuildSyscallFlags ( const uintptr_t inFlags , bool create ) { uintptr_t temp = 0 ; if ( create && inFlags & VM_REGION_FORCE_ALLOC ) { temp |= ( 1 << 0 ) ; } if ( create && ( inFlags & VM_REGION_LOCKED ) ) { temp |= ( 1 << 8 ) ; } if ( inFlags & VM_REGION_READ ) { temp |= ( 1 << 10 ) ; } if ( inFlags & VM_REGION_WRITE ) { temp |= ( 1 << 11 ) ; } if ( inFlags & VM_REGION_EXEC ) { temp |= ( 1 << 12 ) ; } if ( inFlags & VM_REGION_MMIO ) { temp |= ( 1 << 13 ) ; } if ( inFlags & VM_REGION_WRITETHRU ) { temp |= ( 1 << 14 ) ; } return temp ; }
Builds a syscall flag value.
Builds a syscall flag value .