Revert "hoc-clk: add live vdd2, live boost clock and basic pwm dimming"

This reverts commit 15b7df8ef1.
This commit is contained in:
souldbminersmwc
2025-11-09 16:14:52 -05:00
parent 22ec140738
commit 21a3f953d7
3804 changed files with 435 additions and 570162 deletions

View File

@@ -1,34 +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 <vapours.hpp>
#include <stratosphere/fssrv/fssrv_i_file_system_creator.hpp>
namespace ams::fssrv::fscreator {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class LocalFileSystemCreator final : public ILocalFileSystemCreator {
NON_COPYABLE(LocalFileSystemCreator);
NON_MOVEABLE(LocalFileSystemCreator);
private:
bool m_is_development;
public:
explicit LocalFileSystemCreator(bool dev) : m_is_development(dev) { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, const fs::Path &path, bool case_sensitive, bool ensure_root, Result on_path_not_found) override;
};
}

View File

@@ -1,32 +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 <vapours.hpp>
#include <stratosphere/fssrv/fssrv_i_file_system_creator.hpp>
namespace ams::fssrv::fscreator {
/* ACCURATE_TO_VERSION: Unknown */
class PartitionFileSystemCreator : public IPartitionFileSystemCreator {
NON_COPYABLE(PartitionFileSystemCreator);
NON_MOVEABLE(PartitionFileSystemCreator);
public:
PartitionFileSystemCreator() { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) override;
};
}

View File

@@ -1,34 +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 <vapours.hpp>
#include <stratosphere/fssrv/fssrv_i_file_system_creator.hpp>
namespace ams::fssrv::fscreator {
/* ACCURATE_TO_VERSION: Unknown */
class RomFileSystemCreator : public IRomFileSystemCreator {
NON_COPYABLE(RomFileSystemCreator);
NON_MOVEABLE(RomFileSystemCreator);
private:
MemoryResource *m_allocator;
public:
explicit RomFileSystemCreator(MemoryResource *mr) : m_allocator(mr) { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) override;
};
}

View File

@@ -1,59 +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 <vapours.hpp>
#include <stratosphere/fssrv/fssrv_i_file_system_creator.hpp>
#include <stratosphere/fs/fs_i_buffer_manager.hpp>
#include <stratosphere/fssystem/fssystem_i_hash_256_generator.hpp>
namespace ams::fssystem {
struct NcaCryptoConfiguration;
struct NcaCompressionConfiguration;
}
namespace ams::fssrv::fscreator {
class StorageOnNcaCreator : public IStorageOnNcaCreator {
NON_COPYABLE(StorageOnNcaCreator);
NON_MOVEABLE(StorageOnNcaCreator);
private:
MemoryResource *m_allocator;
const fssystem::NcaCryptoConfiguration &m_nca_crypto_cfg;
const fssystem::NcaCompressionConfiguration &m_nca_compression_cfg;
fs::IBufferManager * const m_buffer_manager;
fssystem::IHash256GeneratorFactorySelector * const m_hash_generator_factory_selector;
public:
explicit StorageOnNcaCreator(MemoryResource *mr, const fssystem::NcaCryptoConfiguration &cfg, const fssystem::NcaCompressionConfiguration &c_cfg, fs::IBufferManager *bm, fssystem::IHash256GeneratorFactorySelector *hgfs)
: m_allocator(mr), m_nca_crypto_cfg(cfg), m_nca_compression_cfg(c_cfg), m_buffer_manager(bm), m_hash_generator_factory_selector(hgfs)
{
/* ... */
}
virtual Result Create(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, std::shared_ptr<fssystem::NcaReader> nca_reader, s32 index) override;
virtual Result CreateWithPatch(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, std::shared_ptr<fssystem::NcaReader> original_nca_reader, std::shared_ptr<fssystem::NcaReader> current_nca_reader, s32 index) override;
virtual Result CreateNcaReader(std::shared_ptr<fssystem::NcaReader> *out, std::shared_ptr<fs::IStorage> storage) override;
#if !defined(ATMOSPHERE_BOARD_NINTENDO_NX)
Result CreateWithContext(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, void *ctx, std::shared_ptr<fssystem::NcaReader> nca_reader, s32 index);
Result CreateWithPatchWithContext(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, void *ctx, std::shared_ptr<fssystem::NcaReader> original_nca_reader, std::shared_ptr<fssystem::NcaReader> current_nca_reader, s32 index);
Result CreateByRawStorage(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, const fssystem::NcaFsHeaderReader *header_reader, std::shared_ptr<fs::IStorage> raw_storage, void *ctx, std::shared_ptr<fssystem::NcaReader> nca_reader);
#endif
};
}

View File

@@ -1,32 +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 <vapours.hpp>
#include <stratosphere/fssrv/fssrv_i_file_system_creator.hpp>
namespace ams::fssrv::fscreator {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class SubDirectoryFileSystemCreator final : public ISubDirectoryFileSystemCreator {
NON_COPYABLE(SubDirectoryFileSystemCreator);
NON_MOVEABLE(SubDirectoryFileSystemCreator);
public:
explicit SubDirectoryFileSystemCreator() { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::fsa::IFileSystem> base_fs, const fs::Path &path) override;
};
}

View File

@@ -1,66 +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 <vapours.hpp>
namespace ams::fssrv::fscreator {
struct FileSystemCreatorInterfaces;
}
namespace ams::fssrv {
class BaseStorageServiceImpl;
class BaseFileSystemServiceImpl;
class NcaFileSystemServiceImpl;
class SaveDataFileSystemServiceImpl;
class AccessFailureManagementServiceImpl;
class TimeServiceImpl;
class StatusReportServiceImpl;
class ProgramRegistryServiceImpl;
class AccessLogServiceImpl;
class DebugConfigurationServiceImpl;
/* ACCURATE_TO_VERSION: Unknown */
struct FileSystemProxyConfiguration {
fscreator::FileSystemCreatorInterfaces *m_fs_creator_interfaces;
BaseStorageServiceImpl *m_base_storage_service_impl;
BaseFileSystemServiceImpl *m_base_file_system_service_impl;
NcaFileSystemServiceImpl *m_nca_file_system_service_impl;
SaveDataFileSystemServiceImpl *m_save_data_file_system_service_impl;
AccessFailureManagementServiceImpl *m_access_failure_management_service_impl;
TimeServiceImpl *m_time_service_impl;
StatusReportServiceImpl *m_status_report_service_impl;
ProgramRegistryServiceImpl *m_program_registry_service_impl;
AccessLogServiceImpl *m_access_log_service_impl;
DebugConfigurationServiceImpl *m_debug_configuration_service_impl;
};
struct InternalProgramIdRangeForSpeedEmulation {
u64 program_id_value_min;
u64 program_id_value_max;
};
}
namespace ams::fssrv {
void InitializeForFileSystemProxy(const FileSystemProxyConfiguration &config);
void InitializeFileSystemProxyServer(int threads);
}

View File

