2018-12-18 06:33:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Kernel.Ipc
|
2018-11-28 23:18:09 +01:00
|
|
|
{
|
|
|
|
class KClientPort : KSynchronizationObject
|
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
private int _sessionsCount;
|
|
|
|
private int _currentCapacity;
|
|
|
|
private int _maxSessions;
|
2018-11-28 23:18:09 +01:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
private KPort _parent;
|
2018-11-28 23:18:09 +01:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public KClientPort(Horizon system) : base(system) { }
|
2018-11-28 23:18:09 +01:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public void Initialize(KPort parent, int maxSessions)
|
2018-11-28 23:18:09 +01:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
_maxSessions = maxSessions;
|
|
|
|
_parent = parent;
|
2018-11-28 23:18:09 +01:00
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
public new static KernelResult RemoveName(Horizon system, string name)
|
2018-11-28 23:18:09 +01:00
|
|
|
{
|
2018-12-06 12:16:24 +01:00
|
|
|
KAutoObject foundObj = FindNamedObject(system, name);
|
2018-11-28 23:18:09 +01:00
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
if (!(foundObj is KClientPort))
|
2018-11-28 23:18:09 +01:00
|
|
|
{
|
|
|
|
return KernelResult.NotFound;
|
|
|
|
}
|
|
|
|
|
2018-12-06 12:16:24 +01:00
|
|
|
return KAutoObject.RemoveName(system, name);
|
2018-11-28 23:18:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|