From f21ab654db620198b388bd25cd0db4c2085c4c8a Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sun, 22 Sep 2019 16:35:43 +1000 Subject: [PATCH] Rebase --- src/core/hle/service/ns/ns.cpp | 6 ++++-- src/core/hle/service/ns/ns.h | 4 ++-- src/core/hle/service/ns/pl_u.cpp | 7 ++++--- src/core/hle/service/ns/pl_u.h | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 13121c4f1..dffd2eefe 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp @@ -617,7 +617,9 @@ public: } }; -void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSystemController& fsc) { +void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system, + FileSystem::FileSystemController& fsc) { + std::make_shared("ns:am2")->InstallAsService(service_manager); std::make_shared("ns:ec")->InstallAsService(service_manager); std::make_shared("ns:rid")->InstallAsService(service_manager); @@ -628,7 +630,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSyst std::make_shared()->InstallAsService(service_manager); std::make_shared()->InstallAsService(service_manager); - std::make_shared(fsc)->InstallAsService(service_manager); + std::make_shared(system, fsc)->InstallAsService(service_manager); } } // namespace Service::NS diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index d067e7a9a..4a10c98f9 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h @@ -97,8 +97,8 @@ private: }; /// Registers all NS services with the specified service manager. -void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSystemController& fsc); +void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system, + FileSystem::FileSystemController& fsc); } // namespace NS - } // namespace Service diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 8f0c6bc07..4f9b843e6 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -145,8 +145,9 @@ struct PL_U::Impl { std::vector shared_font_regions; }; -PL_U::PL_U(FileSystem::FileSystemController& fsc) - : ServiceFramework("pl:u"), impl{std::make_unique()} { +PL_U::PL_U(Core::System& system, FileSystem::FileSystemController& fsc) + : ServiceFramework("pl:u"), impl{std::make_unique()}, system(system) { + static const FunctionInfo functions[] = { {0, &PL_U::RequestLoad, "RequestLoad"}, {1, &PL_U::GetLoadState, "GetLoadState"}, @@ -255,7 +256,7 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { Kernel::MemoryState::Shared); // Create shared font memory object - auto& kernel = Core::System::GetInstance().Kernel(); + auto& kernel = system.Kernel(); impl->shared_font_mem = Kernel::SharedMemory::Create( kernel, Core::CurrentProcess(), SHARED_FONT_MEM_SIZE, Kernel::MemoryPermission::ReadWrite, Kernel::MemoryPermission::Read, SHARED_FONT_MEM_VADDR, Kernel::MemoryRegion::BASE, diff --git a/src/core/hle/service/ns/pl_u.h b/src/core/hle/service/ns/pl_u.h index 7e9fe6220..0d38d7d36 100644 --- a/src/core/hle/service/ns/pl_u.h +++ b/src/core/hle/service/ns/pl_u.h @@ -20,7 +20,7 @@ void EncryptSharedFont(const std::vector& input, Kernel::PhysicalMemory& out class PL_U final : public ServiceFramework { public: - PL_U(FileSystem::FileSystemController& fsc); + PL_U(Core::System& system, FileSystem::FileSystemController& fsc); ~PL_U() override; private: @@ -33,6 +33,7 @@ private: struct Impl; std::unique_ptr impl; + Core::System& system; }; } // namespace NS