mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-24 10:07:52 -05:00
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.
This commit is contained in:
@ -6,12 +6,13 @@
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/client_session.h"
|
||||
#include "core/hle/service/mm/mm_u.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
|
||||
namespace Service::MM {
|
||||
|
||||
class MM_U final : public ServiceFramework<MM_U> {
|
||||
public:
|
||||
explicit MM_U() : ServiceFramework{"mm:u"} {
|
||||
explicit MM_U(Core::System& system_) : ServiceFramework{system_, "mm:u"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &MM_U::InitializeOld, "InitializeOld"},
|
||||
@ -104,8 +105,8 @@ private:
|
||||
u32 id{1};
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<MM_U>()->InstallAsService(service_manager);
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
||||
std::make_shared<MM_U>(system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::MM
|
||||
|
@ -4,11 +4,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Service::SM {
|
||||
class ServiceManager;
|
||||
}
|
||||
|
||||
namespace Service::MM {
|
||||
|
||||
/// Registers all MM services with the specified service manager.
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
|
||||
|
||||
} // namespace Service::MM
|
||||
|
Reference in New Issue
Block a user