Merge pull request #2884 from ogniK5377/deglobal-sys-services
Remove usage of System::CurrentInterface() from most services
This commit is contained in:
commit
4ace69de9c
64 changed files with 290 additions and 211 deletions
|
@ -617,7 +617,8 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSystemController& fsc) {
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
|
||||
|
||||
std::make_shared<NS>("ns:am2")->InstallAsService(service_manager);
|
||||
std::make_shared<NS>("ns:ec")->InstallAsService(service_manager);
|
||||
std::make_shared<NS>("ns:rid")->InstallAsService(service_manager);
|
||||
|
@ -628,7 +629,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSyst
|
|||
std::make_shared<NS_SU>()->InstallAsService(service_manager);
|
||||
std::make_shared<NS_VM>()->InstallAsService(service_manager);
|
||||
|
||||
std::make_shared<PL_U>(fsc)->InstallAsService(service_manager);
|
||||
std::make_shared<PL_U>(system)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::NS
|
||||
|
|
|
@ -97,8 +97,7 @@ 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);
|
||||
|
||||
} // namespace NS
|
||||
|
||||
} // namespace Service
|
||||
|
|
|
@ -150,8 +150,9 @@ struct PL_U::Impl {
|
|||
std::vector<FontRegion> shared_font_regions;
|
||||
};
|
||||
|
||||
PL_U::PL_U(FileSystem::FileSystemController& fsc)
|
||||
: ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} {
|
||||
PL_U::PL_U(Core::System& system)
|
||||
: ServiceFramework("pl:u"), impl{std::make_unique<Impl>()}, system(system) {
|
||||
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &PL_U::RequestLoad, "RequestLoad"},
|
||||
{1, &PL_U::GetLoadState, "GetLoadState"},
|
||||
|
@ -161,6 +162,9 @@ PL_U::PL_U(FileSystem::FileSystemController& fsc)
|
|||
{5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
||||
auto& fsc = system.GetFileSystemController();
|
||||
|
||||
// Attempt to load shared font data from disk
|
||||
const auto* nand = fsc.GetSystemNANDContents();
|
||||
std::size_t offset = 0;
|
||||
|
@ -325,7 +329,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,
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace NS {
|
|||
|
||||
class PL_U final : public ServiceFramework<PL_U> {
|
||||
public:
|
||||
PL_U(FileSystem::FileSystemController& fsc);
|
||||
explicit PL_U(Core::System& system);
|
||||
~PL_U() override;
|
||||
|
||||
private:
|
||||
|
@ -30,6 +30,7 @@ private:
|
|||
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> impl;
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace NS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue