aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-05-04 00:41:29 -0300
committerGitHub <noreply@github.com>2020-05-04 13:41:29 +1000
commit15d1cc806b1b978bab83d8bb426a124d9f0f788c (patch)
tree4fd10fdd11412bafcf3022e7cc4eb21179eef1b1 /Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs
parentcd48576f5846aa89a36bfc833e9de5dde9627aed (diff)
Move kernel state out of the Horizon class (#1107)
* Move kernel state from Horizon to KernelContext * Merge syscalls partial classes, split 32 and 64-bit variants * Sort usings
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs
index 901b0222..9c542ca0 100644
--- a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs
@@ -8,19 +8,19 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
{
private int _sessionsCount;
private int _currentCapacity;
- private int _maxSessions;
+ private readonly int _maxSessions;
- private KPort _parent;
+ private readonly KPort _parent;
public bool IsLight => _parent.IsLight;
- private object _countIncLock;
+ private readonly object _countIncLock;
// TODO: Remove that, we need it for now to allow HLE
// SM implementation to work with the new IPC system.
public IpcService Service { get; set; }
- public KClientPort(Horizon system, KPort parent, int maxSessions) : base(system)
+ public KClientPort(KernelContext context, KPort parent, int maxSessions) : base(context)
{
_maxSessions = maxSessions;
_parent = parent;
@@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
{
clientSession = null;
- KProcess currentProcess = System.Scheduler.GetCurrentProcess();
+ KProcess currentProcess = KernelContext.Scheduler.GetCurrentProcess();
if (currentProcess.ResourceLimit != null &&
!currentProcess.ResourceLimit.Reserve(LimitableResource.Session, 1))
@@ -59,7 +59,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
}
}
- KSession session = new KSession(System);
+ KSession session = new KSession(KernelContext);
if (Service != null)
{
@@ -85,7 +85,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
{
clientSession = null;
- KProcess currentProcess = System.Scheduler.GetCurrentProcess();
+ KProcess currentProcess = KernelContext.Scheduler.GetCurrentProcess();
if (currentProcess.ResourceLimit != null &&
!currentProcess.ResourceLimit.Reserve(LimitableResource.Session, 1))
@@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
}
}
- KLightSession session = new KLightSession(System);
+ KLightSession session = new KLightSession(KernelContext);
KernelResult result = _parent.EnqueueIncomingLightSession(session.ServerSession);
@@ -124,16 +124,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
return result;
}
- public new static KernelResult RemoveName(Horizon system, string name)
+ public new static KernelResult RemoveName(KernelContext context, string name)
{
- KAutoObject foundObj = FindNamedObject(system, name);
+ KAutoObject foundObj = FindNamedObject(context, name);
if (!(foundObj is KClientPort))
{
return KernelResult.NotFound;
}
- return KAutoObject.RemoveName(system, name);
+ return KAutoObject.RemoveName(context, name);
}
}
} \ No newline at end of file