summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/pm/pm.cpp70
-rw-r--r--src/core/hle/service/pm/pm.h16
-rw-r--r--src/core/hle/service/service.cpp2
4 files changed, 90 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 87e381055..d513ce70a 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -203,6 +203,8 @@ add_library(core STATIC
203 hle/service/pctl/module.h 203 hle/service/pctl/module.h
204 hle/service/pctl/pctl.cpp 204 hle/service/pctl/pctl.cpp
205 hle/service/pctl/pctl.h 205 hle/service/pctl/pctl.h
206 hle/service/pm/pm.cpp
207 hle/service/pm/pm.h
206 hle/service/prepo/prepo.cpp 208 hle/service/prepo/prepo.cpp
207 hle/service/prepo/prepo.h 209 hle/service/prepo/prepo.h
208 hle/service/service.cpp 210 hle/service/service.cpp
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp
new file mode 100644
index 000000000..e20a25689
--- /dev/null
+++ b/src/core/hle/service/pm/pm.cpp
@@ -0,0 +1,70 @@
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 "core/hle/service/service.h"
6
7namespace Service::PM {
8
9class BootMode final : public ServiceFramework<BootMode> {
10public:
11 explicit BootMode() : ServiceFramework{"pm:bm"} {
12 static const FunctionInfo functions[] = {
13 {0, nullptr, "GetBootMode"},
14 {1, nullptr, "SetMaintenanceBoot"},
15 };
16 RegisterHandlers(functions);
17 }
18};
19
20class DebugMonitor final : public ServiceFramework<DebugMonitor> {
21public:
22 explicit DebugMonitor() : ServiceFramework{"pm:dmnt"} {
23 static const FunctionInfo functions[] = {
24 {0, nullptr, "IsDebugMode"},
25 {1, nullptr, "GetDebugProcesses"},
26 {2, nullptr, "StartDebugProcess"},
27 {3, nullptr, "GetTitlePid"},
28 {4, nullptr, "EnableDebugForTitleId"},
29 {5, nullptr, "GetApplicationPid"},
30 {6, nullptr, "EnableDebugForApplication"},
31 };
32 RegisterHandlers(functions);
33 }
34};
35
36class Info final : public ServiceFramework<Info> {
37public:
38 explicit Info() : ServiceFramework{"pm:info"} {
39 static const FunctionInfo functions[] = {
40 {0, nullptr, "GetTitleId"},
41 };
42 RegisterHandlers(functions);
43 }
44};
45
46class Shell final : public ServiceFramework<Shell> {
47public:
48 explicit Shell() : ServiceFramework{"pm:shell"} {
49 static const FunctionInfo functions[] = {
50 {0, nullptr, "LaunchProcess"},
51 {1, nullptr, "TerminateProcessByPid"},
52 {2, nullptr, "TerminateProcessByTitleId"},
53 {3, nullptr, "GetProcessEventWaiter"},
54 {4, nullptr, "GetProcessEventType"},
55 {5, nullptr, "NotifyBootFinished"},
56 {6, nullptr, "GetApplicationPid"},
57 {7, nullptr, "BoostSystemMemoryResourceLimit"},
58 };
59 RegisterHandlers(functions);
60 }
61};
62
63void InstallInterfaces(SM::ServiceManager& sm) {
64 std::make_shared<BootMode>()->InstallAsService(sm);
65 std::make_shared<DebugMonitor>()->InstallAsService(sm);
66 std::make_shared<Info>()->InstallAsService(sm);
67 std::make_shared<Shell>()->InstallAsService(sm);
68}
69
70} // namespace Service::PM
diff --git a/src/core/hle/service/pm/pm.h b/src/core/hle/service/pm/pm.h
new file mode 100644
index 000000000..9fc19fed6
--- /dev/null
+++ b/src/core/hle/service/pm/pm.h
@@ -0,0 +1,16 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::PM {
12
13/// Registers all PM services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& service_manager);
15
16} // namespace Service::PM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index b70d0d517..4daf13fa3 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -33,6 +33,7 @@
33#include "core/hle/service/ns/ns.h" 33#include "core/hle/service/ns/ns.h"
34#include "core/hle/service/nvdrv/nvdrv.h" 34#include "core/hle/service/nvdrv/nvdrv.h"
35#include "core/hle/service/pctl/pctl.h" 35#include "core/hle/service/pctl/pctl.h"
36#include "core/hle/service/pm/pm.h"
36#include "core/hle/service/prepo/prepo.h" 37#include "core/hle/service/prepo/prepo.h"
37#include "core/hle/service/service.h" 38#include "core/hle/service/service.h"
38#include "core/hle/service/set/settings.h" 39#include "core/hle/service/set/settings.h"
@@ -201,6 +202,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
201 Nvidia::InstallInterfaces(*sm); 202 Nvidia::InstallInterfaces(*sm);
202 PCTL::InstallInterfaces(*sm); 203 PCTL::InstallInterfaces(*sm);
203 PlayReport::InstallInterfaces(*sm); 204 PlayReport::InstallInterfaces(*sm);
205 PM::InstallInterfaces(*sm);
204 Sockets::InstallInterfaces(*sm); 206 Sockets::InstallInterfaces(*sm);
205 SPL::InstallInterfaces(*sm); 207 SPL::InstallInterfaces(*sm);
206 SSL::InstallInterfaces(*sm); 208 SSL::InstallInterfaces(*sm);