diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/ptm/psm.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/ptm/psm.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/ptm/ptm.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/service/ptm/ptm.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/ptm/ts.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/ptm/ts.h | 4 |
6 files changed, 25 insertions, 25 deletions
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index 1ac97fe31..136313d7b 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -5,8 +5,8 @@ #include "common/logging/log.h" #include "core/core.h" -#include "core/hle/ipc_helpers.h" #include "core/hle/kernel/k_event.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/kernel_helpers.h" #include "core/hle/service/ptm/psm.h" @@ -54,7 +54,7 @@ public: } private: - void BindStateChangeEvent(Kernel::HLERequestContext& ctx) { + void BindStateChangeEvent(HLERequestContext& ctx) { LOG_DEBUG(Service_PTM, "called"); should_signal = true; @@ -64,7 +64,7 @@ private: rb.PushCopyObjects(state_change_event->GetReadableEvent()); } - void UnbindStateChangeEvent(Kernel::HLERequestContext& ctx) { + void UnbindStateChangeEvent(HLERequestContext& ctx) { LOG_DEBUG(Service_PTM, "called"); should_signal = false; @@ -73,7 +73,7 @@ private: rb.Push(ResultSuccess); } - void SetChargerTypeChangeEventEnabled(Kernel::HLERequestContext& ctx) { + void SetChargerTypeChangeEventEnabled(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto state = rp.Pop<bool>(); LOG_DEBUG(Service_PTM, "called, state={}", state); @@ -84,7 +84,7 @@ private: rb.Push(ResultSuccess); } - void SetPowerSupplyChangeEventEnabled(Kernel::HLERequestContext& ctx) { + void SetPowerSupplyChangeEventEnabled(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto state = rp.Pop<bool>(); LOG_DEBUG(Service_PTM, "called, state={}", state); @@ -95,7 +95,7 @@ private: rb.Push(ResultSuccess); } - void SetBatteryVoltageStateChangeEventEnabled(Kernel::HLERequestContext& ctx) { + void SetBatteryVoltageStateChangeEventEnabled(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto state = rp.Pop<bool>(); LOG_DEBUG(Service_PTM, "called, state={}", state); @@ -145,7 +145,7 @@ PSM::PSM(Core::System& system_) : ServiceFramework{system_, "psm"} { PSM::~PSM() = default; -void PSM::GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { +void PSM::GetBatteryChargePercentage(HLERequestContext& ctx) { LOG_DEBUG(Service_PTM, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -153,7 +153,7 @@ void PSM::GetBatteryChargePercentage(Kernel::HLERequestContext& ctx) { rb.Push<u32>(battery_charge_percentage); } -void PSM::GetChargerType(Kernel::HLERequestContext& ctx) { +void PSM::GetChargerType(HLERequestContext& ctx) { LOG_DEBUG(Service_PTM, "called"); IPC::ResponseBuilder rb{ctx, 3}; @@ -161,7 +161,7 @@ void PSM::GetChargerType(Kernel::HLERequestContext& ctx) { rb.PushEnum(charger_type); } -void PSM::OpenSession(Kernel::HLERequestContext& ctx) { +void PSM::OpenSession(HLERequestContext& ctx) { LOG_DEBUG(Service_PTM, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; diff --git a/src/core/hle/service/ptm/psm.h b/src/core/hle/service/ptm/psm.h index f674ba8bc..fa47919e5 100644 --- a/src/core/hle/service/ptm/psm.h +++ b/src/core/hle/service/ptm/psm.h @@ -20,9 +20,9 @@ private: Unknown = 3, }; - void GetBatteryChargePercentage(Kernel::HLERequestContext& ctx); - void GetChargerType(Kernel::HLERequestContext& ctx); - void OpenSession(Kernel::HLERequestContext& ctx); + void GetBatteryChargePercentage(HLERequestContext& ctx); + void GetChargerType(HLERequestContext& ctx); + void OpenSession(HLERequestContext& ctx); u32 battery_charge_percentage{100}; ChargerType charger_type{ChargerType::RegularCharger}; diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 4bea995c6..6f0cfe04b 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -7,12 +7,16 @@ #include "core/hle/service/ptm/psm.h" #include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ts.h" +#include "core/hle/service/server_manager.h" namespace Service::PTM { -void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { - std::make_shared<PSM>(system)->InstallAsService(sm); - std::make_shared<TS>(system)->InstallAsService(sm); +void LoopProcess(Core::System& system) { + auto server_manager = std::make_unique<ServerManager>(system); + + server_manager->RegisterNamedService("psm", std::make_shared<PSM>(system)); + server_manager->RegisterNamedService("ts", std::make_shared<TS>(system)); + ServerManager::RunServer(std::move(server_manager)); } } // namespace Service::PTM diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index 06224a24e..a0ae03d28 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -7,12 +7,8 @@ namespace Core { class System; } -namespace Service::SM { -class ServiceManager; -} - namespace Service::PTM { -void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); +void LoopProcess(Core::System& system); } // namespace Service::PTM diff --git a/src/core/hle/service/ptm/ts.cpp b/src/core/hle/service/ptm/ts.cpp index b1a0a5544..ca064dd90 100644 --- a/src/core/hle/service/ptm/ts.cpp +++ b/src/core/hle/service/ptm/ts.cpp @@ -4,7 +4,7 @@ #include <memory> #include "core/core.h" -#include "core/hle/ipc_helpers.h" +#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/ptm/ts.h" namespace Service::PTM { @@ -25,7 +25,7 @@ TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} { TS::~TS() = default; -void TS::GetTemperature(Kernel::HLERequestContext& ctx) { +void TS::GetTemperature(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto location{rp.PopEnum<Location>()}; @@ -36,7 +36,7 @@ void TS::GetTemperature(Kernel::HLERequestContext& ctx) { rb.Push(temperature); } -void TS::GetTemperatureMilliC(Kernel::HLERequestContext& ctx) { +void TS::GetTemperatureMilliC(HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; const auto location{rp.PopEnum<Location>()}; diff --git a/src/core/hle/service/ptm/ts.h b/src/core/hle/service/ptm/ts.h index 39d51847e..c3f43d5a3 100644 --- a/src/core/hle/service/ptm/ts.h +++ b/src/core/hle/service/ptm/ts.h @@ -19,8 +19,8 @@ private: External, }; - void GetTemperature(Kernel::HLERequestContext& ctx); - void GetTemperatureMilliC(Kernel::HLERequestContext& ctx); + void GetTemperature(HLERequestContext& ctx); + void GetTemperatureMilliC(HLERequestContext& ctx); }; } // namespace Service::PTM |