summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/vm_manager.h
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-18 04:19:16 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-08-16 06:03:45 +0200
commitcdeeecf0807d0005356f30db0f7164c5891a9245 (patch)
treee32e6d673cdac358df0abd3d3ece13f37c1c28d5 /src/core/hle/kernel/vm_manager.h
parentMemory: Move PAGE_MASK and PAGE_BITS to memory.h (diff)
downloadyuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.gz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.bz2
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.lz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.xz
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.tar.zst
yuzu-cdeeecf0807d0005356f30db0f7164c5891a9245.zip
Diffstat (limited to 'src/core/hle/kernel/vm_manager.h')
-rw-r--r--src/core/hle/kernel/vm_manager.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h
index 15c10e413..4e95f1f0c 100644
--- a/src/core/hle/kernel/vm_manager.h
+++ b/src/core/hle/kernel/vm_manager.h
@@ -171,11 +171,20 @@ public:
*/
ResultVal<VMAHandle> MapMMIO(VAddr target, PAddr paddr, u32 size, MemoryState state);
- /// Unmaps the given VMA.
- void Unmap(VMAHandle vma);
+ /// Unmaps a range of addresses, splitting VMAs as necessary.
+ ResultCode UnmapRange(VAddr target, u32 size);
/// Changes the permissions of the given VMA.
- void Reprotect(VMAHandle vma, VMAPermission new_perms);
+ VMAHandle Reprotect(VMAHandle vma, VMAPermission new_perms);
+
+ /// Changes the permissions of a range of addresses, splitting VMAs as necessary.
+ ResultCode ReprotectRange(VAddr target, u32 size, VMAPermission new_perms);
+
+ /**
+ * Scans all VMAs and updates the page table range of any that use the given vector as backing
+ * memory. This should be called after any operation that causes reallocation of the vector.
+ */
+ void RefreshMemoryBlockMappings(const std::vector<u8>* block);
/// Dumps the address space layout to the log, for debugging
void LogLayout(Log::Level log_level) const;
@@ -186,6 +195,9 @@ private:
/// Converts a VMAHandle to a mutable VMAIter.
VMAIter StripIterConstness(const VMAHandle& iter);
+ /// Unmaps the given VMA.
+ VMAIter Unmap(VMAIter vma);
+
/**
* Carves a VMA of a specific size at the specified address by splitting Free VMAs while doing
* the appropriate error checking.
@@ -193,6 +205,12 @@ private:
ResultVal<VMAIter> CarveVMA(VAddr base, u32 size);
/**
+ * Splits the edges of the given range of non-Free VMAs so that there is a VMA split at each
+ * end of the range.
+ */
+ ResultVal<VMAIter> CarveVMARange(VAddr base, u32 size);
+
+ /**
* Splits a VMA in two, at the specified offset.
* @returns the right side of the split, with the original iterator becoming the left side.
*/