Kernel: Cleanup VirtualRange code

Virtual range does not need to look into the page table for mapped
physcial pages. It can (and should) just keep track of them itself.
This commit is contained in:
2024-07-21 17:35:07 +03:00
parent 02051ed60f
commit 96c7e9e29d
2 changed files with 88 additions and 118 deletions

View File

@@ -30,19 +30,20 @@ namespace Kernel
BAN::ErrorOr<void> allocate_page_for_demand_paging(vaddr_t address);
void copy_from(size_t offset, const uint8_t* buffer, size_t bytes);
private:
VirtualRange(PageTable&, bool preallocated, vaddr_t, size_t, PageTable::flags_t);
BAN::ErrorOr<void> initialize();
private:
VirtualRange(PageTable&, bool preallocated);
PageTable& m_page_table;
const bool m_preallocated;
const vaddr_t m_vaddr;
const size_t m_size;
const PageTable::flags_t m_flags;
BAN::Vector<paddr_t> m_paddrs;
SpinLock m_lock;
void set_zero();
private:
PageTable& m_page_table;
const bool m_preallocated;
vaddr_t m_vaddr { 0 };
size_t m_size { 0 };
PageTable::flags_t m_flags { 0 };
friend class BAN::UniqPtr<VirtualRange>;
};
}