summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 833605475..8f40458fd 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -201,6 +201,8 @@ add_library(core STATIC
201 hle/service/pctl/module.h 201 hle/service/pctl/module.h
202 hle/service/pctl/pctl.cpp 202 hle/service/pctl/pctl.cpp
203 hle/service/pctl/pctl.h 203 hle/service/pctl/pctl.h
204 hle/service/pm/pm.cpp
205 hle/service/pm/pm.h
204 hle/service/prepo/prepo.cpp 206 hle/service/prepo/prepo.cpp
205 hle/service/prepo/prepo.h 207 hle/service/prepo/prepo.h
206 hle/service/service.cpp 208 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 0d036bfaa..e3ff5f705 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -32,6 +32,7 @@
32#include "core/hle/service/ns/ns.h" 32#include "core/hle/service/ns/ns.h"
33#include "core/hle/service/nvdrv/nvdrv.h" 33#include "core/hle/service/nvdrv/nvdrv.h"
34#include "core/hle/service/pctl/pctl.h" 34#include "core/hle/service/pctl/pctl.h"
35#include "core/hle/service/pm/pm.h"
35#include "core/hle/service/prepo/prepo.h" 36#include "core/hle/service/prepo/prepo.h"
36#include "core/hle/service/service.h" 37#include "core/hle/service/service.h"
37#include "core/hle/service/set/settings.h" 38#include "core/hle/service/set/settings.h"
@@ -199,6 +200,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
199 Nvidia::InstallInterfaces(*sm); 200 Nvidia::InstallInterfaces(*sm);
200 PCTL::InstallInterfaces(*sm); 201 PCTL::InstallInterfaces(*sm);
201 PlayReport::InstallInterfaces(*sm); 202 PlayReport::InstallInterfaces(*sm);
203 PM::InstallInterfaces(*sm);
202 Sockets::InstallInterfaces(*sm); 204 Sockets::InstallInterfaces(*sm);
203 SPL::InstallInterfaces(*sm); 205 SPL::InstallInterfaces(*sm);
204 SSL::InstallInterfaces(*sm); 206 SSL::InstallInterfaces(*sm);