mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 23:06:23 -05:00
services: Pass FileSystemController as reference to services that need it
This commit is contained in:
parent
1b04b72653
commit
4b91057688
11 changed files with 47 additions and 20 deletions
|
@ -1268,7 +1268,7 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
|
||||||
"new_journal={:016X}",
|
"new_journal={:016X}",
|
||||||
static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);
|
static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);
|
||||||
|
|
||||||
fsc.WriteSaveDataSize(type, Core::CurrentProcess()->GetTitleID(), user_id,
|
fsc.WriteSaveDataSize(type, system.CurrentProcess()->GetTitleID(), user_id,
|
||||||
{new_normal_size, new_journal_size});
|
{new_normal_size, new_journal_size});
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 4};
|
IPC::ResponseBuilder rb{ctx, 4};
|
||||||
|
@ -1288,7 +1288,8 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type),
|
LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type),
|
||||||
user_id[1], user_id[0]);
|
user_id[1], user_id[0]);
|
||||||
|
|
||||||
const auto size = fsc.ReadSaveDataSize(type, Core::CurrentProcess()->GetTitleID(), user_id);
|
const auto size = system.FileSystemController().ReadSaveDataSize(
|
||||||
|
type, system.CurrentProcess()->GetTitleID(), user_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 6};
|
IPC::ResponseBuilder rb{ctx, 6};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
|
|
|
@ -106,7 +106,7 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushIpcInterface<IApplicationFunctions>(system);
|
rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
|
namespace FileSystem {
|
||||||
|
class FileSystemController;
|
||||||
|
}
|
||||||
|
|
||||||
namespace NVFlinger {
|
namespace NVFlinger {
|
||||||
class NVFlinger;
|
class NVFlinger;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ private:
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushIpcInterface<IApplicationFunctions>(system);
|
rb.PushIpcInterface<IApplicationFunctions>(system.FileSystemController());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
|
namespace FileSystem {
|
||||||
|
class FileSystemController;
|
||||||
|
}
|
||||||
|
|
||||||
namespace NVFlinger {
|
namespace NVFlinger {
|
||||||
class NVFlinger;
|
class NVFlinger;
|
||||||
}
|
}
|
||||||
|
|
|
@ -617,7 +617,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSystemController& fsc) {
|
||||||
std::make_shared<NS>("ns:am2")->InstallAsService(service_manager);
|
std::make_shared<NS>("ns:am2")->InstallAsService(service_manager);
|
||||||
std::make_shared<NS>("ns:ec")->InstallAsService(service_manager);
|
std::make_shared<NS>("ns:ec")->InstallAsService(service_manager);
|
||||||
std::make_shared<NS>("ns:rid")->InstallAsService(service_manager);
|
std::make_shared<NS>("ns:rid")->InstallAsService(service_manager);
|
||||||
|
@ -628,7 +628,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||||
std::make_shared<NS_SU>()->InstallAsService(service_manager);
|
std::make_shared<NS_SU>()->InstallAsService(service_manager);
|
||||||
std::make_shared<NS_VM>()->InstallAsService(service_manager);
|
std::make_shared<NS_VM>()->InstallAsService(service_manager);
|
||||||
|
|
||||||
std::make_shared<PL_U>()->InstallAsService(service_manager);
|
std::make_shared<PL_U>(fsc)->InstallAsService(service_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Service::NS
|
} // namespace Service::NS
|
||||||
|
|
|
@ -6,7 +6,13 @@
|
||||||
|
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service::NS {
|
namespace Service {
|
||||||
|
|
||||||
|
namespace FileSystem {
|
||||||
|
class FileSystemController;
|
||||||
|
} // namespace FileSystem
|
||||||
|
|
||||||
|
namespace NS {
|
||||||
|
|
||||||
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> {
|
class IAccountProxyInterface final : public ServiceFramework<IAccountProxyInterface> {
|
||||||
public:
|
public:
|
||||||
|
@ -91,6 +97,8 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Registers all NS services with the specified service manager.
|
/// Registers all NS services with the specified service manager.
|
||||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
void InstallInterfaces(SM::ServiceManager& service_manager, FileSystem::FileSystemController& fsc);
|
||||||
|
|
||||||
} // namespace Service::NS
|
} // namespace NS
|
||||||
|
|
||||||
|
} // namespace Service
|
||||||
|
|
|
@ -150,7 +150,8 @@ struct PL_U::Impl {
|
||||||
std::vector<FontRegion> shared_font_regions;
|
std::vector<FontRegion> shared_font_regions;
|
||||||
};
|
};
|
||||||
|
|
||||||
PL_U::PL_U() : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} {
|
PL_U::PL_U(FileSystem::FileSystemController& fsc)
|
||||||
|
: ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &PL_U::RequestLoad, "RequestLoad"},
|
{0, &PL_U::RequestLoad, "RequestLoad"},
|
||||||
{1, &PL_U::GetLoadState, "GetLoadState"},
|
{1, &PL_U::GetLoadState, "GetLoadState"},
|
||||||
|
@ -161,7 +162,7 @@ PL_U::PL_U() : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} {
|
||||||
};
|
};
|
||||||
RegisterHandlers(functions);
|
RegisterHandlers(functions);
|
||||||
// Attempt to load shared font data from disk
|
// Attempt to load shared font data from disk
|
||||||
const auto* nand = FileSystem::GetSystemNANDContents();
|
const auto* nand = fsc.GetSystemNANDContents();
|
||||||
std::size_t offset = 0;
|
std::size_t offset = 0;
|
||||||
// Rebuild shared fonts from data ncas
|
// Rebuild shared fonts from data ncas
|
||||||
if (nand->HasEntry(static_cast<u64>(FontArchives::Standard),
|
if (nand->HasEntry(static_cast<u64>(FontArchives::Standard),
|
||||||
|
|
|
@ -7,11 +7,17 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service::NS {
|
namespace Service {
|
||||||
|
|
||||||
|
namespace FileSystem {
|
||||||
|
class FileSystemController;
|
||||||
|
} // namespace FileSystem
|
||||||
|
|
||||||
|
namespace NS {
|
||||||
|
|
||||||
class PL_U final : public ServiceFramework<PL_U> {
|
class PL_U final : public ServiceFramework<PL_U> {
|
||||||
public:
|
public:
|
||||||
PL_U();
|
PL_U(FileSystem::FileSystemController& fsc);
|
||||||
~PL_U() override;
|
~PL_U() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -26,4 +32,6 @@ private:
|
||||||
std::unique_ptr<Impl> impl;
|
std::unique_ptr<Impl> impl;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service::NS
|
} // namespace NS
|
||||||
|
|
||||||
|
} // namespace Service
|
||||||
|
|
|
@ -199,6 +199,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {
|
||||||
// NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it
|
// NVFlinger needs to be accessed by several services like Vi and AppletOE so we instantiate it
|
||||||
// here and pass it into the respective InstallInterfaces functions.
|
// here and pass it into the respective InstallInterfaces functions.
|
||||||
auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming());
|
auto nv_flinger = std::make_shared<NVFlinger::NVFlinger>(system.CoreTiming());
|
||||||
|
fsc.CreateFactories(*system.GetFilesystem(), false);
|
||||||
|
|
||||||
SM::ServiceManager::InstallInterfaces(sm);
|
SM::ServiceManager::InstallInterfaces(sm);
|
||||||
|
|
||||||
|
@ -229,13 +230,13 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system) {
|
||||||
Migration::InstallInterfaces(*sm);
|
Migration::InstallInterfaces(*sm);
|
||||||
Mii::InstallInterfaces(*sm);
|
Mii::InstallInterfaces(*sm);
|
||||||
MM::InstallInterfaces(*sm);
|
MM::InstallInterfaces(*sm);
|
||||||
NCM::InstallInterfaces(*sm);
|
NCM::InstallInterfaces(*sm, fsc);
|
||||||
NFC::InstallInterfaces(*sm);
|
NFC::InstallInterfaces(*sm);
|
||||||
NFP::InstallInterfaces(*sm);
|
NFP::InstallInterfaces(*sm);
|
||||||
NIFM::InstallInterfaces(*sm);
|
NIFM::InstallInterfaces(*sm);
|
||||||
NIM::InstallInterfaces(*sm);
|
NIM::InstallInterfaces(*sm);
|
||||||
NPNS::InstallInterfaces(*sm);
|
NPNS::InstallInterfaces(*sm);
|
||||||
NS::InstallInterfaces(*sm);
|
NS::InstallInterfaces(*sm, fsc);
|
||||||
Nvidia::InstallInterfaces(*sm, *nv_flinger, system);
|
Nvidia::InstallInterfaces(*sm, *nv_flinger, system);
|
||||||
PCIe::InstallInterfaces(*sm);
|
PCIe::InstallInterfaces(*sm);
|
||||||
PCTL::InstallInterfaces(*sm);
|
PCTL::InstallInterfaces(*sm);
|
||||||
|
|
|
@ -18,10 +18,6 @@ namespace Core {
|
||||||
class System;
|
class System;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace FileSys {
|
|
||||||
class VfsFilesystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
class ClientPort;
|
class ClientPort;
|
||||||
class ServerPort;
|
class ServerPort;
|
||||||
|
@ -31,6 +27,10 @@ class HLERequestContext;
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
|
|
||||||
|
namespace FileSystem {
|
||||||
|
class FileSystemController;
|
||||||
|
} // namespace FileSystem
|
||||||
|
|
||||||
namespace SM {
|
namespace SM {
|
||||||
class ServiceManager;
|
class ServiceManager;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue