mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 09:12:46 +01:00
Merge pull request #2065 from lioncash/pm
service/pm: Implement SetMaintenanceBoot
This commit is contained in:
commit
c608d3a979
2 changed files with 19 additions and 3 deletions
|
@ -13,7 +13,7 @@ public:
|
||||||
explicit BootMode() : ServiceFramework{"pm:bm"} {
|
explicit BootMode() : ServiceFramework{"pm:bm"} {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &BootMode::GetBootMode, "GetBootMode"},
|
{0, &BootMode::GetBootMode, "GetBootMode"},
|
||||||
{1, nullptr, "SetMaintenanceBoot"},
|
{1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"},
|
||||||
};
|
};
|
||||||
RegisterHandlers(functions);
|
RegisterHandlers(functions);
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,19 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.Push<u32>(static_cast<u32>(SystemBootMode::Normal)); // Normal boot mode
|
rb.PushEnum(boot_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMaintenanceBoot(Kernel::HLERequestContext& ctx) {
|
||||||
|
LOG_DEBUG(Service_PM, "called");
|
||||||
|
|
||||||
|
boot_mode = SystemBootMode::Maintenance;
|
||||||
|
|
||||||
|
IPC::ResponseBuilder rb{ctx, 2};
|
||||||
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemBootMode boot_mode = SystemBootMode::Normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DebugMonitor final : public ServiceFramework<DebugMonitor> {
|
class DebugMonitor final : public ServiceFramework<DebugMonitor> {
|
||||||
|
|
|
@ -9,7 +9,12 @@ class ServiceManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Service::PM {
|
namespace Service::PM {
|
||||||
enum class SystemBootMode : u32 { Normal = 0, Maintenance = 1 };
|
|
||||||
|
enum class SystemBootMode {
|
||||||
|
Normal,
|
||||||
|
Maintenance,
|
||||||
|
};
|
||||||
|
|
||||||
/// Registers all PM services with the specified service manager.
|
/// Registers all PM services with the specified service manager.
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue