diff options
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.h | 3 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 9 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 80b1be1fd..35cf6dc95 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -292,6 +292,10 @@ ResultCode Process::MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | |||
| 292 | return RESULT_SUCCESS; | 292 | return RESULT_SUCCESS; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | ResultCode Process::UnmapMemory(VAddr dst_addr, VAddr /*src_addr*/, u64 size) { | ||
| 296 | return vm_manager.UnmapRange(dst_addr, size); | ||
| 297 | } | ||
| 298 | |||
| 295 | Kernel::Process::Process() {} | 299 | Kernel::Process::Process() {} |
| 296 | Kernel::Process::~Process() {} | 300 | Kernel::Process::~Process() {} |
| 297 | 301 | ||
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 6774168e5..3ea8c298f 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -179,6 +179,9 @@ public: | |||
| 179 | 179 | ||
| 180 | ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size); | 180 | ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size); |
| 181 | 181 | ||
| 182 | ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size); | ||
| 183 | |||
| 184 | |||
| 182 | private: | 185 | private: |
| 183 | Process(); | 186 | Process(); |
| 184 | ~Process() override; | 187 | ~Process() override; |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 9f983ce0e..3b49686d7 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -41,6 +41,13 @@ static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | |||
| 41 | return Kernel::g_current_process->MirrorMemory(dst_addr, src_addr, size); | 41 | return Kernel::g_current_process->MirrorMemory(dst_addr, src_addr, size); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | /// Unmaps a region that was previously mapped with svcMapMemory | ||
| 45 | static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) { | ||
| 46 | LOG_TRACE(Kernel_SVC, "called, dst_addr=0x%llx, src_addr=0x%llx, size=0x%llx", dst_addr, | ||
| 47 | src_addr, size); | ||
| 48 | return Kernel::g_current_process->UnmapMemory(dst_addr, src_addr, size); | ||
| 49 | } | ||
| 50 | |||
| 44 | /// Connect to an OS service given the port name, returns the handle to the port to out | 51 | /// Connect to an OS service given the port name, returns the handle to the port to out |
| 45 | static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) { | 52 | static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) { |
| 46 | if (!Memory::IsValidVirtualAddress(port_name_address)) | 53 | if (!Memory::IsValidVirtualAddress(port_name_address)) |
| @@ -241,7 +248,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 241 | {0x02, nullptr, "svcSetMemoryPermission"}, | 248 | {0x02, nullptr, "svcSetMemoryPermission"}, |
| 242 | {0x03, nullptr, "svcSetMemoryAttribute"}, | 249 | {0x03, nullptr, "svcSetMemoryAttribute"}, |
| 243 | {0x04, HLE::Wrap<MapMemory>, "svcMapMemory"}, | 250 | {0x04, HLE::Wrap<MapMemory>, "svcMapMemory"}, |
| 244 | {0x05, nullptr, "svcUnmapMemory"}, | 251 | {0x05, HLE::Wrap<UnmapMemory>, "svcUnmapMemory"}, |
| 245 | {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"}, | 252 | {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"}, |
| 246 | {0x07, nullptr, "svcExitProcess"}, | 253 | {0x07, nullptr, "svcExitProcess"}, |
| 247 | {0x08, nullptr, "svcCreateThread"}, | 254 | {0x08, nullptr, "svcCreateThread"}, |