summaryrefslogtreecommitdiff
path: root/src/core/hle/service/npns
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-26 15:19:08 -0500
committerGravatar Lioncash2020-11-26 20:03:11 -0500
commit1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f (patch)
tree3593cd42e0ba676c3919561983f7e9766fcb641c /src/core/hle/service/npns
parentMerge pull request #4975 from comex/invalid-syncpoint-id (diff)
downloadyuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.gz
yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.tar.xz
yuzu-1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f.zip
service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
Diffstat (limited to 'src/core/hle/service/npns')
-rw-r--r--src/core/hle/service/npns/npns.cpp10
-rw-r--r--src/core/hle/service/npns/npns.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp
index 8fa16fb08..f7a58f659 100644
--- a/src/core/hle/service/npns/npns.cpp
+++ b/src/core/hle/service/npns/npns.cpp
@@ -12,7 +12,7 @@ namespace Service::NPNS {
12 12
13class NPNS_S final : public ServiceFramework<NPNS_S> { 13class NPNS_S final : public ServiceFramework<NPNS_S> {
14public: 14public:
15 explicit NPNS_S() : ServiceFramework{"npns:s"} { 15 explicit NPNS_S(Core::System& system_) : ServiceFramework{system_, "npns:s"} {
16 // clang-format off 16 // clang-format off
17 static const FunctionInfo functions[] = { 17 static const FunctionInfo functions[] = {
18 {1, nullptr, "ListenAll"}, 18 {1, nullptr, "ListenAll"},
@@ -62,7 +62,7 @@ public:
62 62
63class NPNS_U final : public ServiceFramework<NPNS_U> { 63class NPNS_U final : public ServiceFramework<NPNS_U> {
64public: 64public:
65 explicit NPNS_U() : ServiceFramework{"npns:u"} { 65 explicit NPNS_U(Core::System& system_) : ServiceFramework{system_, "npns:u"} {
66 // clang-format off 66 // clang-format off
67 static const FunctionInfo functions[] = { 67 static const FunctionInfo functions[] = {
68 {1, nullptr, "ListenAll"}, 68 {1, nullptr, "ListenAll"},
@@ -91,9 +91,9 @@ public:
91 } 91 }
92}; 92};
93 93
94void InstallInterfaces(SM::ServiceManager& sm) { 94void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
95 std::make_shared<NPNS_S>()->InstallAsService(sm); 95 std::make_shared<NPNS_S>(system)->InstallAsService(sm);
96 std::make_shared<NPNS_U>()->InstallAsService(sm); 96 std::make_shared<NPNS_U>(system)->InstallAsService(sm);
97} 97}
98 98
99} // namespace Service::NPNS 99} // namespace Service::NPNS
diff --git a/src/core/hle/service/npns/npns.h b/src/core/hle/service/npns/npns.h
index 861cd3e48..3b7596b6b 100644
--- a/src/core/hle/service/npns/npns.h
+++ b/src/core/hle/service/npns/npns.h
@@ -4,12 +4,16 @@
4 4
5#pragma once 5#pragma once
6 6
7namespace Core {
8class System;
9}
10
7namespace Service::SM { 11namespace Service::SM {
8class ServiceManager; 12class ServiceManager;
9} 13}
10 14
11namespace Service::NPNS { 15namespace Service::NPNS {
12 16
13void InstallInterfaces(SM::ServiceManager& sm); 17void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);
14 18
15} // namespace Service::NPNS 19} // namespace Service::NPNS