diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 23 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 8 |
2 files changed, 28 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 71f5804f0..7c2aee417 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "core/hle/kernel/client_port.h" | 9 | #include "core/hle/kernel/client_port.h" |
| 10 | #include "core/hle/kernel/client_session.h" | 10 | #include "core/hle/kernel/client_session.h" |
| 11 | #include "core/hle/kernel/condition_variable.h" | 11 | #include "core/hle/kernel/condition_variable.h" |
| 12 | #include "core/hle/kernel/event.h" | ||
| 12 | #include "core/hle/kernel/handle_table.h" | 13 | #include "core/hle/kernel/handle_table.h" |
| 13 | #include "core/hle/kernel/mutex.h" | 14 | #include "core/hle/kernel/mutex.h" |
| 14 | #include "core/hle/kernel/object_address_table.h" | 15 | #include "core/hle/kernel/object_address_table.h" |
| @@ -647,6 +648,22 @@ static ResultCode CloseHandle(Handle handle) { | |||
| 647 | return g_handle_table.Close(handle); | 648 | return g_handle_table.Close(handle); |
| 648 | } | 649 | } |
| 649 | 650 | ||
| 651 | /// Reset an event | ||
| 652 | static ResultCode ResetSignal(Handle handle) { | ||
| 653 | LOG_WARNING(Kernel_SVC, "(STUBBED) called handle 0x%08X", handle); | ||
| 654 | auto event = g_handle_table.Get<Event>(handle); | ||
| 655 | ASSERT(event != nullptr); | ||
| 656 | event->Clear(); | ||
| 657 | return RESULT_SUCCESS; | ||
| 658 | } | ||
| 659 | |||
| 660 | /// Creates a TransferMemory object | ||
| 661 | static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { | ||
| 662 | LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%llx, size=0x%llx, perms=%08X", addr, size, permissions); | ||
| 663 | *handle = 0; | ||
| 664 | return RESULT_SUCCESS; | ||
| 665 | } | ||
| 666 | |||
| 650 | namespace { | 667 | namespace { |
| 651 | struct FunctionDef { | 668 | struct FunctionDef { |
| 652 | using Func = void(); | 669 | using Func = void(); |
| @@ -661,7 +678,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 661 | {0x00, nullptr, "Unknown"}, | 678 | {0x00, nullptr, "Unknown"}, |
| 662 | {0x01, SvcWrap<SetHeapSize>, "SetHeapSize"}, | 679 | {0x01, SvcWrap<SetHeapSize>, "SetHeapSize"}, |
| 663 | {0x02, nullptr, "SetMemoryPermission"}, | 680 | {0x02, nullptr, "SetMemoryPermission"}, |
| 664 | {0x03, nullptr, "SetMemoryAttribute"}, | 681 | {0x03, SvcWrap<SetMemoryAttribute>, "SetMemoryAttribute"}, |
| 665 | {0x04, SvcWrap<MapMemory>, "MapMemory"}, | 682 | {0x04, SvcWrap<MapMemory>, "MapMemory"}, |
| 666 | {0x05, SvcWrap<UnmapMemory>, "UnmapMemory"}, | 683 | {0x05, SvcWrap<UnmapMemory>, "UnmapMemory"}, |
| 667 | {0x06, SvcWrap<QueryMemory>, "QueryMemory"}, | 684 | {0x06, SvcWrap<QueryMemory>, "QueryMemory"}, |
| @@ -679,9 +696,9 @@ static const FunctionDef SVC_Table[] = { | |||
| 679 | {0x12, nullptr, "ClearEvent"}, | 696 | {0x12, nullptr, "ClearEvent"}, |
| 680 | {0x13, nullptr, "MapSharedMemory"}, | 697 | {0x13, nullptr, "MapSharedMemory"}, |
| 681 | {0x14, nullptr, "UnmapSharedMemory"}, | 698 | {0x14, nullptr, "UnmapSharedMemory"}, |
| 682 | {0x15, nullptr, "CreateTransferMemory"}, | 699 | {0x15, SvcWrap<CreateTransferMemory>, "CreateTransferMemory"}, |
| 683 | {0x16, SvcWrap<CloseHandle>, "CloseHandle"}, | 700 | {0x16, SvcWrap<CloseHandle>, "CloseHandle"}, |
| 684 | {0x17, nullptr, "ResetSignal"}, | 701 | {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, |
| 685 | {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, | 702 | {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, |
| 686 | {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, | 703 | {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, |
| 687 | {0x1A, SvcWrap<LockMutex>, "LockMutex"}, | 704 | {0x1A, SvcWrap<LockMutex>, "LockMutex"}, |
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index befc4a727..31cf71a0d 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h | |||
| @@ -132,6 +132,14 @@ void SvcWrap() { | |||
| 132 | FuncReturn(retval); | 132 | FuncReturn(retval); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | template <ResultCode func(u32*, u64, u64, u32)> | ||
| 136 | void SvcWrap() { | ||
| 137 | u32 param_1 = 0; | ||
| 138 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; | ||
| 139 | Core::CPU().SetReg(1, param_1); | ||
| 140 | FuncReturn(retval); | ||
| 141 | } | ||
| 142 | |||
| 135 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 143 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 136 | // Function wrappers that return type u32 | 144 | // Function wrappers that return type u32 |
| 137 | 145 | ||