From 3a91a62b8f80046f18b7629657e3679b1eb3deb4 Mon Sep 17 00:00:00 2001
From: bunnei <bunneidev@gmail.com>
Date: Sun, 31 Dec 2017 15:22:49 -0500
Subject: svc: Implement svcUnmapMemory.

---
 src/core/hle/svc.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/core/hle/svc.cpp')

diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 9f983ce0ed..3b49686d76 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) {
     return Kernel::g_current_process->MirrorMemory(dst_addr, src_addr, size);
 }
 
+/// Unmaps a region that was previously mapped with svcMapMemory
+static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
+    LOG_TRACE(Kernel_SVC, "called, dst_addr=0x%llx, src_addr=0x%llx, size=0x%llx", dst_addr,
+        src_addr, size);
+    return Kernel::g_current_process->UnmapMemory(dst_addr, src_addr, size);
+}
+
 /// Connect to an OS service given the port name, returns the handle to the port to out
 static ResultCode ConnectToPort(Kernel::Handle* out_handle, VAddr port_name_address) {
     if (!Memory::IsValidVirtualAddress(port_name_address))
@@ -241,7 +248,7 @@ static const FunctionDef SVC_Table[] = {
     {0x02, nullptr, "svcSetMemoryPermission"},
     {0x03, nullptr, "svcSetMemoryAttribute"},
     {0x04, HLE::Wrap<MapMemory>, "svcMapMemory"},
-    {0x05, nullptr, "svcUnmapMemory"},
+    {0x05, HLE::Wrap<UnmapMemory>, "svcUnmapMemory"},
     {0x06, HLE::Wrap<QueryMemory>, "svcQueryMemory"},
     {0x07, nullptr, "svcExitProcess"},
     {0x08, nullptr, "svcCreateThread"},
-- 
cgit v1.2.3-70-g09d2