diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-04-12 00:38:54 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-04-12 21:56:03 -0400 |
| commit | 4d293bb5cbb65d3551dd0d22e92b7065a7ebba14 (patch) | |
| tree | d57782959b51296eef132a721a1b6d0600e8e117 /src/core/hle/kernel/vm_manager.h | |
| parent | 76a2465655be493492446b4ef686f4b59b2e3969 (diff) | |
kernel/svc: Implement svcUnmapProcessCodeMemory
Essentially performs the inverse of svcMapProcessCodeMemory. This unmaps
the aliasing region first, then restores the general traits of the
aliased memory.
What this entails, is:
- Restoring Read/Write permissions to the VMA.
- Restoring its memory state to reflect it as a general heap memory region.
- Clearing the memory attributes on the region.
Diffstat (limited to 'src/core/hle/kernel/vm_manager.h')
| -rw-r--r-- | src/core/hle/kernel/vm_manager.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 27120d3b1..288eb9450 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -441,6 +441,29 @@ public: /// ResultCode MapCodeMemory(VAddr dst_address, VAddr src_address, u64 size); + /// Unmaps a region of memory designated as code module memory. + /// + /// @param dst_address The base address of the memory region aliasing the source memory region. + /// @param src_address The base address of the memory region being aliased. + /// @param size The size of the memory region to unmap in bytes. + /// + /// @pre Both memory ranges lie within the actual addressable address space. + /// + /// @pre The memory region being unmapped has been previously been mapped + /// by a call to MapCodeMemory. + /// + /// @post After execution of the function, if successful. the aliasing memory region + /// will be unmapped and the aliased region will have various traits about it + /// restored to what they were prior to the original mapping call preceding + /// this function call. + /// <p> + /// What this also entails is as follows: + /// 1. The state of the memory region will now indicate a general heap region. + /// 2. All memory attributes for the memory region are cleared. + /// 3. Memory permissions for the region are restored to user read/write. + /// + ResultCode UnmapCodeMemory(VAddr dst_address, VAddr src_address, u64 size); + /// Queries the memory manager for information about the given address. /// /// @param address The address to query the memory manager about for information. |
