ServiceEntry.cs 862 B

123456789101112131415161718192021222324252627
  1. using Ryujinx.Horizon.Common;
  2. using Ryujinx.Memory;
  3. using System;
  4. namespace Ryujinx.Horizon
  5. {
  6. public struct ServiceEntry
  7. {
  8. private readonly Action<ServiceTable> _entrypoint;
  9. private readonly ServiceTable _serviceTable;
  10. private readonly HorizonOptions _options;
  11. internal ServiceEntry(Action<ServiceTable> entrypoint, ServiceTable serviceTable, HorizonOptions options)
  12. {
  13. _entrypoint = entrypoint;
  14. _serviceTable = serviceTable;
  15. _options = options;
  16. }
  17. public void Start(ISyscallApi syscallApi, IVirtualMemoryManager addressSpace, IThreadContext threadContext)
  18. {
  19. HorizonStatic.Register(_options, syscallApi, addressSpace, threadContext, (int)threadContext.GetX(1));
  20. _entrypoint(_serviceTable);
  21. }
  22. }
  23. }