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