genarch
[Memory management]


Files

file  as_pt.h
file  page_pt.h
file  as_pt.c
 Address space functions for 4-level hierarchical pagetables.
file  page_pt.c
 Virtual Address Translation for hierarchical 4-level page tables.

Functions

static pte_tptl0_create (int flags)
static void ptl0_destroy (pte_t *page_table)
static void pt_lock (as_t *as, bool lock)
static void pt_unlock (as_t *as, bool unlock)
static void pt_mapping_insert (as_t *as, __address page, __address frame, int flags)
static void pt_mapping_remove (as_t *as, __address page)
static pte_tpt_mapping_find (as_t *as, __address page)

Variables

as_operations_t as_pt_operations
as_operations_t as_pt_operations
page_mapping_operations_t pt_mapping_operations

Function Documentation

void pt_lock as_t as,
bool  lock
[static]
 

Lock page tables.

Lock only the address space. Interrupts must be disabled.

Parameters:
as Address space.
lock If false, do not attempt to lock the address space.

Definition at line 122 of file as_pt.c.

References mutex_lock.

pte_t * pt_mapping_find as_t as,
__address  page
[static]
 

Find mapping for virtual page in hierarchical page tables.

Find mapping for virtual page.

The page table must be locked and interrupts must be disabled.

Parameters:
as Address space to which page belongs.
page Virtual page.
Returns:
NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.

Definition at line 244 of file page_pt.c.

References NULL, and PAGE_NOT_PRESENT.

void pt_mapping_insert as_t as,
__address  page,
__address  frame,
int  flags
[static]
 

Map page to frame using hierarchical page tables.

Map virtual address page to physical address frame using flags.

The page table must be locked and interrupts must be disabled.

Parameters:
as Address space to wich page belongs.
page Virtual address of the page to be mapped.
frame Physical address of memory frame to which the mapping is done.
flags Flags to be used for mapping.

Definition at line 71 of file page_pt.c.

References frame_alloc, FRAME_KA, memsetb(), ONE_FRAME, PAGE_CACHEABLE, PAGE_EXEC, PAGE_NOT_PRESENT, PAGE_PRESENT, PAGE_SIZE, PAGE_USER, PAGE_WRITE, and PFN2ADDR().

Here is the call graph for this function:

void pt_mapping_remove as_t as,
__address  page
[static]
 

Remove mapping of page from hierarchical page tables.

Remove any mapping of page within address space as. TLB shootdown should follow in order to make effects of this call visible.

Empty page tables except PTL0 are freed.

The page table must be locked and interrupts must be disabled.

Parameters:
as Address space to wich page belongs.
page Virtual address of the page to be demapped.

Definition at line 122 of file page_pt.c.

References memsetb(), and PAGE_NOT_PRESENT.

Here is the call graph for this function:

void pt_unlock as_t as,
bool  unlock
[static]
 

Unlock page tables.

Unlock the address space. Interrupts must be disabled.

Parameters:
as Address space.
unlock If false, do not attempt to unlock the address space.

Definition at line 136 of file as_pt.c.

References mutex_unlock().

Here is the call graph for this function:

pte_t * ptl0_create int  flags  )  [static]
 

Create PTL0.

PTL0 of 4-level page table will be created for each address space.

Parameters:
flags Flags can specify whether ptl0 is for the kernel address space.
Returns:
New PTL0.

Definition at line 71 of file as_pt.c.

References AS_KERNEL, frame_alloc, FRAME_KA, FRAME_PANIC, interrupts_disable(), interrupts_restore(), memcpy(), memsetb(), mutex_lock, mutex_unlock(), ONE_FRAME, PAGE_SIZE, and PFN2ADDR().

Here is the call graph for this function:

void ptl0_destroy pte_t page_table  )  [static]
 

Destroy page table.

Destroy PTL0, other levels are expected to be already deallocated.

Parameters:
page_table Physical address of PTL0.

Definition at line 109 of file as_pt.c.

References ADDR2PFN(), and frame_free().

Here is the call graph for this function:


Variable Documentation

as_operations_t as_pt_operations
 

Initial value:

 {
        .page_table_create = ptl0_create,
        .page_table_destroy = ptl0_destroy,
        .page_table_lock = pt_lock,
        .page_table_unlock = pt_unlock
}

Definition at line 56 of file as_pt.c.

as_operations_t as_pt_operations
 

Definition at line 56 of file as_pt.c.

page_mapping_operations_t pt_mapping_operations
 

Initial value:

 {
        .mapping_insert = pt_mapping_insert,
        .mapping_remove = pt_mapping_remove,
        .mapping_find = pt_mapping_find
}

Definition at line 53 of file page_pt.c.

Referenced by page_arch_init().


Generated on Sun Jun 18 16:35:13 2006 for HelenOS Kernel (amd64) by  doxygen 1.4.6