2018-08-17 01:47:36 +02:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Apm
|
2018-02-10 01:14:55 +01:00
|
|
|
{
|
2020-11-08 21:00:54 +01:00
|
|
|
abstract class IManager : IpcService
|
2018-02-10 01:14:55 +01:00
|
|
|
{
|
2019-07-12 03:13:43 +02:00
|
|
|
public IManager(ServiceCtx context) { }
|
2018-02-10 01:14:55 +01:00
|
|
|
|
2020-11-08 21:00:54 +01:00
|
|
|
protected abstract ResultCode OpenSession(out SessionServer sessionServer);
|
|
|
|
protected abstract PerformanceMode GetPerformanceMode();
|
|
|
|
protected abstract bool IsCpuOverclockEnabled();
|
|
|
|
|
2019-07-12 03:13:43 +02:00
|
|
|
[Command(0)]
|
|
|
|
// OpenSession() -> object<nn::apm::ISession>
|
2019-07-14 21:04:38 +02:00
|
|
|
public ResultCode OpenSession(ServiceCtx context)
|
2018-02-10 01:14:55 +01:00
|
|
|
{
|
2020-11-08 21:00:54 +01:00
|
|
|
ResultCode resultCode = OpenSession(out SessionServer sessionServer);
|
|
|
|
|
|
|
|
if (resultCode == ResultCode.Success)
|
|
|
|
{
|
|
|
|
MakeObject(context, sessionServer);
|
|
|
|
}
|
|
|
|
|
|
|
|
return resultCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
[Command(1)]
|
|
|
|
// GetPerformanceMode() -> nn::apm::PerformanceMode
|
|
|
|
public ResultCode GetPerformanceMode(ServiceCtx context)
|
|
|
|
{
|
|
|
|
context.ResponseData.Write((uint)GetPerformanceMode());
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
[Command(6)] // 7.0.0+
|
|
|
|
// IsCpuOverclockEnabled() -> bool
|
|
|
|
public ResultCode IsCpuOverclockEnabled(ServiceCtx context)
|
|
|
|
{
|
|
|
|
context.ResponseData.Write(IsCpuOverclockEnabled());
|
2018-02-25 05:34:16 +01:00
|
|
|
|
2019-07-14 21:04:38 +02:00
|
|
|
return ResultCode.Success;
|
2018-02-10 01:14:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|