diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index f8c834a8d..be1aed615 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common.h" | 9 | #include "common/common.h" |
| 10 | #include "common/math_util.h" | ||
| 10 | #include "common/thread_queue_list.h" | 11 | #include "common/thread_queue_list.h" |
| 11 | 12 | ||
| 12 | #include "core/arm/arm_interface.h" | 13 | #include "core/arm/arm_interface.h" |
| @@ -339,7 +340,7 @@ static void DebugThreadQueue() { | |||
| 339 | ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority, | 340 | ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, s32 priority, |
| 340 | u32 arg, s32 processor_id, VAddr stack_top) { | 341 | u32 arg, s32 processor_id, VAddr stack_top) { |
| 341 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { | 342 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { |
| 342 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 343 | s32 new_priority = MathUtil::Clamp<s32>(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 343 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", | 344 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", |
| 344 | name.c_str(), priority, new_priority); | 345 | name.c_str(), priority, new_priority); |
| 345 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 346 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |
| @@ -387,7 +388,7 @@ static void ClampPriority(const Thread* thread, s32* priority) { | |||
| 387 | if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { | 388 | if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { |
| 388 | DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned."); | 389 | DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned."); |
| 389 | 390 | ||
| 390 | s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 391 | s32 new_priority = MathUtil::Clamp<s32>(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 391 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", | 392 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", |
| 392 | thread->name.c_str(), *priority, new_priority); | 393 | thread->name.c_str(), *priority, new_priority); |
| 393 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 394 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |