diff options
| author | 2018-07-25 16:37:00 -0400 | |
|---|---|---|
| committer | 2018-07-25 16:57:16 -0400 | |
| commit | c664f8a2573426213c6f4c2f8fa40ad7e0d8443e (patch) | |
| tree | 28fd6c402290199f38d49af3db66409e3a33098f /src | |
| parent | Merge pull request #801 from lioncash/time (diff) | |
| download | yuzu-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')
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/pm/pm.cpp | 70 | ||||
| -rw-r--r-- | src/core/hle/service/pm/pm.h | 16 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
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 | |||
| 7 | namespace Service::PM { | ||
| 8 | |||
| 9 | class BootMode final : public ServiceFramework<BootMode> { | ||
| 10 | public: | ||
| 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 | |||
| 20 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { | ||
| 21 | public: | ||
| 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 | |||
| 36 | class Info final : public ServiceFramework<Info> { | ||
| 37 | public: | ||
| 38 | explicit Info() : ServiceFramework{"pm:info"} { | ||
| 39 | static const FunctionInfo functions[] = { | ||
| 40 | {0, nullptr, "GetTitleId"}, | ||
| 41 | }; | ||
| 42 | RegisterHandlers(functions); | ||
| 43 | } | ||
| 44 | }; | ||
| 45 | |||
| 46 | class Shell final : public ServiceFramework<Shell> { | ||
| 47 | public: | ||
| 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 | |||
| 63 | void 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 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::PM { | ||
| 12 | |||
| 13 | /// Registers all PM services with the specified service manager. | ||
| 14 | void 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); |