diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-13 14:16:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 14:16:16 +0100 |
commit | 1f952f6ac9e3aca3dba8e4286fe937616081a767 (patch) | |
tree | ca57513605bdef4767762614c074ca90b7791575 /src/core/hle/kernel/svc/svc_condition_variable.cpp | |
parent | Merge pull request #9942 from liamwhite/speling (diff) | |
parent | kernel: additional style fixes to KThread, KProcess (diff) | |
download | yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar.gz yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar.bz2 yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar.lz yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar.xz yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.tar.zst yuzu-1f952f6ac9e3aca3dba8e4286fe937616081a767.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/svc/svc_condition_variable.cpp | 15 |
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 |