Linux Kernel Architecture

(Jacob Rumans) #1

Chapter3:MemoryManagement


❑ pte_fileis employed for nonlinear mappings that provide a different view on file contents by
manipulating the page table (this mechanism is discussed in more detail in Section 4.7.3). The
function checks if a page table entry belongs to such a mapping.

pte_filemay only be invoked ifpte_presentreturnsfalse; that is, the page asso-
ciated with the page table entry isnotpresent in memory.

Since the generic code relies onpte_file, it must also be defined if an architecture does not sup-
port nonlinear mappings. In this case, the function always returns 0.

A summary of all functions provided to manipulate PTE entries can be found in Table 3-3.

Table 3-3: Functions for Processing the Architecture-Dependent State of a Memory
Page

Function Description

pte_present Is the page present?

pte_read May the page be read from within userspace?

pte_write May the page be written to?

pte_exec May the data in the page be executed as binary code?

pte_dirty Is the page dirty; that is, have its contents been modified?

pte_file Does the PTE belong to a nonlinear mapping?

pte_young Is the access bit (typically_PAGE_ACCESS)set?

pte_rdprotect Removes read permission for the page.

pte_wrprotect Deletes write permission for the page.

pte_exprotect Removes permission to execute binary data in the page.

pte_mkread Sets read permission.

pte_mkwrite Sets write permission.

pte_mkexec Permits execution of page contents.

pte_mkdirty Marks the page as dirty.

pte_mkclean ‘‘Cleans‘‘ the page; that is, usually deletes the_PAGE_DIRTYbit.

pte_mkyoung Sets the accessed bit —_PAGE_ACCESSEDon most architectures.

pte_mkold Deletes the accessed bit.
Free download pdf