2023-01-04 23:15:45 +01:00
|
|
|
using Ryujinx.Horizon.Common;
|
|
|
|
using Ryujinx.Memory;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Ryujinx.Horizon
|
|
|
|
{
|
|
|
|
public struct ServiceEntry
|
|
|
|
{
|
2023-01-08 13:13:39 +01:00
|
|
|
private readonly Action<ServiceTable> _entrypoint;
|
|
|
|
private readonly ServiceTable _serviceTable;
|
|
|
|
private readonly HorizonOptions _options;
|
2023-01-04 23:15:45 +01:00
|
|
|
|
2023-01-08 13:13:39 +01:00
|
|
|
internal ServiceEntry(Action<ServiceTable> entrypoint, ServiceTable serviceTable, HorizonOptions options)
|
2023-01-04 23:15:45 +01:00
|
|
|
{
|
2023-01-08 13:13:39 +01:00
|
|
|
_entrypoint = entrypoint;
|
|
|
|
_serviceTable = serviceTable;
|
|
|
|
_options = options;
|
2023-01-04 23:15:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Start(ISyscallApi syscallApi, IVirtualMemoryManager addressSpace, IThreadContext threadContext)
|
|
|
|
{
|
|
|
|
HorizonStatic.Register(_options, syscallApi, addressSpace, threadContext, (int)threadContext.GetX(1));
|
|
|
|
|
2023-01-08 13:13:39 +01:00
|
|
|
_entrypoint(_serviceTable);
|
2023-01-04 23:15:45 +01:00
|
|
|
}
|
|
|
|
}
|
2023-01-08 13:13:39 +01:00
|
|
|
}
|