Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/cloudabi/cloudabi_mem.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap) | ||||
if (uap->flags & CLOUDABI_MAP_SHARED) | if (uap->flags & CLOUDABI_MAP_SHARED) | ||||
flags |= MAP_SHARED; | flags |= MAP_SHARED; | ||||
/* Translate protection. */ | /* Translate protection. */ | ||||
error = convert_mprot(uap->prot, &prot); | error = convert_mprot(uap->prot, &prot); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, | return (kern_mmap(td, &(struct mmap_req){ | ||||
uap->fd, uap->off)); | .mr_hint = (uintptr_t)uap->addr, | ||||
kib: I would fill the previous line by merging with this one. | |||||
.mr_len = uap->len, | |||||
.mr_prot = prot, | |||||
.mr_flags = flags, | |||||
.mr_fd = uap->fd, | |||||
.mr_pos = uap->off, | |||||
})); | |||||
} | } | ||||
int | int | ||||
cloudabi_sys_mem_protect(struct thread *td, | cloudabi_sys_mem_protect(struct thread *td, | ||||
struct cloudabi_sys_mem_protect_args *uap) | struct cloudabi_sys_mem_protect_args *uap) | ||||
{ | { | ||||
int error, prot; | int error, prot; | ||||
Show All 39 Lines |
I would fill the previous line by merging with this one.