summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/CMakeLists.txt10
-rw-r--r--src/core/hle/service/erpt/erpt.cpp51
-rw-r--r--src/core/hle/service/erpt/erpt.h16
-rw-r--r--src/core/hle/service/eupld/eupld.cpp52
-rw-r--r--src/core/hle/service/eupld/eupld.h16
-rw-r--r--src/core/hle/service/nifm/nifm.cpp47
-rw-r--r--src/core/hle/service/nifm/nifm.h19
-rw-r--r--src/core/hle/service/nifm/nifm_a.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_a.h16
-rw-r--r--src/core/hle/service/nifm/nifm_s.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_s.h16
-rw-r--r--src/core/hle/service/nifm/nifm_u.cpp17
-rw-r--r--src/core/hle/service/nifm/nifm_u.h16
-rw-r--r--src/core/hle/service/service.cpp4
14 files changed, 173 insertions, 141 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f5e7ec080..2e2de59b1 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -136,8 +136,12 @@ add_library(core STATIC
136 hle/service/bcat/bcat.h 136 hle/service/bcat/bcat.h
137 hle/service/bcat/module.cpp 137 hle/service/bcat/module.cpp
138 hle/service/bcat/module.h 138 hle/service/bcat/module.h
139 hle/service/erpt/erpt.cpp
140 hle/service/erpt/erpt.h
139 hle/service/es/es.cpp 141 hle/service/es/es.cpp
140 hle/service/es/es.h 142 hle/service/es/es.h
143 hle/service/eupld/eupld.cpp
144 hle/service/eupld/eupld.h
141 hle/service/fatal/fatal.cpp 145 hle/service/fatal/fatal.cpp
142 hle/service/fatal/fatal.h 146 hle/service/fatal/fatal.h
143 hle/service/fatal/fatal_p.cpp 147 hle/service/fatal/fatal_p.cpp
@@ -166,12 +170,6 @@ add_library(core STATIC
166 hle/service/nfp/nfp_user.h 170 hle/service/nfp/nfp_user.h
167 hle/service/nifm/nifm.cpp 171 hle/service/nifm/nifm.cpp
168 hle/service/nifm/nifm.h 172 hle/service/nifm/nifm.h
169 hle/service/nifm/nifm_a.cpp
170 hle/service/nifm/nifm_a.h
171 hle/service/nifm/nifm_s.cpp
172 hle/service/nifm/nifm_s.h
173 hle/service/nifm/nifm_u.cpp
174 hle/service/nifm/nifm_u.h
175 hle/service/ns/ns.cpp 173 hle/service/ns/ns.cpp
176 hle/service/ns/ns.h 174 hle/service/ns/ns.h
177 hle/service/ns/pl_u.cpp 175 hle/service/ns/pl_u.cpp
diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp
new file mode 100644
index 000000000..ee11cd78e
--- /dev/null
+++ b/src/core/hle/service/erpt/erpt.cpp
@@ -0,0 +1,51 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/erpt/erpt.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::ERPT {
12
13class ErrorReportContext final : public ServiceFramework<ErrorReportContext> {
14public:
15 explicit ErrorReportContext() : ServiceFramework{"erpt:c"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "SubmitContext"},
19 {1, nullptr, "CreateReport"},
20 {2, nullptr, "Unknown1"},
21 {3, nullptr, "Unknown2"},
22 {4, nullptr, "Unknown3"},
23 {5, nullptr, "Unknown4"},
24 {6, nullptr, "Unknown5"},
25 };
26 // clang-format on
27
28 RegisterHandlers(functions);
29 }
30};
31
32class ErrorReportSession final : public ServiceFramework<ErrorReportSession> {
33public:
34 explicit ErrorReportSession() : ServiceFramework{"erpt:r"} {
35 // clang-format off
36 static const FunctionInfo functions[] = {
37 {0, nullptr, "OpenReport"},
38 {1, nullptr, "OpenManager"},
39 };
40 // clang-format on
41
42 RegisterHandlers(functions);
43 }
44};
45
46void InstallInterfaces(SM::ServiceManager& sm) {
47 std::make_shared<ErrorReportContext>()->InstallAsService(sm);
48 std::make_shared<ErrorReportSession>()->InstallAsService(sm);
49}
50
51} // namespace Service::ERPT
diff --git a/src/core/hle/service/erpt/erpt.h b/src/core/hle/service/erpt/erpt.h
new file mode 100644
index 000000000..de439ab6d
--- /dev/null
+++ b/src/core/hle/service/erpt/erpt.h
@@ -0,0 +1,16 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::ERPT {
12
13/// Registers all ERPT services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::ERPT
diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp
new file mode 100644
index 000000000..2df30acee
--- /dev/null
+++ b/src/core/hle/service/eupld/eupld.cpp
@@ -0,0 +1,52 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/eupld/eupld.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::EUPLD {
12
13class ErrorUploadContext final : public ServiceFramework<ErrorUploadContext> {
14public:
15 explicit ErrorUploadContext() : ServiceFramework{"eupld:c"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "SetUrl"},
19 {1, nullptr, "ImportCrt"},
20 {2, nullptr, "ImportPki"},
21 {3, nullptr, "SetAutoUpload"},
22 };
23 // clang-format on
24
25 RegisterHandlers(functions);
26 }
27};
28
29class ErrorUploadRequest final : public ServiceFramework<ErrorUploadRequest> {
30public:
31 explicit ErrorUploadRequest() : ServiceFramework{"eupld:r"} {
32 // clang-format off
33 static const FunctionInfo functions[] = {
34 {0, nullptr, "Initialize"},
35 {1, nullptr, "UploadAll"},
36 {2, nullptr, "UploadSelected"},
37 {3, nullptr, "GetUploadStatus"},
38 {4, nullptr, "CancelUpload"},
39 {5, nullptr, "GetResult"},
40 };
41 // clang-format on
42
43 RegisterHandlers(functions);
44 }
45};
46
47void InstallInterfaces(SM::ServiceManager& sm) {
48 std::make_shared<ErrorUploadContext>()->InstallAsService(sm);
49 std::make_shared<ErrorUploadRequest>()->InstallAsService(sm);
50}
51
52} // namespace Service::EUPLD
diff --git a/src/core/hle/service/eupld/eupld.h b/src/core/hle/service/eupld/eupld.h
new file mode 100644
index 000000000..6eef2c15f
--- /dev/null
+++ b/src/core/hle/service/eupld/eupld.h
@@ -0,0 +1,16 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::EUPLD {
12
13/// Registers all EUPLD services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::EUPLD
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 0d951084b..cfe8d9178 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -5,9 +5,7 @@
5#include "core/hle/ipc_helpers.h" 5#include "core/hle/ipc_helpers.h"
6#include "core/hle/kernel/event.h" 6#include "core/hle/kernel/event.h"
7#include "core/hle/service/nifm/nifm.h" 7#include "core/hle/service/nifm/nifm.h"
8#include "core/hle/service/nifm/nifm_a.h" 8#include "core/hle/service/service.h"
9#include "core/hle/service/nifm/nifm_s.h"
10#include "core/hle/service/nifm/nifm_u.h"
11 9
12namespace Service::NIFM { 10namespace Service::NIFM {
13 11
@@ -210,28 +208,35 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") {
210 RegisterHandlers(functions); 208 RegisterHandlers(functions);
211} 209}
212 210
213void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { 211class NetworkInterface final : public ServiceFramework<NetworkInterface> {
214 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 212public:
215 rb.Push(RESULT_SUCCESS); 213 explicit NetworkInterface(const char* name) : ServiceFramework{name} {
216 rb.PushIpcInterface<IGeneralService>(); 214 static const FunctionInfo functions[] = {
217 LOG_DEBUG(Service_NIFM, "called"); 215 {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
218} 216 {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"},
217 };
218 RegisterHandlers(functions);
219 }
219 220
220void Module::Interface::CreateGeneralService(Kernel::HLERequestContext& ctx) { 221 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) {
221 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 222 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
222 rb.Push(RESULT_SUCCESS); 223 rb.Push(RESULT_SUCCESS);
223 rb.PushIpcInterface<IGeneralService>(); 224 rb.PushIpcInterface<IGeneralService>();
224 LOG_DEBUG(Service_NIFM, "called"); 225 LOG_DEBUG(Service_NIFM, "called");
225} 226 }
226 227
227Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 228 void CreateGeneralService(Kernel::HLERequestContext& ctx) {
228 : ServiceFramework(name), module(std::move(module)) {} 229 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
230 rb.Push(RESULT_SUCCESS);
231 rb.PushIpcInterface<IGeneralService>();
232 LOG_DEBUG(Service_NIFM, "called");
233 }
234};
229 235
230void InstallInterfaces(SM::ServiceManager& service_manager) { 236void InstallInterfaces(SM::ServiceManager& service_manager) {
231 auto module = std::make_shared<Module>(); 237 std::make_shared<NetworkInterface>("nifm:a")->InstallAsService(service_manager);
232 std::make_shared<NIFM_A>(module)->InstallAsService(service_manager); 238 std::make_shared<NetworkInterface>("nifm:s")->InstallAsService(service_manager);
233 std::make_shared<NIFM_S>(module)->InstallAsService(service_manager); 239 std::make_shared<NetworkInterface>("nifm:u")->InstallAsService(service_manager);
234 std::make_shared<NIFM_U>(module)->InstallAsService(service_manager);
235} 240}
236 241
237} // namespace Service::NIFM 242} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h
index 11f1b5831..4616b3b48 100644
--- a/src/core/hle/service/nifm/nifm.h
+++ b/src/core/hle/service/nifm/nifm.h
@@ -4,24 +4,13 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7namespace Service::SM {
8class ServiceManager;
9}
8 10
9namespace Service::NIFM { 11namespace Service::NIFM {
10 12
11class Module final { 13/// Registers all NIFM services with the specified service manager.
12public:
13 class Interface : public ServiceFramework<Interface> {
14 public:
15 explicit Interface(std::shared_ptr<Module> module, const char* name);
16
17 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx);
18 void CreateGeneralService(Kernel::HLERequestContext& ctx);
19
20 protected:
21 std::shared_ptr<Module> module;
22 };
23};
24
25void InstallInterfaces(SM::ServiceManager& service_manager); 14void InstallInterfaces(SM::ServiceManager& service_manager);
26 15
27} // namespace Service::NIFM 16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_a.cpp b/src/core/hle/service/nifm/nifm_a.cpp
deleted file mode 100644
index b7f296a20..000000000
--- a/src/core/hle/service/nifm/nifm_a.cpp
+++ /dev/null
@@ -1,17 +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#include "core/hle/service/nifm/nifm_a.h"
6
7namespace Service::NIFM {
8
9NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:a") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_A::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_A::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_a.h b/src/core/hle/service/nifm/nifm_a.h
deleted file mode 100644
index c3ba33110..000000000
--- a/src/core/hle/service/nifm/nifm_a.h
+++ /dev/null
@@ -1,16 +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/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_A final : public Module::Interface {
12public:
13 explicit NIFM_A(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_s.cpp b/src/core/hle/service/nifm/nifm_s.cpp
deleted file mode 100644
index 96e3c0cee..000000000
--- a/src/core/hle/service/nifm/nifm_s.cpp
+++ /dev/null
@@ -1,17 +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#include "core/hle/service/nifm/nifm_s.h"
6
7namespace Service::NIFM {
8
9NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:s") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_S::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_S::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_s.h b/src/core/hle/service/nifm/nifm_s.h
deleted file mode 100644
index 8d1635a5d..000000000
--- a/src/core/hle/service/nifm/nifm_s.h
+++ /dev/null
@@ -1,16 +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/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_S final : public Module::Interface {
12public:
13 explicit NIFM_S(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_u.cpp b/src/core/hle/service/nifm/nifm_u.cpp
deleted file mode 100644
index 8cb75b903..000000000
--- a/src/core/hle/service/nifm/nifm_u.cpp
+++ /dev/null
@@ -1,17 +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#include "core/hle/service/nifm/nifm_u.h"
6
7namespace Service::NIFM {
8
9NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:u") {
10 static const FunctionInfo functions[] = {
11 {4, &NIFM_U::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
12 {5, &NIFM_U::CreateGeneralService, "CreateGeneralService"},
13 };
14 RegisterHandlers(functions);
15}
16
17} // namespace Service::NIFM
diff --git a/src/core/hle/service/nifm/nifm_u.h b/src/core/hle/service/nifm/nifm_u.h
deleted file mode 100644
index def9726b1..000000000
--- a/src/core/hle/service/nifm/nifm_u.h
+++ /dev/null
@@ -1,16 +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/nifm/nifm.h"
8
9namespace Service::NIFM {
10
11class NIFM_U final : public Module::Interface {
12public:
13 explicit NIFM_U(std::shared_ptr<Module> module);
14};
15
16} // namespace Service::NIFM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 2ac416b98..482989ea7 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -21,7 +21,9 @@
21#include "core/hle/service/apm/apm.h" 21#include "core/hle/service/apm/apm.h"
22#include "core/hle/service/audio/audio.h" 22#include "core/hle/service/audio/audio.h"
23#include "core/hle/service/bcat/bcat.h" 23#include "core/hle/service/bcat/bcat.h"
24#include "core/hle/service/erpt/erpt.h"
24#include "core/hle/service/es/es.h" 25#include "core/hle/service/es/es.h"
26#include "core/hle/service/eupld/eupld.h"
25#include "core/hle/service/fatal/fatal.h" 27#include "core/hle/service/fatal/fatal.h"
26#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
27#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
@@ -190,7 +192,9 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
190 APM::InstallInterfaces(*sm); 192 APM::InstallInterfaces(*sm);
191 BCAT::InstallInterfaces(*sm); 193 BCAT::InstallInterfaces(*sm);
192 Audio::InstallInterfaces(*sm); 194 Audio::InstallInterfaces(*sm);
195 ERPT::InstallInterfaces(*sm);
193 ES::InstallInterfaces(*sm); 196 ES::InstallInterfaces(*sm);
197 EUPLD::InstallInterfaces(*sm);
194 Fatal::InstallInterfaces(*sm); 198 Fatal::InstallInterfaces(*sm);
195 FileSystem::InstallInterfaces(*sm); 199 FileSystem::InstallInterfaces(*sm);
196 Friend::InstallInterfaces(*sm); 200 Friend::InstallInterfaces(*sm);