Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_mmap.c
Show First 20 Lines • Show All 703 Lines • ▼ Show 20 Lines | struct minherit_args { | ||||
void *addr; | void *addr; | ||||
size_t len; | size_t len; | ||||
int inherit; | int inherit; | ||||
}; | }; | ||||
#endif | #endif | ||||
int | int | ||||
sys_minherit(struct thread *td, struct minherit_args *uap) | sys_minherit(struct thread *td, struct minherit_args *uap) | ||||
{ | { | ||||
return (kern_minherit(td, (uintptr_t)uap->addr, uap->len, | |||||
uap->inherit)); | |||||
} | |||||
int | |||||
kern_minherit(struct thread *td, uintptr_t addr0, size_t len, int inherit0) | |||||
{ | |||||
brooks: Since this in a new function, why not just expose there proper types and not have the… | |||||
traszAuthorUnsubmitted Done Inline ActionsFor consistency. The sys/syscallsubr.h header contains vm_offset_t and vm_size_t anyway; yet all the function definiotions except for one use the standard types instead. trasz: For consistency. The sys/syscallsubr.h header contains vm_offset_t and vm_size_t anyway; yet… | |||||
brooksUnsubmitted Not Done Inline ActionsOK. I checked and in CheriBSD I went with: int kern_minherit(struct thread *td, vm_offset_t addr, vm_size_t size, int inherit); brooks: OK. I checked and in CheriBSD I went with:
```
int kern_minherit(struct thread *td… | |||||
traszAuthorUnsubmitted Done Inline ActionsI think I still prefer keeping consistent with the rest of that API, ie kern_madvise(). I know, it might be my OCD speaking again :-) trasz: I think I still prefer keeping consistent with the rest of that API, ie kern_madvise(). I know… | |||||
vm_offset_t addr; | vm_offset_t addr; | ||||
vm_size_t size, pageoff; | vm_size_t size, pageoff; | ||||
vm_inherit_t inherit; | vm_inherit_t inherit; | ||||
addr = (vm_offset_t)uap->addr; | addr = (vm_offset_t)addr0; | ||||
size = uap->len; | size = len; | ||||
inherit = uap->inherit; | inherit = inherit0; | ||||
Not Done Inline ActionsCommit it separately? markj: Commit it separately? | |||||
Done Inline ActionsDefinitely. trasz: Definitely. | |||||
Done Inline ActionsAnd of course I only remembered it five minutes after committing the whole thing. Hopefully it's ok as it is. Next time I should make it two separate reviews, I guess. trasz: And of course I only remembered it five minutes after committing the whole thing. Hopefully… | |||||
pageoff = (addr & PAGE_MASK); | pageoff = (addr & PAGE_MASK); | ||||
addr -= pageoff; | addr -= pageoff; | ||||
size += pageoff; | size += pageoff; | ||||
size = (vm_size_t) round_page(size); | size = (vm_size_t) round_page(size); | ||||
if (addr + size < addr) | if (addr + size < addr) | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 946 Lines • Show Last 20 Lines |
Since this in a new function, why not just expose there proper types and not have the temporaries? Is there a header pollution concern?