@@ -1,200 +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 <vapours.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_file_system_proxy.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_program_registry.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_file_system_proxy_for_loader.hpp>
namespace ams::fssrv {
namespace impl {
class FileSystemProxyCoreImpl;
}
class NcaFileSystemService;
class SaveDataFileSystemService;
/* ACCURATE_TO_VERSION: Unknown */
class FileSystemProxyImpl {
NON_COPYABLE(FileSystemProxyImpl);
NON_MOVEABLE(FileSystemProxyImpl);
private:
impl::FileSystemProxyCoreImpl *m_impl;
std::shared_ptr<NcaFileSystemService> m_nca_service;
std::shared_ptr<SaveDataFileSystemService> m_save_data_service;
u64 m_process_id;
public:
FileSystemProxyImpl();
~FileSystemProxyImpl();
/* TODO */
public:
/* fsp-srv */
Result OpenFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 type);
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid);
Result OpenDataFileSystemByCurrentProcess(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out);
Result OpenFileSystemWithPatch(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, ncm::ProgramId program_id, u32 type);
Result OpenFileSystemWithIdObsolete(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u64 program_id, u32 type);
Result OpenDataFileSystemByProgramId(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, ncm::ProgramId program_id);
Result OpenFileSystemWithId(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr, u64 program_id, u32 type);
Result OpenBisFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 id);
Result OpenBisStorage(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u32 id);
Result InvalidateBisCache();
Result OpenHostFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path);
Result OpenSdCardFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out);
Result FormatSdCardFileSystem();
Result DeleteSaveDataFileSystem(u64 save_data_id);
Result CreateSaveDataFileSystem(const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info, const fs::SaveDataMetaInfo &meta_info);
Result CreateSaveDataFileSystemBySystemSaveDataId(const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info);
Result RegisterSaveDataFileSystemAtomicDeletion(const ams::sf::InBuffer &save_data_ids);
Result DeleteSaveDataFileSystemBySaveDataSpaceId(u8 indexer_space_id, u64 save_data_id);
Result FormatSdCardDryRun();
Result IsExFatSupported(ams::sf::Out<bool> out);
Result DeleteSaveDataFileSystemBySaveDataAttribute(u8 space_id, const fs::SaveDataAttribute &attribute);
Result OpenGameCardStorage(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u32 handle, u32 partition);
Result OpenGameCardFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 handle, u32 partition);
Result ExtendSaveDataFileSystem(u8 space_id, u64 save_data_id, s64 available_size, s64 journal_size);
Result DeleteCacheStorage(u16 index);
Result GetCacheStorageSize(ams::sf::Out<s64> out_size, ams::sf::Out<s64> out_journal_size, u16 index);
Result CreateSaveDataFileSystemWithHashSalt(const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info, const fs::SaveDataMetaInfo &meta_info, const fs::HashSalt &salt);
Result OpenHostFileSystemWithOption(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 option);
Result OpenSaveDataFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute);
Result OpenSaveDataFileSystemBySystemSaveDataId(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute);
Result OpenReadOnlySaveDataFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute);
Result ReadSaveDataFileSystemExtraDataBySaveDataSpaceId(const ams::sf::OutBuffer &buffer, u8 space_id, u64 save_data_id);
Result ReadSaveDataFileSystemExtraData(const ams::sf::OutBuffer &buffer, u64 save_data_id);
Result WriteSaveDataFileSystemExtraData(u64 save_data_id, u8 space_id, const ams::sf::InBuffer &buffer);
/* ... */
Result OpenImageDirectoryFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 id);
/* ... */
Result OpenContentStorageFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 id);
/* ... */
Result OpenDataStorageByCurrentProcess(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out);
Result OpenDataStorageByProgramId(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, ncm::ProgramId program_id);
Result OpenDataStorageByDataId(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, ncm::DataId data_id, u8 storage_id);
Result OpenPatchDataStorageByCurrentProcess(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out);
Result OpenDataFileSystemWithProgramIndex(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 index);
Result OpenDataStorageWithProgramIndex(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u8 index);
Result OpenDataStorageByPathObsolete(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, const fssrv::sf::FspPath &path, u32 type);
Result OpenDataStorageByPath(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr, u32 type);
Result OpenDeviceOperator(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IDeviceOperator>> out);
Result OpenSdCardDetectionEventNotifier(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out);
Result OpenGameCardDetectionEventNotifier(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out);
Result OpenSystemDataUpdateEventNotifier(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out);
Result NotifySystemDataUpdateEvent();
/* ... */
Result SetCurrentPosixTime(s64 posix_time);
/* ... */
Result GetRightsId(ams::sf::Out<fs::RightsId> out, ncm::ProgramId program_id, ncm::StorageId storage_id);
Result RegisterExternalKey(const fs::RightsId &rights_id, const spl::AccessKey &access_key);
Result UnregisterAllExternalKey();
Result GetProgramId(ams::sf::Out<ncm::ProgramId> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr);
Result GetRightsIdByPath(ams::sf::Out<fs::RightsId> out, const fssrv::sf::FspPath &path);
Result GetRightsIdAndKeyGenerationByPathObsolete(ams::sf::Out<fs::RightsId> out, ams::sf::Out<u8> out_key_generation, const fssrv::sf::FspPath &path);
Result GetRightsIdAndKeyGenerationByPath(ams::sf::Out<fs::RightsId> out, ams::sf::Out<u8> out_key_generation, const fssrv::sf::FspPath &path, fs::ContentAttributes attr);
Result SetCurrentPosixTimeWithTimeDifference(s64 posix_time, s32 time_difference);
Result GetFreeSpaceSizeForSaveData(ams::sf::Out<s64> out, u8 space_id);
Result VerifySaveDataFileSystemBySaveDataSpaceId();
Result CorruptSaveDataFileSystemBySaveDataSpaceId();
Result QuerySaveDataInternalStorageTotalSize();
Result GetSaveDataCommitId();
Result UnregisterExternalKey(const fs::RightsId &rights_id);
Result SetSdCardEncryptionSeed(const fs::EncryptionSeed &seed);
Result SetSdCardAccessibility(bool accessible);
Result IsSdCardAccessible(ams::sf::Out<bool> out);
Result IsSignedSystemPartitionOnSdCardValid(ams::sf::Out<bool> out);
Result OpenAccessFailureDetectionEventNotifier();
/* ... */
Result GetAndClearErrorInfo(ams::sf::Out<fs::FileSystemProxyErrorInfo> out);
Result RegisterProgramIndexMapInfo(const ams::sf::InBuffer &buffer, s32 count);
Result SetBisRootForHost(u32 id, const fssrv::sf::FspPath &path);
Result SetSaveDataSize(s64 size, s64 journal_size);
Result SetSaveDataRootPath(const fssrv::sf::FspPath &path);
Result DisableAutoSaveDataCreation();
Result SetGlobalAccessLogMode(u32 mode);
Result GetGlobalAccessLogMode(ams::sf::Out<u32> out);
Result OutputAccessLogToSdCard(const ams::sf::InBuffer &buf);
Result RegisterUpdatePartition();
Result OpenRegisteredUpdatePartition(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out);
Result GetAndClearMemoryReportInfo(ams::sf::Out<fs::MemoryReportInfo> out);
/* ... */
Result GetProgramIndexForAccessLog(ams::sf::Out<u32> out_idx, ams::sf::Out<u32> out_count);
Result GetFsStackUsage(ams::sf::Out<u32> out, u32 type);
Result UnsetSaveDataRootPath();
Result OutputMultiProgramTagAccessLog();
Result FlushAccessLogOnSdCard();
Result OutputApplicationInfoAccessLog();
Result RegisterDebugConfiguration(u32 key, s64 value);
Result UnregisterDebugConfiguration(u32 key);
Result OverrideSaveDataTransferTokenSignVerificationKey(const ams::sf::InBuffer &buf);
Result CorruptSaveDataFileSystemByOffset(u8 space_id, u64 save_data_id, s64 offset);
/* ... */
public:
/* fsp-ldr */
Result OpenCodeFileSystemDeprecated(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const fssrv::sf::Path &path, ncm::ProgramId program_id);
Result OpenCodeFileSystemDeprecated2(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, ncm::ProgramId program_id);
Result OpenCodeFileSystemDeprecated3(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id);
Result OpenCodeFileSystemDeprecated4(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id);
Result OpenCodeFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, fs::ContentAttributes attr, ncm::ProgramId program_id, ncm::StorageId storage_id);
Result IsArchivedProgram(ams::sf::Out<bool> out, u64 process_id);
};
static_assert(sf::IsIFileSystemProxy<FileSystemProxyImpl>);
static_assert(sf::IsIFileSystemProxyForLoader<FileSystemProxyImpl>);
/* ACCURATE_TO_VERSION: Unknown */
class InvalidFileSystemProxyImplForLoader {
public:
Result OpenCodeFileSystemDeprecated(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const fssrv::sf::Path &path, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, path, program_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result OpenCodeFileSystemDeprecated2(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, out_verif, path, program_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result OpenCodeFileSystemDeprecated3(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, out_verif, path, attr, program_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result OpenCodeFileSystemDeprecated4(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id) {
AMS_UNUSED(out_fs, out_verif, path, attr, program_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result OpenCodeFileSystem(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, fs::ContentAttributes attr, ncm::ProgramId program_id, ncm::StorageId storage_id) {
AMS_UNUSED(out_fs, out_verif, attr, program_id, storage_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result IsArchivedProgram(ams::sf::Out<bool> out, u64 process_id) {
AMS_UNUSED(out, process_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid) {
AMS_UNUSED(client_pid);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
};
static_assert(sf::IsIFileSystemProxyForLoader<FileSystemProxyImpl>);
}

View File

@@ -1,30 +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 <vapours.hpp>
namespace ams::fssrv {
enum class FileSystemProxyServerSessionType : s32 {
Any = 0,
Realtime = 1,
Background = 2,
Other = 3,
};
constexpr inline auto FileSystemProxyServerActiveSessionCount = 5;
}

View File

@@ -1,103 +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 <vapours.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
namespace ams::fs {
class IStorage;
enum class BisPartitionId;
class Path;
namespace fsa {
class IFileSystem;
}
}
namespace ams::fssystem {
class NcaReader;
class NcaFsHeaderReader;
class IAsynchronousAccessSplitter;
namespace save {
/* TODO */
}
}
namespace ams::fssrv::fscreator {
/* ACCURATE_TO_VERSION: Unknown */
class IRomFileSystemCreator {
public:
virtual ~IRomFileSystemCreator() { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) = 0;
};
/* ACCURATE_TO_VERSION: Unknown */
class IPartitionFileSystemCreator {
public:
virtual ~IPartitionFileSystemCreator() { /* ... */ }
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) = 0;
};
/* ACCURATE_TO_VERSION: Unknown */
class IStorageOnNcaCreator {
public:
virtual ~IStorageOnNcaCreator() { /* ... */ }
virtual Result Create(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, std::shared_ptr<fssystem::NcaReader> nca_reader, s32 index) = 0;
virtual Result CreateWithPatch(std::shared_ptr<fs::IStorage> *out, std::shared_ptr<fssystem::IAsynchronousAccessSplitter> *out_splitter, fssystem::NcaFsHeaderReader *out_header_reader, std::shared_ptr<fssystem::NcaReader> original_nca_reader, std::shared_ptr<fssystem::NcaReader> current_nca_reader, s32 index) = 0;
virtual Result CreateNcaReader(std::shared_ptr<fssystem::NcaReader> *out, std::shared_ptr<fs::IStorage> storage) = 0;
};
/* ACCURATE_TO_VERSION: Unknown */
class ILocalFileSystemCreator {
public:
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, const fs::Path &path, bool case_sensitive, bool ensure_root, Result on_path_not_found) = 0;
public:
Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, const fs::Path &path, bool case_sensitive) {
R_RETURN(this->Create(out, path, case_sensitive, false, ResultSuccess()));
}
};
/* ACCURATE_TO_VERSION: Unknown */
class ISubDirectoryFileSystemCreator {
public:
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::fsa::IFileSystem> base_fs, const fs::Path &path) = 0;
};
/* ACCURATE_TO_VERSION: Unknown */
struct FileSystemCreatorInterfaces {
ILocalFileSystemCreator *local_fs_creator;
ISubDirectoryFileSystemCreator *subdir_fs_creator;
/* TODO: These don't exist any more, and should be refactored out. */
IRomFileSystemCreator *rom_fs_creator;
IPartitionFileSystemCreator *partition_fs_creator;
IStorageOnNcaCreator *storage_on_nca_creator;
/* TODO: More creators. */
};
static_assert(util::is_pod<FileSystemCreatorInterfaces>::value);
}

View File

@@ -1,18 +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/fssrv/interface_adapters/fssrv_storage_interface_adapter.hpp>
#include <stratosphere/fssrv/interface_adapters/fssrv_filesystem_interface_adapter.hpp>

View File

@@ -1,79 +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 <vapours.hpp>
#include <stratosphere/os.hpp>
#include <stratosphere/lmem/lmem_exp_heap.hpp>
namespace ams::fssrv {
/* ACCURATE_TO_VERSION: Unknown */
class MemoryResourceFromExpHeap : public ams::MemoryResource {
private:
lmem::HeapHandle m_heap_handle;
public:
constexpr explicit MemoryResourceFromExpHeap(lmem::HeapHandle handle) : m_heap_handle(handle) { /* ... */ }
protected:
virtual void *AllocateImpl(size_t size, size_t align) override {
return lmem::AllocateFromExpHeap(m_heap_handle, size, static_cast<s32>(align));
}
virtual void DeallocateImpl(void *p, size_t size, size_t align) override {
AMS_UNUSED(size, align);
return lmem::FreeToExpHeap(m_heap_handle, p);
}
virtual bool IsEqualImpl(const MemoryResource &rhs) const override {
AMS_UNUSED(rhs);
return false;
}
};
/* ACCURATE_TO_VERSION: Unknown */
class PeakCheckableMemoryResourceFromExpHeap : public ams::MemoryResource {
private:
lmem::HeapHandle m_heap_handle;
os::SdkMutex m_mutex;
size_t m_peak_free_size;
size_t m_current_free_size;
public:
constexpr explicit PeakCheckableMemoryResourceFromExpHeap(size_t heap_size) : m_heap_handle(nullptr), m_mutex(), m_peak_free_size(heap_size), m_current_free_size(heap_size) { /* ... */ }
void SetHeapHandle(lmem::HeapHandle handle) {
m_heap_handle = handle;
}
size_t GetPeakFreeSize() const { return m_peak_free_size; }
size_t GetCurrentFreeSize() const { return m_current_free_size; }
void ClearPeak() { m_peak_free_size = m_current_free_size; }
std::scoped_lock<os::SdkMutex> GetScopedLock() {
return std::scoped_lock(m_mutex);
}
void OnAllocate(void *p, size_t size);
void OnDeallocate(void *p, size_t size);
protected:
virtual void *AllocateImpl(size_t size, size_t align) override;
virtual void DeallocateImpl(void *p, size_t size, size_t align) override;
virtual bool IsEqualImpl(const MemoryResource &rhs) const override {
AMS_UNUSED(rhs);
return false;
}
};
}

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 <vapours.hpp>
#include <stratosphere/os.hpp>
namespace ams::mem {
class StandardAllocator;
}
namespace ams::fssrv {
/* ACCURATE_TO_VERSION: Unknown */
class MemoryResourceFromStandardAllocator : public ams::MemoryResource {
private:
mem::StandardAllocator *m_allocator;
os::SdkMutex m_mutex;
size_t m_peak_free_size;
size_t m_current_free_size;
size_t m_peak_allocated_size;
public:
explicit MemoryResourceFromStandardAllocator(mem::StandardAllocator *allocator);
constexpr virtual ~MemoryResourceFromStandardAllocator() = default;
public:
size_t GetPeakFreeSize() const { return m_peak_free_size; }
size_t GetCurrentFreeSize() const { return m_current_free_size; }
size_t GetPeakAllocatedSize() const { return m_peak_allocated_size; }
void ClearPeak();
protected:
virtual void *AllocateImpl(size_t size, size_t align) override;
virtual void DeallocateImpl(void *p, size_t size, size_t align) override;
virtual bool IsEqualImpl(const MemoryResource &rhs) const override {
AMS_UNUSED(rhs);
return false;
}
};
}

View File

@@ -1,23 +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/fssystem/fssystem_nca_file_system_driver.hpp>
namespace ams::fssrv {
const ::ams::fssystem::NcaCryptoConfiguration *GetDefaultNcaCryptoConfiguration(bool prod);
}

View File

@@ -1,89 +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 <vapours.hpp>
#include <stratosphere/fssystem/fssystem_pimpl.hpp>
#include <stratosphere/fssrv/fssrv_file_system_proxy_api.hpp>
namespace ams::fssrv {
class BaseFileSystemServiceImpl;
class ProgramRegistryServiceImpl;
class AccessFailureManagementServiceImpl;
namespace fscreator {
class LocalFileSystemCreator;
class TargetManagerFileSystemCreator;
class PartitionFileSystemCreator;
class IRomFileSystemCreator;
class StorageOnNcaCreator;
class SubDirectoryFileSystemCreator;
class EncryptedFileSystemCreator;
class INspRootFileSystemCreator;
}
namespace impl {
class UpdatePartitionPath;
class ExternalKeyManager;
class LocationResolverSet;
class SystemDataUpdateEventManager;
}
/* ACCURATE_TO_VERSION: Unknown */
class NcaFileSystemServiceImpl {
public:
struct Configuration {
BaseFileSystemServiceImpl *base_fs_service;
fscreator::LocalFileSystemCreator *local_fs_creator;
fscreator::TargetManagerFileSystemCreator *tm_fs_creator;
fscreator::PartitionFileSystemCreator *partition_fs_creator;
fscreator::IRomFileSystemCreator *rom_fs_creator;
fscreator::StorageOnNcaCreator *storage_on_nca_creator;
fscreator::SubDirectoryFileSystemCreator *subdir_fs_creator;
fscreator::EncryptedFileSystemCreator *encrypted_fs_creator;
fscreator::INspRootFileSystemCreator *nsp_root_fs_creator;
ProgramRegistryServiceImpl *program_registry_service;
AccessFailureManagementServiceImpl *access_failure_management_service;
InternalProgramIdRangeForSpeedEmulation program_id_range_for_speed_emulation;
};
private:
struct MountInfo {
bool is_game_card;
u32 gc_handle;
bool is_host_fs;
bool can_mount_nca;
};
private:
Configuration m_config;
fssystem::Pimpl<impl::UpdatePartitionPath, 0x350> m_update_partition_path;
fssystem::Pimpl<impl::ExternalKeyManager, 0x50> m_external_key_manager;
fssystem::Pimpl<impl::UpdatePartitionPath, 0xA8> m_location_resolver_set;
fssystem::Pimpl<impl::SystemDataUpdateEventManager, 0x48> m_system_data_update_event_manager;
fs::EncryptionSeed m_encryption_seed;
int m_romfs_remount_for_data_corruption_count;
int m_romfs_unrecoverable_data_corruption_by_remount_count;
int m_romfs_recovered_by_invalidate_cache_count;
os::SdkMutex m_romfs_count_mutex;
public:
NcaFileSystemServiceImpl(const Configuration &cfg) : m_config(cfg) { /* ... */ }
};
}

View File

@@ -1,74 +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 <vapours.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_program_registry.hpp>
namespace ams::fssrv {
class ProgramRegistryServiceImpl;
namespace impl {
class ProgramInfo;
}
/* ACCURATE_TO_VERSION: Unknown */
class ProgramRegistryImpl {
NON_COPYABLE(ProgramRegistryImpl);
NON_MOVEABLE(ProgramRegistryImpl);
private:
u64 m_process_id;
public:
ProgramRegistryImpl();
~ProgramRegistryImpl();
public:
static void Initialize(ProgramRegistryServiceImpl *service);
public:
Result RegisterProgram(u64 process_id, u64 program_id, u8 storage_id, const ams::sf::InBuffer &data, s64 data_size, const ams::sf::InBuffer &desc, s64 desc_size);
Result UnregisterProgram(u64 process_id);
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid);
Result SetEnabledProgramVerification(bool en);
};
static_assert(sf::IsIProgramRegistry<ProgramRegistryImpl>);
/* ACCURATE_TO_VERSION: Unknown */
class InvalidProgramRegistryImpl {
public:
Result RegisterProgram(u64 process_id, u64 program_id, u8 storage_id, const ams::sf::InBuffer &data, s64 data_size, const ams::sf::InBuffer &desc, s64 desc_size) {
AMS_UNUSED(process_id, program_id, storage_id, data, data_size, desc, desc_size);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result UnregisterProgram(u64 process_id) {
AMS_UNUSED(process_id);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result SetCurrentProcess(const ams::sf::ClientProcessId &client_pid) {
AMS_UNUSED(client_pid);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
Result SetEnabledProgramVerification(bool en) {
AMS_UNUSED(en);
R_THROW(fs::ResultPortAcceptableCountLimited());
}
};
static_assert(sf::IsIProgramRegistry<InvalidProgramRegistryImpl>);
}

View File

@@ -1,57 +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 <vapours.hpp>
#include <stratosphere/fssystem/fssystem_pimpl.hpp>
namespace ams::fssrv {
namespace impl {
class ProgramInfo;
class ProgramRegistryManager;
class ProgramIndexMapInfoManager;
}
/* ACCURATE_TO_VERSION: Unknown */
class ProgramRegistryServiceImpl {
public:
struct Configuration {
/* ... */
};
private:
Configuration m_config;
fssystem::Pimpl<impl::ProgramRegistryManager, 0x40> m_registry_manager;
fssystem::Pimpl<impl::ProgramIndexMapInfoManager, 0x50> m_index_map_info_manager;
public:
ProgramRegistryServiceImpl(const Configuration &cfg) : m_config(cfg) { /* ... */ }
Result RegisterProgramInfo(u64 process_id, u64 program_id, u8 storage_id, const void *data, s64 data_size, const void *desc, s64 desc_size);
Result UnregisterProgramInfo(u64 process_id);
Result ResetProgramIndexMapInfo(const fs::ProgramIndexMapInfo *infos, int count);
Result GetProgramInfo(std::shared_ptr<impl::ProgramInfo> *out, u64 process_id);
Result GetProgramInfoByProgramId(std::shared_ptr<impl::ProgramInfo> *out, u64 program_id);
size_t GetProgramIndexMapInfoCount();
util::optional<fs::ProgramIndexMapInfo> GetProgramIndexMapInfo(const ncm::ProgramId &program_id);
ncm::ProgramId GetProgramIdByIndex(const ncm::ProgramId &program_id, u8 index);
};
}

View File

@@ -1,253 +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 <vapours.hpp>
#include <stratosphere/ncm/ncm_ids.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
#include <stratosphere/fssrv/impl/fssrv_access_control_bits.hpp>
namespace ams::fssrv {
bool IsDebugFlagEnabled();
void SetDebugFlagEnabled(bool en);
}
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
struct Accessibility {
u8 value;
constexpr bool CanRead() const { return value & (1 << 0); }
constexpr bool CanWrite() const { return value & (1 << 1); }
static constexpr Accessibility MakeAccessibility(bool read, bool write) {
return { static_cast<u8>(read * (1 << 0) + write * (1 << 1)) };
}
};
static_assert(std::is_trivial<Accessibility>::value);
class ContentOwnerInfo : public util::IntrusiveListBaseNode<ContentOwnerInfo>, public ::ams::fs::impl::Newable {
private:
u64 m_id;
public:
ContentOwnerInfo(u64 id) : m_id(id) { /* ... */ }
u64 GetId() const { return m_id; }
};
class SaveDataOwnerInfo : public util::IntrusiveListBaseNode<SaveDataOwnerInfo>, public ::ams::fs::impl::Newable {
private:
u64 m_id;
Accessibility m_accessibility;
public:
SaveDataOwnerInfo(u64 id, Accessibility access) : m_id(id), m_accessibility(access) { /* ... */ }
u64 GetId() const { return m_id; }
Accessibility GetAccessibility() const { return m_accessibility; }
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class AccessControl {
public:
enum class AccessibilityType : u32 {
MountLogo,
MountContentMeta,
MountContentControl,
MountContentManual,
MountContentData,
MountApplicationPackage,
MountSaveDataStorage,
MountContentStorage,
MountImageAndVideoStorage,
MountCloudBackupWorkStorage,
MountCustomStorage,
MountBisCalibrationFile,
MountBisSafeMode,
MountBisUser,
MountBisSystem,
MountBisSystemProperEncryption,
MountBisSystemProperPartition,
MountSdCard,
MountGameCard,
MountDeviceSaveData,
MountSystemSaveData,
MountOthersSaveData,
MountOthersSystemSaveData,
OpenBisPartitionBootPartition1Root,
OpenBisPartitionBootPartition2Root,
OpenBisPartitionUserDataRoot,
OpenBisPartitionBootConfigAndPackage2Part1,
OpenBisPartitionBootConfigAndPackage2Part2,
OpenBisPartitionBootConfigAndPackage2Part3,
OpenBisPartitionBootConfigAndPackage2Part4,
OpenBisPartitionBootConfigAndPackage2Part5,
OpenBisPartitionBootConfigAndPackage2Part6,
OpenBisPartitionCalibrationBinary,
OpenBisPartitionCalibrationFile,
OpenBisPartitionSafeMode,
OpenBisPartitionUser,
OpenBisPartitionSystem,
OpenBisPartitionSystemProperEncryption,
OpenBisPartitionSystemProperPartition,
OpenSdCardStorage,
OpenGameCardStorage,
MountSystemDataPrivate,
MountHost,
MountRegisteredUpdatePartition,
MountSaveDataInternalStorage,
MountTemporaryDirectory,
MountAllBaseFileSystem,
NotMount,
Count,
};
enum class OperationType : u32 {
InvalidateBisCache,
EraseMmc,
GetGameCardDeviceCertificate,
GetGameCardIdSet,
FinalizeGameCardDriver,
GetGameCardAsicInfo,
CreateSaveData,
DeleteSaveData,
CreateSystemSaveData,
CreateOthersSystemSaveData,
DeleteSystemSaveData,
OpenSaveDataInfoReader,
OpenSaveDataInfoReaderForSystem,
OpenSaveDataInfoReaderForInternal,
OpenSaveDataMetaFile,
SetCurrentPosixTime,
ReadSaveDataFileSystemExtraData,
SetGlobalAccessLogMode,
SetSpeedEmulationMode,
Debug,
FillBis,
CorruptSaveData,
CorruptSystemSaveData,
VerifySaveData,
DebugSaveData,
FormatSdCard,
GetRightsId,
RegisterExternalKey,
SetEncryptionSeed,
WriteSaveDataFileSystemExtraDataTimeStamp,
WriteSaveDataFileSystemExtraDataFlags,
WriteSaveDataFileSystemExtraDataCommitId,
WriteSaveDataFileSystemExtraDataAll,
ExtendSaveData,
ExtendSystemSaveData,
ExtendOthersSystemSaveData,
RegisterUpdatePartition,
OpenSaveDataTransferManager,
OpenSaveDataTransferManagerVersion2,
OpenSaveDataTransferManagerForSaveDataRepair,
OpenSaveDataTransferManagerForSaveDataRepairTool,
OpenSaveDataTransferProhibiter,
OpenSaveDataMover,
OpenBisWiper,
ListAccessibleSaveDataOwnerId,
ControlMmcPatrol,
OverrideSaveDataTransferTokenSignVerificationKey,
OpenSdCardDetectionEventNotifier,
OpenGameCardDetectionEventNotifier,
OpenSystemDataUpdateEventNotifier,
NotifySystemDataUpdateEvent,
OpenAccessFailureDetectionEventNotifier,
GetAccessFailureDetectionEvent,
IsAccessFailureDetected,
ResolveAccessFailure,
AbandonAccessFailure,
QuerySaveDataInternalStorageTotalSize,
GetSaveDataCommitId,
SetSdCardAccessibility,
SimulateDevice,
CreateSaveDataWithHashSalt,
RegisterProgramIndexMapInfo,
ChallengeCardExistence,
CreateOwnSaveData,
DeleteOwnSaveData,
ReadOwnSaveDataFileSystemExtraData,
ExtendOwnSaveData,
OpenOwnSaveDataTransferProhibiter,
FindOwnSaveDataWithFilter,
OpenSaveDataTransferManagerForRepair,
SetDebugConfiguration,
OpenDataStorageByPath,
Count,
};
AMS_PRAGMA_BEGIN_PACK(4)
struct AccessControlDataHeader {
u8 version;
u8 reserved[3];
u64 flag_bits;
u32 content_owner_infos_offset;
u32 content_owner_infos_size;
u32 save_data_owner_infos_offset;
u32 save_data_owner_infos_size;
};
struct AccessControlDescriptor {
u8 version;
u8 content_owner_id_count;
u8 save_data_owner_id_count;
u8 reserved;
u64 flag_bits;
u64 content_owner_id_min;
u64 content_owner_id_max;
u64 save_data_owner_id_min;
u64 save_data_owner_id_max;
/* ... */
};
AMS_PRAGMA_END_PACK()
static_assert(util::is_pod<AccessControlDataHeader>::value);
static_assert(util::is_pod<AccessControlDescriptor>::value);
static constexpr u64 AllFlagBitsMask = ~static_cast<u64>(0);
static constexpr u64 DebugFlagDisableMask = AllFlagBitsMask & ~util::ToUnderlying(AccessControlBits::Bits::Debug);
private:
using ContentOwnerInfoList = util::IntrusiveListBaseTraits<ContentOwnerInfo>::ListType;
using SaveDataOwnerInfoList = util::IntrusiveListBaseTraits<SaveDataOwnerInfo>::ListType;
private:
util::optional<AccessControlBits> m_flag_bits;
ContentOwnerInfoList m_content_owner_infos;
SaveDataOwnerInfoList m_save_data_owner_infos;
public:
AccessControl(const void *data, s64 data_size, const void *desc, s64 desc_size);
AccessControl(const void *data, s64 data_size, const void *desc, s64 desc_size, u64 flag_mask);
~AccessControl();
public:
bool HasContentOwnerId(u64 owner_id) const;
Accessibility GetAccessibilitySaveDataOwnedBy(u64 owner_id) const;
void ListContentOwnerId(s32 *out_count, u64 *out_owner_ids, s32 offset, s32 count) const;
void ListSaveDataOwnedId(s32 *out_count, ncm::ApplicationId *out_owner_ids, s32 offset, s32 count) const;
Accessibility GetAccessibilityFor(AccessibilityType type) const;
bool CanCall(OperationType type) const;
public:
u64 GetRawFlagBits() const {
return m_flag_bits.value().GetValue();
}
};
}

View File

@@ -1,254 +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 <vapours.hpp>
#include <stratosphere/ncm/ncm_ids.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
#include <stratosphere/fssrv/impl/fssrv_access_control_bits.hpp>
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_FOR_EACH_ACCESS_CONTROL_CAPABILITY(HANDLER, _NS_) \
HANDLER(CanAbandonAccessFailure, _NS_::AccessFailureResolution) \
HANDLER(CanChallengeCardExistence, _NS_::GameCard) \
HANDLER(CanControlMmcPatrol, _NS_::None) \
HANDLER(CanCorruptSaveData, _NS_::Debug, _NS_::CorruptSaveData) \
HANDLER(CanCorruptSystemSaveData, _NS_::CorruptSaveData, _NS_::SaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanCreateOthersSystemSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanCreateOwnSaveData, _NS_::CreateOwnSaveData) \
HANDLER(CanCreateSaveData, _NS_::CreateSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanCreateSaveDataWithHashSalt, _NS_::None) \
HANDLER(CanCreateSystemSaveData, _NS_::SaveDataBackUp, _NS_::SystemSaveData) \
HANDLER(CanDebugSaveData, _NS_::Debug, _NS_::SaveDataForDebug) \
HANDLER(CanDeleteOwnSaveData, _NS_::CreateOwnSaveData) \
HANDLER(CanDeleteSaveData, _NS_::SaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanDeleteSystemSaveData, _NS_::SystemSaveDataManagement, _NS_::SaveDataBackUp, _NS_::SystemSaveData) \
HANDLER(CanEraseMmc, _NS_::BisAllRaw) \
HANDLER(CanExtendOthersSystemSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanExtendOwnSaveData, _NS_::CreateOwnSaveData) \
HANDLER(CanExtendSaveData, _NS_::CreateSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanExtendSystemSaveData, _NS_::SaveDataBackUp, _NS_::SystemSaveData) \
HANDLER(CanFillBis, _NS_::Debug, _NS_::FillBis) \
HANDLER(CanFinalizeGameCardDriver, _NS_::GameCardPrivate) \
HANDLER(CanFindOwnSaveDataWithFilter, _NS_::CreateOwnSaveData) \
HANDLER(CanFormatSdCard, _NS_::FormatSdCard) \
HANDLER(CanGetAccessFailureDetectionEvent, _NS_::AccessFailureResolution) \
HANDLER(CanGetGameCardAsicInfo, _NS_::GameCardPrivate) \
HANDLER(CanGetGameCardDeviceCertificate, _NS_::GameCard) \
HANDLER(CanGetGameCardIdSet, _NS_::GameCard) \
HANDLER(CanGetRightsId, _NS_::GetRightsId) \
HANDLER(CanGetSaveDataCommitId, _NS_::SaveDataTransferVersion2, _NS_::SaveDataBackUp) \
HANDLER(CanInvalidateBisCache, _NS_::BisAllRaw) \
HANDLER(CanIsAccessFailureDetected, _NS_::AccessFailureResolution) \
HANDLER(CanListAccessibleSaveDataOwnerId, _NS_::SaveDataTransferVersion2, _NS_::SaveDataTransfer, _NS_::CreateSaveData) \
HANDLER(CanMountAllBaseFileSystemRead, _NS_::None) \
HANDLER(CanMountAllBaseFileSystemWrite, _NS_::None) \
HANDLER(CanMountApplicationPackageRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountBisCalibrationFileRead, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanMountBisCalibrationFileWrite, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanMountBisSafeModeRead, _NS_::BisAllRaw) \
HANDLER(CanMountBisSafeModeWrite, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemProperEncryptionRead, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemProperEncryptionWrite, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemProperPartitionRead, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemProperPartitionWrite, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemRead, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountBisSystemWrite, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountBisUserRead, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountBisUserWrite, _NS_::BisFileSystem, _NS_::BisAllRaw) \
HANDLER(CanMountCloudBackupWorkStorageRead, _NS_::SaveDataTransferVersion2) \
HANDLER(CanMountCloudBackupWorkStorageWrite, _NS_::SaveDataTransferVersion2) \
HANDLER(CanMountContentControlRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountContentDataRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountContentManualRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountContentMetaRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountContentStorageRead, _NS_::ContentManager) \
HANDLER(CanMountContentStorageWrite, _NS_::ContentManager) \
HANDLER(CanMountCustomStorage0Read, _NS_::None) \
HANDLER(CanMountCustomStorage0Write, _NS_::None) \
HANDLER(CanMountDeviceSaveDataRead, _NS_::DeviceSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanMountDeviceSaveDataWrite, _NS_::DeviceSaveData, _NS_::SaveDataBackUp) \
HANDLER(CanMountGameCardRead, _NS_::GameCard) \
HANDLER(CanMountHostRead, _NS_::Debug, _NS_::Host) \
HANDLER(CanMountHostWrite, _NS_::Debug, _NS_::Host) \
HANDLER(CanMountImageAndVideoStorageRead, _NS_::ImageManager) \
HANDLER(CanMountImageAndVideoStorageWrite, _NS_::ImageManager) \
HANDLER(CanMountLogoRead, _NS_::ContentManager, _NS_::ApplicationInfo) \
HANDLER(CanMountOthersSaveDataRead, _NS_::SaveDataBackUp) \
HANDLER(CanMountOthersSaveDataWrite, _NS_::SaveDataBackUp) \
HANDLER(CanMountOthersSystemSaveDataRead, _NS_::SaveDataBackUp) \
HANDLER(CanMountOthersSystemSaveDataWrite, _NS_::SaveDataBackUp) \
HANDLER(CanMountRegisteredUpdatePartitionRead, _NS_::SystemUpdate) \
HANDLER(CanMountSaveDataStorageRead, _NS_::None) \
HANDLER(CanMountSaveDataStorageWrite, _NS_::None) \
HANDLER(CanMountSdCardRead, _NS_::Debug, _NS_::SdCard) \
HANDLER(CanMountSdCardWrite, _NS_::Debug, _NS_::SdCard) \
HANDLER(CanMountSystemDataPrivateRead, _NS_::SystemData, _NS_::SystemSaveData) \
HANDLER(CanMountSystemSaveDataRead, _NS_::SaveDataBackUp, _NS_::SystemSaveData) \
HANDLER(CanMountSystemSaveDataWrite, _NS_::SaveDataBackUp, _NS_::SystemSaveData) \
HANDLER(CanMountTemporaryDirectoryRead, _NS_::Debug) \
HANDLER(CanMountTemporaryDirectoryWrite, _NS_::Debug) \
HANDLER(CanNotifySystemDataUpdateEvent, _NS_::SystemUpdate) \
HANDLER(CanOpenAccessFailureDetectionEventNotifier, _NS_::AccessFailureResolution) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part1Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part1Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part2Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part2Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part3Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part3Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part4Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part4Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part5Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part5Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part6Read, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootConfigAndPackage2Part6Write, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootPartition1RootRead, _NS_::SystemUpdate, _NS_::BisAllRaw, _NS_::BootModeControl) \
HANDLER(CanOpenBisPartitionBootPartition1RootWrite, _NS_::SystemUpdate, _NS_::BisAllRaw, _NS_::BootModeControl) \
HANDLER(CanOpenBisPartitionBootPartition2RootRead, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionBootPartition2RootWrite, _NS_::SystemUpdate, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionCalibrationBinaryRead, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanOpenBisPartitionCalibrationBinaryWrite, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanOpenBisPartitionCalibrationFileRead, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanOpenBisPartitionCalibrationFileWrite, _NS_::BisAllRaw, _NS_::Calibration) \
HANDLER(CanOpenBisPartitionSafeModeRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSafeModeWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemProperEncryptionRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemProperEncryptionWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemProperPartitionRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemProperPartitionWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionSystemWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionUserDataRootRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionUserDataRootWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionUserRead, _NS_::BisAllRaw) \
HANDLER(CanOpenBisPartitionUserWrite, _NS_::BisAllRaw) \
HANDLER(CanOpenBisWiper, _NS_::ContentManager) \
HANDLER(CanOpenDataStorageByPath, _NS_::None) \
HANDLER(CanOpenGameCardDetectionEventNotifier, _NS_::DeviceDetection, _NS_::GameCardRaw, _NS_::GameCard) \
HANDLER(CanOpenGameCardStorageRead, _NS_::GameCardRaw) \
HANDLER(CanOpenGameCardStorageWrite, _NS_::GameCardRaw) \
HANDLER(CanOpenOwnSaveDataTransferProhibiter, _NS_::CreateOwnSaveData) \
HANDLER(CanOpenSaveDataInfoReader, _NS_::SaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanOpenSaveDataInfoReaderForInternal, _NS_::SaveDataManagement) \
HANDLER(CanOpenSaveDataInfoReaderForSystem, _NS_::SystemSaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanOpenSaveDataInternalStorageRead, _NS_::None) \
HANDLER(CanOpenSaveDataInternalStorageWrite, _NS_::None) \
HANDLER(CanOpenSaveDataMetaFile, _NS_::SaveDataMeta) \
HANDLER(CanOpenSaveDataMover, _NS_::MoveCacheStorage) \
HANDLER(CanOpenSaveDataTransferManager, _NS_::SaveDataTransfer) \
HANDLER(CanOpenSaveDataTransferManagerForRepair, _NS_::SaveDataBackUp) \
HANDLER(CanOpenSaveDataTransferManagerForSaveDataRepair, _NS_::SaveDataTransferVersion2) \
HANDLER(CanOpenSaveDataTransferManagerForSaveDataRepairTool, _NS_::None) \
HANDLER(CanOpenSaveDataTransferManagerVersion2, _NS_::SaveDataTransferVersion2) \
HANDLER(CanOpenSaveDataTransferProhibiter, _NS_::SaveDataTransferVersion2, _NS_::CreateSaveData) \
HANDLER(CanOpenSdCardDetectionEventNotifier, _NS_::DeviceDetection, _NS_::SdCard) \
HANDLER(CanOpenSdCardStorageRead, _NS_::Debug, _NS_::SdCard) \
HANDLER(CanOpenSdCardStorageWrite, _NS_::Debug, _NS_::SdCard) \
HANDLER(CanOpenSystemDataUpdateEventNotifier, _NS_::SystemData, _NS_::SystemSaveData) \
HANDLER(CanOverrideSaveDataTransferTokenSignVerificationKey, _NS_::None) \
HANDLER(CanQuerySaveDataInternalStorageTotalSize, _NS_::SaveDataTransfer) \
HANDLER(CanReadOwnSaveDataFileSystemExtraData, _NS_::CreateOwnSaveData) \
HANDLER(CanReadSaveDataFileSystemExtraData, _NS_::SystemSaveDataManagement, _NS_::SaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanRegisterExternalKey, _NS_::RegisterExternalKey) \
HANDLER(CanRegisterProgramIndexMapInfo, _NS_::RegisterProgramIndexMapInfo) \
HANDLER(CanRegisterUpdatePartition, _NS_::RegisterUpdatePartition) \
HANDLER(CanResolveAccessFailure, _NS_::AccessFailureResolution) \
HANDLER(CanSetCurrentPosixTime, _NS_::SetTime) \
HANDLER(CanSetDebugConfiguration, _NS_::None) \
HANDLER(CanSetEncryptionSeed, _NS_::ContentManager) \
HANDLER(CanSetGlobalAccessLogMode, _NS_::SettingsControl) \
HANDLER(CanSetSdCardAccessibility, _NS_::SdCard) \
HANDLER(CanSetSpeedEmulationMode, _NS_::SettingsControl) \
HANDLER(CanSimulateDevice, _NS_::Debug) \
HANDLER(CanVerifySaveData, _NS_::SaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanWriteSaveDataFileSystemExtraDataAll, _NS_::None) \
HANDLER(CanWriteSaveDataFileSystemExtraDataCommitId, _NS_::SaveDataBackUp) \
HANDLER(CanWriteSaveDataFileSystemExtraDataFlags, _NS_::SaveDataTransferVersion2, _NS_::SystemSaveDataManagement, _NS_::SaveDataBackUp) \
HANDLER(CanWriteSaveDataFileSystemExtraDataTimeStamp, _NS_::SaveDataBackUp)
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class AccessControlBits {
public:
enum class Bits : u64 {
None = 0,
ApplicationInfo = UINT64_C(1) << 0,
BootModeControl = UINT64_C(1) << 1,
Calibration = UINT64_C(1) << 2,
SystemSaveData = UINT64_C(1) << 3,
GameCard = UINT64_C(1) << 4,
SaveDataBackUp = UINT64_C(1) << 5,
SaveDataManagement = UINT64_C(1) << 6,
BisAllRaw = UINT64_C(1) << 7,
GameCardRaw = UINT64_C(1) << 8,
GameCardPrivate = UINT64_C(1) << 9,
SetTime = UINT64_C(1) << 10,
ContentManager = UINT64_C(1) << 11,
ImageManager = UINT64_C(1) << 12,
CreateSaveData = UINT64_C(1) << 13,
SystemSaveDataManagement = UINT64_C(1) << 14,
BisFileSystem = UINT64_C(1) << 15,
SystemUpdate = UINT64_C(1) << 16,
SaveDataMeta = UINT64_C(1) << 17,
DeviceSaveData = UINT64_C(1) << 18,
SettingsControl = UINT64_C(1) << 19,
SystemData = UINT64_C(1) << 20,
SdCard = UINT64_C(1) << 21,
Host = UINT64_C(1) << 22,
FillBis = UINT64_C(1) << 23,
CorruptSaveData = UINT64_C(1) << 24,
SaveDataForDebug = UINT64_C(1) << 25,
FormatSdCard = UINT64_C(1) << 26,
GetRightsId = UINT64_C(1) << 27,
RegisterExternalKey = UINT64_C(1) << 28,
RegisterUpdatePartition = UINT64_C(1) << 29,
SaveDataTransfer = UINT64_C(1) << 30,
DeviceDetection = UINT64_C(1) << 31,
AccessFailureResolution = UINT64_C(1) << 32,
SaveDataTransferVersion2 = UINT64_C(1) << 33,
RegisterProgramIndexMapInfo = UINT64_C(1) << 34,
CreateOwnSaveData = UINT64_C(1) << 35,
MoveCacheStorage = UINT64_C(1) << 36,
Debug = UINT64_C(1) << 62,
FullPermission = UINT64_C(1) << 63
};
private:
static constexpr u64 CombineBits(Bits b) {
return util::ToUnderlying(b);
}
template<typename... Args>
static constexpr u64 CombineBits(Bits b, Args... args) {
return CombineBits(b) | CombineBits(args...);
}
private:
const u64 m_value;
public:
constexpr AccessControlBits(u64 v) : m_value(v) { /* ... */ }
constexpr u64 GetValue() const { return m_value; }
#define DEFINE_ACCESS_GETTER(name, ...) \
constexpr bool name() const { constexpr u64 Mask = CombineBits(Bits::FullPermission, ## __VA_ARGS__); return (m_value & Mask); }
AMS_FSSRV_FOR_EACH_ACCESS_CONTROL_CAPABILITY(DEFINE_ACCESS_GETTER, Bits)
#undef DEFINE_ACCESS_GETTER
};
}

View File

@@ -1,151 +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 <vapours.hpp>
#include <stratosphere/ncm/ncm_ids.hpp>
#include <stratosphere/fs/fs_rights_id.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
#include <stratosphere/spl/spl_types.hpp>
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ExternalKeyEntry : public util::IntrusiveListBaseNode<ExternalKeyEntry>, public ::ams::fs::impl::Newable {
private:
fs::RightsId m_rights_id;
spl::AccessKey m_access_key;
public:
ExternalKeyEntry(const fs::RightsId &rights_id, const spl::AccessKey &access_key) : m_rights_id(rights_id), m_access_key(access_key) {
/* ... */
}
bool Contains(const fs::RightsId &rights_id) const {
return crypto::IsSameBytes(std::addressof(m_rights_id), std::addressof(rights_id), sizeof(m_rights_id));
}
bool Contains(const void *key, size_t key_size) const {
AMS_ASSERT(key_size == sizeof(spl::AccessKey));
AMS_UNUSED(key_size);
return crypto::IsSameBytes(std::addressof(m_access_key), key, sizeof(m_access_key));
}
void CopyAccessKey(spl::AccessKey *out) const {
AMS_ASSERT(out != nullptr);
std::memcpy(out, std::addressof(m_access_key), sizeof(m_access_key));
}
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ExternalKeyManager {
NON_COPYABLE(ExternalKeyManager);
NON_MOVEABLE(ExternalKeyManager);
private:
using ExternalKeyList = util::IntrusiveListBaseTraits<ExternalKeyEntry>::ListType;
private:
ExternalKeyList m_key_list;
os::SdkMutex m_mutex;
public:
constexpr ExternalKeyManager() : m_key_list(), m_mutex() { /* ... */ }
Result Register(const fs::RightsId &rights_id, const spl::AccessKey &access_key) {
/* Acquire exclusive access to the key list */
std::scoped_lock lk(m_mutex);
/* Try to find an existing entry. */
spl::AccessKey existing;
if (R_SUCCEEDED(this->FindCore(std::addressof(existing), rights_id))) {
/* Check the key matches what was previously registered. */
R_UNLESS(crypto::IsSameBytes(std::addressof(existing), std::addressof(access_key), sizeof(access_key)), fs::ResultNcaExternalKeyInconsistent());
} else {
/* Make a new entry. */
auto *entry = new ExternalKeyEntry(rights_id, access_key);
R_UNLESS(entry != nullptr, fs::ResultAllocationMemoryFailed());
/* Add the entry to our list. */
m_key_list.push_back(*entry);
}
R_SUCCEED();
}
Result Unregister(const fs::RightsId &rights_id) {
/* Acquire exclusive access to the key list */
std::scoped_lock lk(m_mutex);
/* Find a matching entry. */
for (auto it = m_key_list.begin(); it != m_key_list.end(); ++it) {
if (it->Contains(rights_id)) {
auto *entry = std::addressof(*it);
m_key_list.erase(it);
delete entry;
break;
}
}
/* Always succeed. */
R_SUCCEED();
}
Result UnregisterAll() {
/* Acquire exclusive access to the key list */
std::scoped_lock lk(m_mutex);
/* Remove all entries until our list is empty. */
while (!m_key_list.empty()) {
auto *entry = std::addressof(*m_key_list.begin());
m_key_list.erase(m_key_list.iterator_to(*entry));
delete entry;
}
R_SUCCEED();
}
bool IsAvailableAccessKey(const void *key, size_t key_size) {
/* Acquire exclusive access to the key list */
std::scoped_lock lk(m_mutex);
/* Check if any entry contains the key. */
for (const auto &entry : m_key_list) {
if (entry.Contains(key, key_size)) {
return true;
}
}
return false;
}
Result Find(spl::AccessKey *out, const fs::RightsId &rights_id) {
/* Acquire exclusive access to the key list */
std::scoped_lock lk(m_mutex);
/* Try to find an entry with the desired rights id. */
R_RETURN(this->FindCore(out, rights_id));
}
private:
Result FindCore(spl::AccessKey *out, const fs::RightsId &rights_id) {
for (const auto &entry : m_key_list) {
if (entry.Contains(rights_id)) {
entry.CopyAccessKey(out);
R_SUCCEED();
}
}
R_THROW(fs::ResultNcaExternalKeyUnregistered());
}
};
}

View File

@@ -1,34 +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 <vapours.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_file_system_proxy.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_program_registry.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_file_system_proxy_for_loader.hpp>
#include <stratosphere/fssrv/fssrv_file_system_proxy_impl.hpp>
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
ams::sf::EmplacedRef<fssrv::sf::IFileSystemProxy, fssrv::FileSystemProxyImpl> GetFileSystemProxyServiceObject();
ams::sf::SharedPointer<fssrv::sf::IProgramRegistry> GetProgramRegistryServiceObject();
ams::sf::SharedPointer<fssrv::sf::IProgramRegistry> GetInvalidProgramRegistryServiceObject();
ams::sf::SharedPointer<fssrv::sf::IFileSystemProxyForLoader> GetFileSystemProxyForLoaderServiceObject();
ams::sf::SharedPointer<fssrv::sf::IFileSystemProxyForLoader> GetInvalidFileSystemProxyForLoaderServiceObject();
}

View File

@@ -1,163 +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 <vapours.hpp>
#include <stratosphere/ncm/ncm_ids.hpp>
#include <stratosphere/fs/impl/fs_newable.hpp>
#include <stratosphere/fs/fs_program_index_map_info.hpp>
#include <stratosphere/fssystem/fssystem_pimpl.hpp>
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
struct ProgramIndexMapInfoEntry : public ::ams::util::IntrusiveListBaseNode<ProgramIndexMapInfoEntry>, public ::ams::fs::impl::Newable {
ncm::ProgramId program_id;
ncm::ProgramId base_program_id;
u8 program_index;
};
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class ProgramIndexMapInfoManager {
NON_COPYABLE(ProgramIndexMapInfoManager);
NON_MOVEABLE(ProgramIndexMapInfoManager);
private:
using ProgramIndexMapInfoList = util::IntrusiveListBaseTraits<ProgramIndexMapInfoEntry>::ListType;
private:
ProgramIndexMapInfoList m_list;
mutable os::SdkMutex m_mutex;
public:
constexpr ProgramIndexMapInfoManager() : m_list(), m_mutex() { /* ... */ }
void Clear() {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
/* Actually clear. */
this->ClearImpl();
}
size_t GetProgramCount() const {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
/* Get the size. */
return m_list.size();
}
util::optional<fs::ProgramIndexMapInfo> Get(const ncm::ProgramId &program_id) const {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
/* Get the entry from the map. */
return this->GetImpl([&] (const ProgramIndexMapInfoEntry &entry) {
return entry.program_id == program_id;
});
}
ncm::ProgramId GetProgramId(const ncm::ProgramId &program_id, u8 program_index) const {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
/* Get the program info for the desired program id. */
const auto base_info = this->GetImpl([&] (const ProgramIndexMapInfoEntry &entry) {
return entry.program_id == program_id;
});
/* Check that an entry exists for the program id. */
if (!base_info.has_value()) {
return ncm::InvalidProgramId;
}
/* Get a program info which matches the same base program with the desired index. */
const auto target_info = this->GetImpl([&] (const ProgramIndexMapInfoEntry &entry) {
return entry.base_program_id == base_info->base_program_id && entry.program_index == program_index;
});
/* Return the desired program id. */
if (target_info.has_value()) {
return target_info->program_id;
} else {
return ncm::InvalidProgramId;
}
}
Result Reset(const fs::ProgramIndexMapInfo *infos, int count) {
/* Acquire exclusive access to the map. */
std::scoped_lock lk(m_mutex);
/* Clear the map, and ensure we remain clear if we fail after this point. */
this->ClearImpl();
ON_RESULT_FAILURE { this->ClearImpl(); };
/* Add each info to the list. */
for (int i = 0; i < count; ++i) {
/* Allocate new entry. */
auto *entry = new ProgramIndexMapInfoEntry;
R_UNLESS(entry != nullptr, fs::ResultAllocationMemoryFailedNew());
/* Copy over the info. */
entry->program_id = infos[i].program_id;
entry->base_program_id = infos[i].base_program_id;
entry->program_index = infos[i].program_index;
/* Add to the list. */
m_list.push_back(*entry);
}
/* We successfully imported the map. */
R_SUCCEED();
}
private:
void ClearImpl() {
/* Delete all entries. */
while (!m_list.empty()) {
/* Get the first entry. */
ProgramIndexMapInfoEntry *front = std::addressof(*m_list.begin());
/* Erase it from the list. */
m_list.erase(m_list.iterator_to(*front));
/* Delete the entry. */
delete front;
}
}
template<typename F>
util::optional<fs::ProgramIndexMapInfo> GetImpl(F f) const {
/* Try to find an entry matching the predicate. */
util::optional<fs::ProgramIndexMapInfo> match = util::nullopt;
for (const auto &entry : m_list) {
/* If the predicate matches, we want to return the relevant info. */
if (f(entry)) {
match.emplace();
match->program_id = entry.program_id;
match->base_program_id = entry.base_program_id;
match->program_index = entry.program_index;
break;
}
}
return match;
}
};
}
AMS_FSSYSTEM_ENABLE_PIMPL(::ams::fssrv::impl::ProgramIndexMapInfoManager)

View File

@@ -1,265 +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/fs_file.hpp>
#include <stratosphere/fs/fs_directory.hpp>
#include <stratosphere/fs/fs_filesystem.hpp>
#include <stratosphere/fs/fs_query_range.hpp>
#include <stratosphere/fssystem/fssystem_utility.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_path.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifile.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_idirectory.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifilesystem.hpp>
namespace ams::fs::fsa {
class IFile;
class IDirectory;
class IFileSystem;
}
namespace ams::fssrv::impl {
class FileSystemInterfaceAdapter;
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class FileInterfaceAdapter {
NON_COPYABLE(FileInterfaceAdapter);
NON_MOVEABLE(FileInterfaceAdapter);
private:
ams::sf::SharedPointer<FileSystemInterfaceAdapter> m_parent_filesystem;
std::unique_ptr<fs::fsa::IFile> m_base_file;
bool m_allow_all_operations;
public:
FileInterfaceAdapter(std::unique_ptr<fs::fsa::IFile> &&file, FileSystemInterfaceAdapter *parent, bool allow_all);
private:
void InvalidateCache();
public:
/* Command API. */
Result Read(ams::sf::Out<s64> out, s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size, fs::ReadOption option);
Result Write(s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size, fs::WriteOption option);
Result Flush();
Result SetSize(s64 size);
Result GetSize(ams::sf::Out<s64> out);
Result OperateRange(ams::sf::Out<fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size);
Result OperateRangeWithBuffer(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size);
};
static_assert(fssrv::sf::IsIFile<FileInterfaceAdapter>);
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class DirectoryInterfaceAdapter {
NON_COPYABLE(DirectoryInterfaceAdapter);
NON_MOVEABLE(DirectoryInterfaceAdapter);
private:
ams::sf::SharedPointer<FileSystemInterfaceAdapter> m_parent_filesystem;
std::unique_ptr<fs::fsa::IDirectory> m_base_dir;
bool m_allow_all_operations;
public:
DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, FileSystemInterfaceAdapter *parent, bool allow_all);
public:
/* Command API */
Result Read(ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries);
Result GetEntryCount(ams::sf::Out<s64> out);
};
static_assert(fssrv::sf::IsIDirectory<DirectoryInterfaceAdapter>);
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class FileSystemInterfaceAdapter : public ams::sf::ISharedObject {
NON_COPYABLE(FileSystemInterfaceAdapter);
NON_MOVEABLE(FileSystemInterfaceAdapter);
private:
std::shared_ptr<fs::fsa::IFileSystem> m_base_fs;
fs::PathFlags m_path_flags;
bool m_allow_all_operations;
bool m_is_mitm_interface;
public:
FileSystemInterfaceAdapter(std::shared_ptr<fs::fsa::IFileSystem> &&fs, const fs::PathFlags &flags, bool allow_all, bool is_mitm_interface = false)
: m_base_fs(std::move(fs)), m_path_flags(flags), m_allow_all_operations(allow_all), m_is_mitm_interface(is_mitm_interface)
{
/* ... */
}
FileSystemInterfaceAdapter(std::shared_ptr<fs::fsa::IFileSystem> &&fs, bool allow_all, bool is_mitm_interface = false)
: m_base_fs(std::move(fs)), m_path_flags(), m_allow_all_operations(allow_all), m_is_mitm_interface(is_mitm_interface)
{
/* ... */
}
private:
Result SetUpPath(fs::Path *out, const fssrv::sf::Path &sf_path);
public:
/* Command API. */
Result CreateFile(const fssrv::sf::Path &path, s64 size, s32 option);
Result DeleteFile(const fssrv::sf::Path &path);
Result CreateDirectory(const fssrv::sf::Path &path);
Result DeleteDirectory(const fssrv::sf::Path &path);
Result DeleteDirectoryRecursively(const fssrv::sf::Path &path);
Result RenameFile(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
Result RenameDirectory(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path);
Result GetEntryType(ams::sf::Out<u32> out, const fssrv::sf::Path &path);
Result OpenFile(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFile>> out, const fssrv::sf::Path &path, u32 mode);
Result OpenDirectory(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IDirectory>> out, const fssrv::sf::Path &path, u32 mode);
Result Commit();
Result GetFreeSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
Result GetTotalSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path);
Result CleanDirectoryRecursively(const fssrv::sf::Path &path);
Result GetFileTimeStampRaw(ams::sf::Out<fs::FileTimeStampRaw> out, const fssrv::sf::Path &path);
Result QueryEntry(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 query_id, const fssrv::sf::Path &path);
};
#if defined(ATMOSPHERE_OS_HORIZON)
class RemoteFile {
NON_COPYABLE(RemoteFile);
NON_MOVEABLE(RemoteFile);
private:
::FsFile m_base_file;
public:
RemoteFile(::FsFile &s) : m_base_file(s) { /* ... */}
virtual ~RemoteFile() { fsFileClose(std::addressof(m_base_file)); }
public:
Result Read(ams::sf::Out<s64> out, s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size, fs::ReadOption option) {
R_RETURN(fsFileRead(std::addressof(m_base_file), offset, buffer.GetPointer(), size, option._value, reinterpret_cast<u64 *>(out.GetPointer())));
}
Result Write(s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size, fs::WriteOption option) {
R_RETURN(fsFileWrite(std::addressof(m_base_file), offset, buffer.GetPointer(), size, option._value));
}
Result Flush(){
R_RETURN(fsFileFlush(std::addressof(m_base_file)));
}
Result SetSize(s64 size) {
R_RETURN(fsFileSetSize(std::addressof(m_base_file), size));
}
Result GetSize(ams::sf::Out<s64> out) {
R_RETURN(fsFileGetSize(std::addressof(m_base_file), out.GetPointer()));
}
Result OperateRange(ams::sf::Out<fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size) {
static_assert(sizeof(::FsRangeInfo) == sizeof(fs::FileQueryRangeInfo));
R_RETURN(fsFileOperateRange(std::addressof(m_base_file), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(out.GetPointer())));
}
Result OperateRangeWithBuffer(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size) {
AMS_UNUSED(out_buf, in_buf, op_id, offset, size);
AMS_ABORT("TODO");
}
};
static_assert(fssrv::sf::IsIFile<RemoteFile>);
class RemoteDirectory {
NON_COPYABLE(RemoteDirectory);
NON_MOVEABLE(RemoteDirectory);
private:
::FsDir m_base_dir;
public:
RemoteDirectory(::FsDir &s) : m_base_dir(s) { /* ... */}
virtual ~RemoteDirectory() { fsDirClose(std::addressof(m_base_dir)); }
public:
Result Read(ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries) {
static_assert(sizeof(::FsDirectoryEntry) == sizeof(fs::DirectoryEntry));
R_RETURN(fsDirRead(std::addressof(m_base_dir), out.GetPointer(), out_entries.GetSize() / sizeof(fs::DirectoryEntry), reinterpret_cast<::FsDirectoryEntry *>(out_entries.GetPointer())));
}
Result GetEntryCount(ams::sf::Out<s64> out) {
R_RETURN(fsDirGetEntryCount(std::addressof(m_base_dir), out.GetPointer()));
}
};
static_assert(fssrv::sf::IsIDirectory<RemoteDirectory>);
class RemoteFileSystem {
NON_COPYABLE(RemoteFileSystem);
NON_MOVEABLE(RemoteFileSystem);
private:
::FsFileSystem m_base_fs;
public:
RemoteFileSystem(::FsFileSystem &s) : m_base_fs(s) { /* ... */}
virtual ~RemoteFileSystem() { fsFsClose(std::addressof(m_base_fs)); }
public:
/* Command API. */
Result CreateFile(const fssrv::sf::Path &path, s64 size, s32 option) {
R_RETURN(fsFsCreateFile(std::addressof(m_base_fs), path.str, size, option));
}
Result DeleteFile(const fssrv::sf::Path &path) {
R_RETURN(fsFsDeleteFile(std::addressof(m_base_fs), path.str));
}
Result CreateDirectory(const fssrv::sf::Path &path) {
R_RETURN(fsFsCreateDirectory(std::addressof(m_base_fs), path.str));
}
Result DeleteDirectory(const fssrv::sf::Path &path) {
R_RETURN(fsFsDeleteDirectory(std::addressof(m_base_fs), path.str));
}
Result DeleteDirectoryRecursively(const fssrv::sf::Path &path) {
R_RETURN(fsFsDeleteDirectoryRecursively(std::addressof(m_base_fs), path.str));
}
Result RenameFile(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path) {
R_RETURN(fsFsRenameFile(std::addressof(m_base_fs), old_path.str, new_path.str));
}
Result RenameDirectory(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path) {
R_RETURN(fsFsRenameDirectory(std::addressof(m_base_fs), old_path.str, new_path.str));
}
Result GetEntryType(ams::sf::Out<u32> out, const fssrv::sf::Path &path) {
static_assert(sizeof(::FsDirEntryType) == sizeof(u32));
R_RETURN(fsFsGetEntryType(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsDirEntryType *>(out.GetPointer())));
}
Result Commit() {
R_RETURN(fsFsCommit(std::addressof(m_base_fs)));
}
Result GetFreeSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path) {
R_RETURN(fsFsGetFreeSpace(std::addressof(m_base_fs), path.str, out.GetPointer()));
}
Result GetTotalSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path) {
R_RETURN(fsFsGetTotalSpace(std::addressof(m_base_fs), path.str, out.GetPointer()));
}
Result CleanDirectoryRecursively(const fssrv::sf::Path &path) {
R_RETURN(fsFsCleanDirectoryRecursively(std::addressof(m_base_fs), path.str));
}
Result GetFileTimeStampRaw(ams::sf::Out<fs::FileTimeStampRaw> out, const fssrv::sf::Path &path) {
static_assert(sizeof(fs::FileTimeStampRaw) == sizeof(::FsTimeStampRaw));
R_RETURN(fsFsGetFileTimeStampRaw(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsTimeStampRaw *>(out.GetPointer())));
}
Result QueryEntry(const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 query_id, const fssrv::sf::Path &path) {
R_RETURN(fsFsQueryEntry(std::addressof(m_base_fs), out_buf.GetPointer(), out_buf.GetSize(), in_buf.GetPointer(), in_buf.GetSize(), path.str, static_cast<FsFileSystemQueryId>(query_id)));
}
Result OpenFile(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFile>> out, const fssrv::sf::Path &path, u32 mode);
Result OpenDirectory(ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IDirectory>> out, const fssrv::sf::Path &path, u32 mode);
};
static_assert(fssrv::sf::IsIFileSystem<RemoteFileSystem>);
#endif
}

View File

@@ -1,87 +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/fs_query_range.hpp>
#include <stratosphere/fssystem/fssystem_utility.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_istorage.hpp>
namespace ams::fs {
class IStorage;
}
namespace ams::fssrv::impl {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
class StorageInterfaceAdapter {
NON_COPYABLE(StorageInterfaceAdapter);
private:
std::shared_ptr<fs::IStorage> m_base_storage;
public:
explicit StorageInterfaceAdapter(std::shared_ptr<fs::IStorage> &&storage) : m_base_storage(std::move(storage)) { /* ... */ }
public:
/* Command API. */
Result Read(s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size);
Result Write(s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size);
Result Flush();
Result SetSize(s64 size);
Result GetSize(ams::sf::Out<s64> out);
Result OperateRange(ams::sf::Out<fs::StorageQueryRangeInfo> out, s32 op_id, s64 offset, s64 size);
};
static_assert(fssrv::sf::IsIStorage<StorageInterfaceAdapter>);
#if defined(ATMOSPHERE_OS_HORIZON)
class RemoteStorage {
NON_COPYABLE(RemoteStorage);
NON_MOVEABLE(RemoteStorage);
private:
::FsStorage m_base_storage;
public:
RemoteStorage(::FsStorage &s) : m_base_storage(s) { /* ... */}
virtual ~RemoteStorage() { fsStorageClose(std::addressof(m_base_storage)); }
public:
Result Read(s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size) {
R_RETURN(fsStorageRead(std::addressof(m_base_storage), offset, buffer.GetPointer(), size));
}
Result Write(s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size) {
R_RETURN(fsStorageWrite(std::addressof(m_base_storage), offset, buffer.GetPointer(), size));
}
Result Flush(){
R_RETURN(fsStorageFlush(std::addressof(m_base_storage)));
}
Result SetSize(s64 size) {
R_RETURN(fsStorageSetSize(std::addressof(m_base_storage), size));
}
Result GetSize(ams::sf::Out<s64> out) {
R_RETURN(fsStorageGetSize(std::addressof(m_base_storage), out.GetPointer()));
}
Result OperateRange(ams::sf::Out<fs::StorageQueryRangeInfo> out, s32 op_id, s64 offset, s64 size) {
static_assert(sizeof(::FsRangeInfo) == sizeof(fs::StorageQueryRangeInfo));
R_RETURN(fsStorageOperateRange(std::addressof(m_base_storage), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(out.GetPointer())));
}
};
static_assert(fssrv::sf::IsIStorage<RemoteStorage>);
#endif
}

View File

@@ -1,42 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_error_info.hpp>
#include <stratosphere/fs/fs_game_card.hpp>
/* TODO */
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_DEVICE_OPERATOR_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, IsSdCardInserted, (ams::sf::Out<bool> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, GetSdCardSpeedMode, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, GetSdCardCid, (ams::sf::OutBuffer out, s64 size), (out, size)) \
AMS_SF_METHOD_INFO(C, H, 3, Result, GetSdCardUserAreaSize, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSdCardProtectedAreaSize, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 5, Result, GetAndClearSdCardErrorInfo, (ams::sf::Out<fs::StorageErrorInfo> out_sei, ams::sf::Out<s64> out_size, ams::sf::OutBuffer out_buf, s64 size), (out_sei, out_size, out_buf, size)) \
AMS_SF_METHOD_INFO(C, H, 100, Result, GetMmcCid, (ams::sf::OutBuffer out, s64 size), (out, size)) \
AMS_SF_METHOD_INFO(C, H, 101, Result, GetMmcSpeedMode, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 112, Result, GetMmcPatrolCount, (ams::sf::Out<u32> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 113, Result, GetAndClearMmcErrorInfo, (ams::sf::Out<fs::StorageErrorInfo> out_sei, ams::sf::Out<s64> out_size, ams::sf::OutBuffer out_buf, s64 size), (out_sei, out_size, out_buf, size)) \
AMS_SF_METHOD_INFO(C, H, 114, Result, GetMmcExtendedCsd, (ams::sf::OutBuffer out, s64 size), (out, size)) \
AMS_SF_METHOD_INFO(C, H, 200, Result, IsGameCardInserted, (ams::sf::Out<bool> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 202, Result, GetGameCardHandle, (ams::sf::Out<u32> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 208, Result, GetGameCardIdSet, (ams::sf::OutBuffer out, s64 size), (out, size)) \
AMS_SF_METHOD_INFO(C, H, 217, Result, GetGameCardErrorReportInfo, (ams::sf::Out<fs::GameCardErrorReportInfo> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 218, Result, GetGameCardDeviceId, (ams::sf::OutBuffer out, s64 size), (out, size))
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IDeviceOperator, AMS_FSSRV_I_DEVICE_OPERATOR_INTERFACE_INFO, 0x1484E21C)

View File

@@ -1,24 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_EVENT_NOTIFIER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, GetEventHandle, (ams::sf::OutCopyHandle out), (out))
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IEventNotifier, AMS_FSSRV_I_EVENT_NOTIFIER_INTERFACE_INFO, 0xA7E3A62C)

View File

@@ -1,156 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifilesystem.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_istorage.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_device_operator.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_i_event_notifier.hpp>
#include <stratosphere/fs/fs_error_info.hpp>
#include <stratosphere/fs/fs_memory_report_info.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_FILE_SYSTEM_PROXY_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 type), (out, path, type), hos::Version_Min, hos::Version_1_0_0) \
AMS_SF_METHOD_INFO(C, H, 1, Result, SetCurrentProcess, (const ams::sf::ClientProcessId &client_pid), (client_pid)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, OpenDataFileSystemByCurrentProcess, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 7, Result, OpenFileSystemWithPatch, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, ncm::ProgramId program_id, u32 type), (out, program_id, type), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 8, Result, OpenFileSystemWithIdObsolete, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u64 program_id, u32 type), (out, path, program_id, type), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 9, Result, OpenDataFileSystemByProgramId, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, ncm::ProgramId program_id), (out, program_id), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 8, Result, OpenFileSystemWithId, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr, u64 program_id, u32 type), (out, path, attr, program_id, type), hos::Version_16_0_0) \
AMS_SF_METHOD_INFO(C, H, 11, Result, OpenBisFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 id), (out, path, id)) \
AMS_SF_METHOD_INFO(C, H, 12, Result, OpenBisStorage, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u32 id), (out, id)) \
AMS_SF_METHOD_INFO(C, H, 13, Result, InvalidateBisCache, (), ()) \
AMS_SF_METHOD_INFO(C, H, 17, Result, OpenHostFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path), (out, path)) \
AMS_SF_METHOD_INFO(C, H, 18, Result, OpenSdCardFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 19, Result, FormatSdCardFileSystem, (), (), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 21, Result, DeleteSaveDataFileSystem, (u64 save_data_id), (save_data_id)) \
AMS_SF_METHOD_INFO(C, H, 22, Result, CreateSaveDataFileSystem, (const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info, const fs::SaveDataMetaInfo &meta_info), (attribute, creation_info, meta_info)) \
AMS_SF_METHOD_INFO(C, H, 23, Result, CreateSaveDataFileSystemBySystemSaveDataId, (const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info), (attribute, creation_info)) \
AMS_SF_METHOD_INFO(C, H, 24, Result, RegisterSaveDataFileSystemAtomicDeletion, (const ams::sf::InBuffer &save_data_ids), (save_data_ids)) \
AMS_SF_METHOD_INFO(C, H, 25, Result, DeleteSaveDataFileSystemBySaveDataSpaceId, (u8 indexer_space_id, u64 save_data_id), (indexer_space_id, save_data_id), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 26, Result, FormatSdCardDryRun, (), (), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 27, Result, IsExFatSupported, (ams::sf::Out<bool> out), (out), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 28, Result, DeleteSaveDataFileSystemBySaveDataAttribute, (u8 space_id, const fs::SaveDataAttribute &attribute), (space_id, attribute), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 30, Result, OpenGameCardStorage, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u32 handle, u32 partition), (out, handle, partition)) \
AMS_SF_METHOD_INFO(C, H, 31, Result, OpenGameCardFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 handle, u32 partition), (out, handle, partition)) \
AMS_SF_METHOD_INFO(C, H, 32, Result, ExtendSaveDataFileSystem, (u8 space_id, u64 save_data_id, s64 available_size, s64 journal_size), (space_id, save_data_id, available_size, journal_size), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 33, Result, DeleteCacheStorage, (u16 index), (index), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 34, Result, GetCacheStorageSize, (ams::sf::Out<s64> out_size, ams::sf::Out<s64> out_journal_size, u16 index), (out_size, out_journal_size, index), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 35, Result, CreateSaveDataFileSystemWithHashSalt, (const fs::SaveDataAttribute &attribute, const fs::SaveDataCreationInfo &creation_info, const fs::SaveDataMetaInfo &meta_info, const fs::HashSalt &salt), (attribute, creation_info, meta_info, salt), hos::Version_6_0_0) \
AMS_SF_METHOD_INFO(C, H, 36, Result, OpenHostFileSystemWithOption, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, const fssrv::sf::FspPath &path, u32 option), (out, path, option), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 51, Result, OpenSaveDataFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute), (out, space_id, attribute)) \
AMS_SF_METHOD_INFO(C, H, 52, Result, OpenSaveDataFileSystemBySystemSaveDataId, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute), (out, space_id, attribute)) \
AMS_SF_METHOD_INFO(C, H, 53, Result, OpenReadOnlySaveDataFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 space_id, const fs::SaveDataAttribute &attribute), (out, space_id, attribute), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 57, Result, ReadSaveDataFileSystemExtraDataBySaveDataSpaceId, (const ams::sf::OutBuffer &buffer, u8 space_id, u64 save_data_id), (buffer, space_id, save_data_id), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 58, Result, ReadSaveDataFileSystemExtraData, (const ams::sf::OutBuffer &buffer, u64 save_data_id), (buffer, save_data_id)) \
AMS_SF_METHOD_INFO(C, H, 59, Result, WriteSaveDataFileSystemExtraData, (u64 save_data_id, u8 space_id, const ams::sf::InBuffer &buffer), (save_data_id, space_id, buffer), hos::Version_2_0_0) \
/* AMS_SF_METHOD_INFO(C, H, 60, Result, OpenSaveDataInfoReader, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 61, Result, OpenSaveDataInfoReaderBySaveDataSpaceId, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 62, Result, OpenSaveDataInfoReaderOnlyCacheStorage, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 64, Result, OpenSaveDataInternalStorageFileSystem, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 65, Result, UpdateSaveDataMacForDebug, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 66, Result, WriteSaveDataFileSystemExtraDataWithMask, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 67, Result, FindSaveDataWithFilter, (), (), hos::Version_6_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 68, Result, OpenSaveDataInfoReaderWithFilter, (), (), hos::Version_6_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 69, Result, ReadSaveDataFileSystemExtraDataBySaveDataAttribute, (), (), hos::Version_8_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 70, Result, WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute, (), (), hos::Version_8_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 71, Result, ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute, (), (), hos::Version_10_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 80, Result, OpenSaveDataMetaFile, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 81, Result, OpenSaveDataTransferManager, (), (), hos::Version_4_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 82, Result, OpenSaveDataTransferManagerVersion2, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 83, Result, OpenSaveDataTransferProhibiter, (), (), hos::Version_6_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 84, Result, ListAccessibleSaveDataOwnerId, (), (), hos::Version_6_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 85, Result, OpenSaveDataTransferManagerForSaveDataRepair, (), (), hos::Version_9_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 86, Result, OpenSaveDataMover, (), (), hos::Version_10_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 87, Result, OpenSaveDataTransferManagerForRepair, (), (), hos::Version_11_0_0) */ \
AMS_SF_METHOD_INFO(C, H, 100, Result, OpenImageDirectoryFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 id), (out, id)) \
/* AMS_SF_METHOD_INFO(C, H, 101, Result, OpenBaseFileSystem, (), (), hos::Version_11_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 102, Result, FormatBaseFileSystem, (), (), hos::Version_12_0_0) */ \
AMS_SF_METHOD_INFO(C, H, 110, Result, OpenContentStorageFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u32 id), (out, id)) \
/* AMS_SF_METHOD_INFO(C, H, 120, Result, OpenCloudBackupWorkStorageFileSystem, (), (), hos::Version_6_0_0, hos::Version_9_2_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 130, Result, OpenCustomStorageFileSystem, (), (), hos::Version_7_0_0) */ \
AMS_SF_METHOD_INFO(C, H, 200, Result, OpenDataStorageByCurrentProcess, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 201, Result, OpenDataStorageByProgramId, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, ncm::ProgramId program_id), (out, program_id), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 202, Result, OpenDataStorageByDataId, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, ncm::DataId data_id, u8 storage_id), (out, data_id, storage_id)) \
AMS_SF_METHOD_INFO(C, H, 203, Result, OpenPatchDataStorageByCurrentProcess, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 204, Result, OpenDataFileSystemWithProgramIndex, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out, u8 index), (out, index), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 205, Result, OpenDataStorageWithProgramIndex, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, u8 index), (out, index), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 206, Result, OpenDataStorageByPathObsolete, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, const fssrv::sf::FspPath &path, u32 type), (out, path, type), hos::Version_13_0_0, hos::Version_15_0_1) \
AMS_SF_METHOD_INFO(C, H, 206, Result, OpenDataStorageByPath, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IStorage>> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr, u32 type), (out, path, attr, type), hos::Version_16_0_0) \
AMS_SF_METHOD_INFO(C, H, 400, Result, OpenDeviceOperator, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IDeviceOperator>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 500, Result, OpenSdCardDetectionEventNotifier, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 501, Result, OpenGameCardDetectionEventNotifier, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 510, Result, OpenSystemDataUpdateEventNotifier, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IEventNotifier>> out), (out), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 511, Result, NotifySystemDataUpdateEvent, (), (), hos::Version_5_0_0) \
/* AMS_SF_METHOD_INFO(C, H, 520, Result, SimulateDeviceDetectionEvent, (), (), hos::Version_6_0_0) */ \
AMS_SF_METHOD_INFO(C, H, 600, Result, SetCurrentPosixTime, (s64 posix_time), (posix_time), hos::Version_Min, hos::Version_3_0_2) \
/* AMS_SF_METHOD_INFO(C, H, 601, Result, QuerySaveDataTotalSize, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 602, Result, VerifySaveDataFileSystem, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 603, Result, CorruptSaveDataFileSystem, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 604, Result, CreatePaddingFile, (), ()) */ \
/* AMS_SF_METHOD_INFO(C, H, 605, Result, DeleteAllPaddingFiles, (), ()) */ \
AMS_SF_METHOD_INFO(C, H, 606, Result, GetRightsId, (ams::sf::Out<fs::RightsId> out, ncm::ProgramId program_id, ncm::StorageId storage_id), (out, program_id, storage_id), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 607, Result, RegisterExternalKey, (const fs::RightsId &rights_id, const spl::AccessKey &access_key), (rights_id, access_key), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 608, Result, UnregisterAllExternalKey, (), (), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 609, Result, GetRightsIdByPath, (ams::sf::Out<fs::RightsId> out, const fssrv::sf::FspPath &path), (out, path), hos::Version_2_0_0, hos::Version_15_0_1) \
AMS_SF_METHOD_INFO(C, H, 610, Result, GetRightsIdAndKeyGenerationByPathObsolete, (ams::sf::Out<fs::RightsId> out, ams::sf::Out<u8> out_key_generation, const fssrv::sf::FspPath &path), (out, out_key_generation, path), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 610, Result, GetRightsIdAndKeyGenerationByPath, (ams::sf::Out<fs::RightsId> out, ams::sf::Out<u8> out_key_generation, const fssrv::sf::FspPath &path, fs::ContentAttributes attr), (out, out_key_generation, path, attr), hos::Version_16_0_0) \
AMS_SF_METHOD_INFO(C, H, 611, Result, SetCurrentPosixTimeWithTimeDifference, (s64 posix_time, s32 time_difference), (posix_time, time_difference), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 612, Result, GetFreeSpaceSizeForSaveData, (ams::sf::Out<s64> out, u8 space_id), (out, space_id), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 613, Result, VerifySaveDataFileSystemBySaveDataSpaceId, (), (), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 614, Result, CorruptSaveDataFileSystemBySaveDataSpaceId, (), (), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 615, Result, QuerySaveDataInternalStorageTotalSize, (), (), hos::Version_5_0_0) \
AMS_SF_METHOD_INFO(C, H, 616, Result, GetSaveDataCommitId, (), (), hos::Version_6_0_0) \
AMS_SF_METHOD_INFO(C, H, 617, Result, UnregisterExternalKey, (const fs::RightsId &rights_id), (rights_id), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 618, Result, GetProgramId, (ams::sf::Out<ncm::ProgramId> out, const fssrv::sf::FspPath &path, fs::ContentAttributes attr), (out, path, attr), hos::Version_17_0_0) \
AMS_SF_METHOD_INFO(C, H, 620, Result, SetSdCardEncryptionSeed, (const fs::EncryptionSeed &seed), (seed), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 630, Result, SetSdCardAccessibility, (bool accessible), (accessible), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 631, Result, IsSdCardAccessible, (ams::sf::Out<bool> out), (out), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 640, Result, IsSignedSystemPartitionOnSdCardValid, (ams::sf::Out<bool> out), (out), hos::Version_4_0_0, hos::Version_7_0_1) \
AMS_SF_METHOD_INFO(C, H, 700, Result, OpenAccessFailureDetectionEventNotifier, (), (), hos::Version_5_0_0) \
/* AMS_SF_METHOD_INFO(C, H, 701, Result, GetAccessFailureDetectionEvent, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 702, Result, IsAccessFailureDetected, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 710, Result, ResolveAccessFailure, (), (), hos::Version_5_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 720, Result, AbandonAccessFailure, (), (), hos::Version_5_0_0) */ \
AMS_SF_METHOD_INFO(C, H, 800, Result, GetAndClearErrorInfo, (ams::sf::Out<fs::FileSystemProxyErrorInfo> out), (out), hos::Version_2_0_0) \
AMS_SF_METHOD_INFO(C, H, 810, Result, RegisterProgramIndexMapInfo, (const ams::sf::InBuffer &buffer, s32 count), (buffer, count), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 1000, Result, SetBisRootForHost, (u32 id, const fssrv::sf::FspPath &path), (id, path), hos::Version_Min, hos::Version_9_2_0) \
AMS_SF_METHOD_INFO(C, H, 1001, Result, SetSaveDataSize, (s64 size, s64 journal_size), (size, journal_size)) \
AMS_SF_METHOD_INFO(C, H, 1002, Result, SetSaveDataRootPath, (const fssrv::sf::FspPath &path), (path)) \
AMS_SF_METHOD_INFO(C, H, 1003, Result, DisableAutoSaveDataCreation, (), ()) \
AMS_SF_METHOD_INFO(C, H, 1004, Result, SetGlobalAccessLogMode, (u32 mode), (mode)) \
AMS_SF_METHOD_INFO(C, H, 1005, Result, GetGlobalAccessLogMode, (ams::sf::Out<u32> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 1006, Result, OutputAccessLogToSdCard, (const ams::sf::InBuffer &buf), (buf)) \
AMS_SF_METHOD_INFO(C, H, 1007, Result, RegisterUpdatePartition, (), (), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 1008, Result, OpenRegisteredUpdatePartition, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out), (out), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 1009, Result, GetAndClearMemoryReportInfo, (ams::sf::Out<fs::MemoryReportInfo> out), (out), hos::Version_4_0_0) \
/* AMS_SF_METHOD_INFO(C, H, 1010, Result, SetDataStorageRedirectTarget, (), (), hos::Version_5_1_0, hos::Version_6_2_0) */ \
AMS_SF_METHOD_INFO(C, H, 1011, Result, GetProgramIndexForAccessLog, (ams::sf::Out<u32> out_idx, ams::sf::Out<u32> out_count), (out_idx, out_count), hos::Version_7_0_0) \
AMS_SF_METHOD_INFO(C, H, 1012, Result, GetFsStackUsage, (ams::sf::Out<u32> out, u32 type), (out, type), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 1013, Result, UnsetSaveDataRootPath, (), (), hos::Version_9_0_0) \
AMS_SF_METHOD_INFO(C, H, 1014, Result, OutputMultiProgramTagAccessLog, (), (), hos::Version_10_0_0, hos::Version_10_2_0) \
AMS_SF_METHOD_INFO(C, H, 1016, Result, FlushAccessLogOnSdCard, (), (), hos::Version_11_0_0) \
AMS_SF_METHOD_INFO(C, H, 1017, Result, OutputApplicationInfoAccessLog, (), (), hos::Version_11_0_0) \
AMS_SF_METHOD_INFO(C, H, 1018, Result, RegisterDebugConfiguration, (u32 key, s64 value), (key, value), hos::Version_13_0_0) \
AMS_SF_METHOD_INFO(C, H, 1019, Result, UnregisterDebugConfiguration, (u32 key), (key), hos::Version_13_0_0) \
AMS_SF_METHOD_INFO(C, H, 1100, Result, OverrideSaveDataTransferTokenSignVerificationKey, (const ams::sf::InBuffer &buf), (buf), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 1110, Result, CorruptSaveDataFileSystemByOffset, (u8 space_id, u64 save_data_id, s64 offset), (space_id, save_data_id, offset), hos::Version_6_0_0) \
/* AMS_SF_METHOD_INFO(C, H, 1200, Result, OpenMultiCommitManager, (), (), hos::Version_6_0_0) */ \
/* AMS_SF_METHOD_INFO(C, H, 1300, Result, OpenBisWiper, (), (), hos::Version_10_0_0) */
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFileSystemProxy, AMS_FSSRV_I_FILE_SYSTEM_PROXY_INTERFACE_INFO, 0x7DF34ED2)

