summaryrefslogtreecommitdiff
path: root/src/core/hle/service/pm
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-25 16:37:00 -0400
committerGravatar Lioncash2018-07-25 16:57:16 -0400
commitc664f8a2573426213c6f4c2f8fa40ad7e0d8443e (patch)
tree28fd6c402290199f38d49af3db66409e3a33098f /src/core/hle/service/pm
parentMerge pull request #801 from lioncash/time (diff)
downloadyuzu-c664f8a2573426213c6f4c2f8fa40ad7e0d8443e.tar.gz
yuzu-c664f8a2573426213c6f4c2f8fa40ad7e0d8443e.tar.xz
yuzu-c664f8a2573426213c6f4c2f8fa40ad7e0d8443e.zip
service: Add pm services
Adds the skeleton for the process management services based off information on Switch Brew.
Diffstat (limited to 'src/core/hle/service/pm')
-rw-r--r--src/core/hle/service/pm/pm.cpp70
-rw-r--r--src/core/hle/service/pm/pm.h16
2 files changed, 86 insertions, 0 deletions
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