fs: for my sanity, begin tracking version where code was last checked for accuracy

This commit is contained in:
Michael Scire
2022-03-24 08:43:40 -07:00
parent b69fa13576
commit 4646581e93
133 changed files with 195 additions and 66 deletions

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class HierarchicalRomFileTable {
public:
using Position = u32;

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
template<typename KeyType, typename ValueType, size_t MaxAuxiliarySize>
class KeyValueRomStorageTemplate {
public:

View File

@@ -18,6 +18,8 @@
namespace ams::fs::RomPathTool {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline u32 MaxPathLength = 0x300;
struct RomEntryName {

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
using RomPathChar = char;
using RomFileId = s32;
using RomDirectoryId = s32;

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class DirectoryPathParser {
NON_COPYABLE(DirectoryPathParser);
NON_MOVEABLE(DirectoryPathParser);

View File

@@ -22,6 +22,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class FileStorage : public IStorage, public impl::Newable {
NON_COPYABLE(FileStorage);
NON_MOVEABLE(FileStorage);
@@ -74,6 +75,7 @@ namespace ams::fs {
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override;
};
/* ACCURATE_TO_VERSION: Unknown */
class FileStorageBasedFileSystem : public FileStorage {
NON_COPYABLE(FileStorageBasedFileSystem);
NON_MOVEABLE(FileStorageBasedFileSystem);

View File

@@ -18,6 +18,8 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum AccessLogMode : u32 {
AccessLogMode_None = 0,
AccessLogMode_Log = 1,

View File

@@ -18,6 +18,8 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
void InitializeForSystem();
void InitializeWithMultiSessionForSystem();

View File

@@ -18,6 +18,8 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
Result MountApplicationPackage(const char *name, const char *common_path);
}

View File

@@ -19,6 +19,8 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class BisPartitionId {
/* Boot0 */
BootPartition1Root = 0,

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
Result MountCode(CodeVerificationData *out, const char *name, const char *path, ncm::ProgramId program_id);
Result MountCodeForAtmosphereWithRedirection(CodeVerificationData *out, const char *name, const char *path, ncm::ProgramId program_id, bool is_hbl, bool is_specific);

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
struct CodeVerificationData : public ams::sf::LargeData {
u8 signature[crypto::Rsa2048PssSha256Verifier::SignatureSize];
u8 target_hash[crypto::Rsa2048PssSha256Verifier::HashSize];

View File

@@ -21,6 +21,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
struct Int64 {
u32 low;
u32 high;

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum ContentType {
ContentType_Meta = 0,
ContentType_Control = 1,

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class ContentStorageId : u32 {
System = 0,
User = 1,

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
Result MountDeviceSaveData(const char *name);
Result MountDeviceSaveData(const char *name, const ncm::ApplicationId application_id);

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline size_t EntryNameLengthMax = 0x300;
struct DirectoryEntry {

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
struct FileTimeStamp {
time::PosixTime create;
time::PosixTime modify;

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class GameCardPartition {
Update = 0,
Normal = 1,

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum MountHostOptionFlag : u32 {
MountHostOptionFlag_None = (0 << 0),
MountHostOptionFlag_PseudoCaseSensitive = (1 << 0),

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class IEventNotifier {
public:
virtual ~IEventNotifier() { /* ... */ }

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class ImageDirectoryId {
Nand = 0,
SdCard = 1,

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class IStorage {
public:
virtual ~IStorage() { /* ... */ }

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
using AllocateFunction = void *(*)(size_t);
using DeallocateFunction = void (*)(void *, size_t);

View File

@@ -20,6 +20,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class MemoryStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
private:
u8 * const m_buf;

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline size_t MountNameLengthMax = 15;
Result ConvertToFsCommonPath(char *dst, size_t dst_size, const char *src);

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class OperationId : s64 {
FillZero = 0,
DestroySignature = 1,

View File

@@ -23,6 +23,7 @@ namespace ams::fs {
class DirectoryPathParser;
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class Path {
NON_COPYABLE(Path);
NON_MOVEABLE(Path);

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
namespace StringTraits {
constexpr inline char DirectorySeparator = '/';

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum Priority {
Priority_Realtime = 0,
Priority_Normal = 1,

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
struct ProgramIndexMapInfo {
ncm::ProgramId program_id;
ncm::ProgramId base_program_id;

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
struct QueryRangeInfo {
s32 aes_ctr_key_type;
s32 speed_emulation_type;

View File

@@ -22,6 +22,8 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
namespace {
class ReadOnlyFile : public fsa::IFile, public impl::Newable {

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
void SetEnabledAutoAbort(bool enabled);
void SetResultHandledByApplication(bool application);

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
union RightsId {
u8 data[0x10];
u64 data64[2];

View File

@@ -23,6 +23,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class RomFsFileSystem : public fsa::IFileSystem, public impl::Newable {
NON_COPYABLE(RomFsFileSystem);
public:

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
Result DeleteSaveData(SaveDataId id);
Result DeleteSaveData(SaveDataSpaceId space_id, SaveDataId id);

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
Result CommitSaveData(const char *path);
}

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
using SaveDataId = u64;
using SystemSaveDataId = u64;
using SystemBcatSaveDataId = SystemSaveDataId;

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class IEventNotifier;
struct EncryptionSeed {

View File

@@ -1,54 +0,0 @@
/*
* Copyright (c) Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stratosphere/fs/fs_common.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
#include <stratosphere/fs/fsa/fs_ifile.hpp>
#include <stratosphere/fs/fsa/fs_idirectory.hpp>
#include <stratosphere/fs/fsa/fs_ifilesystem.hpp>
namespace ams::fs {
class SharedFileSystemHolder : public fsa::IFileSystem, public impl::Newable {
NON_COPYABLE(SharedFileSystemHolder);
NON_MOVEABLE(SharedFileSystemHolder);
private:
std::shared_ptr<fsa::IFileSystem> m_fs;
public:
SharedFileSystemHolder(std::shared_ptr<fsa::IFileSystem> f) : m_fs(std::move(f)) { /* ... */ }
public:
virtual Result DoCreateFile(const fs::Path &path, s64 size, int flags) override { return m_fs->CreateFile(path, size, flags); }
virtual Result DoDeleteFile(const fs::Path &path) override { return m_fs->DeleteFile(path); }
virtual Result DoCreateDirectory(const fs::Path &path) override { return m_fs->CreateDirectory(path); }
virtual Result DoDeleteDirectory(const fs::Path &path) override { return m_fs->DeleteDirectory(path); }
virtual Result DoDeleteDirectoryRecursively(const fs::Path &path) override { return m_fs->DeleteDirectoryRecursively(path); }
virtual Result DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) override { return m_fs->RenameFile(old_path, new_path); }
virtual Result DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) override { return m_fs->RenameDirectory(old_path, new_path); }
virtual Result DoGetEntryType(fs::DirectoryEntryType *out, const fs::Path &path) override { return m_fs->GetEntryType(out, path); }
virtual Result DoOpenFile(std::unique_ptr<fs::fsa::IFile> *out_file, const fs::Path &path, fs::OpenMode mode) override { return m_fs->OpenFile(out_file, path, mode); }
virtual Result DoOpenDirectory(std::unique_ptr<fs::fsa::IDirectory> *out_dir, const fs::Path &path, fs::OpenDirectoryMode mode) override { return m_fs->OpenDirectory(out_dir, path, mode); }
virtual Result DoCommit() override { return m_fs->Commit(); }
virtual Result DoGetFreeSpaceSize(s64 *out, const fs::Path &path) override { return m_fs->GetFreeSpaceSize(out, path); }
virtual Result DoGetTotalSpaceSize(s64 *out, const fs::Path &path) override { return m_fs->GetTotalSpaceSize(out, path); }
virtual Result DoCleanDirectoryRecursively(const fs::Path &path) override { return m_fs->CleanDirectoryRecursively(path); }
/* These aren't accessible as commands. */
virtual Result DoCommitProvisionally(s64 counter) override { return m_fs->CommitProvisionally(counter); }
virtual Result DoRollback() override { return m_fs->Rollback(); }
virtual Result DoFlush() override { return m_fs->Flush(); }
};
}

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
bool IsSignedSystemPartitionOnSdCardValid(const char *system_root_path);
bool IsSignedSystemPartitionOnSdCardValidDeprecated();

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum class SpeedEmulationMode {
None = 0,
Faster = 1,

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
enum StorageType : s32 {
StorageType_SaveData = 0,
StorageType_RomFs = 1,

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
class SubStorage : public ::ams::fs::IStorage, public ::ams::fs::impl::Newable {
private:
std::shared_ptr<IStorage> m_shared_base_storage;

View File

@@ -18,6 +18,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
Result QueryMountSystemDataCacheSize(size_t *out, ncm::SystemDataId data_id);
Result MountSystemData(const char *name, ncm::SystemDataId data_id);

View File

@@ -19,6 +19,7 @@
namespace ams::fs {
/* ACCURATE_TO_VERSION: Unknown */
void DisableAutoSaveDataCreation();
Result CreateSystemSaveData(SystemSaveDataId save_id, s64 size, s64 journal_size, u32 flags);

View File

@@ -20,6 +20,7 @@
namespace ams::fs::fsa {
/* ACCURATE_TO_VERSION: Unknown */
class IDirectory {
public:
virtual ~IDirectory() { /* ... */ }

View File

@@ -22,6 +22,7 @@
namespace ams::fs::fsa {
/* ACCURATE_TO_VERSION: Unknown */
class IFile;
class IDirectory;

View File

@@ -19,6 +19,7 @@
namespace ams::fs::fsa {
/* ACCURATE_TO_VERSION: Unknown */
class ICommonMountNameGenerator {
public:
virtual ~ICommonMountNameGenerator() { /* ... */ }

View File

@@ -23,6 +23,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
enum AccessLogTarget : u32 {
AccessLogTarget_None = (0 << 0),
AccessLogTarget_Application = (1 << 0),

View File

@@ -17,6 +17,8 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
/* Delimiting of mount names. */
constexpr inline const char ReservedMountNamePrefixCharacter = '@';

View File

@@ -18,6 +18,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
Result QueryMountDataCacheSize(size_t *out, ncm::DataId data_id, ncm::StorageId storage_id);
Result MountData(const char *name, ncm::DataId data_id, ncm::StorageId storage_id);

View File

@@ -18,6 +18,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
enum FileSystemProxyType {
FileSystemProxyType_Code = 0,
FileSystemProxyType_Rom = 1,

View File

@@ -19,6 +19,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
constexpr inline u8 TlsIoPriorityMask = 0x7;
constexpr inline u8 TlsIoRecursiveCallMask = 0x8;

View File

@@ -18,6 +18,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
fssystem::IHash256GeneratorFactorySelector *GetNcaHashGeneratorFactorySelector();
fssystem::IHash256GeneratorFactorySelector *GetSaveDataHashGeneratorFactorySelector();

View File

@@ -18,6 +18,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
class Newable {
public:
static ALWAYS_INLINE void *operator new(size_t size) noexcept {

View File

@@ -20,6 +20,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
enum TlsIoPriority : u8 {
TlsIoPriority_Normal = 0,
TlsIoPriority_Realtime = 1,

View File

@@ -18,6 +18,7 @@
namespace ams::fs::impl {
/* ACCURATE_TO_VERSION: Unknown */
bool IsAbortNeeded(Result result);
void LogErrorMessage(Result result, const char *function);