Memory: remove GetMMIOHandler with current process

This commit is contained in:
Weiyi Wang 2018-11-17 14:34:26 -05:00
parent 7308b8d294
commit d4ba87d90a

View File

@ -110,12 +110,6 @@ static MMIORegionPointer GetMMIOHandler(const PageTable& page_table, VAddr vaddr
return nullptr; // Should never happen
}
static MMIORegionPointer GetMMIOHandler(VAddr vaddr) {
const PageTable& page_table =
Core::System::GetInstance().Kernel().GetCurrentProcess()->vm_manager.page_table;
return GetMMIOHandler(page_table, vaddr);
}
template <typename T>
T ReadMMIO(MMIORegionPointer mmio_handler, VAddr addr);
@ -148,7 +142,7 @@ T Read(const VAddr vaddr) {
return value;
}
case PageType::Special:
return ReadMMIO<T>(GetMMIOHandler(vaddr), vaddr);
return ReadMMIO<T>(GetMMIOHandler(*current_page_table, vaddr), vaddr);
default:
UNREACHABLE();
}
@ -184,7 +178,7 @@ void Write(const VAddr vaddr, const T data) {
break;
}
case PageType::Special:
WriteMMIO<T>(GetMMIOHandler(vaddr), vaddr, data);
WriteMMIO<T>(GetMMIOHandler(*current_page_table, vaddr), vaddr, data);
break;
default:
UNREACHABLE();