diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-31 22:02:21 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-03-31 22:06:45 +0200 |
commit | 88582b84a5851338618050e62bdd8b6a1753b5b7 (patch) | |
tree | c97bc552cb5d4c32a7e345882334acbf693f1cd2 /src/core/hle | |
parent | memory: Fix stack region. (diff) | |
download | yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar.gz yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar.bz2 yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar.lz yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar.xz yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.tar.zst yuzu-88582b84a5851338618050e62bdd8b6a1753b5b7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 41b8cbfd2..92b3d07b4 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -72,8 +72,8 @@ public: explicit IFile(std::unique_ptr<FileSys::StorageBackend>&& backend) : ServiceFramework("IFile"), backend(std::move(backend)) { static const FunctionInfo functions[] = { - {0, &IFile::Read, "Read"}, {1, &IFile::Write, "Write"}, {2, nullptr, "Flush"}, - {3, nullptr, "SetSize"}, {4, nullptr, "GetSize"}, + {0, &IFile::Read, "Read"}, {1, &IFile::Write, "Write"}, {2, nullptr, "Flush"}, + {3, &IFile::SetSize, "SetSize"}, {4, &IFile::GetSize, "GetSize"}, }; RegisterHandlers(functions); } @@ -150,6 +150,25 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } + + void SetSize(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const u64 size = rp.Pop<u64>(); + backend->SetSize(size); + LOG_DEBUG(Service_FS, "called, size=0x%ld, length=0x%ld", size); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + void GetSize(Kernel::HLERequestContext& ctx) { + const u64 size = backend->GetSize(); + LOG_DEBUG(Service_FS, "called, size=0x%ld", size); + + IPC::ResponseBuilder rb{ctx, 4}; + rb.Push(RESULT_SUCCESS); + rb.Push<u64>(size); + } }; class IDirectory final : public ServiceFramework<IDirectory> { |