Main index | Section 9 | Options |
#include <sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
The flags argument may have the following values:
VM_PROT_READ | A read access to the given virtual address triggered the call. |
VM_PROT_WRITE | A write access to the given virtual address triggered the call. |
VM_PROT_EXECUTE | An execute access to the given virtual address triggered the call. |
PMAP_ENTER_WIRED | The mapping should be marked as wired. |
PMAP_ENTER_NOSLEEP | |
This function may not sleep during creation of the mapping. If the mapping cannot be created without sleeping, an appropriate Mach VM error is returned. | |
The psind parameter specifies the page size that should be used by the mapping. The supported page sizes are described by the global array pagesizes[]. The desired page size is specified by passing the index of the array element that equals the desired page size.
When the pmap_enter() function destroys or updates a managed mapping, including an existing mapping at virtual address va, it updates the vm_page structure corresponding to the previously mapped physical page. If the physical page was accessed through the managed mapping, then the vm_page structure's PGA_REFERENCED aflag is set. If the physical page was modified through the managed mapping, then the vm_page_dirty() function is called on the vm_page structure.
The PGA_WRITEABLE aflag must be set for the page m if the new mapping is managed and writeable. It is advised to clear PGA_WRITEABLE for destroyed mappings if the implementation can ensure that no other writeable managed mappings for the previously mapped pages exist.
If the request modifies an existing mapping to use a different physical page, an implementation of pmap_enter must invalidate the previous mapping before installing the new one. This ensures that all threads sharing the pmap keep a consistent view of the mapping, which is necessary for the correct handling of CoW (copy on write) faults.
If the page m is managed, the page must be busied by the caller or the owning object must be locked. In the later case, the PMAP_ENTER_NOSLEEP must be specified by the caller.
The pmap_enter() function must handle the multiprocessor TLB consistency for the given address.
PMAP_ENTER (9) | December 16, 2018 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | With features like these, who needs bugs? | ” |
— Henry Spencer |