summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/hle/service/pctl/module.cpp (renamed from src/core/hle/service/pctl/pctl_a.cpp)37
-rw-r--r--src/core/hle/service/pctl/module.h28
-rw-r--r--src/core/hle/service/pctl/pctl.cpp11
-rw-r--r--src/core/hle/service/pctl/pctl.h8
-rw-r--r--src/core/hle/service/pctl/pctl_a.h20
-rw-r--r--src/core/hle/service/service.cpp2
7 files changed, 71 insertions, 39 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b3807c204..f4be926e4 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -181,10 +181,10 @@ add_library(core STATIC
181 hle/service/nvflinger/buffer_queue.h 181 hle/service/nvflinger/buffer_queue.h
182 hle/service/nvflinger/nvflinger.cpp 182 hle/service/nvflinger/nvflinger.cpp
183 hle/service/nvflinger/nvflinger.h 183 hle/service/nvflinger/nvflinger.h
184 hle/service/pctl/module.cpp
185 hle/service/pctl/module.h
184 hle/service/pctl/pctl.cpp 186 hle/service/pctl/pctl.cpp
185 hle/service/pctl/pctl.h 187 hle/service/pctl/pctl.h
186 hle/service/pctl/pctl_a.cpp
187 hle/service/pctl/pctl_a.h
188 hle/service/service.cpp 188 hle/service/service.cpp
189 hle/service/service.h 189 hle/service/service.h
190 hle/service/set/set.cpp 190 hle/service/set/set.cpp
diff --git a/src/core/hle/service/pctl/pctl_a.cpp b/src/core/hle/service/pctl/module.cpp
index 24a6cf310..dd20d5ae7 100644
--- a/src/core/hle/service/pctl/pctl_a.cpp
+++ b/src/core/hle/service/pctl/module.cpp
@@ -4,7 +4,8 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h" 6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/pctl/pctl_a.h" 7#include "core/hle/service/pctl/module.h"
8#include "core/hle/service/pctl/pctl.h"
8 9
9namespace Service::PCTL { 10namespace Service::PCTL {
10 11
@@ -12,7 +13,7 @@ class IParentalControlService final : public ServiceFramework<IParentalControlSe
12public: 13public:
13 IParentalControlService() : ServiceFramework("IParentalControlService") { 14 IParentalControlService() : ServiceFramework("IParentalControlService") {
14 static const FunctionInfo functions[] = { 15 static const FunctionInfo functions[] = {
15 {1, nullptr, "Initialize"}, 16 {1, &IParentalControlService::Initialize, "Initialize"},
16 {1001, nullptr, "CheckFreeCommunicationPermission"}, 17 {1001, nullptr, "CheckFreeCommunicationPermission"},
17 {1002, nullptr, "ConfirmLaunchApplicationPermission"}, 18 {1002, nullptr, "ConfirmLaunchApplicationPermission"},
18 {1003, nullptr, "ConfirmResumeApplicationPermission"}, 19 {1003, nullptr, "ConfirmResumeApplicationPermission"},
@@ -108,20 +109,38 @@ public:
108 }; 109 };
109 RegisterHandlers(functions); 110 RegisterHandlers(functions);
110 } 111 }
112
113private:
114 void Initialize(Kernel::HLERequestContext& ctx) {
115 NGLOG_WARNING(Service_PCTL, "(STUBBED) called");
116 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
117 rb.Push(RESULT_SUCCESS);
118 }
111}; 119};
112void PCTL_A::CreateService(Kernel::HLERequestContext& ctx) { 120
121void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
122 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
123 rb.Push(RESULT_SUCCESS);
124 rb.PushIpcInterface<IParentalControlService>();
125 NGLOG_DEBUG(Service_PCTL, "called");
126}
127
128void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx) {
113 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 129 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
114 rb.Push(RESULT_SUCCESS); 130 rb.Push(RESULT_SUCCESS);
115 rb.PushIpcInterface<IParentalControlService>(); 131 rb.PushIpcInterface<IParentalControlService>();
116 NGLOG_DEBUG(Service_PCTL, "called"); 132 NGLOG_DEBUG(Service_PCTL, "called");
117} 133}
118 134
119PCTL_A::PCTL_A() : ServiceFramework("pctl:a") { 135Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
120 static const FunctionInfo functions[] = { 136 : ServiceFramework(name), module(std::move(module)) {}
121 {0, &PCTL_A::CreateService, "CreateService"}, 137
122 {1, nullptr, "CreateServiceWithoutInitialize"}, 138void InstallInterfaces(SM::ServiceManager& service_manager) {
123 }; 139 auto module = std::make_shared<Module>();
124 RegisterHandlers(functions); 140 std::make_shared<PCTL>(module, "pctl")->InstallAsService(service_manager);
141 std::make_shared<PCTL>(module, "pctl:a")->InstallAsService(service_manager);
142 std::make_shared<PCTL>(module, "pctl:r")->InstallAsService(service_manager);
143 std::make_shared<PCTL>(module, "pctl:s")->InstallAsService(service_manager);
125} 144}
126 145
127} // namespace Service::PCTL 146} // namespace Service::PCTL
diff --git a/src/core/hle/service/pctl/module.h b/src/core/hle/service/pctl/module.h
new file mode 100644
index 000000000..68da628a8
--- /dev/null
+++ b/src/core/hle/service/pctl/module.h
@@ -0,0 +1,28 @@
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#include "core/hle/service/service.h"
8
9namespace Service::PCTL {
10
11class Module final {
12public:
13 class Interface : public ServiceFramework<Interface> {
14 public:
15 Interface(std::shared_ptr<Module> module, const char* name);
16
17 void CreateService(Kernel::HLERequestContext& ctx);
18 void CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx);
19
20 protected:
21 std::shared_ptr<Module> module;
22 };
23};
24
25/// Registers all PCTL services with the specified service manager.
26void InstallInterfaces(SM::ServiceManager& service_manager);
27
28} // namespace Service::PCTL
diff --git a/src/core/hle/service/pctl/pctl.cpp b/src/core/hle/service/pctl/pctl.cpp
index 6ee81866d..de2741d66 100644
--- a/src/core/hle/service/pctl/pctl.cpp
+++ b/src/core/hle/service/pctl/pctl.cpp
@@ -3,12 +3,15 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/pctl/pctl.h" 5#include "core/hle/service/pctl/pctl.h"
6#include "core/hle/service/pctl/pctl_a.h"
7 6
8namespace Service::PCTL { 7namespace Service::PCTL {
9 8
10void InstallInterfaces(SM::ServiceManager& service_manager) { 9PCTL::PCTL(std::shared_ptr<Module> module, const char* name)
11 std::make_shared<PCTL_A>()->InstallAsService(service_manager); 10 : Module::Interface(std::move(module), name) {
11 static const FunctionInfo functions[] = {
12 {0, &PCTL::CreateService, "CreateService"},
13 {1, &PCTL::CreateServiceWithoutInitialize, "CreateServiceWithoutInitialize"},
14 };
15 RegisterHandlers(functions);
12} 16}
13
14} // namespace Service::PCTL 17} // namespace Service::PCTL
diff --git a/src/core/hle/service/pctl/pctl.h b/src/core/hle/service/pctl/pctl.h
index f0a84b115..8ddf69128 100644
--- a/src/core/hle/service/pctl/pctl.h
+++ b/src/core/hle/service/pctl/pctl.h
@@ -4,11 +4,13 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/pctl/module.h"
8 8
9namespace Service::PCTL { 9namespace Service::PCTL {
10 10
11/// Registers all PCTL services with the specified service manager. 11class PCTL final : public Module::Interface {
12void InstallInterfaces(SM::ServiceManager& service_manager); 12public:
13 explicit PCTL(std::shared_ptr<Module> module, const char* name);
14};
13 15
14} // namespace Service::PCTL 16} // namespace Service::PCTL
diff --git a/src/core/hle/service/pctl/pctl_a.h b/src/core/hle/service/pctl/pctl_a.h
deleted file mode 100644
index 09ed82e1b..000000000
--- a/src/core/hle/service/pctl/pctl_a.h
+++ /dev/null
@@ -1,20 +0,0 @@
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#include "core/hle/service/service.h"
8
9namespace Service::PCTL {
10
11class PCTL_A final : public ServiceFramework<PCTL_A> {
12public:
13 PCTL_A();
14 ~PCTL_A() = default;
15
16private:
17 void CreateService(Kernel::HLERequestContext& ctx);
18};
19
20} // namespace Service::PCTL
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 5817819fe..a85c406be 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -29,7 +29,7 @@
29#include "core/hle/service/nifm/nifm.h" 29#include "core/hle/service/nifm/nifm.h"
30#include "core/hle/service/ns/ns.h" 30#include "core/hle/service/ns/ns.h"
31#include "core/hle/service/nvdrv/nvdrv.h" 31#include "core/hle/service/nvdrv/nvdrv.h"
32#include "core/hle/service/pctl/pctl.h" 32#include "core/hle/service/pctl/module.h"
33#include "core/hle/service/service.h" 33#include "core/hle/service/service.h"
34#include "core/hle/service/set/settings.h" 34#include "core/hle/service/set/settings.h"
35#include "core/hle/service/sm/controller.h" 35#include "core/hle/service/sm/controller.h"