Memory: remove GetMMIOHandler with current process
This commit is contained in:
parent
7308b8d294
commit
d4ba87d90a
|
@ -110,12 +110,6 @@ static MMIORegionPointer GetMMIOHandler(const PageTable& page_table, VAddr vaddr
|
||||||
return nullptr; // Should never happen
|
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>
|
template <typename T>
|
||||||
T ReadMMIO(MMIORegionPointer mmio_handler, VAddr addr);
|
T ReadMMIO(MMIORegionPointer mmio_handler, VAddr addr);
|
||||||
|
|
||||||
|
@ -148,7 +142,7 @@ T Read(const VAddr vaddr) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
case PageType::Special:
|
case PageType::Special:
|
||||||
return ReadMMIO<T>(GetMMIOHandler(vaddr), vaddr);
|
return ReadMMIO<T>(GetMMIOHandler(*current_page_table, vaddr), vaddr);
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -184,7 +178,7 @@ void Write(const VAddr vaddr, const T data) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PageType::Special:
|
case PageType::Special:
|
||||||
WriteMMIO<T>(GetMMIOHandler(vaddr), vaddr, data);
|
WriteMMIO<T>(GetMMIOHandler(*current_page_table, vaddr), vaddr, data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
Reference in New Issue