diff options
author | archshift <admin@archshift.com> | 2015-01-20 17:16:47 -0800 |
---|---|---|
committer | archshift <admin@archshift.com> | 2015-02-10 18:30:31 -0800 |
commit | ef24e72b2618806f64345544fa46c84f3f494890 (patch) | |
tree | fca138e8377c4d66bd1fe026a3d2fef54a7f090c /src/core/hle/kernel/thread.cpp | |
parent | 168eb27aee7992b8abf9f505b8c246a25fc8dca5 (diff) |
Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)
Also removed some GEKKO cruft.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r-- | src/core/hle/kernel/thread.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 7f629c20ec..f8c834a8d5 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -29,7 +29,7 @@ bool Thread::ShouldWait() { } void Thread::Acquire() { - _assert_msg_(Kernel, !ShouldWait(), "object unavailable!"); + ASSERT_MSG(!ShouldWait(), "object unavailable!"); } // Lists all thread ids that aren't deleted/etc. @@ -144,7 +144,7 @@ void ArbitrateAllThreads(u32 address) { * @param new_thread The thread to switch to */ static void SwitchContext(Thread* new_thread) { - _dbg_assert_msg_(Kernel, new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running."); + DEBUG_ASSERT_MSG(new_thread->status == THREADSTATUS_READY, "Thread must be ready to become running."); Thread* previous_thread = GetCurrentThread(); @@ -304,14 +304,12 @@ void Thread::ResumeFromWait() { break; case THREADSTATUS_RUNNING: case THREADSTATUS_READY: - LOG_ERROR(Kernel, "Thread with object id %u has already resumed.", GetObjectId()); - _dbg_assert_(Kernel, false); + DEBUG_ASSERT_MSG(false, "Thread with object id %u has already resumed.", GetObjectId()); return; case THREADSTATUS_DEAD: // This should never happen, as threads must complete before being stopped. - LOG_CRITICAL(Kernel, "Thread with object id %u cannot be resumed because it's DEAD.", + DEBUG_ASSERT_MSG(false, "Thread with object id %u cannot be resumed because it's DEAD.", GetObjectId()); - _dbg_assert_(Kernel, false); return; } @@ -387,7 +385,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, // TODO(peachum): Remove this. Range checking should be done, and an appropriate error should be returned. static void ClampPriority(const Thread* thread, s32* priority) { if (*priority < THREADPRIO_HIGHEST || *priority > THREADPRIO_LOWEST) { - _dbg_assert_msg_(Kernel, false, "Application passed an out of range priority. An error should be returned."); + DEBUG_ASSERT_MSG(false, "Application passed an out of range priority. An error should be returned."); s32 new_priority = CLAMP(*priority, THREADPRIO_HIGHEST, THREADPRIO_LOWEST); LOG_WARNING(Kernel_SVC, "(name=%s): invalid priority=%d, clamping to %d", @@ -425,7 +423,7 @@ SharedPtr<Thread> SetupIdleThread() { } SharedPtr<Thread> SetupMainThread(u32 stack_size, u32 entry_point, s32 priority) { - _dbg_assert_(Kernel, !GetCurrentThread()); + DEBUG_ASSERT(!GetCurrentThread()); // Initialize new "main" thread auto thread_res = Thread::Create("main", entry_point, priority, 0, |