summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nifm/nifm.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-07-25 23:07:32 +0200
committerLioncash <mathew1800@gmail.com>2018-07-25 23:18:41 +0200
commit85ed42a1d28daf30d8115e5e9bd1b5230ec25e00 (patch)
tree145d6aa9eb85e048c3361785d5ca1148cf8ba930 /src/core/hle/service/nifm/nifm.cpp
parentMerge pull request #801 from lioncash/time (diff)
downloadyuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar.gz
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar.bz2
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar.lz
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar.xz
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.tar.zst
yuzu-85ed42a1d28daf30d8115e5e9bd1b5230ec25e00.zip
Diffstat (limited to 'src/core/hle/service/nifm/nifm.cpp')
-rw-r--r--src/core/hle/service/nifm/nifm.cpp47
1 files changed, 26 insertions, 21 deletions
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 @@
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/nifm/nifm.h"
-#include "core/hle/service/nifm/nifm_a.h"
-#include "core/hle/service/nifm/nifm_s.h"
-#include "core/hle/service/nifm/nifm_u.h"
+#include "core/hle/service/service.h"
namespace Service::NIFM {
@@ -210,28 +208,35 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") {
RegisterHandlers(functions);
}
-void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IGeneralService>();
- LOG_DEBUG(Service_NIFM, "called");
-}
+class NetworkInterface final : public ServiceFramework<NetworkInterface> {
+public:
+ explicit NetworkInterface(const char* name) : ServiceFramework{name} {
+ static const FunctionInfo functions[] = {
+ {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
+ {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"},
+ };
+ RegisterHandlers(functions);
+ }
-void Module::Interface::CreateGeneralService(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IGeneralService>();
- LOG_DEBUG(Service_NIFM, "called");
-}
+ void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IGeneralService>();
+ LOG_DEBUG(Service_NIFM, "called");
+ }
-Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
- : ServiceFramework(name), module(std::move(module)) {}
+ void CreateGeneralService(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IGeneralService>();
+ LOG_DEBUG(Service_NIFM, "called");
+ }
+};
void InstallInterfaces(SM::ServiceManager& service_manager) {
- auto module = std::make_shared<Module>();
- std::make_shared<NIFM_A>(module)->InstallAsService(service_manager);
- std::make_shared<NIFM_S>(module)->InstallAsService(service_manager);
- std::make_shared<NIFM_U>(module)->InstallAsService(service_manager);
+ std::make_shared<NetworkInterface>("nifm:a")->InstallAsService(service_manager);
+ std::make_shared<NetworkInterface>("nifm:s")->InstallAsService(service_manager);
+ std::make_shared<NetworkInterface>("nifm:u")->InstallAsService(service_manager);
}
} // namespace Service::NIFM