diff options
author | bunnei <bunneidev@gmail.com> | 2018-05-06 05:13:15 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-05-11 01:34:51 +0200 |
commit | d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07 (patch) | |
tree | a5f807f89462b91b8f81fffbd2e42a81393d0094 /src/core/hle | |
parent | thread: Implement ChangeCore function. (diff) | |
download | yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar.gz yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar.bz2 yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar.lz yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar.xz yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.tar.zst yuzu-d6e3cd9a17c47ce68ddb1392b7fff8c9e645aa07.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index fdf9f9011..9050ff3de 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -726,16 +726,31 @@ static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 return RESULT_SUCCESS; } -static ResultCode GetThreadCoreMask(Handle handle, u32* mask, u64* unknown) { - NGLOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}", handle); - *mask = 0x0; - *unknown = 0xf; +static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask) { + NGLOG_TRACE(Kernel_SVC, "called, handle=0x{:08X}", thread_handle); + + const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); + if (!thread) { + return ERR_INVALID_HANDLE; + } + + *core = thread->ideal_core; + *mask = thread->mask; + return RESULT_SUCCESS; } -static ResultCode SetThreadCoreMask(Handle handle, u32 mask, u64 unknown) { - NGLOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x{:08X}, mask=0x{:08X}, unknown=0x{:X}", - handle, mask, unknown); +static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { + NGLOG_TRACE(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:08X}, core=0x{:X}", thread_handle, + mask, core); + + const SharedPtr<Thread> thread = g_handle_table.Get<Thread>(thread_handle); + if (!thread) { + return ERR_INVALID_HANDLE; + } + + thread->ChangeCore(core, mask); + return RESULT_SUCCESS; } |