View File

@@ -1,33 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifilesystem.hpp>
#include <stratosphere/fs/fs_code_verification_data.hpp>
#include <stratosphere/fs/fs_content_attributes.hpp>
/* ACCURATE_TO_VERSION: 17.5.0.0 */
#define AMS_FSSRV_I_FILE_SYSTEM_PROXY_FOR_LOADER_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenCodeFileSystemDeprecated, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const fssrv::sf::Path &path, ncm::ProgramId program_id), (out_fs, path, program_id), hos::Version_Min, hos::Version_9_2_0) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenCodeFileSystemDeprecated2, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, ncm::ProgramId program_id), (out_fs, out_verif, path, program_id), hos::Version_10_0_0, hos::Version_15_0_1) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenCodeFileSystemDeprecated3, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, ams::sf::Out<fs::CodeVerificationData> out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id), (out_fs, out_verif, path, attr, program_id), hos::Version_16_0_0, hos::Version_16_1_0) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenCodeFileSystemDeprecated4, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, const fssrv::sf::Path &path, fs::ContentAttributes attr, ncm::ProgramId program_id), (out_fs, out_verif, path, attr, program_id), hos::Version_17_0_0, hos::Version_19_0_1) \
AMS_SF_METHOD_INFO(C, H, 0, Result, OpenCodeFileSystem, (ams::sf::Out<ams::sf::SharedPointer<fssrv::sf::IFileSystem>> out_fs, const ams::sf::OutBuffer &out_verif, fs::ContentAttributes attr, ncm::ProgramId program_id, ncm::StorageId storage_id), (out_fs, out_verif, attr, program_id, storage_id), hos::Version_20_0_0) \
AMS_SF_METHOD_INFO(C, H, 1, Result, IsArchivedProgram, (ams::sf::Out<bool> out, u64 process_id), (out, process_id)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, SetCurrentProcess, (const ams::sf::ClientProcessId &client_pid), (client_pid), hos::Version_4_0_0)
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFileSystemProxyForLoader, AMS_FSSRV_I_FILE_SYSTEM_PROXY_FOR_LOADER_INTERFACE_INFO, 0xDC92EE15)

