12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PMAP (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> PMAP (9)void pmap_init(void)This function initializes the pmap module. It is called by uvm_init() to initialize anydata structures that the module needs to manage physical maps.pmap_t pmap_kernel(void)Return a pointer to the pmap structure that maps the kernel virtual address space.Note that this function may be provided as a C pre-processor macro.void pmap_virtual_space(vaddr_t ∗vstartp , vaddr_t ∗vendp)The pmap_virtual_space() function is called to determine the initial kernel virtualaddress space beginning and end. These values are used to create the kernel’s virtual memorymap. The function must set ∗vstartp to the first kernel virtual address that will bemanaged by uvm(9), and must set ∗vendp to the last kernel virtual address that will bemanaged by uvm(9).If the pmap_growkernel() feature is used by a pmap implementation, then ∗vendpshould be set to the maximum kernel virtual address allowed by the implementation. Ifpmap_growkernel() is not used, then ∗vendp must be set to the maximum kernel virtualaddress that can be mapped with the resources currently allocated to map the kernelvirtual address space.pmap_t pmap_create(void)Create a physical map and return it to the caller. The reference count on the new map is 1.void pmap_destroy(pmap_t pmap)Drop the reference count on the specified physical map. If the reference count drops to 0,all resources associated with the physical map are released and the physical map destroyed.In the case of a drop-to-0, no mappings will exist in the map. The pmap implementationmay assert this.void pmap_reference(pmap_t pmap)Increment the reference count on the specified physical map.long pmap_resident_count(pmap_t pmap)Query the “resident pages” statistic for pmap.Note that this function may be provided as a C pre-processor macro.long pmap_wired_count(pmap_t pmap)Query the “wired pages” statistic for pmap.Note that this function may be provided as a C pre-processor macro.int pmap_enter(pmap_t pmap , vaddr_t va , paddr_t pa , vm_prot_t prot , intflags)Create a mapping in physical map pmap for the physical address pa at the virtual addressva with protection specified by bits in prot:VM_PROT_READVM_PROT_WRITEVM_PROT_EXECUTEThe mapping must allow reading.The mapping must allow writing.The page mapped contains instructions that will beexecuted by the processor.The flags argument contains protection bits (the same bits as used in the prot argument)indicating the type of access that caused the mapping to be created. This informationmay be used to seed modified/referenced information for the page being mapped, possiblyavoiding redundant faults on platforms that track modified/referenced information in<strong>NetBSD</strong> 3.0 December 25, 2007 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!