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