diff options
| -rw-r--r-- | src/core/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm.cpp | 47 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm.h | 19 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_a.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_a.h | 16 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_s.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_s.h | 16 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_u.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/nifm/nifm_u.h | 16 |
9 files changed, 30 insertions, 141 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index d513ce70a..96e619167 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -164,12 +164,6 @@ add_library(core STATIC | |||
| 164 | hle/service/nfp/nfp_user.h | 164 | hle/service/nfp/nfp_user.h |
| 165 | hle/service/nifm/nifm.cpp | 165 | hle/service/nifm/nifm.cpp |
| 166 | hle/service/nifm/nifm.h | 166 | hle/service/nifm/nifm.h |
| 167 | hle/service/nifm/nifm_a.cpp | ||
| 168 | hle/service/nifm/nifm_a.h | ||
| 169 | hle/service/nifm/nifm_s.cpp | ||
| 170 | hle/service/nifm/nifm_s.h | ||
| 171 | hle/service/nifm/nifm_u.cpp | ||
| 172 | hle/service/nifm/nifm_u.h | ||
| 173 | hle/service/ns/ns.cpp | 167 | hle/service/ns/ns.cpp |
| 174 | hle/service/ns/ns.h | 168 | hle/service/ns/ns.h |
| 175 | hle/service/ns/pl_u.cpp | 169 | hle/service/ns/pl_u.cpp |
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 | ||
| 12 | namespace Service::NIFM { | 10 | namespace Service::NIFM { |
| 13 | 11 | ||
| @@ -210,28 +208,35 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") { | |||
| 210 | RegisterHandlers(functions); | 208 | RegisterHandlers(functions); |
| 211 | } | 209 | } |
| 212 | 210 | ||
| 213 | void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { | 211 | class NetworkInterface final : public ServiceFramework<NetworkInterface> { |
| 214 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 212 | public: |
| 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 | ||
| 220 | void 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 | ||
| 227 | Module::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 | ||
| 230 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 236 | void 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" | 7 | namespace Service::SM { |
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 8 | 10 | ||
| 9 | namespace Service::NIFM { | 11 | namespace Service::NIFM { |
| 10 | 12 | ||
| 11 | class Module final { | 13 | /// Registers all NIFM services with the specified service manager. |
| 12 | public: | ||
| 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 | |||
| 25 | void InstallInterfaces(SM::ServiceManager& service_manager); | 14 | void 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 | |||
| 7 | namespace Service::NIFM { | ||
| 8 | |||
| 9 | NIFM_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 | |||
| 9 | namespace Service::NIFM { | ||
| 10 | |||
| 11 | class NIFM_A final : public Module::Interface { | ||
| 12 | public: | ||
| 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 | |||
| 7 | namespace Service::NIFM { | ||
| 8 | |||
| 9 | NIFM_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 | |||
| 9 | namespace Service::NIFM { | ||
| 10 | |||
| 11 | class NIFM_S final : public Module::Interface { | ||
| 12 | public: | ||
| 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 | |||
| 7 | namespace Service::NIFM { | ||
| 8 | |||
| 9 | NIFM_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 | |||
| 9 | namespace Service::NIFM { | ||
| 10 | |||
| 11 | class NIFM_U final : public Module::Interface { | ||
| 12 | public: | ||
| 13 | explicit NIFM_U(std::shared_ptr<Module> module); | ||
| 14 | }; | ||
| 15 | |||
| 16 | } // namespace Service::NIFM | ||