mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-02 16:50:20 -07:00

* mm: Migrate service in Horizon project This PR migrate the `mm:u` service to the Horizon project, things were checked by some RE aswell, that's why some vars are renamed, the logic should be the same as before. Tests are welcome. * Lock _sessionList instead * Fix comment * Fix Session fields order
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Ryujinx.Horizon.MmNv.Ipc;
|
|
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
|
using Ryujinx.Horizon.Sdk.Sm;
|
|
|
|
namespace Ryujinx.Horizon.MmNv
|
|
{
|
|
class MmNvIpcServer
|
|
{
|
|
private const int MmNvMaxSessionsCount = 9;
|
|
|
|
private const int PointerBufferSize = 0;
|
|
private const int MaxDomains = 0;
|
|
private const int MaxDomainObjects = 0;
|
|
private const int MaxPortsCount = 1;
|
|
|
|
private static readonly ManagerOptions _mmNvOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
|
|
|
private SmApi _sm;
|
|
private ServerManager _serverManager;
|
|
|
|
public void Initialize()
|
|
{
|
|
HeapAllocator allocator = new();
|
|
|
|
_sm = new SmApi();
|
|
_sm.Initialize().AbortOnFailure();
|
|
|
|
_serverManager = new ServerManager(allocator, _sm, MaxPortsCount, _mmNvOptions, MmNvMaxSessionsCount);
|
|
|
|
_serverManager.RegisterObjectForServer(new Request(), ServiceName.Encode("mm:u"), MmNvMaxSessionsCount);
|
|
}
|
|
|
|
public void ServiceRequests()
|
|
{
|
|
_serverManager.ServiceRequests();
|
|
}
|
|
|
|
public void Shutdown()
|
|
{
|
|
_serverManager.Dispose();
|
|
}
|
|
}
|
|
}
|