kern: implement SvcMapPhysicalMemory

This commit is contained in:
Michael Scire authored and SciresM committed 2020-07-31 14:50:52 -07:00
1 parent 695b82b945
commit 5ecc80a5f6
11 files changed
+559 -13

No files matched your search

@@ -180,6 +180,10 @@ namespace ams::kern {
return this->address_space_start <= addr && addr < addr + size && addr + size - 1 <= this->address_space_end - 1;
}
constexpr bool IsInAliasRegion(KProcessAddress addr, size_t size) const {
return this->Contains(addr, size) && this->alias_region_start <= addr && addr + size - 1 <= this->alias_region_end - 1;
}
KProcessAddress GetRegionAddress(KMemoryState state) const;
size_t GetRegionSize(KMemoryState state) const;
bool CanContain(KProcessAddress addr, size_t size, KMemoryState state) const;
@@ -336,6 +340,12 @@ namespace ams::kern {
Result CleanupForIpcServer(KProcessAddress address, size_t size, KMemoryState dst_state, KProcess *server_process);
Result CleanupForIpcClient(KProcessAddress address, size_t size, KMemoryState dst_state);
Result MapPhysicalMemory(KProcessAddress address, size_t size);
Result UnmapPhysicalMemory(KProcessAddress address, size_t size);
Result MapPhysicalMemoryUnsafe(KProcessAddress address, size_t size);
Result UnmapPhysicalMemoryUnsafe(KProcessAddress address, size_t size);
void DumpTable() const {
KScopedLightLock lk(this->general_lock);
this->GetImpl().Dump(GetInteger(this->address_space_start), this->address_space_end - this->address_space_start);