diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-04-14 06:40:33 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-04-14 06:40:33 +0200 |
commit | 2067115c78fb43f525f025e79e347b9bb886c0c9 (patch) | |
tree | 87b3d66d33f42961b36d4cd9c3332a46d9b44e55 /src/core/hle/kernel/k_resource_limit.cpp | |
parent | Merge pull request #6185 from ameerj/process-reslimit (diff) | |
download | yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar.gz yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar.bz2 yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar.lz yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar.xz yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.tar.zst yuzu-2067115c78fb43f525f025e79e347b9bb886c0c9.zip |
Diffstat (limited to 'src/core/hle/kernel/k_resource_limit.cpp')
-rw-r--r-- | src/core/hle/kernel/k_resource_limit.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp index d7a4a38e6..d05b34ea3 100644 --- a/src/core/hle/kernel/k_resource_limit.cpp +++ b/src/core/hle/kernel/k_resource_limit.cpp @@ -2,21 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// This file references various implementation details from Atmosphere, an open-source firmware for -// the Nintendo Switch. Copyright 2018-2020 Atmosphere-NX. - #include "common/assert.h" -#include "core/core.h" #include "core/core_timing.h" -#include "core/core_timing_util.h" #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/svc_results.h" namespace Kernel { constexpr s64 DefaultTimeout = 10000000000; // 10 seconds -KResourceLimit::KResourceLimit(KernelCore& kernel, Core::System& system) - : Object{kernel}, lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {} +KResourceLimit::KResourceLimit(KernelCore& kernel, const Core::Timing::CoreTiming& core_timing_) + : Object{kernel}, lock{kernel}, cond_var{kernel}, core_timing(core_timing_) {} KResourceLimit::~KResourceLimit() = default; s64 KResourceLimit::GetLimitValue(LimitableResource which) const { @@ -83,7 +78,7 @@ ResultCode KResourceLimit::SetLimitValue(LimitableResource which, s64 value) { } bool KResourceLimit::Reserve(LimitableResource which, s64 value) { - return Reserve(which, value, system.CoreTiming().GetGlobalTimeNs().count() + DefaultTimeout); + return Reserve(which, value, core_timing.GetGlobalTimeNs().count() + DefaultTimeout); } bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { @@ -114,7 +109,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) { } if (current_hints[index] + value <= limit_values[index] && - (timeout < 0 || system.CoreTiming().GetGlobalTimeNs().count() < timeout)) { + (timeout < 0 || core_timing.GetGlobalTimeNs().count() < timeout)) { waiter_count++; cond_var.Wait(&lock, timeout); waiter_count--; |