diff options
author | Subv <subv2112@gmail.com> | 2018-01-08 03:24:19 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-01-11 05:27:59 +0100 |
commit | ba02f0deefcf3e748615cc00ad99bcae4d681fa3 (patch) | |
tree | 5c94e8e34134e3efc8bd583ed799d96738064ff3 /src/core/hle/kernel | |
parent | svc: Stub SetMemoryAttribute (diff) | |
download | yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar.gz yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar.bz2 yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar.lz yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar.xz yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.tar.zst yuzu-ba02f0deefcf3e748615cc00ad99bcae4d681fa3.zip |
Diffstat (limited to 'src/core/hle/kernel')
-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 @@ #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" #include "core/hle/kernel/condition_variable.h" +#include "core/hle/kernel/event.h" #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/object_address_table.h" @@ -647,6 +648,22 @@ static ResultCode CloseHandle(Handle handle) { return g_handle_table.Close(handle); } +/// Reset an event +static ResultCode ResetSignal(Handle handle) { + LOG_WARNING(Kernel_SVC, "(STUBBED) called handle 0x%08X", handle); + auto event = g_handle_table.Get<Event>(handle); + ASSERT(event != nullptr); + event->Clear(); + return RESULT_SUCCESS; +} + +/// Creates a TransferMemory object +static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 permissions) { + LOG_WARNING(Kernel_SVC, "(STUBBED) called addr=0x%llx, size=0x%llx, perms=%08X", addr, size, permissions); + *handle = 0; + return RESULT_SUCCESS; +} + namespace { struct FunctionDef { using Func = void(); @@ -661,7 +678,7 @@ static const FunctionDef SVC_Table[] = { {0x00, nullptr, "Unknown"}, {0x01, SvcWrap<SetHeapSize>, "SetHeapSize"}, {0x02, nullptr, "SetMemoryPermission"}, - {0x03, nullptr, "SetMemoryAttribute"}, + {0x03, SvcWrap<SetMemoryAttribute>, "SetMemoryAttribute"}, {0x04, SvcWrap<MapMemory>, "MapMemory"}, {0x05, SvcWrap<UnmapMemory>, "UnmapMemory"}, {0x06, SvcWrap<QueryMemory>, "QueryMemory"}, @@ -679,9 +696,9 @@ static const FunctionDef SVC_Table[] = { {0x12, nullptr, "ClearEvent"}, {0x13, nullptr, "MapSharedMemory"}, {0x14, nullptr, "UnmapSharedMemory"}, - {0x15, nullptr, "CreateTransferMemory"}, + {0x15, SvcWrap<CreateTransferMemory>, "CreateTransferMemory"}, {0x16, SvcWrap<CloseHandle>, "CloseHandle"}, - {0x17, nullptr, "ResetSignal"}, + {0x17, SvcWrap<ResetSignal>, "ResetSignal"}, {0x18, SvcWrap<WaitSynchronization>, "WaitSynchronization"}, {0x19, SvcWrap<CancelSynchronization>, "CancelSynchronization"}, {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() { FuncReturn(retval); } +template <ResultCode func(u32*, u64, u64, u32)> +void SvcWrap() { + u32 param_1 = 0; + u32 retval = func(¶m_1, PARAM(1), PARAM(2), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; + Core::CPU().SetReg(1, param_1); + FuncReturn(retval); +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // Function wrappers that return type u32 |