Documentation ¶
Overview ¶
Package pagetables provides a generic implementation of pagetables.
Index ¶
- type Node
- type Opts
- type PCIDs
- type PTE
- type PTEs
- type PageTables
- func (p *PageTables) CR3() uint64
- func (p *PageTables) FlushCR3() uint64
- func (p *PageTables) Lookup(addr usermem.Addr) (physical uintptr, accessType usermem.AccessType)
- func (p *PageTables) Map(addr usermem.Addr, length uintptr, user bool, at usermem.AccessType, ...) bool
- func (p *PageTables) New() *PageTables
- func (p *PageTables) Release()
- func (p *PageTables) Unmap(addr usermem.Addr, length uintptr) bool
- type Translater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a single node within a set of page tables.
type PCIDs ¶
type PCIDs struct {
// contains filtered or unexported fields
}
PCIDs is a simple PCID database.
type PTE ¶
type PTE uint64
PTE is a page table entry.
func (*PTE) Executable ¶
Executable returns true iff the page is executable.
type PageTables ¶
type PageTables struct {
// contains filtered or unexported fields
}
PageTables is a set of page tables.
func (*PageTables) CR3 ¶
func (p *PageTables) CR3() uint64
CR3 returns the CR3 value for these tables.
This may be called in interrupt contexts.
func (*PageTables) FlushCR3 ¶
func (p *PageTables) FlushCR3() uint64
FlushCR3 returns the CR3 value that flushes the TLB.
This may be called in interrupt contexts.
func (*PageTables) Lookup ¶
func (p *PageTables) Lookup(addr usermem.Addr) (physical uintptr, accessType usermem.AccessType)
Lookup returns the physical address for the given virtual address.
func (*PageTables) Map ¶
func (p *PageTables) Map(addr usermem.Addr, length uintptr, user bool, at usermem.AccessType, physical uintptr) bool
Map installs a mapping with the given physical address.
True is returned iff there was a previous mapping in the range.
Precondition: addr & length must be aligned, their sum must not overflow.
func (*PageTables) New ¶
func (p *PageTables) New() *PageTables
New returns a new set of PageTables derived from the given one.
This function should always be preferred to New if there are existing pagetables, as this function preserves architectural constraints relevant to managing multiple sets of pagetables.
func (*PageTables) Release ¶
func (p *PageTables) Release()
Release releases this address space.
This must be called to release the PCID.
type Translater ¶
type Translater interface { // TranslateToPhysical translates the given pointer object into a // "physical" address. We do not require that it translates back, the // reverse mapping is maintained internally. TranslateToPhysical(*PTEs) uintptr }
Translater translates to guest physical addresses.