diff options
| author | 2018-07-25 16:37:00 -0400 | |
|---|---|---|
| committer | 2018-07-25 16:57:16 -0400 | |
| commit | c664f8a2573426213c6f4c2f8fa40ad7e0d8443e (patch) | |
| tree | 28fd6c402290199f38d49af3db66409e3a33098f /src/core/hle/service/pm | |
| 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/core/hle/service/pm')
| -rw-r--r-- | src/core/hle/service/pm/pm.cpp | 70 | ||||
| -rw-r--r-- | src/core/hle/service/pm/pm.h | 16 |
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 | |||
| 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 | ||