summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/pctl/pctl_module.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/pctl/pctl_module.cpp54
1 files changed, 29 insertions, 25 deletions
diff --git a/src/core/hle/service/pctl/pctl_module.cpp b/src/core/hle/service/pctl/pctl_module.cpp
index 083609b34..f966c5c8b 100644
--- a/src/core/hle/service/pctl/pctl_module.cpp
+++ b/src/core/hle/service/pctl/pctl_module.cpp
@@ -5,9 +5,10 @@
#include "core/core.h"
#include "core/file_sys/control_metadata.h"
#include "core/file_sys/patch_manager.h"
-#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/pctl/pctl.h"
#include "core/hle/service/pctl/pctl_module.h"
+#include "core/hle/service/server_manager.h"
namespace Service::PCTL {
@@ -176,7 +177,7 @@ private:
settings.is_stero_vision_restricted = is_restricted;
}
- void Initialize(Kernel::HLERequestContext& ctx) {
+ void Initialize(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 2};
@@ -214,7 +215,7 @@ private:
rb.Push(ResultSuccess);
}
- void CheckFreeCommunicationPermission(Kernel::HLERequestContext& ctx) {
+ void CheckFreeCommunicationPermission(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 2};
@@ -227,7 +228,7 @@ private:
states.free_communication = true;
}
- void ConfirmStereoVisionPermission(Kernel::HLERequestContext& ctx) {
+ void ConfirmStereoVisionPermission(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
states.stereo_vision = true;
@@ -235,14 +236,14 @@ private:
rb.Push(ResultSuccess);
}
- void EndFreeCommunication(Kernel::HLERequestContext& ctx) {
+ void EndFreeCommunication(HLERequestContext& ctx) {
LOG_WARNING(Service_PCTL, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
- void IsFreeCommunicationAvailable(Kernel::HLERequestContext& ctx) {
+ void IsFreeCommunicationAvailable(HLERequestContext& ctx) {
LOG_WARNING(Service_PCTL, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
@@ -253,7 +254,7 @@ private:
}
}
- void IsRestrictionEnabled(Kernel::HLERequestContext& ctx) {
+ void IsRestrictionEnabled(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 3};
@@ -267,7 +268,7 @@ private:
rb.Push(pin_code[0] != '\0');
}
- void ConfirmStereoVisionRestrictionConfigurable(Kernel::HLERequestContext& ctx) {
+ void ConfirmStereoVisionRestrictionConfigurable(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 2};
@@ -286,7 +287,7 @@ private:
rb.Push(ResultSuccess);
}
- void IsStereoVisionPermitted(Kernel::HLERequestContext& ctx) {
+ void IsStereoVisionPermitted(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 3};
@@ -299,7 +300,7 @@ private:
}
}
- void SetStereoVisionRestriction(Kernel::HLERequestContext& ctx) {
+ void SetStereoVisionRestriction(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto can_use = rp.Pop<bool>();
LOG_DEBUG(Service_PCTL, "called, can_use={}", can_use);
@@ -315,7 +316,7 @@ private:
rb.Push(ResultSuccess);
}
- void GetStereoVisionRestriction(Kernel::HLERequestContext& ctx) {
+ void GetStereoVisionRestriction(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 3};
@@ -330,7 +331,7 @@ private:
rb.Push(settings.is_stero_vision_restricted);
}
- void ResetConfirmedStereoVisionPermission(Kernel::HLERequestContext& ctx) {
+ void ResetConfirmedStereoVisionPermission(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
states.stereo_vision = false;
@@ -369,7 +370,7 @@ private:
Capability capability{};
};
-void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
+void Module::Interface::CreateService(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -379,7 +380,7 @@ void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
rb.PushIpcInterface<IParentalControlService>(system, capability);
}
-void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx) {
+void Module::Interface::CreateServiceWithoutInitialize(HLERequestContext& ctx) {
LOG_DEBUG(Service_PCTL, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -393,19 +394,22 @@ Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> modu
Module::Interface::~Interface() = default;
-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
+void LoopProcess(Core::System& system) {
+ auto server_manager = std::make_unique<ServerManager>(system);
+
auto module = std::make_shared<Module>();
- std::make_shared<PCTL>(system, module, "pctl",
- Capability::Application | Capability::SnsPost | Capability::Status |
- Capability::StereoVision)
- ->InstallAsService(service_manager);
+ server_manager->RegisterNamedService(
+ "pctl", std::make_shared<PCTL>(system, module, "pctl",
+ Capability::Application | Capability::SnsPost |
+ Capability::Status | Capability::StereoVision));
// TODO(ogniK): Implement remaining capabilities
- std::make_shared<PCTL>(system, module, "pctl:a", Capability::None)
- ->InstallAsService(service_manager);
- std::make_shared<PCTL>(system, module, "pctl:r", Capability::None)
- ->InstallAsService(service_manager);
- std::make_shared<PCTL>(system, module, "pctl:s", Capability::None)
- ->InstallAsService(service_manager);
+ server_manager->RegisterNamedService(
+ "pctl:a", std::make_shared<PCTL>(system, module, "pctl:a", Capability::None));
+ server_manager->RegisterNamedService(
+ "pctl:r", std::make_shared<PCTL>(system, module, "pctl:r", Capability::None));
+ server_manager->RegisterNamedService(
+ "pctl:s", std::make_shared<PCTL>(system, module, "pctl:s", Capability::None));
+ ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::PCTL