diff options
| author | 2018-02-22 20:16:43 +0100 | |
|---|---|---|
| committer | 2018-02-25 11:38:06 +0100 | |
| commit | 2b41c6e5738c2052fd0aaa1cf8e5475c37614115 (patch) | |
| tree | 404594c84a9f1e036632a5ad0f20e20dfbd9836d /src | |
| parent | Merge pull request #211 from shinyquagsire23/time_local (diff) | |
| download | yuzu-2b41c6e5738c2052fd0aaa1cf8e5475c37614115.tar.gz yuzu-2b41c6e5738c2052fd0aaa1cf8e5475c37614115.tar.xz yuzu-2b41c6e5738c2052fd0aaa1cf8e5475c37614115.zip | |
Add UnmapSharedMemory
C++11 requires spaces on the Identifier
Add inttypes include
clang
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 5 |
2 files changed, 17 insertions, 1 deletions
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 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <inttypes.h> | ||
| 6 | 7 | ||
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 8 | #include "common/microprofile.h" | 9 | #include "common/microprofile.h" |
| @@ -443,6 +444,16 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s | |||
| 443 | return RESULT_SUCCESS; | 444 | return RESULT_SUCCESS; |
| 444 | } | 445 | } |
| 445 | 446 | ||
| 447 | static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 size) { | ||
| 448 | LOG_WARNING(Kernel_SVC, | ||
| 449 | "called, shared_memory_handle=0x%08X, addr=0x%" PRIx64 ", size=0x%" PRIx64 "", | ||
| 450 | shared_memory_handle, addr, size); | ||
| 451 | |||
| 452 | SharedPtr<SharedMemory> shared_memory = g_handle_table.Get<SharedMemory>(shared_memory_handle); | ||
| 453 | |||
| 454 | return shared_memory->Unmap(g_current_process.get(), addr); | ||
| 455 | } | ||
| 456 | |||
| 446 | /// Query process memory | 457 | /// Query process memory |
| 447 | static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_info*/, | 458 | static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_info*/, |
| 448 | Handle process_handle, u64 addr) { | 459 | Handle process_handle, u64 addr) { |
| @@ -792,7 +803,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 792 | {0x11, nullptr, "SignalEvent"}, | 803 | {0x11, nullptr, "SignalEvent"}, |
| 793 | {0x12, nullptr, "ClearEvent"}, | 804 | {0x12, nullptr, "ClearEvent"}, |
| 794 | {0x13, SvcWrap<MapSharedMemory>, "MapSharedMemory"}, | 805 | {0x13, SvcWrap<MapSharedMemory>, "MapSharedMemory"}, |
| 795 | {0x14, nullptr, "UnmapSharedMemory"}, | 806 | {0x14, SvcWrap<UnmapSharedMemory>, "UnmapSharedMemory"}, |
| 796 | {0x15, SvcWrap<CreateTransferMemory>, "CreateTransferMemory"}, | 807 | {0x15, SvcWrap<CreateTransferMemory>, "CreateTransferMemory"}, |
| 797 | {0x16, SvcWrap<CloseHandle>, "CloseHandle"}, | 808 | {0x16, SvcWrap<CloseHandle>, "CloseHandle"}, |
| 798 | {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, | 809 | {0x17, SvcWrap<ResetSignal>, "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() { | |||
| 91 | FuncReturn(func((u32)PARAM(0), PARAM(1), PARAM(2), (u32)PARAM(3)).raw); | 91 | FuncReturn(func((u32)PARAM(0), PARAM(1), PARAM(2), (u32)PARAM(3)).raw); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | template <ResultCode func(u32, u64, u64)> | ||
| 95 | void SvcWrap() { | ||
| 96 | FuncReturn(func((u32)PARAM(0), PARAM(1), PARAM(2)).raw); | ||
| 97 | } | ||
| 98 | |||
| 94 | template <ResultCode func(u32*, u64, u64, s64)> | 99 | template <ResultCode func(u32*, u64, u64, s64)> |
| 95 | void SvcWrap() { | 100 | void SvcWrap() { |
| 96 | u32 param_1 = 0; | 101 | u32 param_1 = 0; |