summaryrefslogtreecommitdiff
path: root/src/core/hle/service/mm
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/mm
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/mm')
-rw-r--r--src/core/hle/service/mm/mm_u.cpp7
-rw-r--r--src/core/hle/service/mm/mm_u.h10
2 files changed, 12 insertions, 5 deletions
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
index 25c24e537..b0cb07d24 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -6,12 +6,13 @@
6#include "core/hle/ipc_helpers.h" 6#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/client_session.h" 7#include "core/hle/kernel/client_session.h"
8#include "core/hle/service/mm/mm_u.h" 8#include "core/hle/service/mm/mm_u.h"
9#include "core/hle/service/sm/sm.h"
9 10
10namespace Service::MM { 11namespace Service::MM {
11 12
12class MM_U final : public ServiceFramework<MM_U> { 13class MM_U final : public ServiceFramework<MM_U> {
13public: 14public:
14 explicit MM_U() : ServiceFramework{"mm:u"} { 15 explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} {
15 // clang-format off 16 // clang-format off
16 static const FunctionInfo functions[] = { 17 static const FunctionInfo functions[] = {
17 {0, &MM_U::InitializeOld, "InitializeOld"}, 18 {0, &MM_U::InitializeOld, "InitializeOld"},
@@ -104,8 +105,8 @@ private:
104 u32 id{1}; 105 u32 id{1};
105}; 106};
106 107
107void InstallInterfaces(SM::ServiceManager& service_manager) { 108void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
108 std::make_shared<MM_U>()->InstallAsService(service_manager); 109 std::make_shared<MM_U>(system)->InstallAsService(service_manager);
109} 110}
110 111
111} // namespace Service::MM 112} // namespace Service::MM
diff --git a/src/core/hle/service/mm/mm_u.h b/src/core/hle/service/mm/mm_u.h
index 5439fa653..49b6a3355 100644
--- a/src/core/hle/service/mm/mm_u.h
+++ b/src/core/hle/service/mm/mm_u.h
@@ -4,11 +4,17 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h" 7namespace Core {
8class System;
9}
10
11namespace Service::SM {
12class ServiceManager;
13}
8 14
9namespace Service::MM { 15namespace Service::MM {
10 16
11/// Registers all MM services with the specified service manager. 17/// Registers all MM services with the specified service manager.
12void InstallInterfaces(SM::ServiceManager& service_manager); 18void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
13 19
14} // namespace Service::MM 20} // namespace Service::MM