26 , m_pageDirectoryAddr(0)
27 , m_pageDirectoryAllocated(false)
34 , m_pageDirectoryAddr(pageDirectory)
35 , m_pageDirectoryAllocated(false)
136 const bool tablesOnly)
volatile u32 readCR3() const
Read the CR3 register.
void writeCR3(u32 cr3) const
Write the CR3 register.
Intel page directory implementation.
MemoryContext::Result unmap(Address virt, SplitAllocator *alloc)
Remove virtual address mapping.
MemoryContext::Result translate(Address virt, Address *phys, SplitAllocator *alloc) const
Translate virtual address to physical address.
MemoryContext::Result map(Address virt, Address phys, Memory::Access access, SplitAllocator *alloc)
Map a virtual address to a physical address.
MemoryContext::Result access(Address virt, Memory::Access *access, SplitAllocator *alloc) const
Get Access flags for a virtual address.
MemoryContext::Result releaseRange(const Memory::Range range, SplitAllocator *alloc)
Release range of memory.
MemoryContext::Result releaseSection(const Memory::Range range, SplitAllocator *alloc, const bool tablesOnly)
Release memory sections.
MemoryContext::Result copy(IntelPageDirectory *directory, Address from, Address to)
Copy mappings from another directory.
virtual ~IntelPaging()
Destructor.
virtual Result lookup(Address virt, Address *phys) const
Translate virtual address to physical address.
Address m_pageDirectoryAddr
Physical address of the page directory.
bool m_pageDirectoryAllocated
Set to true if page directory was allocated by this class.
virtual Result map(Address virt, Address phys, Memory::Access access)
Map a physical page to a virtual address.
IntelPaging(MemoryMap *map, SplitAllocator *alloc)
Constructor.
virtual Result initialize()
Initialize the MemoryContext.
IntelPageDirectory * m_pageDirectory
Pointer to page directory in kernel's virtual memory.
virtual Result releaseSection(const Memory::Range &range, const bool tablesOnly=false)
Release memory sections.
virtual Result activate(bool initializeMMU=false)
Activate the MemoryContext.
virtual Result access(Address virt, Memory::Access *access) const
Get Access flags for a virtual address.
virtual Result unmap(Address virt)
Unmap a virtual address.
virtual Result releaseRange(Memory::Range *range)
Release range of memory.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Virtual memory abstract interface.
MemoryMap * m_map
Virtual memory layout.
SplitAllocator * m_alloc
Physical memory allocator.
static MemoryContext * m_current
The currently active MemoryContext.
Describes virtual memory map layout.
@ KernelPrivate
< Kernel dynamic memory mappings
@ KernelData
< Kernel program data from libexec, e.g.
Memory::Range range(Region region) const
Get memory range for the given region.
Allocator which separates kernel mapped memory at virtual and physical addresses.
virtual Result allocate(Range &args)
Allocate physical memory.
Address toVirtual(const Address phys) const
Convert Address to virtual pointer.
virtual Result release(const Address addr)
Release memory page.
#define tlb_flush(addr)
Flushes the Translation Lookaside Buffers (TLB) for a single page.
unsigned long Address
A memory address.
Access
Memory access flags.
Describes a range of memory.
Size alignment
Alignment in bytes or ZERO for default alignment.
Address address
Starting address of the memory range.
Size size
Amount of memory in bytes.
Size size
Size in number of bytes.
Address virt
Virtual address.