diff options
| author | 2018-08-07 14:57:12 -0400 | |
|---|---|---|
| committer | 2018-08-07 14:57:12 -0400 | |
| commit | 2d57cbaec144c1ef9b142863aa7c0eda73ac783a (patch) | |
| tree | 20daeb9d217732e20f951941b2de2dcc8d55691c | |
| parent | Merge pull request #950 from lioncash/hotkey (diff) | |
| parent | service/apm: Add the apm:sys service (diff) | |
| download | yuzu-2d57cbaec144c1ef9b142863aa7c0eda73ac783a.tar.gz yuzu-2d57cbaec144c1ef9b142863aa7c0eda73ac783a.tar.xz yuzu-2d57cbaec144c1ef9b142863aa7c0eda73ac783a.zip | |
Merge pull request #960 from lioncash/apm
service/apm: Add the apm:sys service
| -rw-r--r-- | src/core/hle/service/apm/apm.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/apm/interface.cpp | 25 | ||||
| -rw-r--r-- | src/core/hle/service/apm/interface.h | 8 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp index 7a185c6c8..4109cb7f7 100644 --- a/src/core/hle/service/apm/apm.cpp +++ b/src/core/hle/service/apm/apm.cpp | |||
| @@ -13,6 +13,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) { | |||
| 13 | auto module_ = std::make_shared<Module>(); | 13 | auto module_ = std::make_shared<Module>(); |
| 14 | std::make_shared<APM>(module_, "apm")->InstallAsService(service_manager); | 14 | std::make_shared<APM>(module_, "apm")->InstallAsService(service_manager); |
| 15 | std::make_shared<APM>(module_, "apm:p")->InstallAsService(service_manager); | 15 | std::make_shared<APM>(module_, "apm:p")->InstallAsService(service_manager); |
| 16 | std::make_shared<APM_Sys>()->InstallAsService(service_manager); | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | } // namespace Service::APM | 19 | } // namespace Service::APM |
diff --git a/src/core/hle/service/apm/interface.cpp b/src/core/hle/service/apm/interface.cpp index ce943d829..4cd8132f5 100644 --- a/src/core/hle/service/apm/interface.cpp +++ b/src/core/hle/service/apm/interface.cpp | |||
| @@ -74,6 +74,31 @@ void APM::OpenSession(Kernel::HLERequestContext& ctx) { | |||
| 74 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 74 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 75 | rb.Push(RESULT_SUCCESS); | 75 | rb.Push(RESULT_SUCCESS); |
| 76 | rb.PushIpcInterface<ISession>(); | 76 | rb.PushIpcInterface<ISession>(); |
| 77 | |||
| 78 | LOG_DEBUG(Service_APM, "called"); | ||
| 79 | } | ||
| 80 | |||
| 81 | APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} { | ||
| 82 | // clang-format off | ||
| 83 | static const FunctionInfo functions[] = { | ||
| 84 | {0, nullptr, "RequestPerformanceMode"}, | ||
| 85 | {1, &APM_Sys::GetPerformanceEvent, "GetPerformanceEvent"}, | ||
| 86 | {2, nullptr, "GetThrottlingState"}, | ||
| 87 | {3, nullptr, "GetLastThrottlingState"}, | ||
| 88 | {4, nullptr, "ClearLastThrottlingState"}, | ||
| 89 | {5, nullptr, "LoadAndApplySettings"}, | ||
| 90 | }; | ||
| 91 | // clang-format on | ||
| 92 | |||
| 93 | RegisterHandlers(functions); | ||
| 94 | } | ||
| 95 | |||
| 96 | void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) { | ||
| 97 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 98 | rb.Push(RESULT_SUCCESS); | ||
| 99 | rb.PushIpcInterface<ISession>(); | ||
| 100 | |||
| 101 | LOG_DEBUG(Service_APM, "called"); | ||
| 77 | } | 102 | } |
| 78 | 103 | ||
| 79 | } // namespace Service::APM | 104 | } // namespace Service::APM |
diff --git a/src/core/hle/service/apm/interface.h b/src/core/hle/service/apm/interface.h index fa68c7d93..d14264ad7 100644 --- a/src/core/hle/service/apm/interface.h +++ b/src/core/hle/service/apm/interface.h | |||
| @@ -19,4 +19,12 @@ private: | |||
| 19 | std::shared_ptr<Module> apm; | 19 | std::shared_ptr<Module> apm; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | class APM_Sys final : public ServiceFramework<APM_Sys> { | ||
| 23 | public: | ||
| 24 | explicit APM_Sys(); | ||
| 25 | |||
| 26 | private: | ||
| 27 | void GetPerformanceEvent(Kernel::HLERequestContext& ctx); | ||
| 28 | }; | ||
| 29 | |||
| 22 | } // namespace Service::APM | 30 | } // namespace Service::APM |