summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-10-20 17:22:15 -0400
committerGravatar Zach Hilman2018-10-20 18:01:07 -0400
commit3b8c0f8885c9e590f4317d8de51ea3d669ccdfcd (patch)
tree61b10c6249df5732518963b66ad75d0ac13fb3b8 /src/core
parentMerge pull request #1535 from ReinUsesLisp/fixup-position (diff)
downloadyuzu-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/core')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ptm/psm.cpp48
-rw-r--r--src/core/hle/service/ptm/psm.h22
-rw-r--r--src/core/hle/service/service.cpp2
4 files changed, 74 insertions, 0 deletions
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
13namespace Service::PSM {
14
15PSM::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
42PSM::~PSM() = default;
43
44void 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
8namespace Service::SM {
9class ServiceManager;
10}
11
12namespace Service::PSM {
13
14class PSM final : public ServiceFramework<PSM> {
15public:
16 explicit PSM();
17 ~PSM() override;
18};
19
20void 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);