summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc/svc_condition_variable.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-03-07 06:13:05 +0100
committerLiam <byteslice@airmail.cc>2023-03-13 03:09:08 +0100
commit91fd4e30f2a12868201b08e73de299db1c3d116a (patch)
treeac85044f0554995ef6af3a3d9a4508286c2b95b3 /src/core/hle/kernel/svc/svc_condition_variable.cpp
parentkernel: convert miscellaneous (diff)
downloadyuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.gz
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.bz2
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.lz
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.xz
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.tar.zst
yuzu-91fd4e30f2a12868201b08e73de299db1c3d116a.zip
Diffstat (limited to 'src/core/hle/kernel/svc/svc_condition_variable.cpp')
-rw-r--r--src/core/hle/kernel/svc/svc_condition_variable.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/hle/kernel/svc/svc_condition_variable.cpp b/src/core/hle/kernel/svc/svc_condition_variable.cpp
index 8ad1a0b8f..648ed23d0 100644
--- a/src/core/hle/kernel/svc/svc_condition_variable.cpp
+++ b/src/core/hle/kernel/svc/svc_condition_variable.cpp
@@ -17,14 +17,8 @@ Result WaitProcessWideKeyAtomic(Core::System& system, VAddr address, VAddr cv_ke
cv_key, tag, timeout_ns);
// Validate input.
- if (IsKernelAddress(address)) {
- LOG_ERROR(Kernel_SVC, "Attempted to wait on kernel address (address={:08X})", address);
- return ResultInvalidCurrentMemory;
- }
- if (!Common::IsAligned(address, sizeof(s32))) {
- LOG_ERROR(Kernel_SVC, "Address must be 4 byte aligned (address={:08X})", address);
- return ResultInvalidAddress;
- }
+ R_UNLESS(!IsKernelAddress(address), ResultInvalidCurrentMemory);
+ R_UNLESS(Common::IsAligned(address, sizeof(s32)), ResultInvalidAddress);
// Convert timeout from nanoseconds to ticks.
s64 timeout{};
@@ -43,8 +37,9 @@ Result WaitProcessWideKeyAtomic(Core::System& system, VAddr address, VAddr cv_ke
}
// Wait on the condition variable.
- return GetCurrentProcess(system.Kernel())
- .WaitConditionVariable(address, Common::AlignDown(cv_key, sizeof(u32)), tag, timeout);
+ R_RETURN(
+ GetCurrentProcess(system.Kernel())
+ .WaitConditionVariable(address, Common::AlignDown(cv_key, sizeof(u32)), tag, timeout));
}
/// Signal process wide key