View File

@@ -1,30 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_code.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifilesystem.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_PROGRAM_REGISTRY_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, RegisterProgram, (u64 process_id, u64 program_id, u8 storage_id, const ams::sf::InBuffer &data, s64 data_size, const ams::sf::InBuffer &desc, s64 desc_size), (process_id, program_id, storage_id, data, data_size, desc, desc_size)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, UnregisterProgram, (u64 process_id), (process_id)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, SetCurrentProcess, (const ams::sf::ClientProcessId &client_pid), (client_pid)) \
AMS_SF_METHOD_INFO(C, H, 256, Result, SetEnabledProgramVerification, (bool en), (en))
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IProgramRegistry, AMS_FSSRV_I_PROGRAM_REGISTRY_INTERFACE_INFO, 0xDA73738C)

View File

@@ -1,26 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_directory.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries), (out, out_entries)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, GetEntryCount, (ams::sf::Out<s64> out), (out))
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IDirectory, AMS_FSSRV_I_DIRECTORY_INTERFACE_INFO, 0xB4953DB6)

View File

@@ -1,32 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_file.hpp>
#include <stratosphere/fs/fs_query_range.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_FILE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (ams::sf::Out<s64> out, s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size, ams::fs::ReadOption option), (out, offset, buffer, size, option)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size, ams::fs::WriteOption option), (offset, buffer, size, option)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::FileQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0) \
AMS_SF_METHOD_INFO(C, H, 6, Result, OperateRangeWithBuffer, (const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 op_id, s64 offset, s64 size), (out_buf, in_buf, op_id, offset, size), hos::Version_12_0_0)
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFile, AMS_FSSRV_I_FILE_INTERFACE_INFO, 0xF3716DA1)

