aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/ServiceEntry.cs
blob: edf76fcd8f50badb54bb922b0ac6cf97181174e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using Ryujinx.Horizon.Common;
using Ryujinx.Memory;
using System;

namespace Ryujinx.Horizon
{
    public readonly struct ServiceEntry
    {
        private readonly Action<ServiceTable> _entrypoint;
        private readonly ServiceTable _serviceTable;
        private readonly HorizonOptions _options;

        internal ServiceEntry(Action<ServiceTable> entrypoint, ServiceTable serviceTable, HorizonOptions options)
        {
            _entrypoint = entrypoint;
            _serviceTable = serviceTable;
            _options = options;
        }

        public void Start(ISyscallApi syscallApi, IVirtualMemoryManager addressSpace, IThreadContext threadContext)
        {
            HorizonStatic.Register(_options, syscallApi, addressSpace, threadContext, (int)threadContext.GetX(1));

            _entrypoint(_serviceTable);
        }
    }
}