IManager.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace Ryujinx.HLE.HOS.Services.Apm
  2. {
  3. abstract class IManager : IpcService
  4. {
  5. public IManager(ServiceCtx context) { }
  6. protected abstract ResultCode OpenSession(out SessionServer sessionServer);
  7. protected abstract PerformanceMode GetPerformanceMode();
  8. protected abstract bool IsCpuOverclockEnabled();
  9. [CommandHipc(0)]
  10. // OpenSession() -> object<nn::apm::ISession>
  11. public ResultCode OpenSession(ServiceCtx context)
  12. {
  13. ResultCode resultCode = OpenSession(out SessionServer sessionServer);
  14. if (resultCode == ResultCode.Success)
  15. {
  16. MakeObject(context, sessionServer);
  17. }
  18. return resultCode;
  19. }
  20. [CommandHipc(1)]
  21. // GetPerformanceMode() -> nn::apm::PerformanceMode
  22. public ResultCode GetPerformanceMode(ServiceCtx context)
  23. {
  24. context.ResponseData.Write((uint)GetPerformanceMode());
  25. return ResultCode.Success;
  26. }
  27. [CommandHipc(6)] // 7.0.0+
  28. // IsCpuOverclockEnabled() -> bool
  29. public ResultCode IsCpuOverclockEnabled(ServiceCtx context)
  30. {
  31. context.ResponseData.Write(IsCpuOverclockEnabled());
  32. return ResultCode.Success;
  33. }
  34. }
  35. }