View File

@@ -1,44 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_filesystem.hpp>
#include <stratosphere/fs/fs_filesystem_for_debug.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_path.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_ifile.hpp>
#include <stratosphere/fssrv/sf/fssrv_sf_idirectory.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, CreateFile, (const ams::fssrv::sf::Path &path, s64 size, s32 option), (path, size, option)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, DeleteFile, (const ams::fssrv::sf::Path &path), (path)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, CreateDirectory, (const ams::fssrv::sf::Path &path), (path)) \
AMS_SF_METHOD_INFO(C, H, 3, Result, DeleteDirectory, (const ams::fssrv::sf::Path &path), (path)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, DeleteDirectoryRecursively, (const ams::fssrv::sf::Path &path), (path)) \
AMS_SF_METHOD_INFO(C, H, 5, Result, RenameFile, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path), (old_path, new_path)) \
AMS_SF_METHOD_INFO(C, H, 6, Result, RenameDirectory, (const ams::fssrv::sf::Path &old_path, const ams::fssrv::sf::Path &new_path), (old_path, new_path)) \
AMS_SF_METHOD_INFO(C, H, 7, Result, GetEntryType, (ams::sf::Out<u32> out, const ams::fssrv::sf::Path &path), (out, path)) \
AMS_SF_METHOD_INFO(C, H, 8, Result, OpenFile, (ams::sf::Out<ams::sf::SharedPointer<ams::fssrv::sf::IFile>> out, const ams::fssrv::sf::Path &path, u32 mode), (out, path, mode)) \
AMS_SF_METHOD_INFO(C, H, 9, Result, OpenDirectory, (ams::sf::Out<ams::sf::SharedPointer<ams::fssrv::sf::IDirectory>> out, const ams::fssrv::sf::Path &path, u32 mode), (out, path, mode)) \
AMS_SF_METHOD_INFO(C, H, 10, Result, Commit, (), ()) \
AMS_SF_METHOD_INFO(C, H, 11, Result, GetFreeSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path), (out, path)) \
AMS_SF_METHOD_INFO(C, H, 12, Result, GetTotalSpaceSize, (ams::sf::Out<s64> out, const ams::fssrv::sf::Path &path), (out, path)) \
AMS_SF_METHOD_INFO(C, H, 13, Result, CleanDirectoryRecursively, (const ams::fssrv::sf::Path &path), (path), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 14, Result, GetFileTimeStampRaw, (ams::sf::Out<ams::fs::FileTimeStampRaw> out, const ams::fssrv::sf::Path &path), (out, path), hos::Version_3_0_0) \
AMS_SF_METHOD_INFO(C, H, 15, Result, QueryEntry, (const ams::sf::OutNonSecureBuffer &out_buf, const ams::sf::InNonSecureBuffer &in_buf, s32 query_id, const ams::fssrv::sf::Path &path), (out_buf, in_buf, query_id, path), hos::Version_4_0_0)
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IFileSystem, AMS_FSSRV_I_FILESYSTEM_INTERFACE_INFO, 0xD4EA59E7)

