Page MenuHomeFreeBSD

Add vm_mmap2(), vm_mprotect(), vm_msync(), vm_munlock(), vm_munmap(), and vm_madvise().
ClosedPublic

Authored by trasz on Jan 30 2017, 11:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 11:33 PM
Unknown Object (File)
Sat, Apr 27, 10:23 PM
Unknown Object (File)
Mar 28 2024, 5:26 AM
Unknown Object (File)
Jan 15 2024, 1:10 PM
Unknown Object (File)
Dec 24 2023, 9:14 PM
Unknown Object (File)
Dec 23 2023, 11:24 AM
Unknown Object (File)
Dec 16 2023, 2:38 PM
Unknown Object (File)
Dec 13 2023, 11:25 AM
Subscribers

Details

Summary

Add vm_mmap2(), vm_mprotect(), vm_msync(), vm_munlock(), vm_munmap(),
and vm_madvise(), and use them in various compats instead of their
sys_*() counterparts.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Add vm_mmap2(), vm_mprotect(), vm_msync(), vm_munlock(), vm_munmap(), and vm_madvise()..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)

Ed, Dmitry, could you test it? Thanks!

I think this is a right change to do. But I suggest to follow the naming conventions of all other syscall subroutines and utilize the kern_ prefix. In other words, for instance vm_munlock() should be named kern_vm_munlock(). I do not think that we ever pretend that our VM is still Mach VM.

trasz edited edge metadata.

Rename by adding the kern_ prefix.

sys/vm/vm_extern.h
74 ↗(On Diff #24558)

Wouldn't it make more sense to just call them kern_mmap(), etc. and place these prototypes in sys/sysproto.h?

sys/vm/vm_extern.h
74 ↗(On Diff #24558)

This would require either contaminating sys/sysproto.h with all the vm_offset_t, vm_size_t etc, or changing the types which is error prone. So I think the current way is safer, and the "kern_vm_" provides a hint to the reader that those are declared somewhere else.

ed edited edge metadata.
This revision is now accepted and ready to land.Feb 1 2017, 9:38 AM
trasz edited edge metadata.

Fix build.

This revision now requires review to proceed.Feb 1 2017, 11:27 PM

Dmitry, could you test it? Thanks!

dchagin edited edge metadata.

NPTL test pass

This revision is now accepted and ready to land.Feb 5 2017, 12:46 PM
kib edited edge metadata.
This revision was automatically updated to reflect the committed changes.