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