Memory: register page tables into a list for rasterizer cache marking

This commit is contained in:
Weiyi Wang 2018-12-10 22:13:10 -05:00
parent 9d616e5951
commit 88161b8ac6
3 changed files with 23 additions and 2 deletions

View file

@ -70,6 +70,7 @@ public:
PageTable* current_page_table = nullptr;
RasterizerCacheMarker cache_marker;
std::vector<PageTable*> page_table_list;
};
MemorySystem::MemorySystem() : impl(std::make_unique<Impl>()) {}
@ -146,6 +147,15 @@ u8* MemorySystem::GetPointerForRasterizerCache(VAddr addr) {
UNREACHABLE();
}
void MemorySystem::RegisterPageTable(PageTable* page_table) {
impl->page_table_list.push_back(page_table);
}
void MemorySystem::UnregisterPageTable(PageTable* page_table) {
impl->page_table_list.erase(
std::find(impl->page_table_list.begin(), impl->page_table_list.end(), page_table));
}
/**
* This function should only be called for virtual addreses with attribute `PageType::Special`.
*/