summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorGravatar Subv2017-01-11 13:20:14 -0500
committerGravatar Subv2017-01-11 16:38:05 -0500
commit1ddff1451140ef58058237a3198d363b96dc238e (patch)
tree4c8d364f61477d80de05f56917d77b566975de1e /src/core/hle/kernel/thread.cpp
parentThread: Added priority range checking to svcSetThreadPriority and removed pri... (diff)
downloadyuzu-1ddff1451140ef58058237a3198d363b96dc238e.tar.gz
yuzu-1ddff1451140ef58058237a3198d363b96dc238e.tar.xz
yuzu-1ddff1451140ef58058237a3198d363b96dc238e.zip
Threads: Check the process' resource limit for the max allowed priority when creating a thread and remove the priority clamping code.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 5ba9abf29..3b7555d87 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -353,14 +353,8 @@ static void ResetThreadContext(ARM_Interface::ThreadContext& context, u32 stack_
353 353
354ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority, 354ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority,
355 u32 arg, s32 processor_id, VAddr stack_top) { 355 u32 arg, s32 processor_id, VAddr stack_top) {
356 if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { 356 ASSERT_MSG(priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST,
357 s32 new_priority = MathUtil::Clamp<s32>(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); 357 "Invalid thread priority");
358 LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", name.c_str(),
359 priority, new_priority);
360 // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm
361 // validity of this
362 priority = new_priority;
363 }
364 358
365 if (!Memory::IsValidVirtualAddress(entry_point)) { 359 if (!Memory::IsValidVirtualAddress(entry_point)) {
366 LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %08x", name.c_str(), entry_point); 360 LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %08x", name.c_str(), entry_point);