summaryrefslogtreecommitdiff
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorGravatar liamwhite2023-03-01 10:38:20 -0500
committerGravatar GitHub2023-03-01 10:38:20 -0500
commit97f7a560f3905a1dd6a4e5a0a308ea752004bf08 (patch)
treee60a69f96d16d051220b66e90906a7abeacf1064 /src/core/hle/service/filesystem
parentMerge pull request #9879 from zhaobot/tx-update-20230301024940 (diff)
parentsm:: fix lingering session initialization issues (diff)
downloadyuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.tar.gz
yuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.tar.xz
yuzu-97f7a560f3905a1dd6a4e5a0a308ea752004bf08.zip
Merge pull request #9832 from liamwhite/hle-mp
service: HLE multiprocess
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp12
-rw-r--r--src/core/hle/service/filesystem/filesystem.h2
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp13
3 files changed, 14 insertions, 13 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 177447bc1..dfcdd3ada 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -23,6 +23,7 @@
23#include "core/hle/service/filesystem/fsp_ldr.h" 23#include "core/hle/service/filesystem/fsp_ldr.h"
24#include "core/hle/service/filesystem/fsp_pr.h" 24#include "core/hle/service/filesystem/fsp_pr.h"
25#include "core/hle/service/filesystem/fsp_srv.h" 25#include "core/hle/service/filesystem/fsp_srv.h"
26#include "core/hle/service/server_manager.h"
26#include "core/loader/loader.h" 27#include "core/loader/loader.h"
27 28
28namespace Service::FileSystem { 29namespace Service::FileSystem {
@@ -796,10 +797,13 @@ void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool ove
796 } 797 }
797} 798}
798 799
799void InstallInterfaces(Core::System& system) { 800void LoopProcess(Core::System& system) {
800 std::make_shared<FSP_LDR>(system)->InstallAsService(system.ServiceManager()); 801 auto server_manager = std::make_unique<ServerManager>(system);
801 std::make_shared<FSP_PR>(system)->InstallAsService(system.ServiceManager()); 802
802 std::make_shared<FSP_SRV>(system)->InstallAsService(system.ServiceManager()); 803 server_manager->RegisterNamedService("fsp-ldr", std::make_shared<FSP_LDR>(system));
804 server_manager->RegisterNamedService("fsp:pr", std::make_shared<FSP_PR>(system));
805 server_manager->RegisterNamedService("fsp-srv", std::make_shared<FSP_SRV>(system));
806 ServerManager::RunServer(std::move(server_manager));
803} 807}
804 808
805} // namespace Service::FileSystem 809} // namespace Service::FileSystem
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index 5b27de9fa..a5c1c9d3e 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -139,7 +139,7 @@ private:
139 Core::System& system; 139 Core::System& system;
140}; 140};
141 141
142void InstallInterfaces(Core::System& system); 142void LoopProcess(Core::System& system);
143 143
144// A class that wraps a VfsDirectory with methods that return ResultVal and Result instead of 144// A class that wraps a VfsDirectory with methods that return ResultVal and Result instead of
145// pointers and booleans. This makes using a VfsDirectory with switch services much easier and 145// pointers and booleans. This makes using a VfsDirectory with switch services much easier and
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index e76346ca9..89eddb510 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -57,8 +57,7 @@ enum class FileSystemType : u8 {
57class IStorage final : public ServiceFramework<IStorage> { 57class IStorage final : public ServiceFramework<IStorage> {
58public: 58public:
59 explicit IStorage(Core::System& system_, FileSys::VirtualFile backend_) 59 explicit IStorage(Core::System& system_, FileSys::VirtualFile backend_)
60 : ServiceFramework{system_, "IStorage", ServiceThreadType::CreateNew}, 60 : ServiceFramework{system_, "IStorage"}, backend(std::move(backend_)) {
61 backend(std::move(backend_)) {
62 static const FunctionInfo functions[] = { 61 static const FunctionInfo functions[] = {
63 {0, &IStorage::Read, "Read"}, 62 {0, &IStorage::Read, "Read"},
64 {1, nullptr, "Write"}, 63 {1, nullptr, "Write"},
@@ -116,8 +115,7 @@ private:
116class IFile final : public ServiceFramework<IFile> { 115class IFile final : public ServiceFramework<IFile> {
117public: 116public:
118 explicit IFile(Core::System& system_, FileSys::VirtualFile backend_) 117 explicit IFile(Core::System& system_, FileSys::VirtualFile backend_)
119 : ServiceFramework{system_, "IFile", ServiceThreadType::CreateNew}, 118 : ServiceFramework{system_, "IFile"}, backend(std::move(backend_)) {
120 backend(std::move(backend_)) {
121 static const FunctionInfo functions[] = { 119 static const FunctionInfo functions[] = {
122 {0, &IFile::Read, "Read"}, 120 {0, &IFile::Read, "Read"},
123 {1, &IFile::Write, "Write"}, 121 {1, &IFile::Write, "Write"},
@@ -254,8 +252,7 @@ static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vec
254class IDirectory final : public ServiceFramework<IDirectory> { 252class IDirectory final : public ServiceFramework<IDirectory> {
255public: 253public:
256 explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_) 254 explicit IDirectory(Core::System& system_, FileSys::VirtualDir backend_)
257 : ServiceFramework{system_, "IDirectory", ServiceThreadType::CreateNew}, 255 : ServiceFramework{system_, "IDirectory"}, backend(std::move(backend_)) {
258 backend(std::move(backend_)) {
259 static const FunctionInfo functions[] = { 256 static const FunctionInfo functions[] = {
260 {0, &IDirectory::Read, "Read"}, 257 {0, &IDirectory::Read, "Read"},
261 {1, &IDirectory::GetEntryCount, "GetEntryCount"}, 258 {1, &IDirectory::GetEntryCount, "GetEntryCount"},
@@ -311,8 +308,8 @@ private:
311class IFileSystem final : public ServiceFramework<IFileSystem> { 308class IFileSystem final : public ServiceFramework<IFileSystem> {
312public: 309public:
313 explicit IFileSystem(Core::System& system_, FileSys::VirtualDir backend_, SizeGetter size_) 310 explicit IFileSystem(Core::System& system_, FileSys::VirtualDir backend_, SizeGetter size_)
314 : ServiceFramework{system_, "IFileSystem", ServiceThreadType::CreateNew}, 311 : ServiceFramework{system_, "IFileSystem"}, backend{std::move(backend_)}, size{std::move(
315 backend{std::move(backend_)}, size{std::move(size_)} { 312 size_)} {
316 static const FunctionInfo functions[] = { 313 static const FunctionInfo functions[] = {
317 {0, &IFileSystem::CreateFile, "CreateFile"}, 314 {0, &IFileSystem::CreateFile, "CreateFile"},
318 {1, &IFileSystem::DeleteFile, "DeleteFile"}, 315 {1, &IFileSystem::DeleteFile, "DeleteFile"},