Go to the documentation of this file.
24 #define PAGE_PRESENT 1
29 #define PAGE_SECTION (1 << 7)
38 #define DIRENTRY(vaddr) \
98 return table->
unmap(virt);
149 const Size allocSize = alloc->
size();
150 if (phys < allocBase || phys > allocBase + allocSize)
191 const bool tablesOnly)
virtual Result allocate(Range &args)
Allocate physical memory.
#define SECTIONMASK
Mask for large 1MiB section mappings.
MemoryContext::Result releaseSection(const Memory::Range range, SplitAllocator *alloc, const bool tablesOnly)
Release memory sections.
Intel second level page table implementation.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
#define PAGEMASK
Mask to find the page.
MemoryContext::Result unmap(Address virt, SplitAllocator *alloc)
Remove virtual address mapping.
u32 m_tables[1024]
Array of page directory entries.
#define PAGESIZE
ARM uses 4K pages.
unsigned long Address
A memory address.
MemoryContext::Result translate(Address virt, Address *phys) const
Translate virtual address to physical 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.
void releasePhysical(SplitAllocator *alloc, const Address phys)
Release a single physical page.
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.
#define MegaByte(v)
Convert megabytes to bytes.
MemoryContext::Result map(Address virt, Address phys, Memory::Access access)
Map a virtual address to a physical address.
#define DIRENTRY(vaddr)
Entry inside the page directory of a given virtual address.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
virtual Size size() const
Get memory size.
MemoryContext::Result access(Address virt, Memory::Access *access, SplitAllocator *alloc) const
Get Access flags for a virtual address.
Access
Memory access flags.
Address base() const
Get memory base address for allocations.
Describes a range of memory.
Intel page directory implementation.
virtual Result release(const Address addr)
Release memory page.
u32 flags(Memory::Access access) const
Convert Memory::Access to page directory flags.
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.
MemoryContext::Result unmap(Address virt)
Remove virtual address mapping.
Size size
Size in number of bytes.
IntelPageTable * getPageTable(Address virt, SplitAllocator *alloc) const
Retrieve second level page table.
bool isAllocated(const Address page) const
Check if a physical page is allocated.
Address toVirtual(const Address phys) const
Convert Address to virtual pointer.
MemoryContext::Result access(Address virt, Memory::Access *access) const
Get Access flags for a virtual address.