diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Ipc')
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs | 33 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Ipc/KPort.cs | 28 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs | 16 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Ipc/KSession.cs | 31 |
4 files changed, 108 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs new file mode 100644 index 00000000..ddfe2096 --- /dev/null +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KClientPort.cs @@ -0,0 +1,33 @@ +using Ryujinx.HLE.HOS.Kernel.Common; + +namespace Ryujinx.HLE.HOS.Kernel.Ipc +{ + class KClientPort : KSynchronizationObject + { + private int _sessionsCount; + private int _currentCapacity; + private int _maxSessions; + + private KPort _parent; + + public KClientPort(Horizon system) : base(system) { } + + public void Initialize(KPort parent, int maxSessions) + { + _maxSessions = maxSessions; + _parent = parent; + } + + public new static KernelResult RemoveName(Horizon system, string name) + { + KAutoObject foundObj = FindNamedObject(system, name); + + if (!(foundObj is KClientPort)) + { + return KernelResult.NotFound; + } + + return KAutoObject.RemoveName(system, name); + } + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KPort.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KPort.cs new file mode 100644 index 00000000..16e9a111 --- /dev/null +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KPort.cs @@ -0,0 +1,28 @@ +using Ryujinx.HLE.HOS.Kernel.Common; + +namespace Ryujinx.HLE.HOS.Kernel.Ipc +{ + class KPort : KAutoObject + { + public KServerPort ServerPort { get; private set; } + public KClientPort ClientPort { get; private set; } + + private long _nameAddress; + private bool _isLight; + + public KPort(Horizon system) : base(system) + { + ServerPort = new KServerPort(system); + ClientPort = new KClientPort(system); + } + + public void Initialize(int maxSessions, bool isLight, long nameAddress) + { + ServerPort.Initialize(this); + ClientPort.Initialize(this, maxSessions); + + _isLight = isLight; + _nameAddress = nameAddress; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs new file mode 100644 index 00000000..d4d3bcd2 --- /dev/null +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs @@ -0,0 +1,16 @@ +using Ryujinx.HLE.HOS.Kernel.Common; + +namespace Ryujinx.HLE.HOS.Kernel.Ipc +{ + class KServerPort : KSynchronizationObject + { + private KPort _parent; + + public KServerPort(Horizon system) : base(system) { } + + public void Initialize(KPort parent) + { + _parent = parent; + } + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Kernel/Ipc/KSession.cs b/Ryujinx.HLE/HOS/Kernel/Ipc/KSession.cs new file mode 100644 index 00000000..f2b30493 --- /dev/null +++ b/Ryujinx.HLE/HOS/Kernel/Ipc/KSession.cs @@ -0,0 +1,31 @@ +using Ryujinx.HLE.HOS.Services; +using System; + +namespace Ryujinx.HLE.HOS.Kernel.Ipc +{ + class KSession : IDisposable + { + public IpcService Service { get; private set; } + + public string ServiceName { get; private set; } + + public KSession(IpcService service, string serviceName) + { + Service = service; + ServiceName = serviceName; + } + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing && Service is IDisposable disposableService) + { + disposableService.Dispose(); + } + } + } +}
\ No newline at end of file |
