summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-12-31 21:22:49 +0100
committerbunnei <bunneidev@gmail.com>2017-12-31 21:22:49 +0100
commit3a91a62b8f80046f18b7629657e3679b1eb3deb4 (patch)
tree23c7bd6403b8b11b8707a8499dcdf06b1aa91ef1
parentsvc: Minor cleanups. (diff)
downloadyuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar.gz
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar.bz2
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar.lz
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar.xz
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.tar.zst
yuzu-3a91a62b8f80046f18b7629657e3679b1eb3deb4.zip
-rw-r--r--src/core/hle/kernel/process.cpp4
-rw-r--r--src/core/hle/kernel/process.h3
-rw-r--r--src/core/hle/svc.cpp9
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) {
return RESULT_SUCCESS;
}
+ResultCode Process::UnmapMemory(VAddr dst_addr, VAddr /*src_addr*/, u64 size) {
+ return vm_manager.UnmapRange(dst_addr, size);
+}
+
Kernel::Process::Process() {}
Kernel::Process::~Process() {}
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:
ResultCode MirrorMemory(VAddr dst_addr, VAddr src_addr, u64 size);
+ ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size);
+
+
private:
Process();
~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) {
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"},