View File

@@ -1,31 +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 <vapours.hpp>
#include <stratosphere/sf.hpp>
#include <stratosphere/fs/fs_file.hpp>
#include <stratosphere/fs/fs_query_range.hpp>
/* ACCURATE_TO_VERSION: 13.4.0.0 */
#define AMS_FSSRV_I_STORAGE_INTERFACE_INFO(C, H) \
AMS_SF_METHOD_INFO(C, H, 0, Result, Read, (s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size), (offset, buffer, size)) \
AMS_SF_METHOD_INFO(C, H, 1, Result, Write, (s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size), (offset, buffer, size)) \
AMS_SF_METHOD_INFO(C, H, 2, Result, Flush, (), ()) \
AMS_SF_METHOD_INFO(C, H, 3, Result, SetSize, (s64 size), (size)) \
AMS_SF_METHOD_INFO(C, H, 4, Result, GetSize, (ams::sf::Out<s64> out), (out)) \
AMS_SF_METHOD_INFO(C, H, 5, Result, OperateRange, (ams::sf::Out<ams::fs::StorageQueryRangeInfo> out, s32 op_id, s64 offset, s64 size), (out, op_id, offset, size), hos::Version_4_0_0)
AMS_SF_DEFINE_INTERFACE(ams::fssrv::sf, IStorage, AMS_FSSRV_I_STORAGE_INTERFACE_INFO, 0xC4D2CAEB)

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/fs_directory.hpp>
#include <stratosphere/sf/sf_buffer_tags.hpp>
namespace ams::fssrv::sf {
/* ACCURATE_TO_VERSION: 13.4.0.0 */
struct Path : public ams::sf::LargeData {
char str[fs::EntryNameLengthMax + 1];
static constexpr Path Encode(const char *p) {
Path path = {};
for (size_t i = 0; i < sizeof(path) - 1; i++) {
path.str[i] = p[i];
if (p[i] == '\x00') {
break;
}
}
return path;
}
static constexpr size_t GetPathLength(const Path &path) {
size_t len = 0;
for (size_t i = 0; i < sizeof(path) - 1 && path.str[i] != '\x00'; i++) {
len++;
}
return len;
}
};
static_assert(util::is_pod<Path>::value);
#if defined(ATMOSPHERE_OS_HORIZON)
static_assert(sizeof(Path) == FS_MAX_PATH);
#endif
using FspPath = Path;
}