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