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)
#define DIRENTRY(vaddr)
Entry inside the page directory of a given virtual address.
Address base() const
Get memory base address for allocations.
virtual Size size() const
Get memory size.
Intel page directory implementation.
MemoryContext::Result unmap(Address virt, SplitAllocator *alloc)
Remove virtual address mapping.
u32 flags(Memory::Access access) const
Convert Memory::Access to page directory flags.
void releasePhysical(SplitAllocator *alloc, const Address phys)
Release a single physical page.
IntelPageTable * getPageTable(Address virt, SplitAllocator *alloc) const
Retrieve second level page table.
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.
u32 m_tables[1024]
Array of page directory entries.
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.
Intel second level page table implementation.
MemoryContext::Result map(Address virt, Address phys, Memory::Access access)
Map a virtual address to a physical address.
MemoryContext::Result access(Address virt, Memory::Access *access) const
Get Access flags for a virtual address.
MemoryContext::Result translate(Address virt, Address *phys) const
Translate virtual address to physical address.
MemoryContext::Result unmap(Address virt)
Remove virtual address mapping.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Allocator which separates kernel mapped memory at virtual and physical addresses.
virtual Result allocate(Range &args)
Allocate physical memory.
bool isAllocated(const Address page) const
Check if a physical page is allocated.
Address toVirtual(const Address phys) const
Convert Address to virtual pointer.
virtual Result release(const Address addr)
Release memory page.
#define PAGESIZE
ARM uses 4K pages.
#define PAGEMASK
Mask to find the page.
#define SECTIONMASK
Mask for large 1MiB section mappings.
unsigned int u32
Unsigned 32-bit number.
unsigned long Address
A memory address.
#define MegaByte(v)
Convert megabytes to bytes.
unsigned int Size
Any sane size indicator cannot go negative.
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.