diff options
| author | 2018-08-24 08:31:45 +1000 | |
|---|---|---|
| committer | 2018-08-23 18:31:45 -0400 | |
| commit | 5049ca5d8c667ed973ad3ed83d82369243b2a16b (patch) | |
| tree | fc8f62d63f32f44954594ae169778ebea59bf113 /src/core/hle/service/pm | |
| parent | Merge pull request #1160 from bunnei/surface-reserve (diff) | |
| download | yuzu-5049ca5d8c667ed973ad3ed83d82369243b2a16b.tar.gz yuzu-5049ca5d8c667ed973ad3ed83d82369243b2a16b.tar.xz yuzu-5049ca5d8c667ed973ad3ed83d82369243b2a16b.zip | |
Added GetBootMode (#1107)
* Added GetBootMode
Used by homebrew
* Added enum for GetBootMode
Diffstat (limited to 'src/core/hle/service/pm')
| -rw-r--r-- | src/core/hle/service/pm/pm.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/service/pm/pm.h | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index e20a25689..6ec35ca60 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/ipc_helpers.h" | ||
| 6 | #include "core/hle/service/pm/pm.h" | ||
| 5 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 6 | 8 | ||
| 7 | namespace Service::PM { | 9 | namespace Service::PM { |
| @@ -10,11 +12,20 @@ class BootMode final : public ServiceFramework<BootMode> { | |||
| 10 | public: | 12 | public: |
| 11 | explicit BootMode() : ServiceFramework{"pm:bm"} { | 13 | explicit BootMode() : ServiceFramework{"pm:bm"} { |
| 12 | static const FunctionInfo functions[] = { | 14 | static const FunctionInfo functions[] = { |
| 13 | {0, nullptr, "GetBootMode"}, | 15 | {0, &BootMode::GetBootMode, "GetBootMode"}, |
| 14 | {1, nullptr, "SetMaintenanceBoot"}, | 16 | {1, nullptr, "SetMaintenanceBoot"}, |
| 15 | }; | 17 | }; |
| 16 | RegisterHandlers(functions); | 18 | RegisterHandlers(functions); |
| 17 | } | 19 | } |
| 20 | |||
| 21 | private: | ||
| 22 | void GetBootMode(Kernel::HLERequestContext& ctx) { | ||
| 23 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 24 | rb.Push(RESULT_SUCCESS); | ||
| 25 | rb.Push<u32>(static_cast<u32>(SystemBootMode::Normal)); // Normal boot mode | ||
| 26 | |||
| 27 | LOG_DEBUG(Service_PM, "called"); | ||
| 28 | } | ||
| 18 | }; | 29 | }; |
| 19 | 30 | ||
| 20 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { | 31 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { |
diff --git a/src/core/hle/service/pm/pm.h b/src/core/hle/service/pm/pm.h index 9fc19fed6..370f2ed72 100644 --- a/src/core/hle/service/pm/pm.h +++ b/src/core/hle/service/pm/pm.h | |||
| @@ -9,7 +9,7 @@ class ServiceManager; | |||
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | namespace Service::PM { | 11 | namespace Service::PM { |
| 12 | 12 | enum class SystemBootMode : u32 { Normal = 0, Maintenance = 1 }; | |
| 13 | /// Registers all PM services with the specified service manager. | 13 | /// Registers all PM services with the specified service manager. |
| 14 | void InstallInterfaces(SM::ServiceManager& service_manager); | 14 | void InstallInterfaces(SM::ServiceManager& service_manager); |
| 15 | 15 | ||