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