vm_bind_l2 - Makes binding from a level 2 page table to a physical page frame.


#include <charm.h>

Status vm_bind_l2( Vaddr va, int pfn, Cap ptcap, Cap bindcap, PTE pte, bool use_hashing );


va Specifies the virtual address to which the physical memory is to be mapped.

pfn Specifies the physical page frame containing the root page table into which the entry is being made.

ptcap The write capability associated with pfn.

bindcap A capability for the page frame described in the pte entry. If the mapping specifies a read-write protection this must be the write capability, if the mapping specifies any other mapping it must be the read capability.

pte The page table entry to be entered into the root page table.

use_hashing Specifies that hashing is to be used when the page is unmapped (see below).


This function makes an entry in a level 2 page table.


Upon the successful completion, the vm_bind_l2() function returns [SUCCESS].

If use_hashing is true, the kernel will calculate a hash code for the page before it is (re)mapped. This hash code is stored in a kernel data structure associated with the arena. This mechanism provides an efficient means to remove and later reinstate a page table (containing valid bindings). Without this mechanism, any extant bindings on the page would need to be recreated whenever the page was rebound.


If the vm_bind_l2() function fails, a Status is returned that corresponds to one of the following values:

[VA_INVALID] The given virtual address is not valid.

[VA_ALREADY_BACKED] The given virtual address is already mapped to an address in physical memory.

[VM_BAD_HASH] The page provided does not match the stored hash code for the arena.

[INVALID_PT_CAP] The capability specified by ptcap is invalid.

[INVALID_BIND_CAP] The capability specified by bindcap is invalid.

[PTE_INVALID] The page table entry is malformed.


pm_change_caps(), vm_bind_l1(), vm_bind_root(), vm_unbind_root().

Notes for Gurus

See vm_bind_l1 notes

last updated: 7/9/99