diff options
| author | 2020-06-18 18:15:19 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:36:25 -0400 | |
| commit | 22ceaca2f415b962416637db9fff9782575746ce (patch) | |
| tree | 1c111e7c2ab438868fb9fb1aa506c0515a9199af /src | |
| parent | ArmDynarmic32: Setup CNTPCT correctly (diff) | |
| download | yuzu-22ceaca2f415b962416637db9fff9782575746ce.tar.gz yuzu-22ceaca2f415b962416637db9fff9782575746ce.tar.xz yuzu-22ceaca2f415b962416637db9fff9782575746ce.zip | |
SVC: Add GetThreadPriority32 & SetThreadPriority32
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 18 |
2 files changed, 30 insertions, 2 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 013ae9e34..5674d9558 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1135,6 +1135,10 @@ static ResultCode SetThreadPriority(Core::System& system, Handle handle, u32 pri | |||
| 1135 | return RESULT_SUCCESS; | 1135 | return RESULT_SUCCESS; |
| 1136 | } | 1136 | } |
| 1137 | 1137 | ||
| 1138 | static ResultCode SetThreadPriority32(Core::System& system, Handle handle, u32 priority) { | ||
| 1139 | return SetThreadPriority(system, handle, priority); | ||
| 1140 | } | ||
| 1141 | |||
| 1138 | /// Get which CPU core is executing the current thread | 1142 | /// Get which CPU core is executing the current thread |
| 1139 | static u32 GetCurrentProcessorNumber(Core::System& system) { | 1143 | static u32 GetCurrentProcessorNumber(Core::System& system) { |
| 1140 | LOG_TRACE(Kernel_SVC, "called"); | 1144 | LOG_TRACE(Kernel_SVC, "called"); |
| @@ -1933,6 +1937,12 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle, | |||
| 1933 | return thread->SetCoreAndAffinityMask(core, affinity_mask); | 1937 | return thread->SetCoreAndAffinityMask(core, affinity_mask); |
| 1934 | } | 1938 | } |
| 1935 | 1939 | ||
| 1940 | static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, u32 core, | ||
| 1941 | u32 affinity_mask_low, u32 affinity_mask_high) { | ||
| 1942 | const u64 affinity_mask = static_cast<u64>(affinity_mask_low) | (static_cast<u64>(affinity_mask_high) << 32); | ||
| 1943 | return SetThreadCoreMask(system, thread_handle, core, affinity_mask); | ||
| 1944 | } | ||
| 1945 | |||
| 1936 | static ResultCode CreateEvent(Core::System& system, Handle* write_handle, Handle* read_handle) { | 1946 | static ResultCode CreateEvent(Core::System& system, Handle* write_handle, Handle* read_handle) { |
| 1937 | LOG_DEBUG(Kernel_SVC, "called"); | 1947 | LOG_DEBUG(Kernel_SVC, "called"); |
| 1938 | 1948 | ||
| @@ -2206,9 +2216,9 @@ static const FunctionDef SVC_Table_32[] = { | |||
| 2206 | {0x0a, nullptr, "ExitThread32"}, | 2216 | {0x0a, nullptr, "ExitThread32"}, |
| 2207 | {0x0b, nullptr, "SleepThread32"}, | 2217 | {0x0b, nullptr, "SleepThread32"}, |
| 2208 | {0x0c, SvcWrap32<GetThreadPriority32>, "GetThreadPriority32"}, | 2218 | {0x0c, SvcWrap32<GetThreadPriority32>, "GetThreadPriority32"}, |
| 2209 | {0x0d, nullptr, "SetThreadPriority32"}, | 2219 | {0x0d, SvcWrap32<SetThreadPriority32>, "SetThreadPriority32"}, |
| 2210 | {0x0e, nullptr, "GetThreadCoreMask32"}, | 2220 | {0x0e, nullptr, "GetThreadCoreMask32"}, |
| 2211 | {0x0f, nullptr, "SetThreadCoreMask32"}, | 2221 | {0x0f, SvcWrap32<SetThreadCoreMask32>, "SetThreadCoreMask32"}, |
| 2212 | {0x10, nullptr, "GetCurrentProcessorNumber32"}, | 2222 | {0x10, nullptr, "GetCurrentProcessorNumber32"}, |
| 2213 | {0x11, nullptr, "SignalEvent32"}, | 2223 | {0x11, nullptr, "SignalEvent32"}, |
| 2214 | {0x12, nullptr, "ClearEvent32"}, | 2224 | {0x12, nullptr, "ClearEvent32"}, |
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 7d735e3fa..fd4edba2a 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h | |||
| @@ -399,6 +399,24 @@ void SvcWrap32(Core::System& system) { | |||
| 399 | func(system, static_cast<u32>(Param(system, 0)), static_cast<s32>(Param(system, 1))); | 399 | func(system, static_cast<u32>(Param(system, 0)), static_cast<s32>(Param(system, 1))); |
| 400 | } | 400 | } |
| 401 | 401 | ||
| 402 | // Used by SetThreadPriority32 | ||
| 403 | template <ResultCode func(Core::System&, Handle, u32)> | ||
| 404 | void SvcWrap32(Core::System& system) { | ||
| 405 | const u32 retval = | ||
| 406 | func(system, static_cast<Handle>(Param(system, 0)), static_cast<u32>(Param(system, 1))).raw; | ||
| 407 | FuncReturn(system, retval); | ||
| 408 | } | ||
| 409 | |||
| 410 | // Used by SetThreadCoreMask32 | ||
| 411 | template <ResultCode func(Core::System&, Handle, u32, u32, u32)> | ||
| 412 | void SvcWrap32(Core::System& system) { | ||
| 413 | const u32 retval = | ||
| 414 | func(system, static_cast<Handle>(Param(system, 0)), static_cast<u32>(Param(system, 1)), | ||
| 415 | static_cast<u32>(Param(system, 2)), static_cast<u32>(Param(system, 3))) | ||
| 416 | .raw; | ||
| 417 | FuncReturn(system, retval); | ||
| 418 | } | ||
| 419 | |||
| 402 | // Used by SendSyncRequest32 | 420 | // Used by SendSyncRequest32 |
| 403 | template <ResultCode func(Core::System&, u32)> | 421 | template <ResultCode func(Core::System&, u32)> |
| 404 | void SvcWrap32(Core::System& system) { | 422 | void SvcWrap32(Core::System& system) { |