diff options
| author | 2018-10-20 17:22:15 -0400 | |
|---|---|---|
| committer | 2018-10-20 18:01:07 -0400 | |
| commit | 3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd (patch) | |
| tree | 61b10c6249df5732518963b66ad75d0ac13fb3b8 /src | |
| parent | Merge pull request #1535 from ReinUsesLisp/fixup-position (diff) | |
| download | yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.tar.gz yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.tar.xz yuzu-3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd.zip | |
service: Add skeleton for psm service
Seems to be the power controller. Listed in switchbrew under the category PTM services.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/logging/log.h | 1 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/psm.h | 22 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
5 files changed, 75 insertions, 0 deletions
diff --git a/src/common/logging/log.h b/src/common/logging/log.h index abbd056ee..c9161155a 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h | |||
| @@ -91,6 +91,7 @@ enum class Class : ClassType { | |||
| 91 | Service_PM, ///< The PM service | 91 | Service_PM, ///< The PM service |
| 92 | Service_PREPO, ///< The PREPO (Play report) service | 92 | Service_PREPO, ///< The PREPO (Play report) service |
| 93 | Service_PSC, ///< The PSC service | 93 | Service_PSC, ///< The PSC service |
| 94 | Service_PSM, ///< The PSM service | ||
| 94 | Service_SET, ///< The SET (Settings) service | 95 | Service_SET, ///< The SET (Settings) service |
| 95 | Service_SM, ///< The SM (Service manager) service | 96 | Service_SM, ///< The SM (Service manager) service |
| 96 | Service_SPL, ///< The SPL service | 97 | Service_SPL, ///< The SPL service |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 4755ec822..5efc382ba 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -327,6 +327,8 @@ add_library(core STATIC | |||
| 327 | hle/service/prepo/prepo.h | 327 | hle/service/prepo/prepo.h |
| 328 | hle/service/psc/psc.cpp | 328 | hle/service/psc/psc.cpp |
| 329 | hle/service/psc/psc.h | 329 | hle/service/psc/psc.h |
| 330 | hle/service/ptm/psm.cpp | ||
| 331 | hle/service/ptm/psm.h | ||
| 330 | hle/service/service.cpp | 332 | hle/service/service.cpp |
| 331 | hle/service/service.h | 333 | hle/service/service.h |
| 332 | hle/service/set/set.cpp | 334 | hle/service/set/set.cpp |
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp new file mode 100644 index 000000000..f6186b809 --- /dev/null +++ b/src/core/hle/service/ptm/psm.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <memory> | ||
| 6 | |||
| 7 | #include "common/logging/log.h" | ||
| 8 | #include "core/hle/ipc_helpers.h" | ||
| 9 | #include "core/hle/service/ptm/psm.h" | ||
| 10 | #include "core/hle/service/service.h" | ||
| 11 | #include "core/hle/service/sm/sm.h" | ||
| 12 | |||
| 13 | namespace Service::PSM { | ||
| 14 | |||
| 15 | PSM::PSM() : ServiceFramework{"psm"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "GetBatteryChargePercentage"}, | ||
| 19 | {1, nullptr, "GetChargerType"}, | ||
| 20 | {2, nullptr, "EnableBatteryCharging"}, | ||
| 21 | {3, nullptr, "DisableBatteryCharging"}, | ||
| 22 | {4, nullptr, "IsBatteryChargingEnabled"}, | ||
| 23 | {5, nullptr, "AcquireControllerPowerSupply"}, | ||
| 24 | {6, nullptr, "ReleaseControllerPowerSupply"}, | ||
| 25 | {7, nullptr, "OpenSession"}, | ||
| 26 | {8, nullptr, "EnableEnoughPowerChargeEmulation"}, | ||
| 27 | {9, nullptr, "DisableEnoughPowerChargeEmulation"}, | ||
| 28 | {10, nullptr, "EnableFastBatteryCharging"}, | ||
| 29 | {11, nullptr, "DisableFastBatteryCharging"}, | ||
| 30 | {12, nullptr, "GetBatteryVoltageState"}, | ||
| 31 | {13, nullptr, "GetRawBatteryChargePercentage"}, | ||
| 32 | {14, nullptr, "IsEnoughPowerSupplied"}, | ||
| 33 | {15, nullptr, "GetBatteryAgePercentage"}, | ||
| 34 | {16, nullptr, "GetBatteryChargeInfoEvent"}, | ||
| 35 | {17, nullptr, "GetBatteryChargeInfoFields"}, | ||
| 36 | }; | ||
| 37 | // clang-format on | ||
| 38 | |||
| 39 | RegisterHandlers(functions); | ||
| 40 | } | ||
| 41 | |||
| 42 | PSM::~PSM() = default; | ||
| 43 | |||
| 44 | void InstallInterfaces(SM::ServiceManager& sm) { | ||
| 45 | std::make_shared<PSM>()->InstallAsService(sm); | ||
| 46 | } | ||
| 47 | |||
| 48 | } // namespace Service::PSM | ||
diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h new file mode 100644 index 000000000..21955aa22 --- /dev/null +++ b/src/core/hle/service/ptm/psm.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | #include "core/hle/service/service.h" | ||
| 7 | |||
| 8 | namespace Service::SM { | ||
| 9 | class ServiceManager; | ||
| 10 | } | ||
| 11 | |||
| 12 | namespace Service::PSM { | ||
| 13 | |||
| 14 | class PSM final : public ServiceFramework<PSM> { | ||
| 15 | public: | ||
| 16 | explicit PSM(); | ||
| 17 | ~PSM() override; | ||
| 18 | }; | ||
| 19 | |||
| 20 | void InstallInterfaces(SM::ServiceManager& sm); | ||
| 21 | |||
| 22 | } // namespace Service::PSM | ||
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index a225cb4cb..fdd65cc68 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #include "core/hle/service/pm/pm.h" | 57 | #include "core/hle/service/pm/pm.h" |
| 58 | #include "core/hle/service/prepo/prepo.h" | 58 | #include "core/hle/service/prepo/prepo.h" |
| 59 | #include "core/hle/service/psc/psc.h" | 59 | #include "core/hle/service/psc/psc.h" |
| 60 | #include "core/hle/service/ptm/psm.h" | ||
| 60 | #include "core/hle/service/service.h" | 61 | #include "core/hle/service/service.h" |
| 61 | #include "core/hle/service/set/settings.h" | 62 | #include "core/hle/service/set/settings.h" |
| 62 | #include "core/hle/service/sm/sm.h" | 63 | #include "core/hle/service/sm/sm.h" |
| @@ -244,6 +245,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, FileSys::VfsFilesystem& vfs) | |||
| 244 | PlayReport::InstallInterfaces(*sm); | 245 | PlayReport::InstallInterfaces(*sm); |
| 245 | PM::InstallInterfaces(*sm); | 246 | PM::InstallInterfaces(*sm); |
| 246 | PSC::InstallInterfaces(*sm); | 247 | PSC::InstallInterfaces(*sm); |
| 248 | PSM::InstallInterfaces(*sm); | ||
| 247 | Set::InstallInterfaces(*sm); | 249 | Set::InstallInterfaces(*sm); |
| 248 | Sockets::InstallInterfaces(*sm); | 250 | Sockets::InstallInterfaces(*sm); |
| 249 | SPL::InstallInterfaces(*sm); | 251 | SPL::InstallInterfaces(*sm); |