kern: update KPageTable::Unmap block closing logic

This commit is contained in:
Michael Scire 2021-09-17 16:54:49 -07:00 committed by SciresM
parent 8b49cea4a9
commit 4c73c461f1
3 changed files with 20 additions and 3 deletions

View file

@ -26,6 +26,18 @@ namespace ams::kern {
}
}
void KPageGroup::CloseAndReset() {
auto &mm = Kernel::GetMemoryManager();
auto it = m_block_list.begin();
while (it != m_block_list.end()) {
KBlockInfo *info = std::addressof(*it);
it = m_block_list.erase(it);
mm.Close(info->GetAddress(), info->GetNumPages());
m_manager->Free(info);
}
}
size_t KPageGroup::GetNumPages() const {
size_t num_pages = 0;