mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-11-24 22:33:01 +00:00
Merge pull request #960 from lioncash/apm
service/apm: Add the apm:sys service
This commit is contained in:
commit
2d57cbaec1
3 changed files with 34 additions and 0 deletions
|
@ -13,6 +13,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
|
|||
auto module_ = std::make_shared<Module>();
|
||||
std::make_shared<APM>(module_, "apm")->InstallAsService(service_manager);
|
||||
std::make_shared<APM>(module_, "apm:p")->InstallAsService(service_manager);
|
||||
std::make_shared<APM_Sys>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::APM
|
||||
|
|
|
@ -74,6 +74,31 @@ void APM::OpenSession(Kernel::HLERequestContext& ctx) {
|
|||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISession>();
|
||||
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
}
|
||||
|
||||
APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "RequestPerformanceMode"},
|
||||
{1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"},
|
||||
{2, nullptr, "GetThrottlingState"},
|
||||
{3, nullptr, "GetLastThrottlingState"},
|
||||
{4, nullptr, "ClearLastThrottlingState"},
|
||||
{5, nullptr, "LoadAndApplySettings"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<ISession>();
|
||||
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
}
|
||||
|
||||
} // namespace Service::APM
|
||||
|
|
|
@ -19,4 +19,12 @@ private:
|
|||
std::shared_ptr<Module> apm;
|
||||
};
|
||||
|
||||
class APM_Sys final : public ServiceFramework<APM_Sys> {
|
||||
public:
|
||||
explicit APM_Sys();
|
||||
|
||||
private:
|
||||
void GetPerformanceEvent(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::APM
|
||||
|
|
Loading…
Reference in a new issue