aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/k_address_arbiter.cpp
diff options
context:
space:
mode:
authorChloe <25727384+ogniK5377@users.noreply.github.com>2021-02-13 10:43:01 +1100
committerGitHub <noreply@github.com>2021-02-12 15:43:01 -0800
commit37939482fb93d2155d8625596f2b1145d4f6e8e3 (patch)
tree0c18a00c0f9be5cc87b50ff46c439765d9f7db46 /src/core/hle/kernel/k_address_arbiter.cpp
parenta0379c2db514b5276e11c847dc6c600fb0a0b5d6 (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_address_arbiter.cpp')
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index d0e90fd60..7018f56da 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -120,10 +120,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
s32 user_value{};
if (!UpdateIfEqual(system, &user_value, addr, value, value + 1)) {
LOG_ERROR(Kernel, "Invalid current memory!");
- return Svc::ResultInvalidCurrentMemory;
+ return ResultInvalidCurrentMemory;
}
if (user_value != value) {
- return Svc::ResultInvalidState;
+ return ResultInvalidState;
}
auto it = thread_tree.nfind_light({addr, -1});
@@ -189,10 +189,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
if (!succeeded) {
LOG_ERROR(Kernel, "Invalid current memory!");
- return Svc::ResultInvalidCurrentMemory;
+ return ResultInvalidCurrentMemory;
}
if (user_value != value) {
- return Svc::ResultInvalidState;
+ return ResultInvalidState;
}
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
@@ -221,11 +221,11 @@ ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement
// Check that the thread isn't terminating.
if (cur_thread->IsTerminationRequested()) {
slp.CancelSleep();
- return Svc::ResultTerminationRequested;
+ return ResultTerminationRequested;
}
// Set the synced object.
- cur_thread->SetSyncedObject(nullptr, Svc::ResultTimedOut);
+ cur_thread->SetSyncedObject(nullptr, ResultTimedOut);
// Read the value from userspace.
s32 user_value{};
@@ -238,19 +238,19 @@ ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement
if (!succeeded) {
slp.CancelSleep();
- return Svc::ResultInvalidCurrentMemory;
+ return ResultInvalidCurrentMemory;
}
// Check that the value is less than the specified one.
if (user_value >= value) {
slp.CancelSleep();
- return Svc::ResultInvalidState;
+ return ResultInvalidState;
}
// Check that the timeout is non-zero.
if (timeout == 0) {
slp.CancelSleep();
- return Svc::ResultTimedOut;
+ return ResultTimedOut;
}
// Set the arbiter.
@@ -288,29 +288,29 @@ ResultCode KAddressArbiter::WaitIfEqual(VAddr addr, s32 value, s64 timeout) {
// Check that the thread isn't terminating.
if (cur_thread->IsTerminationRequested()) {
slp.CancelSleep();
- return Svc::ResultTerminationRequested;
+ return ResultTerminationRequested;
}
// Set the synced object.
- cur_thread->SetSyncedObject(nullptr, Svc::ResultTimedOut);
+ cur_thread->SetSyncedObject(nullptr, ResultTimedOut);
// Read the value from userspace.
s32 user_value{};
if (!ReadFromUser(system, &user_value, addr)) {
slp.CancelSleep();
- return Svc::ResultInvalidCurrentMemory;
+ return ResultInvalidCurrentMemory;
}
// Check that the value is equal.
if (value != user_value) {
slp.CancelSleep();
- return Svc::ResultInvalidState;
+ return ResultInvalidState;
}
// Check that the timeout is non-zero.
if (timeout == 0) {
slp.CancelSleep();
- return Svc::ResultTimedOut;
+ return ResultTimedOut;
}
// Set the arbiter.