kern: implement enough of KPageTable to initialize a thread

This commit is contained in:
Michael Scire 2020-02-13 17:38:56 -08:00
parent c6d1579265
commit 8c93eb5712
31 changed files with 1475 additions and 270 deletions

View file

@ -27,6 +27,10 @@ namespace ams::kern {
std::memset(buffer, 0, sizeof(buffer));
}
ALWAYS_INLINE KPhysicalAddress GetPhysicalAddress() const {
return KMemoryLayout::GetLinearPhysicalAddress(KVirtualAddress(this));
}
static ALWAYS_INLINE KPageBuffer *FromPhysicalAddress(KPhysicalAddress phys_addr) {
const KVirtualAddress virt_addr = KMemoryLayout::GetLinearVirtualAddress(phys_addr);