diff options
| author | 2014-12-12 23:20:01 -0500 | |
|---|---|---|
| committer | 2014-12-12 23:20:01 -0500 | |
| commit | af1cd769e7b407af71496e788e218add31f8b2b0 (patch) | |
| tree | 1e3fd71256c04a15970b09abd3f7280f8b1ff678 /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #267 from bunnei/apt-shared-font (diff) | |
| parent | Remove old logging system (diff) | |
| download | yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.gz yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.xz yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.zip | |
Merge pull request #258 from yuriks/log-ng
New logging system
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 492b917e1..1c04701de 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -150,13 +150,13 @@ void ChangeReadyState(Thread* t, bool ready) { | |||
| 150 | 150 | ||
| 151 | /// Verify that a thread has not been released from waiting | 151 | /// Verify that a thread has not been released from waiting |
| 152 | static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle) { | 152 | static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle) { |
| 153 | _dbg_assert_(KERNEL, thread != nullptr); | 153 | _dbg_assert_(Kernel, thread != nullptr); |
| 154 | return (type == thread->wait_type) && (wait_handle == thread->wait_handle) && (thread->IsWaiting()); | 154 | return (type == thread->wait_type) && (wait_handle == thread->wait_handle) && (thread->IsWaiting()); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | /// Verify that a thread has not been released from waiting (with wait address) | 157 | /// Verify that a thread has not been released from waiting (with wait address) |
| 158 | static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle, VAddr wait_address) { | 158 | static bool VerifyWait(const Thread* thread, WaitType type, Handle wait_handle, VAddr wait_address) { |
| 159 | _dbg_assert_(KERNEL, thread != nullptr); | 159 | _dbg_assert_(Kernel, thread != nullptr); |
| 160 | return VerifyWait(thread, type, wait_handle) && (wait_address == thread->wait_address); | 160 | return VerifyWait(thread, type, wait_handle) && (wait_address == thread->wait_address); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| @@ -196,7 +196,7 @@ void ChangeThreadState(Thread* t, ThreadStatus new_status) { | |||
| 196 | 196 | ||
| 197 | if (new_status == THREADSTATUS_WAIT) { | 197 | if (new_status == THREADSTATUS_WAIT) { |
| 198 | if (t->wait_type == WAITTYPE_NONE) { | 198 | if (t->wait_type == WAITTYPE_NONE) { |
| 199 | ERROR_LOG(KERNEL, "Waittype none not allowed"); | 199 | LOG_ERROR(Kernel, "Waittype none not allowed"); |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | } | 202 | } |
| @@ -318,12 +318,12 @@ void DebugThreadQueue() { | |||
| 318 | if (!thread) { | 318 | if (!thread) { |
| 319 | return; | 319 | return; |
| 320 | } | 320 | } |
| 321 | INFO_LOG(KERNEL, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThreadHandle()); | 321 | LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThreadHandle()); |
| 322 | for (u32 i = 0; i < thread_queue.size(); i++) { | 322 | for (u32 i = 0; i < thread_queue.size(); i++) { |
| 323 | Handle handle = thread_queue[i]; | 323 | Handle handle = thread_queue[i]; |
| 324 | s32 priority = thread_ready_queue.contains(handle); | 324 | s32 priority = thread_ready_queue.contains(handle); |
| 325 | if (priority != -1) { | 325 | if (priority != -1) { |
| 326 | INFO_LOG(KERNEL, "0x%02X 0x%08X", priority, handle); | 326 | LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, handle); |
| 327 | } | 327 | } |
| 328 | } | 328 | } |
| 329 | } | 329 | } |
| @@ -333,7 +333,7 @@ Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 prio | |||
| 333 | s32 processor_id, u32 stack_top, int stack_size) { | 333 | s32 processor_id, u32 stack_top, int stack_size) { |
| 334 | 334 | ||
| 335 | _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST), | 335 | _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST), |
| 336 | "CreateThread priority=%d, outside of allowable range!", priority) | 336 | "priority=%d, outside of allowable range!", priority) |
| 337 | 337 | ||
| 338 | Thread* thread = new Thread; | 338 | Thread* thread = new Thread; |
| 339 | 339 | ||
| @@ -362,24 +362,24 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3 | |||
| 362 | u32 stack_top, int stack_size) { | 362 | u32 stack_top, int stack_size) { |
| 363 | 363 | ||
| 364 | if (name == nullptr) { | 364 | if (name == nullptr) { |
| 365 | ERROR_LOG(KERNEL, "CreateThread(): nullptr name"); | 365 | LOG_ERROR(Kernel_SVC, "nullptr name"); |
| 366 | return -1; | 366 | return -1; |
| 367 | } | 367 | } |
| 368 | if ((u32)stack_size < 0x200) { | 368 | if ((u32)stack_size < 0x200) { |
| 369 | ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name, | 369 | LOG_ERROR(Kernel_SVC, "(name=%s): invalid stack_size=0x%08X", name, |
| 370 | stack_size); | 370 | stack_size); |
| 371 | return -1; | 371 | return -1; |
| 372 | } | 372 | } |
| 373 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { | 373 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { |
| 374 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 374 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 375 | WARN_LOG(KERNEL, "CreateThread(name=%s): invalid priority=0x%08X, clamping to %08X", | 375 | LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", |
| 376 | name, priority, new_priority); | 376 | name, priority, new_priority); |
| 377 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 377 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |
| 378 | // validity of this | 378 | // validity of this |
| 379 | priority = new_priority; | 379 | priority = new_priority; |
| 380 | } | 380 | } |
| 381 | if (!Memory::GetPointer(entry_point)) { | 381 | if (!Memory::GetPointer(entry_point)) { |
| 382 | ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid entry %08x", name, entry_point); | 382 | LOG_ERROR(Kernel_SVC, "(name=%s): invalid entry %08x", name, entry_point); |
| 383 | return -1; | 383 | return -1; |
| 384 | } | 384 | } |
| 385 | Handle handle; | 385 | Handle handle; |
| @@ -416,7 +416,7 @@ ResultCode SetThreadPriority(Handle handle, s32 priority) { | |||
| 416 | // If priority is invalid, clamp to valid range | 416 | // If priority is invalid, clamp to valid range |
| 417 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { | 417 | if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) { |
| 418 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); | 418 | s32 new_priority = CLAMP(priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); |
| 419 | WARN_LOG(KERNEL, "invalid priority=0x%08X, clamping to %08X", priority, new_priority); | 419 | LOG_WARNING(Kernel_SVC, "invalid priority=%d, clamping to %d", priority, new_priority); |
| 420 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm | 420 | // TODO(bunnei): Clamping to a valid priority is not necessarily correct behavior... Confirm |
| 421 | // validity of this | 421 | // validity of this |
| 422 | priority = new_priority; | 422 | priority = new_priority; |
| @@ -470,7 +470,7 @@ void Reschedule() { | |||
| 470 | Thread* next = NextThread(); | 470 | Thread* next = NextThread(); |
| 471 | HLE::g_reschedule = false; | 471 | HLE::g_reschedule = false; |
| 472 | if (next > 0) { | 472 | if (next > 0) { |
| 473 | INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle()); | 473 | LOG_TRACE(Kernel, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle()); |
| 474 | 474 | ||
| 475 | SwitchContext(next); | 475 | SwitchContext(next); |
| 476 | 476 | ||