From 2b41c6e5738c2052fd0aaa1cf8e5475c37614115 Mon Sep 17 00:00:00 2001 From: N00byKing Date: Thu, 22 Feb 2018 20:16:43 +0100 Subject: Add UnmapSharedMemory C++11 requires spaces on the Identifier Add inttypes include clang --- src/core/hle/kernel/svc.cpp | 13 ++++++++++++- src/core/hle/kernel/svc_wrap.h | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index cbd5b69aa..92bb80404 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "common/logging/log.h" #include "common/microprofile.h" @@ -443,6 +444,16 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s return RESULT_SUCCESS; } +static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { + LOG_WARNING(Kernel_SVC, + "called, shared_memory_handle=0x%08X, addr=0x%" PRIx64 ", size=0x%" PRIx64 "", + shared_memory_handle, addr, size); + + SharedPtr shared_memory = g_handle_table.Get(shared_memory_handle); + + return shared_memory->Unmap(g_current_process.get(), addr); +} + /// Query process memory static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_info*/, Handle process_handle, u64 addr) { @@ -792,7 +803,7 @@ static const FunctionDef SVC_Table[] = { {0x11, nullptr, "SignalEvent"}, {0x12, nullptr, "ClearEvent"}, {0x13, SvcWrap, "MapSharedMemory"}, - {0x14, nullptr, "UnmapSharedMemory"}, + {0x14, SvcWrap, "UnmapSharedMemory"}, {0x15, SvcWrap, "CreateTransferMemory"}, {0x16, SvcWrap, "CloseHandle"}, {0x17, SvcWrap, "ResetSignal"}, diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 7a165d8dc..b224f5e67 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -91,6 +91,11 @@ void SvcWrap() { FuncReturn(func((u32)PARAM(0), PARAM(1), PARAM(2), (u32)PARAM(3)).raw); } +template +void SvcWrap() { + FuncReturn(func((u32)PARAM(0), PARAM(1), PARAM(2)).raw); +} + template void SvcWrap() { u32 param_1 = 0; -- cgit v1.2.3 From 08c6ac02cf502a787f24619cf1b50bc430bbcdea Mon Sep 17 00:00:00 2001 From: N00byKing Date: Sun, 25 Feb 2018 13:40:22 +0100 Subject: (Hopefully) Fix MinGW Build --- src/core/hle/kernel/svc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 92bb80404..4141c0ec2 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -3,7 +3,7 @@ // Refer to the license.txt file included. #include -#include +#include #include "common/logging/log.h" #include "common/microprofile.h" -- cgit v1.2.3