kern: retrieve target firmware from exosphere instead of hardcoding

This commit is contained in:
Michael Scire 2020-07-14 19:52:41 -07:00
parent 8295d4830d
commit e179b5e1fa

View File

@ -640,15 +640,10 @@ namespace ams::kern::board::nintendo::nx {
} }
bool KDevicePageTable::Compare(const KPageGroup &compare_pg, KDeviceVirtualAddress device_address) const { bool KDevicePageTable::Compare(const KPageGroup &compare_pg, KDeviceVirtualAddress device_address) const {
bool same_pages = false; /* Check whether the page group we expect for the virtual address matches the page group we're validating. */
/* Make a page group. */
KPageGroup calc_pg(std::addressof(Kernel::GetBlockInfoManager())); KPageGroup calc_pg(std::addressof(Kernel::GetBlockInfoManager()));
if (R_SUCCEEDED(this->MakePageGroup(std::addressof(calc_pg), device_address, compare_pg.GetNumPages() * PageSize))) { return (R_SUCCEEDED(this->MakePageGroup(std::addressof(calc_pg), device_address, compare_pg.GetNumPages() * PageSize))) &&
same_pages = calc_pg.IsEquivalentTo(compare_pg); calc_pg.IsEquivalentTo(compare_pg);
}
return same_pages;
} }
Result KDevicePageTable::Map(size_t *out_mapped_size, const KPageGroup &pg, KDeviceVirtualAddress device_address, ams::svc::MemoryPermission device_perm, bool refresh_mappings) { Result KDevicePageTable::Map(size_t *out_mapped_size, const KPageGroup &pg, KDeviceVirtualAddress device_address, ams::svc::MemoryPermission device_perm, bool refresh_mappings) {