From 1a954b2a596fdfd4fc4b5feb9b43c8147de4cc7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 26 Nov 2020 15:19:08 -0500 Subject: 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. --- src/core/hle/service/am/am.h | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'src/core/hle/service/am/am.h') diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index af97c303a..b1da0d081 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -77,13 +77,11 @@ public: private: void GetAppletResourceUserId(Kernel::HLERequestContext& ctx); void AcquireForegroundRights(Kernel::HLERequestContext& ctx); - - Core::System& system; }; class IAudioController final : public ServiceFramework { public: - IAudioController(); + explicit IAudioController(Core::System& system_); ~IAudioController() override; private: @@ -109,13 +107,13 @@ private: class IDisplayController final : public ServiceFramework { public: - IDisplayController(); + explicit IDisplayController(Core::System& system_); ~IDisplayController() override; }; class IDebugFunctions final : public ServiceFramework { public: - IDebugFunctions(); + explicit IDebugFunctions(Core::System& system_); ~IDebugFunctions() override; }; @@ -154,7 +152,6 @@ private: Disable = 2, }; - Core::System& system; NVFlinger::NVFlinger& nvflinger; Kernel::EventPair launchable_event; Kernel::EventPair accumulated_suspended_tick_changed_event; @@ -167,8 +164,8 @@ private: class ICommonStateGetter final : public ServiceFramework { public: - explicit ICommonStateGetter(Core::System& system, - std::shared_ptr msg_queue); + explicit ICommonStateGetter(Core::System& system_, + std::shared_ptr msg_queue_); ~ICommonStateGetter() override; private: @@ -196,7 +193,6 @@ private: void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); void SetCpuBoostMode(Kernel::HLERequestContext& ctx); - Core::System& system; std::shared_ptr msg_queue; bool vr_mode_state{}; }; @@ -211,7 +207,7 @@ public: class IStorage final : public ServiceFramework { public: - explicit IStorage(std::vector&& buffer); + explicit IStorage(Core::System& system_, std::vector&& buffer); ~IStorage() override; std::vector& GetData() { @@ -235,7 +231,7 @@ private: class IStorageAccessor final : public ServiceFramework { public: - explicit IStorageAccessor(IStorage& backing); + explicit IStorageAccessor(Core::System& system_, IStorage& backing_); ~IStorageAccessor() override; private: @@ -255,8 +251,6 @@ private: void CreateLibraryApplet(Kernel::HLERequestContext& ctx); void CreateStorage(Kernel::HLERequestContext& ctx); void CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx); - - Core::System& system; }; class IApplicationFunctions final : public ServiceFramework { @@ -299,12 +293,11 @@ private: s32 previous_program_index{-1}; Kernel::EventPair gpu_error_detected_event; Kernel::EventPair friend_invitation_storage_channel_event; - Core::System& system; }; class IHomeMenuFunctions final : public ServiceFramework { public: - explicit IHomeMenuFunctions(Kernel::KernelCore& kernel); + explicit IHomeMenuFunctions(Core::System& system_); ~IHomeMenuFunctions() override; private: @@ -312,24 +305,23 @@ private: void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx); Kernel::EventPair pop_from_general_channel_event; - Kernel::KernelCore& kernel; }; class IGlobalStateController final : public ServiceFramework { public: - IGlobalStateController(); + explicit IGlobalStateController(Core::System& system_); ~IGlobalStateController() override; }; class IApplicationCreator final : public ServiceFramework { public: - IApplicationCreator(); + explicit IApplicationCreator(Core::System& system_); ~IApplicationCreator() override; }; class IProcessWindingController final : public ServiceFramework { public: - IProcessWindingController(); + explicit IProcessWindingController(Core::System& system_); ~IProcessWindingController() override; }; -- cgit v1.2.3