HorizonStatic.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Ryujinx.Horizon.Common;
  2. using Ryujinx.Memory;
  3. using System;
  4. namespace Ryujinx.Horizon
  5. {
  6. static class HorizonStatic
  7. {
  8. [ThreadStatic]
  9. private static HorizonOptions _options;
  10. [ThreadStatic]
  11. private static ISyscallApi _syscall;
  12. [ThreadStatic]
  13. private static IVirtualMemoryManager _addressSpace;
  14. [ThreadStatic]
  15. private static IThreadContext _threadContext;
  16. [ThreadStatic]
  17. private static int _threadHandle;
  18. public static HorizonOptions Options => _options;
  19. public static ISyscallApi Syscall => _syscall;
  20. public static IVirtualMemoryManager AddressSpace => _addressSpace;
  21. public static IThreadContext ThreadContext => _threadContext;
  22. public static int CurrentThreadHandle => _threadHandle;
  23. public static void Register(
  24. HorizonOptions options,
  25. ISyscallApi syscallApi,
  26. IVirtualMemoryManager addressSpace,
  27. IThreadContext threadContext,
  28. int threadHandle)
  29. {
  30. _options = options;
  31. _syscall = syscallApi;
  32. _addressSpace = addressSpace;
  33. _threadContext = threadContext;
  34. _threadHandle = threadHandle;
  35. }
  36. }
  37. }