summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2021-05-10 15:42:46 -0700
committerGravatar bunnei2021-05-10 15:42:46 -0700
commit9f44a44f2f6d55ccbc75f9f630c1fc9dd0174d47 (patch)
treee741063e939d38582e8ee12e519f10e2024ebee3
parenthle: kernel: KClientPort: Cleanup comment format. (diff)
downloadyuzu-9f44a44f2f6d55ccbc75f9f630c1fc9dd0174d47.tar.gz
yuzu-9f44a44f2f6d55ccbc75f9f630c1fc9dd0174d47.tar.xz
yuzu-9f44a44f2f6d55ccbc75f9f630c1fc9dd0174d47.zip
hle: ipc_helpers: Reserve session resource when we create a KSession.
-rw-r--r--src/core/hle/ipc_helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index d1eb8b075..c76302dc9 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -15,6 +15,8 @@
15#include "core/hle/ipc.h" 15#include "core/hle/ipc.h"
16#include "core/hle/kernel/hle_ipc.h" 16#include "core/hle/kernel/hle_ipc.h"
17#include "core/hle/kernel/k_client_port.h" 17#include "core/hle/kernel/k_client_port.h"
18#include "core/hle/kernel/k_process.h"
19#include "core/hle/kernel/k_resource_limit.h"
18#include "core/hle/kernel/k_session.h" 20#include "core/hle/kernel/k_session.h"
19#include "core/hle/result.h" 21#include "core/hle/result.h"
20 22
@@ -148,6 +150,9 @@ public:
148 if (context->Session()->IsDomain()) { 150 if (context->Session()->IsDomain()) {
149 context->AddDomainObject(std::move(iface)); 151 context->AddDomainObject(std::move(iface));
150 } else { 152 } else {
153 kernel.CurrentProcess()->GetResourceLimit()->Reserve(
154 Kernel::LimitableResource::Sessions, 1);
155
151 auto* session = Kernel::KSession::Create(kernel); 156 auto* session = Kernel::KSession::Create(kernel);
152 session->Initialize(nullptr, iface->GetServiceName()); 157 session->Initialize(nullptr, iface->GetServiceName());
153 158