diff options
| author | Chloe <25727384+ogniK5377@users.noreply.github.com> | 2021-02-13 10:43:01 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-12 15:43:01 -0800 |
| commit | 37939482fb93d2155d8625596f2b1145d4f6e8e3 (patch) | |
| tree | 0c18a00c0f9be5cc87b50ff46c439765d9f7db46 /src/core/hle/kernel/k_condition_variable.cpp | |
| parent | a0379c2db514b5276e11c847dc6c600fb0a0b5d6 (diff) | |
kernel: Unify result codes (#5890)
* kernel: Unify result codes
Drop the usage of ERR_NAME convention in kernel for ResultName. Removed seperation between svc_results.h & errors.h as we mainly include both most of the time anyways.
* oops
* rename errors to svc_results
Diffstat (limited to 'src/core/hle/kernel/k_condition_variable.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_condition_variable.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp index f0ad8b390..170d8fa0d 100644 --- a/src/core/hle/kernel/k_condition_variable.cpp +++ b/src/core/hle/kernel/k_condition_variable.cpp @@ -92,10 +92,10 @@ ResultCode KConditionVariable::SignalToAddress(VAddr addr) { // Write the value to userspace. if (!WriteToUser(system, addr, std::addressof(next_value))) { if (next_owner_thread) { - next_owner_thread->SetSyncedObject(nullptr, Svc::ResultInvalidCurrentMemory); + next_owner_thread->SetSyncedObject(nullptr, ResultInvalidCurrentMemory); } - return Svc::ResultInvalidCurrentMemory; + return ResultInvalidCurrentMemory; } } @@ -114,20 +114,20 @@ ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 val cur_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); // Check if the thread should terminate. - R_UNLESS(!cur_thread->IsTerminationRequested(), Svc::ResultTerminationRequested); + R_UNLESS(!cur_thread->IsTerminationRequested(), ResultTerminationRequested); { // Read the tag from userspace. u32 test_tag{}; R_UNLESS(ReadFromUser(system, std::addressof(test_tag), addr), - Svc::ResultInvalidCurrentMemory); + ResultInvalidCurrentMemory); // If the tag isn't the handle (with wait mask), we're done. R_UNLESS(test_tag == (handle | Svc::HandleWaitMask), RESULT_SUCCESS); // Get the lock owner thread. owner_thread = kernel.CurrentProcess()->GetHandleTable().Get<KThread>(handle); - R_UNLESS(owner_thread, Svc::ResultInvalidHandle); + R_UNLESS(owner_thread, ResultInvalidHandle); // Update the lock. cur_thread->SetAddressKey(addr, value); @@ -191,13 +191,13 @@ KThread* KConditionVariable::SignalImpl(KThread* thread) { thread_to_close = owner_thread.get(); } else { // The lock was tagged with a thread that doesn't exist. - thread->SetSyncedObject(nullptr, Svc::ResultInvalidState); + thread->SetSyncedObject(nullptr, ResultInvalidState); thread->Wakeup(); } } } else { // If the address wasn't accessible, note so. - thread->SetSyncedObject(nullptr, Svc::ResultInvalidCurrentMemory); + thread->SetSyncedObject(nullptr, ResultInvalidCurrentMemory); thread->Wakeup(); } @@ -263,12 +263,12 @@ ResultCode KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) KScopedSchedulerLockAndSleep slp{kernel, cur_thread, timeout}; // Set the synced object. - cur_thread->SetSyncedObject(nullptr, Svc::ResultTimedOut); + cur_thread->SetSyncedObject(nullptr, ResultTimedOut); // Check that the thread isn't terminating. if (cur_thread->IsTerminationRequested()) { slp.CancelSleep(); - return Svc::ResultTerminationRequested; + return ResultTerminationRequested; } // Update the value and process for the next owner. @@ -302,7 +302,7 @@ ResultCode KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout) // Write the value to userspace. if (!WriteToUser(system, addr, std::addressof(next_value))) { slp.CancelSleep(); - return Svc::ResultInvalidCurrentMemory; + return ResultInvalidCurrentMemory; } } |
