mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -04:00
ams: globally prefer R_RETURN to return for ams::Result
This commit is contained in:
parent
dd78ede99f
commit
bbf22b4c60
325 changed files with 1955 additions and 1993 deletions
|
@ -113,12 +113,12 @@ namespace ams::ddsf {
|
|||
|
||||
template<typename F>
|
||||
Result ForEachSession(F f, bool return_on_fail) {
|
||||
return impl::ForEach(m_session_list_lock, m_session_list, f, return_on_fail);
|
||||
R_RETURN(impl::ForEach(m_session_list_lock, m_session_list, f, return_on_fail));
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
Result ForEachSession(F f, bool return_on_fail) const {
|
||||
return impl::ForEach(m_session_list_lock, m_session_list, f, return_on_fail);
|
||||
R_RETURN(impl::ForEach(m_session_list_lock, m_session_list, f, return_on_fail));
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
|
|
|
@ -76,12 +76,12 @@ namespace ams::ddsf {
|
|||
|
||||
template<typename F>
|
||||
Result ForEachDevice(F f, bool return_on_fail) {
|
||||
return impl::ForEach(m_device_list_lock, m_device_list, f, return_on_fail);
|
||||
R_RETURN(impl::ForEach(m_device_list_lock, m_device_list, f, return_on_fail));
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
Result ForEachDevice(F f, bool return_on_fail) const {
|
||||
return impl::ForEach(m_device_list_lock, m_device_list, f, return_on_fail);
|
||||
R_RETURN(impl::ForEach(m_device_list_lock, m_device_list, f, return_on_fail));
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
|
|
|
@ -26,13 +26,13 @@ namespace ams::ddsf::impl {
|
|||
for (auto && it : list) {
|
||||
if (const auto cur_result = f(std::addressof(it)); R_FAILED(cur_result)) {
|
||||
if (return_on_fail) {
|
||||
return cur_result;
|
||||
R_RETURN(cur_result);
|
||||
} else if (R_SUCCEEDED(result)) {
|
||||
result = cur_result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
template<typename List, typename F, typename Lock>
|
||||
|
|
|
@ -81,23 +81,23 @@ namespace ams::fs {
|
|||
using Base = KeyValueRomStorageTemplate<ImplKeyType, ValueType, MaxKeyLength>;
|
||||
public:
|
||||
Result Add(Position *out, const ClientKeyType &key, const Value &value) {
|
||||
return Base::AddInternal(out, key.key, key.Hash(), key.name.path, key.name.length * sizeof(RomPathChar), value);
|
||||
R_RETURN(Base::AddInternal(out, key.key, key.Hash(), key.name.path, key.name.length * sizeof(RomPathChar), value));
|
||||
}
|
||||
|
||||
Result Get(Position *out_pos, Value *out_val, const ClientKeyType &key) {
|
||||
return Base::GetInternal(out_pos, out_val, key.key, key.Hash(), key.name.path, key.name.length * sizeof(RomPathChar));
|
||||
R_RETURN(Base::GetInternal(out_pos, out_val, key.key, key.Hash(), key.name.path, key.name.length * sizeof(RomPathChar)));
|
||||
}
|
||||
|
||||
Result GetByPosition(ImplKey *out_key, Value *out_val, Position pos) {
|
||||
return Base::GetByPosition(out_key, out_val, pos);
|
||||
R_RETURN(Base::GetByPosition(out_key, out_val, pos));
|
||||
}
|
||||
|
||||
Result GetByPosition(ImplKey *out_key, Value *out_val, void *out_aux, size_t *out_aux_size, Position pos) {
|
||||
return Base::GetByPosition(out_key, out_val, out_aux, out_aux_size, pos);
|
||||
R_RETURN(Base::GetByPosition(out_key, out_val, out_aux, out_aux_size, pos));
|
||||
}
|
||||
|
||||
Result SetByPosition(Position pos, const Value &value) {
|
||||
return Base::SetByPosition(pos, value);
|
||||
R_RETURN(Base::SetByPosition(pos, value));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace ams::fs {
|
|||
Element elem;
|
||||
R_TRY(this->ReadKeyValue(std::addressof(elem), pos));
|
||||
elem.value = value;
|
||||
return this->WriteKeyValue(std::addressof(elem), pos, nullptr, 0);
|
||||
R_RETURN(this->WriteKeyValue(std::addressof(elem), pos, nullptr, 0));
|
||||
}
|
||||
private:
|
||||
BucketIndex HashToBucket(u32 hash_key) const {
|
||||
|
@ -259,14 +259,14 @@ namespace ams::fs {
|
|||
AMS_ASSERT(ind < m_bucket_count);
|
||||
|
||||
const s64 offset = ind * sizeof(Position);
|
||||
return m_bucket_storage.Read(offset, out, sizeof(*out));
|
||||
R_RETURN(m_bucket_storage.Read(offset, out, sizeof(*out)));
|
||||
}
|
||||
|
||||
Result WriteBucket(Position pos, BucketIndex ind) {
|
||||
AMS_ASSERT(ind < m_bucket_count);
|
||||
|
||||
const s64 offset = ind * sizeof(Position);
|
||||
return m_bucket_storage.Write(offset, std::addressof(pos), sizeof(pos));
|
||||
R_RETURN(m_bucket_storage.Write(offset, std::addressof(pos), sizeof(pos)));
|
||||
}
|
||||
|
||||
Result ReadKeyValue(Element *out, Position pos) {
|
||||
|
@ -276,7 +276,7 @@ namespace ams::fs {
|
|||
R_TRY(m_kv_storage.GetSize(std::addressof(kv_size)));
|
||||
AMS_ASSERT(pos < kv_size);
|
||||
|
||||
return m_kv_storage.Read(pos, out, sizeof(*out));
|
||||
R_RETURN(m_kv_storage.Read(pos, out, sizeof(*out)));
|
||||
}
|
||||
|
||||
Result ReadKeyValue(Element *out, void *out_aux, size_t *out_aux_size, Position pos) {
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace ams::fs {
|
|||
|
||||
Result BindEvent(os::SystemEventType *out, os::EventClearMode clear_mode) {
|
||||
AMS_ASSERT(out != nullptr);
|
||||
return this->DoBindEvent(out, clear_mode);
|
||||
R_RETURN(this->DoBindEvent(out, clear_mode));
|
||||
}
|
||||
private:
|
||||
virtual Result DoBindEvent(os::SystemEventType *out, os::EventClearMode clear_mode) = 0;
|
||||
|
|
|
@ -95,19 +95,19 @@ namespace ams::fs {
|
|||
virtual ~ReadOnlyStorageAdapter() { /* ... */ }
|
||||
public:
|
||||
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
||||
return m_storage->Read(offset, buffer, size);
|
||||
R_RETURN(m_storage->Read(offset, buffer, size));
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
return m_storage->Flush();
|
||||
R_RETURN(m_storage->Flush());
|
||||
}
|
||||
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
return m_storage->GetSize(out);
|
||||
R_RETURN(m_storage->GetSize(out));
|
||||
}
|
||||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
return m_storage->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
|
||||
R_RETURN(m_storage->OperateRange(dst, dst_size, op_id, offset, size, src, src_size));
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace ams::fs {
|
|||
/* Check the path is valid. */
|
||||
R_UNLESS(path != nullptr, fs::ResultNullptrArgument());
|
||||
|
||||
return this->Initialize(path, std::strlen(path));
|
||||
R_RETURN(this->Initialize(path, std::strlen(path)));
|
||||
}
|
||||
|
||||
Result InitializeWithFormat(const char *fmt, ...) __attribute__((format (printf, 2, 3))) {
|
||||
|
|
|
@ -619,7 +619,7 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
static constexpr ALWAYS_INLINE Result SkipMountName(const char **out, size_t *out_len, const char *path) {
|
||||
return ParseMountName(out, out_len, nullptr, 0, path);
|
||||
R_RETURN(ParseMountName(out, out_len, nullptr, 0, path));
|
||||
}
|
||||
|
||||
static constexpr Result ParseMountName(const char **out, size_t *out_len, char *out_mount_name, size_t out_mount_name_buffer_size, const char *path) {
|
||||
|
@ -684,7 +684,7 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
static constexpr ALWAYS_INLINE Result SkipRelativeDotPath(const char **out, size_t *out_len, const char *path) {
|
||||
return ParseRelativeDotPath(out, out_len, nullptr, 0, path);
|
||||
R_RETURN(ParseRelativeDotPath(out, out_len, nullptr, 0, path));
|
||||
}
|
||||
|
||||
static constexpr Result ParseRelativeDotPath(const char **out, size_t *out_len, char *out_relative, size_t out_relative_buffer_size, const char *path) {
|
||||
|
|
|
@ -36,11 +36,11 @@ namespace ams::fs {
|
|||
virtual ~ReadOnlyFile() { /* ... */ }
|
||||
private:
|
||||
virtual Result DoRead(size_t *out, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) override final {
|
||||
return m_base_file->Read(out, offset, buffer, size, option);
|
||||
R_RETURN(m_base_file->Read(out, offset, buffer, size, option));
|
||||
}
|
||||
|
||||
virtual Result DoGetSize(s64 *out) override final {
|
||||
return m_base_file->GetSize(out);
|
||||
R_RETURN(m_base_file->GetSize(out));
|
||||
}
|
||||
|
||||
virtual Result DoFlush() override final {
|
||||
|
@ -66,7 +66,7 @@ namespace ams::fs {
|
|||
switch (op_id) {
|
||||
case OperationId::Invalidate:
|
||||
case OperationId::QueryRange:
|
||||
return m_base_file->OperateRange(dst, dst_size, op_id, offset, size, src, src_size);
|
||||
R_RETURN(m_base_file->OperateRange(dst, dst_size, op_id, offset, size, src, src_size));
|
||||
default:
|
||||
R_THROW(fs::ResultUnsupportedOperateRangeForReadOnlyFile());
|
||||
}
|
||||
|
@ -104,11 +104,11 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
virtual Result DoOpenDirectory(std::unique_ptr<fsa::IDirectory> *out_dir, const fs::Path &path, OpenDirectoryMode mode) override final {
|
||||
return m_base_fs->OpenDirectory(out_dir, path, mode);
|
||||
R_RETURN(m_base_fs->OpenDirectory(out_dir, path, mode));
|
||||
}
|
||||
|
||||
virtual Result DoGetEntryType(DirectoryEntryType *out, const fs::Path &path) override final {
|
||||
return m_base_fs->GetEntryType(out, path);
|
||||
R_RETURN(m_base_fs->GetEntryType(out, path));
|
||||
}
|
||||
|
||||
virtual Result DoCommit() override final {
|
||||
|
|
|
@ -35,23 +35,23 @@ namespace ams::fs {
|
|||
virtual ~RemoteFile() { fsFileClose(std::addressof(m_base_file)); }
|
||||
public:
|
||||
virtual Result DoRead(size_t *out, s64 offset, void *buffer, size_t size, const fs::ReadOption &option) override final {
|
||||
return fsFileRead(std::addressof(m_base_file), offset, buffer, size, option._value, out);
|
||||
R_RETURN(fsFileRead(std::addressof(m_base_file), offset, buffer, size, option._value, out));
|
||||
}
|
||||
|
||||
virtual Result DoGetSize(s64 *out) override final {
|
||||
return fsFileGetSize(std::addressof(m_base_file), out);
|
||||
R_RETURN(fsFileGetSize(std::addressof(m_base_file), out));
|
||||
}
|
||||
|
||||
virtual Result DoFlush() override final {
|
||||
return fsFileFlush(std::addressof(m_base_file));
|
||||
R_RETURN(fsFileFlush(std::addressof(m_base_file)));
|
||||
}
|
||||
|
||||
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override final {
|
||||
return fsFileWrite(std::addressof(m_base_file), offset, buffer, size, option._value);
|
||||
R_RETURN(fsFileWrite(std::addressof(m_base_file), offset, buffer, size, option._value));
|
||||
}
|
||||
|
||||
virtual Result DoSetSize(s64 size) override final {
|
||||
return fsFileSetSize(std::addressof(m_base_file), size);
|
||||
R_RETURN(fsFileSetSize(std::addressof(m_base_file), size));
|
||||
}
|
||||
|
||||
virtual Result DoOperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override final {
|
||||
|
@ -60,7 +60,7 @@ namespace ams::fs {
|
|||
R_UNLESS(op_id == OperationId::QueryRange, fs::ResultUnsupportedOperateRangeForFileServiceObjectAdapter());
|
||||
R_UNLESS(dst_size == sizeof(FileQueryRangeInfo), fs::ResultInvalidSize());
|
||||
|
||||
return fsFileOperateRange(std::addressof(m_base_file), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(dst));
|
||||
R_RETURN(fsFileOperateRange(std::addressof(m_base_file), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(dst)));
|
||||
}
|
||||
public:
|
||||
virtual sf::cmif::DomainObjectId GetDomainObjectId() const override final {
|
||||
|
@ -80,11 +80,11 @@ namespace ams::fs {
|
|||
public:
|
||||
virtual Result DoRead(s64 *out_count, DirectoryEntry *out_entries, s64 max_entries) override final {
|
||||
static_assert(sizeof(*out_entries) == sizeof(::FsDirectoryEntry));
|
||||
return fsDirRead(std::addressof(m_base_dir), out_count, max_entries, reinterpret_cast<::FsDirectoryEntry *>(out_entries));
|
||||
R_RETURN(fsDirRead(std::addressof(m_base_dir), out_count, max_entries, reinterpret_cast<::FsDirectoryEntry *>(out_entries)));
|
||||
}
|
||||
|
||||
virtual Result DoGetEntryCount(s64 *out) override final {
|
||||
return fsDirGetEntryCount(std::addressof(m_base_dir), out);
|
||||
R_RETURN(fsDirGetEntryCount(std::addressof(m_base_dir), out));
|
||||
}
|
||||
public:
|
||||
virtual sf::cmif::DomainObjectId GetDomainObjectId() const override final {
|
||||
|
@ -119,31 +119,31 @@ namespace ams::fs {
|
|||
virtual Result DoCreateFile(const fs::Path &path, s64 size, int flags) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsCreateFile(std::addressof(m_base_fs), sf_path.str, size, flags);
|
||||
R_RETURN(fsFsCreateFile(std::addressof(m_base_fs), sf_path.str, size, flags));
|
||||
}
|
||||
|
||||
virtual Result DoDeleteFile(const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsDeleteFile(std::addressof(m_base_fs), sf_path.str);
|
||||
R_RETURN(fsFsDeleteFile(std::addressof(m_base_fs), sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoCreateDirectory(const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsCreateDirectory(std::addressof(m_base_fs), sf_path.str);
|
||||
R_RETURN(fsFsCreateDirectory(std::addressof(m_base_fs), sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoDeleteDirectory(const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsDeleteDirectory(std::addressof(m_base_fs), sf_path.str);
|
||||
R_RETURN(fsFsDeleteDirectory(std::addressof(m_base_fs), sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoDeleteDirectoryRecursively(const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsDeleteDirectoryRecursively(std::addressof(m_base_fs), sf_path.str);
|
||||
R_RETURN(fsFsDeleteDirectoryRecursively(std::addressof(m_base_fs), sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoRenameFile(const fs::Path &old_path, const fs::Path &new_path) override final {
|
||||
|
@ -151,7 +151,7 @@ namespace ams::fs {
|
|||
fssrv::sf::Path new_sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(old_sf_path), old_path));
|
||||
R_TRY(GetPathForServiceObject(std::addressof(new_sf_path), new_path));
|
||||
return fsFsRenameFile(std::addressof(m_base_fs), old_sf_path.str, new_sf_path.str);
|
||||
R_RETURN(fsFsRenameFile(std::addressof(m_base_fs), old_sf_path.str, new_sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoRenameDirectory(const fs::Path &old_path, const fs::Path &new_path) override final {
|
||||
|
@ -159,7 +159,7 @@ namespace ams::fs {
|
|||
fssrv::sf::Path new_sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(old_sf_path), old_path));
|
||||
R_TRY(GetPathForServiceObject(std::addressof(new_sf_path), new_path));
|
||||
return fsFsRenameDirectory(std::addressof(m_base_fs), old_sf_path.str, new_sf_path.str);
|
||||
R_RETURN(fsFsRenameDirectory(std::addressof(m_base_fs), old_sf_path.str, new_sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoGetEntryType(DirectoryEntryType *out, const fs::Path &path) override final {
|
||||
|
@ -167,7 +167,7 @@ namespace ams::fs {
|
|||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
|
||||
static_assert(sizeof(::FsDirEntryType) == sizeof(DirectoryEntryType));
|
||||
return fsFsGetEntryType(std::addressof(m_base_fs), sf_path.str, reinterpret_cast<::FsDirEntryType *>(out));
|
||||
R_RETURN(fsFsGetEntryType(std::addressof(m_base_fs), sf_path.str, reinterpret_cast<::FsDirEntryType *>(out)));
|
||||
}
|
||||
|
||||
virtual Result DoOpenFile(std::unique_ptr<fsa::IFile> *out_file, const fs::Path &path, OpenMode mode) override final {
|
||||
|
@ -199,38 +199,38 @@ namespace ams::fs {
|
|||
}
|
||||
|
||||
virtual Result DoCommit() override final {
|
||||
return fsFsCommit(std::addressof(m_base_fs));
|
||||
R_RETURN(fsFsCommit(std::addressof(m_base_fs)));
|
||||
}
|
||||
|
||||
virtual Result DoGetFreeSpaceSize(s64 *out, const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsGetFreeSpace(std::addressof(m_base_fs), sf_path.str, out);
|
||||
R_RETURN(fsFsGetFreeSpace(std::addressof(m_base_fs), sf_path.str, out));
|
||||
}
|
||||
|
||||
virtual Result DoGetTotalSpaceSize(s64 *out, const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsGetTotalSpace(std::addressof(m_base_fs), sf_path.str, out);
|
||||
R_RETURN(fsFsGetTotalSpace(std::addressof(m_base_fs), sf_path.str, out));
|
||||
}
|
||||
|
||||
virtual Result DoCleanDirectoryRecursively(const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsCleanDirectoryRecursively(std::addressof(m_base_fs), sf_path.str);
|
||||
R_RETURN(fsFsCleanDirectoryRecursively(std::addressof(m_base_fs), sf_path.str));
|
||||
}
|
||||
|
||||
virtual Result DoGetFileTimeStampRaw(FileTimeStampRaw *out, const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
static_assert(sizeof(FileTimeStampRaw) == sizeof(::FsTimeStampRaw));
|
||||
return fsFsGetFileTimeStampRaw(std::addressof(m_base_fs), sf_path.str, reinterpret_cast<::FsTimeStampRaw *>(out));
|
||||
R_RETURN(fsFsGetFileTimeStampRaw(std::addressof(m_base_fs), sf_path.str, reinterpret_cast<::FsTimeStampRaw *>(out)));
|
||||
}
|
||||
|
||||
virtual Result DoQueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, fsa::QueryId query, const fs::Path &path) override final {
|
||||
fssrv::sf::Path sf_path;
|
||||
R_TRY(GetPathForServiceObject(std::addressof(sf_path), path));
|
||||
return fsFsQueryEntry(std::addressof(m_base_fs), dst, dst_size, src, src_size, sf_path.str, static_cast<FsFileSystemQueryId>(query));
|
||||
R_RETURN(fsFsQueryEntry(std::addressof(m_base_fs), dst, dst_size, src, src_size, sf_path.str, static_cast<FsFileSystemQueryId>(query)));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -32,23 +32,23 @@ namespace ams::fs {
|
|||
virtual ~RemoteStorage() { fsStorageClose(std::addressof(m_base_storage)); }
|
||||
public:
|
||||
virtual Result Read(s64 offset, void *buffer, size_t size) override {
|
||||
return fsStorageRead(std::addressof(m_base_storage), offset, buffer, size);
|
||||
R_RETURN(fsStorageRead(std::addressof(m_base_storage), offset, buffer, size));
|
||||
};
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
return fsStorageWrite(std::addressof(m_base_storage), offset, buffer, size);
|
||||
R_RETURN(fsStorageWrite(std::addressof(m_base_storage), offset, buffer, size));
|
||||
};
|
||||
|
||||
virtual Result Flush() override {
|
||||
return fsStorageFlush(std::addressof(m_base_storage));
|
||||
R_RETURN(fsStorageFlush(std::addressof(m_base_storage)));
|
||||
};
|
||||
|
||||
virtual Result GetSize(s64 *out_size) override {
|
||||
return fsStorageGetSize(std::addressof(m_base_storage), out_size);
|
||||
R_RETURN(fsStorageGetSize(std::addressof(m_base_storage), out_size));
|
||||
};
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
return fsStorageSetSize(std::addressof(m_base_storage), size);
|
||||
R_RETURN(fsStorageSetSize(std::addressof(m_base_storage), size));
|
||||
};
|
||||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace ams::fs {
|
|||
/* Validate arguments and read. */
|
||||
R_UNLESS(buffer != nullptr, fs::ResultNullptrArgument());
|
||||
R_TRY(IStorage::CheckAccessRange(offset, size, m_size));
|
||||
return m_base_storage->Read(m_offset + offset, buffer, size);
|
||||
R_RETURN(m_base_storage->Read(m_offset + offset, buffer, size));
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override{
|
||||
|
@ -97,12 +97,12 @@ namespace ams::fs {
|
|||
/* Validate arguments and write. */
|
||||
R_UNLESS(buffer != nullptr, fs::ResultNullptrArgument());
|
||||
R_TRY(IStorage::CheckAccessRange(offset, size, m_size));
|
||||
return m_base_storage->Write(m_offset + offset, buffer, size);
|
||||
R_RETURN(m_base_storage->Write(m_offset + offset, buffer, size));
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
R_UNLESS(this->IsValid(), fs::ResultNotInitialized());
|
||||
return m_base_storage->Flush();
|
||||
R_RETURN(m_base_storage->Flush());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
|
|
|
@ -135,28 +135,28 @@ namespace ams::fssrv::impl {
|
|||
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) {
|
||||
return fsFileRead(std::addressof(m_base_file), offset, buffer.GetPointer(), size, option._value, reinterpret_cast<u64 *>(out.GetPointer()));
|
||||
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) {
|
||||
return fsFileWrite(std::addressof(m_base_file), offset, buffer.GetPointer(), size, option._value);
|
||||
R_RETURN(fsFileWrite(std::addressof(m_base_file), offset, buffer.GetPointer(), size, option._value));
|
||||
}
|
||||
|
||||
Result Flush(){
|
||||
return fsFileFlush(std::addressof(m_base_file));
|
||||
R_RETURN(fsFileFlush(std::addressof(m_base_file)));
|
||||
}
|
||||
|
||||
Result SetSize(s64 size) {
|
||||
return fsFileSetSize(std::addressof(m_base_file), size);
|
||||
R_RETURN(fsFileSetSize(std::addressof(m_base_file), size));
|
||||
}
|
||||
|
||||
Result GetSize(ams::sf::Out<s64> out) {
|
||||
return fsFileGetSize(std::addressof(m_base_file), out.GetPointer());
|
||||
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));
|
||||
return fsFileOperateRange(std::addressof(m_base_file), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(out.GetPointer()));
|
||||
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) {
|
||||
|
@ -178,11 +178,11 @@ namespace ams::fssrv::impl {
|
|||
public:
|
||||
Result Read(ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries) {
|
||||
static_assert(sizeof(::FsDirectoryEntry) == sizeof(fs::DirectoryEntry));
|
||||
return fsDirRead(std::addressof(m_base_dir), out.GetPointer(), out_entries.GetSize() / sizeof(fs::DirectoryEntry), reinterpret_cast<::FsDirectoryEntry *>(out_entries.GetPointer()));
|
||||
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) {
|
||||
return fsDirGetEntryCount(std::addressof(m_base_dir), out.GetPointer());
|
||||
R_RETURN(fsDirGetEntryCount(std::addressof(m_base_dir), out.GetPointer()));
|
||||
}
|
||||
};
|
||||
static_assert(fssrv::sf::IsIDirectory<RemoteDirectory>);
|
||||
|
@ -199,61 +199,61 @@ namespace ams::fssrv::impl {
|
|||
public:
|
||||
/* Command API. */
|
||||
Result CreateFile(const fssrv::sf::Path &path, s64 size, s32 option) {
|
||||
return fsFsCreateFile(std::addressof(m_base_fs), path.str, size, option);
|
||||
R_RETURN(fsFsCreateFile(std::addressof(m_base_fs), path.str, size, option));
|
||||
}
|
||||
|
||||
Result DeleteFile(const fssrv::sf::Path &path) {
|
||||
return fsFsDeleteFile(std::addressof(m_base_fs), path.str);
|
||||
R_RETURN(fsFsDeleteFile(std::addressof(m_base_fs), path.str));
|
||||
}
|
||||
|
||||
Result CreateDirectory(const fssrv::sf::Path &path) {
|
||||
return fsFsCreateDirectory(std::addressof(m_base_fs), path.str);
|
||||
R_RETURN(fsFsCreateDirectory(std::addressof(m_base_fs), path.str));
|
||||
}
|
||||
|
||||
Result DeleteDirectory(const fssrv::sf::Path &path) {
|
||||
return fsFsDeleteDirectory(std::addressof(m_base_fs), path.str);
|
||||
R_RETURN(fsFsDeleteDirectory(std::addressof(m_base_fs), path.str));
|
||||
}
|
||||
|
||||
Result DeleteDirectoryRecursively(const fssrv::sf::Path &path) {
|
||||
return fsFsDeleteDirectoryRecursively(std::addressof(m_base_fs), path.str);
|
||||
R_RETURN(fsFsDeleteDirectoryRecursively(std::addressof(m_base_fs), path.str));
|
||||
}
|
||||
|
||||
Result RenameFile(const fssrv::sf::Path &old_path, const fssrv::sf::Path &new_path) {
|
||||
return fsFsRenameFile(std::addressof(m_base_fs), old_path.str, new_path.str);
|
||||
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) {
|
||||
return fsFsRenameDirectory(std::addressof(m_base_fs), old_path.str, new_path.str);
|
||||
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));
|
||||
return fsFsGetEntryType(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsDirEntryType *>(out.GetPointer()));
|
||||
R_RETURN(fsFsGetEntryType(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsDirEntryType *>(out.GetPointer())));
|
||||
}
|
||||
|
||||
Result Commit() {
|
||||
return fsFsCommit(std::addressof(m_base_fs));
|
||||
R_RETURN(fsFsCommit(std::addressof(m_base_fs)));
|
||||
}
|
||||
|
||||
Result GetFreeSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path) {
|
||||
return fsFsGetFreeSpace(std::addressof(m_base_fs), path.str, out.GetPointer());
|
||||
R_RETURN(fsFsGetFreeSpace(std::addressof(m_base_fs), path.str, out.GetPointer()));
|
||||
}
|
||||
|
||||
Result GetTotalSpaceSize(ams::sf::Out<s64> out, const fssrv::sf::Path &path) {
|
||||
return fsFsGetTotalSpace(std::addressof(m_base_fs), path.str, out.GetPointer());
|
||||
R_RETURN(fsFsGetTotalSpace(std::addressof(m_base_fs), path.str, out.GetPointer()));
|
||||
}
|
||||
|
||||
Result CleanDirectoryRecursively(const fssrv::sf::Path &path) {
|
||||
return fsFsCleanDirectoryRecursively(std::addressof(m_base_fs), path.str);
|
||||
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));
|
||||
return fsFsGetFileTimeStampRaw(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsTimeStampRaw *>(out.GetPointer()));
|
||||
R_RETURN(fsFsGetFileTimeStampRaw(std::addressof(m_base_fs), path.str, reinterpret_cast<::FsTimeStampRaw *>(out.GetPointer())));
|
||||
}
|
||||
|
||||
Result QueryEntry(const ams::sf::OutBuffer &out_buf, const ams::sf::InBuffer &in_buf, s32 query_id, const fssrv::sf::Path &path) {
|
||||
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));
|
||||
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);
|
||||
|
|
|
@ -57,28 +57,28 @@ namespace ams::fssrv::impl {
|
|||
virtual ~RemoteStorage() { fsStorageClose(std::addressof(m_base_storage)); }
|
||||
public:
|
||||
Result Read(s64 offset, const ams::sf::OutNonSecureBuffer &buffer, s64 size) {
|
||||
return fsStorageRead(std::addressof(m_base_storage), offset, buffer.GetPointer(), size);
|
||||
R_RETURN(fsStorageRead(std::addressof(m_base_storage), offset, buffer.GetPointer(), size));
|
||||
}
|
||||
|
||||
Result Write(s64 offset, const ams::sf::InNonSecureBuffer &buffer, s64 size) {
|
||||
return fsStorageWrite(std::addressof(m_base_storage), offset, buffer.GetPointer(), size);
|
||||
R_RETURN(fsStorageWrite(std::addressof(m_base_storage), offset, buffer.GetPointer(), size));
|
||||
}
|
||||
|
||||
Result Flush(){
|
||||
return fsStorageFlush(std::addressof(m_base_storage));
|
||||
R_RETURN(fsStorageFlush(std::addressof(m_base_storage)));
|
||||
}
|
||||
|
||||
Result SetSize(s64 size) {
|
||||
return fsStorageSetSize(std::addressof(m_base_storage), size);
|
||||
R_RETURN(fsStorageSetSize(std::addressof(m_base_storage), size));
|
||||
}
|
||||
|
||||
Result GetSize(ams::sf::Out<s64> out) {
|
||||
return fsStorageGetSize(std::addressof(m_base_storage), out.GetPointer());
|
||||
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));
|
||||
return fsStorageOperateRange(std::addressof(m_base_storage), static_cast<::FsOperationId>(op_id), offset, size, reinterpret_cast<::FsRangeInfo *>(out.GetPointer()));
|
||||
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>);
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace ams::fssystem {
|
|||
Result Initialize(uintptr_t address, size_t size, size_t block_size, s32 order_max);
|
||||
|
||||
Result Initialize(uintptr_t address, size_t size, size_t block_size) {
|
||||
return this->Initialize(address, size, block_size, QueryOrderMax(size, block_size));
|
||||
R_RETURN(this->Initialize(address, size, block_size, QueryOrderMax(size, block_size)));
|
||||
}
|
||||
|
||||
Result Initialize(uintptr_t address, size_t size, size_t block_size, s32 order_max, void *work, size_t work_size) {
|
||||
|
@ -103,11 +103,11 @@ namespace ams::fssystem {
|
|||
|
||||
const auto aligned_work = util::AlignUp(reinterpret_cast<uintptr_t>(work), alignof(PageList));
|
||||
m_external_free_lists = reinterpret_cast<PageList *>(aligned_work);
|
||||
return this->Initialize(address, size, block_size, order_max);
|
||||
R_RETURN(this->Initialize(address, size, block_size, order_max));
|
||||
}
|
||||
|
||||
Result Initialize(uintptr_t address, size_t size, size_t block_size, void *work, size_t work_size) {
|
||||
return this->Initialize(address, size, block_size, QueryOrderMax(size, block_size), work, work_size);
|
||||
R_RETURN(this->Initialize(address, size, block_size, QueryOrderMax(size, block_size), work, work_size));
|
||||
}
|
||||
|
||||
void Finalize();
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace ams::fssystem {
|
|||
R_TRY(this->GetSize(std::addressof(bs_size)));
|
||||
R_TRY(fs::IStorage::CheckAccessRange(offset, size, bs_size));
|
||||
|
||||
return AlignmentMatchingStorageImpl::Read(m_base_storage, work_buf, sizeof(work_buf), DataAlign, BufferAlign, offset, static_cast<char *>(buffer), size);
|
||||
R_RETURN(AlignmentMatchingStorageImpl::Read(m_base_storage, work_buf, sizeof(work_buf), DataAlign, BufferAlign, offset, static_cast<char *>(buffer), size));
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
|
@ -82,16 +82,16 @@ namespace ams::fssystem {
|
|||
R_TRY(this->GetSize(std::addressof(bs_size)));
|
||||
R_TRY(fs::IStorage::CheckAccessRange(offset, size, bs_size));
|
||||
|
||||
return AlignmentMatchingStorageImpl::Write(m_base_storage, work_buf, sizeof(work_buf), DataAlign, BufferAlign, offset, static_cast<const char *>(buffer), size);
|
||||
R_RETURN(AlignmentMatchingStorageImpl::Write(m_base_storage, work_buf, sizeof(work_buf), DataAlign, BufferAlign, offset, static_cast<const char *>(buffer), size));
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
return m_base_storage->Flush();
|
||||
R_RETURN(m_base_storage->Flush());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
ON_SCOPE_EXIT { m_is_base_storage_size_dirty = true; };
|
||||
return m_base_storage->SetSize(util::AlignUp(size, DataAlign));
|
||||
R_RETURN(m_base_storage->SetSize(util::AlignUp(size, DataAlign)));
|
||||
}
|
||||
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
|
@ -111,7 +111,7 @@ namespace ams::fssystem {
|
|||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
if (op_id == fs::OperationId::Invalidate) {
|
||||
return m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size);
|
||||
R_RETURN(m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size));
|
||||
} else {
|
||||
/* Succeed if zero size. */
|
||||
R_SUCCEED_IF(size == 0);
|
||||
|
@ -127,7 +127,7 @@ namespace ams::fssystem {
|
|||
const auto aligned_offset_end = util::AlignUp(offset + valid_size, DataAlign);
|
||||
const auto aligned_size = aligned_offset_end - aligned_offset;
|
||||
|
||||
return m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size);
|
||||
R_RETURN(m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,7 +166,7 @@ namespace ams::fssystem {
|
|||
PooledBuffer pooled_buffer;
|
||||
pooled_buffer.AllocateParticularlyLarge(m_data_align, m_data_align);
|
||||
|
||||
return AlignmentMatchingStorageImpl::Read(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<char *>(buffer), size);
|
||||
R_RETURN(AlignmentMatchingStorageImpl::Read(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<char *>(buffer), size));
|
||||
}
|
||||
|
||||
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
|
||||
|
@ -184,16 +184,16 @@ namespace ams::fssystem {
|
|||
PooledBuffer pooled_buffer;
|
||||
pooled_buffer.AllocateParticularlyLarge(m_data_align, m_data_align);
|
||||
|
||||
return AlignmentMatchingStorageImpl::Write(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<const char *>(buffer), size);
|
||||
R_RETURN(AlignmentMatchingStorageImpl::Write(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<const char *>(buffer), size));
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
return m_base_storage->Flush();
|
||||
R_RETURN(m_base_storage->Flush());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
ON_SCOPE_EXIT { m_is_base_storage_size_dirty = true; };
|
||||
return m_base_storage->SetSize(util::AlignUp(size, m_data_align));
|
||||
R_RETURN(m_base_storage->SetSize(util::AlignUp(size, m_data_align)));
|
||||
}
|
||||
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
|
@ -213,7 +213,7 @@ namespace ams::fssystem {
|
|||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
if (op_id == fs::OperationId::Invalidate) {
|
||||
return m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size);
|
||||
R_RETURN(m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size));
|
||||
} else {
|
||||
/* Succeed if zero size. */
|
||||
R_SUCCEED_IF(size == 0);
|
||||
|
@ -229,7 +229,7 @@ namespace ams::fssystem {
|
|||
const auto aligned_offset_end = util::AlignUp(offset + valid_size, m_data_align);
|
||||
const auto aligned_size = aligned_offset_end - aligned_offset;
|
||||
|
||||
return m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size);
|
||||
R_RETURN(m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -272,16 +272,16 @@ namespace ams::fssystem {
|
|||
|
||||
/* Allocate a pooled buffer. */
|
||||
PooledBuffer pooled_buffer(m_data_align, m_data_align);
|
||||
return AlignmentMatchingStorageImpl::Write(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<const char *>(buffer), size);
|
||||
R_RETURN(AlignmentMatchingStorageImpl::Write(m_base_storage, pooled_buffer.GetBuffer(), pooled_buffer.GetSize(), m_data_align, BufferAlign, offset, static_cast<const char *>(buffer), size));
|
||||
}
|
||||
|
||||
virtual Result Flush() override {
|
||||
return m_base_storage->Flush();
|
||||
R_RETURN(m_base_storage->Flush());
|
||||
}
|
||||
|
||||
virtual Result SetSize(s64 size) override {
|
||||
ON_SCOPE_EXIT { m_base_storage_size = -1; };
|
||||
return m_base_storage->SetSize(util::AlignUp(size, m_data_align));
|
||||
R_RETURN(m_base_storage->SetSize(util::AlignUp(size, m_data_align)));
|
||||
}
|
||||
|
||||
virtual Result GetSize(s64 *out) override {
|
||||
|
@ -300,7 +300,7 @@ namespace ams::fssystem {
|
|||
|
||||
virtual Result OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) override {
|
||||
if (op_id == fs::OperationId::Invalidate) {
|
||||
return m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size);
|
||||
R_RETURN(m_base_storage->OperateRange(fs::OperationId::Invalidate, offset, size));
|
||||
} else {
|
||||
/* Succeed if zero size. */
|
||||
R_SUCCEED_IF(size == 0);
|
||||
|
@ -316,7 +316,7 @@ namespace ams::fssystem {
|
|||
const auto aligned_offset_end = util::AlignUp(offset + valid_size, m_data_align);
|
||||
const auto aligned_size = aligned_offset_end - aligned_offset;
|
||||
|
||||
return m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size);
|
||||
R_RETURN(m_base_storage->OperateRange(dst, dst_size, op_id, aligned_offset, aligned_size, src, src_size));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -26,11 +26,11 @@ namespace ams::fssystem {
|
|||
static Result Write(fs::IStorage *base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, const char *buffer, size_t size);
|
||||
|
||||
static Result Read(std::shared_ptr<fs::IStorage> &base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, char *buffer, size_t size) {
|
||||
return Read(base_storage.get(), work_buf, work_buf_size, data_alignment, buffer_alignment, offset, buffer, size);
|
||||
R_RETURN(Read(base_storage.get(), work_buf, work_buf_size, data_alignment, buffer_alignment, offset, buffer, size));
|
||||
}
|
||||
|
||||
static Result Write(std::shared_ptr<fs::IStorage> &base_storage, char *work_buf, size_t work_buf_size, size_t data_alignment, size_t buffer_alignment, s64 offset, const char *buffer, size_t size) {
|
||||
return Write(base_storage.get(), work_buf, work_buf_size, data_alignment, buffer_alignment, offset, buffer, size);
|
||||
R_RETURN(Write(base_storage.get(), work_buf, work_buf_size, data_alignment, buffer_alignment, offset, buffer, size));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace ams::fssystem {
|
|||
std::memcpy(std::addressof(param.entry), m_entry, sizeof(EntryType));
|
||||
|
||||
/* Scan. */
|
||||
return m_tree->ScanContinuousReading<EntryType>(out_info, param);
|
||||
R_RETURN(m_tree->ScanContinuousReading<EntryType>(out_info, param));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace ams::fssystem {
|
|||
bool IsInitialized() const { return m_table.IsInitialized(); }
|
||||
|
||||
Result Initialize(IAllocator *allocator, fs::SubStorage node_storage, fs::SubStorage entry_storage, s32 entry_count) {
|
||||
return m_table.Initialize(allocator, node_storage, entry_storage, NodeSize, sizeof(Entry), entry_count);
|
||||
R_RETURN(m_table.Initialize(allocator, node_storage, entry_storage, NodeSize, sizeof(Entry), entry_count));
|
||||
}
|
||||
|
||||
void SetStorage(s32 idx, fs::SubStorage storage) {
|
||||
|
|
|
@ -89,12 +89,12 @@ namespace ams::fssystem {
|
|||
template<impl::IterateDirectoryHandler OnEnterDir, impl::IterateDirectoryHandler OnExitDir, impl::IterateDirectoryHandler OnFile>
|
||||
Result IterateDirectoryRecursively(fs::fsa::IFileSystem *fs, const fs::Path &root_path, OnEnterDir on_enter_dir, OnExitDir on_exit_dir, OnFile on_file) {
|
||||
fs::DirectoryEntry dir_entry = {};
|
||||
return IterateDirectoryRecursively(fs, root_path, std::addressof(dir_entry), on_enter_dir, on_exit_dir, on_file);
|
||||
R_RETURN(IterateDirectoryRecursively(fs, root_path, std::addressof(dir_entry), on_enter_dir, on_exit_dir, on_file));
|
||||
}
|
||||
|
||||
template<impl::IterateDirectoryHandler OnEnterDir, impl::IterateDirectoryHandler OnExitDir, impl::IterateDirectoryHandler OnFile>
|
||||
Result IterateDirectoryRecursively(fs::fsa::IFileSystem *fs, OnEnterDir on_enter_dir, OnExitDir on_exit_dir, OnFile on_file) {
|
||||
return IterateDirectoryRecursively(fs, fs::MakeConstantPath("/"), on_enter_dir, on_exit_dir, on_file);
|
||||
R_RETURN(IterateDirectoryRecursively(fs, fs::MakeConstantPath("/"), on_enter_dir, on_exit_dir, on_file));
|
||||
}
|
||||
|
||||
/* TODO: Cleanup API */
|
||||
|
@ -103,13 +103,13 @@ namespace ams::fssystem {
|
|||
Result CopyFile(fs::fsa::IFileSystem *dst_fs, fs::fsa::IFileSystem *src_fs, const fs::Path &dst_path, const fs::Path &src_path, void *work_buf, size_t work_buf_size);
|
||||
|
||||
ALWAYS_INLINE Result CopyFile(fs::fsa::IFileSystem *fs, const fs::Path &dst_path, const fs::Path &src_path, void *work_buf, size_t work_buf_size) {
|
||||
return CopyFile(fs, fs, dst_path, src_path, work_buf, work_buf_size);
|
||||
R_RETURN(CopyFile(fs, fs, dst_path, src_path, work_buf, work_buf_size));
|
||||
}
|
||||
|
||||
Result CopyDirectoryRecursively(fs::fsa::IFileSystem *dst_fs, fs::fsa::IFileSystem *src_fs, const fs::Path &dst_path, const fs::Path &src_path, fs::DirectoryEntry *entry, void *work_buf, size_t work_buf_size);
|
||||
|
||||
ALWAYS_INLINE Result CopyDirectoryRecursively(fs::fsa::IFileSystem *fs, const fs::Path &dst_path, const fs::Path &src_path, fs::DirectoryEntry *entry, void *work_buf, size_t work_buf_size) {
|
||||
return CopyDirectoryRecursively(fs, fs, dst_path, src_path, entry, work_buf, work_buf_size);
|
||||
R_RETURN(CopyDirectoryRecursively(fs, fs, dst_path, src_path, entry, work_buf, work_buf_size));
|
||||
}
|
||||
|
||||
/* Semaphore adapter class. */
|
||||
|
@ -147,7 +147,7 @@ namespace ams::fssystem {
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result RetryToAvoidTargetLocked(auto f) {
|
||||
return RetryFinitelyForTargetLocked<2, 25>(f);
|
||||
R_RETURN((RetryFinitelyForTargetLocked<2, 25>(f)));
|
||||
}
|
||||
|
||||
void AddCounter(void *counter, size_t counter_size, u64 value);
|
||||
|
|
|
@ -227,11 +227,11 @@ namespace ams::kvdb {
|
|||
}
|
||||
|
||||
static Result DirectoryExists(bool *out, const char *path) {
|
||||
return Exists(out, path, fs::DirectoryEntryType_Directory);
|
||||
R_RETURN(Exists(out, path, fs::DirectoryEntryType_Directory));
|
||||
}
|
||||
|
||||
static Result FileExists(bool *out, const char *path) {
|
||||
return Exists(out, path, fs::DirectoryEntryType_File);
|
||||
R_RETURN(Exists(out, path, fs::DirectoryEntryType_File));
|
||||
}
|
||||
public:
|
||||
static Result CreateNewCache(const char *dir) {
|
||||
|
@ -298,18 +298,18 @@ namespace ams::kvdb {
|
|||
Result Get(size_t *out_size, void *out_value, size_t max_out_size, const Key &key) {
|
||||
/* Note that we accessed the key. */
|
||||
m_lru_list.Update(key);
|
||||
return m_kvs.Get(out_size, out_value, max_out_size, key);
|
||||
R_RETURN(m_kvs.Get(out_size, out_value, max_out_size, key));
|
||||
}
|
||||
|
||||
template<typename Value>
|
||||
Result Get(Value *out_value, const Key &key) {
|
||||
/* Note that we accessed the key. */
|
||||
m_lru_list.Update(key);
|
||||
return m_kvs.Get(out_value, key);
|
||||
R_RETURN(m_kvs.Get(out_value, key));
|
||||
}
|
||||
|
||||
Result GetSize(size_t *out_size, const Key &key) {
|
||||
return m_kvs.GetSize(out_size, key);
|
||||
R_RETURN(m_kvs.GetSize(out_size, key));
|
||||
}
|
||||
|
||||
Result Set(const Key &key, const void *value, size_t value_size) {
|
||||
|
@ -356,7 +356,7 @@ namespace ams::kvdb {
|
|||
|
||||
template<typename Value>
|
||||
Result Set(const Key &key, const Value &value) {
|
||||
return this->Set(key, &value, sizeof(Value));
|
||||
R_RETURN(this->Set(key, &value, sizeof(Value)));
|
||||
}
|
||||
|
||||
Result Remove(const Key &key) {
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace ams::kvdb {
|
|||
template<typename Key>
|
||||
Result Get(size_t *out_size, void *out_value, size_t max_out_size, const Key &key) {
|
||||
static_assert(util::is_pod<Key>::value && sizeof(Key) <= MaxKeySize, "Invalid FileKeyValueStore Key!");
|
||||
return this->Get(out_size, out_value, max_out_size, std::addressof(key), sizeof(Key));
|
||||
R_RETURN(this->Get(out_size, out_value, max_out_size, std::addressof(key), sizeof(Key)));
|
||||
}
|
||||
|
||||
template<typename Key, typename Value>
|
||||
|
@ -98,24 +98,24 @@ namespace ams::kvdb {
|
|||
|
||||
template<typename Key>
|
||||
Result GetSize(size_t *out_size, const Key &key) {
|
||||
return this->GetSize(out_size, std::addressof(key), sizeof(Key));
|
||||
R_RETURN(this->GetSize(out_size, std::addressof(key), sizeof(Key)));
|
||||
}
|
||||
|
||||
template<typename Key>
|
||||
Result Set(const Key &key, const void *value, size_t value_size) {
|
||||
static_assert(util::is_pod<Key>::value && sizeof(Key) <= MaxKeySize, "Invalid FileKeyValueStore Key!");
|
||||
return this->Set(std::addressof(key), sizeof(Key), value, value_size);
|
||||
R_RETURN(this->Set(std::addressof(key), sizeof(Key), value, value_size));
|
||||
}
|
||||
|
||||
template<typename Key, typename Value>
|
||||
Result Set(const Key &key, const Value &value) {
|
||||
static_assert(util::is_pod<Value>::value && !std::is_pointer<Value>::value, "Invalid FileKeyValueStore Value!");
|
||||
return this->Set(key, std::addressof(value), sizeof(Value));
|
||||
R_RETURN(this->Set(key, std::addressof(value), sizeof(Value)));
|
||||
}
|
||||
|
||||
template<typename Key>
|
||||
Result Remove(const Key &key) {
|
||||
return this->Remove(std::addressof(key), sizeof(Key));
|
||||
R_RETURN(this->Remove(std::addressof(key), sizeof(Key)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -355,25 +355,25 @@ namespace ams::kvdb {
|
|||
}
|
||||
|
||||
/* Save the buffer to disk. */
|
||||
return this->Commit(buffer, destructive);
|
||||
R_RETURN(this->Commit(buffer, destructive));
|
||||
}
|
||||
|
||||
Result Set(const Key &key, const void *value, size_t value_size) {
|
||||
return m_index.Set(key, value, value_size);
|
||||
R_RETURN(m_index.Set(key, value, value_size));
|
||||
}
|
||||
|
||||
template<typename Value>
|
||||
Result Set(const Key &key, const Value &value) {
|
||||
/* Only allow setting pod. */
|
||||
static_assert(util::is_pod<Value>::value, "KeyValueStore Values must be pod");
|
||||
return this->Set(key, std::addressof(value), sizeof(Value));
|
||||
R_RETURN(this->Set(key, std::addressof(value), sizeof(Value)));
|
||||
}
|
||||
|
||||
template<typename Value>
|
||||
Result Set(const Key &key, const Value *value) {
|
||||
/* Only allow setting pod. */
|
||||
static_assert(util::is_pod<Value>::value, "KeyValueStore Values must be pod");
|
||||
return this->Set(key, value, sizeof(Value));
|
||||
R_RETURN(this->Set(key, value, sizeof(Value)));
|
||||
}
|
||||
|
||||
Result Get(size_t *out_size, void *out_value, size_t max_out_size, const Key &key) {
|
||||
|
@ -427,7 +427,7 @@ namespace ams::kvdb {
|
|||
}
|
||||
|
||||
Result Remove(const Key &key) {
|
||||
return m_index.Remove(key);
|
||||
R_RETURN(m_index.Remove(key));
|
||||
}
|
||||
|
||||
Entry *begin() {
|
||||
|
|
|
@ -44,31 +44,31 @@ namespace ams::lr {
|
|||
/* Actual commands. */
|
||||
Result ResolveAddOnContentPath(Path *out, ncm::DataId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveAddOnContentPath(out, id);
|
||||
R_RETURN(m_interface->ResolveAddOnContentPath(out, id));
|
||||
}
|
||||
|
||||
Result RegisterAddOnContentStorage(ncm::DataId id, ncm::ApplicationId application_id, ncm::StorageId storage_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
if (hos::GetVersion() >= hos::Version_9_0_0) {
|
||||
return m_interface->RegisterAddOnContentStorage(id, application_id, storage_id);
|
||||
R_RETURN(m_interface->RegisterAddOnContentStorage(id, application_id, storage_id));
|
||||
} else {
|
||||
return m_interface->RegisterAddOnContentStorageDeprecated(id, storage_id);
|
||||
R_RETURN(m_interface->RegisterAddOnContentStorageDeprecated(id, storage_id));
|
||||
}
|
||||
}
|
||||
|
||||
Result UnregisterAllAddOnContentPath() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->UnregisterAllAddOnContentPath();
|
||||
R_RETURN(m_interface->UnregisterAllAddOnContentPath());
|
||||
}
|
||||
|
||||
Result RefreshApplicationAddOnContent(const ncm::ApplicationId *ids, size_t num_ids) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->RefreshApplicationAddOnContent(sf::InArray<ncm::ApplicationId>(ids, num_ids));
|
||||
R_RETURN(m_interface->RefreshApplicationAddOnContent(sf::InArray<ncm::ApplicationId>(ids, num_ids)));
|
||||
}
|
||||
|
||||
Result UnregisterApplicationAddOnContent(ncm::ApplicationId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->UnregisterApplicationAddOnContent(id);
|
||||
R_RETURN(m_interface->UnregisterApplicationAddOnContent(id));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace ams::lr {
|
|||
public:
|
||||
Result ResolveProgramPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveProgramPath(out, id);
|
||||
R_RETURN(m_interface->ResolveProgramPath(out, id));
|
||||
}
|
||||
|
||||
void RedirectProgramPath(const Path &path, ncm::ProgramId id) {
|
||||
|
@ -53,17 +53,17 @@ namespace ams::lr {
|
|||
|
||||
Result ResolveApplicationControlPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveApplicationControlPath(out, id);
|
||||
R_RETURN(m_interface->ResolveApplicationControlPath(out, id));
|
||||
}
|
||||
|
||||
Result ResolveApplicationHtmlDocumentPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveApplicationHtmlDocumentPath(out, id);
|
||||
R_RETURN(m_interface->ResolveApplicationHtmlDocumentPath(out, id));
|
||||
}
|
||||
|
||||
Result ResolveDataPath(Path *out, ncm::DataId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveDataPath(out, id);
|
||||
R_RETURN(m_interface->ResolveDataPath(out, id));
|
||||
}
|
||||
|
||||
void RedirectApplicationControlPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
|
@ -86,7 +86,7 @@ namespace ams::lr {
|
|||
|
||||
Result ResolveApplicationLegalInformationPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveApplicationLegalInformationPath(out, id);
|
||||
R_RETURN(m_interface->ResolveApplicationLegalInformationPath(out, id));
|
||||
}
|
||||
|
||||
void RedirectApplicationLegalInformationPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
|
@ -100,7 +100,7 @@ namespace ams::lr {
|
|||
|
||||
Result Refresh() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Refresh();
|
||||
R_RETURN(m_interface->Refresh());
|
||||
}
|
||||
|
||||
void RedirectApplicationProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
|
@ -115,41 +115,41 @@ namespace ams::lr {
|
|||
Result ClearApplicationRedirection() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
AMS_ASSERT(hos::GetVersion() < hos::Version_9_0_0);
|
||||
return this->ClearApplicationRedirection(nullptr, 0);
|
||||
R_RETURN(this->ClearApplicationRedirection(nullptr, 0));
|
||||
}
|
||||
|
||||
Result ClearApplicationRedirection(const ncm::ProgramId *excluding_ids, size_t num_ids) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
if (hos::GetVersion() >= hos::Version_9_0_0) {
|
||||
return m_interface->ClearApplicationRedirection(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids));
|
||||
R_RETURN(m_interface->ClearApplicationRedirection(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids)));
|
||||
} else {
|
||||
return m_interface->ClearApplicationRedirectionDeprecated();
|
||||
R_RETURN(m_interface->ClearApplicationRedirectionDeprecated());
|
||||
}
|
||||
}
|
||||
|
||||
Result EraseProgramRedirection(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->EraseProgramRedirection(id);
|
||||
R_RETURN(m_interface->EraseProgramRedirection(id));
|
||||
}
|
||||
|
||||
Result EraseApplicationControlRedirection(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->EraseApplicationControlRedirection(id);
|
||||
R_RETURN(m_interface->EraseApplicationControlRedirection(id));
|
||||
}
|
||||
|
||||
Result EraseApplicationHtmlDocumentRedirection(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->EraseApplicationHtmlDocumentRedirection(id);
|
||||
R_RETURN(m_interface->EraseApplicationHtmlDocumentRedirection(id));
|
||||
}
|
||||
|
||||
Result EraseApplicationLegalInformationRedirection(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->EraseApplicationLegalInformationRedirection(id);
|
||||
R_RETURN(m_interface->EraseApplicationLegalInformationRedirection(id));
|
||||
}
|
||||
|
||||
Result ResolveProgramPathForDebug(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveProgramPathForDebug(out, id);
|
||||
R_RETURN(m_interface->ResolveProgramPathForDebug(out, id));
|
||||
}
|
||||
|
||||
void RedirectProgramPathForDebug(const Path &path, ncm::ProgramId id) {
|
||||
|
@ -168,7 +168,7 @@ namespace ams::lr {
|
|||
|
||||
Result EraseProgramRedirectionForDebug(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->EraseProgramRedirectionForDebug(id);
|
||||
R_RETURN(m_interface->EraseProgramRedirectionForDebug(id));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -44,21 +44,21 @@ namespace ams::lr {
|
|||
/* Actual commands. */
|
||||
Result ResolveProgramPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveProgramPath(out, id);
|
||||
R_RETURN(m_interface->ResolveProgramPath(out, id));
|
||||
}
|
||||
|
||||
Result RegisterProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
if (hos::GetVersion() >= hos::Version_9_0_0) {
|
||||
return m_interface->RegisterProgramPath(path, id, owner_id);
|
||||
R_RETURN(m_interface->RegisterProgramPath(path, id, owner_id));
|
||||
} else {
|
||||
return m_interface->RegisterProgramPathDeprecated(path, id);
|
||||
R_RETURN(m_interface->RegisterProgramPathDeprecated(path, id));
|
||||
}
|
||||
}
|
||||
|
||||
Result UnregisterProgramPath(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->UnregisterProgramPath(id);
|
||||
R_RETURN(m_interface->UnregisterProgramPath(id));
|
||||
}
|
||||
|
||||
void RedirectProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
|
@ -72,21 +72,21 @@ namespace ams::lr {
|
|||
|
||||
Result ResolveHtmlDocumentPath(Path *out, ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ResolveHtmlDocumentPath(out, id);
|
||||
R_RETURN(m_interface->ResolveHtmlDocumentPath(out, id));
|
||||
}
|
||||
|
||||
Result RegisterHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
if (hos::GetVersion() >= hos::Version_9_0_0) {
|
||||
return m_interface->RegisterHtmlDocumentPath(path, id, owner_id);
|
||||
R_RETURN(m_interface->RegisterHtmlDocumentPath(path, id, owner_id));
|
||||
} else {
|
||||
return m_interface->RegisterHtmlDocumentPathDeprecated(path, id);
|
||||
R_RETURN(m_interface->RegisterHtmlDocumentPathDeprecated(path, id));
|
||||
}
|
||||
}
|
||||
|
||||
Result UnregisterHtmlDocumentPath(ncm::ProgramId id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->UnregisterHtmlDocumentPath(id);
|
||||
R_RETURN(m_interface->UnregisterHtmlDocumentPath(id));
|
||||
}
|
||||
|
||||
void RedirectHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id) {
|
||||
|
@ -100,12 +100,12 @@ namespace ams::lr {
|
|||
|
||||
Result Refresh() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Refresh();
|
||||
R_RETURN(m_interface->Refresh());
|
||||
}
|
||||
|
||||
Result RefreshExcluding(const ncm::ProgramId *excluding_ids, size_t num_ids) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->RefreshExcluding(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids));
|
||||
R_RETURN(m_interface->RefreshExcluding(sf::InArray<ncm::ProgramId>(excluding_ids, num_ids)));
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace ams::ncm {
|
|||
public:
|
||||
Result Set(const ContentMetaKey &key, const void *buf, size_t size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Set(key, sf::InBuffer(buf, size));
|
||||
R_RETURN(m_interface->Set(key, sf::InBuffer(buf, size)));
|
||||
}
|
||||
|
||||
Result Get(size_t *out_size, void *dst, size_t dst_size, const ContentMetaKey &key) {
|
||||
|
@ -58,15 +58,15 @@ namespace ams::ncm {
|
|||
R_SUCCEED();
|
||||
}
|
||||
|
||||
#define AMS_NCM_DEFINE_GETTERS(Kind, IdType) \
|
||||
Result Get##Kind(ContentId *out, IdType##Id id, u32 version) { \
|
||||
return m_interface->GetContentIdByType(out, ContentMetaKey::MakeUnknownType(id.value, version), ContentType::Kind); \
|
||||
} \
|
||||
\
|
||||
Result GetLatest##Kind(ContentId *out, IdType##Id id) { \
|
||||
ContentMetaKey latest_key; \
|
||||
R_TRY(m_interface->GetLatestContentMetaKey(std::addressof(latest_key), id.value)); \
|
||||
return m_interface->GetContentIdByType(out, latest_key, ContentType::Kind); \
|
||||
#define AMS_NCM_DEFINE_GETTERS(Kind, IdType) \
|
||||
Result Get##Kind(ContentId *out, IdType##Id id, u32 version) { \
|
||||
R_RETURN(m_interface->GetContentIdByType(out, ContentMetaKey::MakeUnknownType(id.value, version), ContentType::Kind)); \
|
||||
} \
|
||||
\
|
||||
Result GetLatest##Kind(ContentId *out, IdType##Id id) { \
|
||||
ContentMetaKey latest_key; \
|
||||
R_TRY(m_interface->GetLatestContentMetaKey(std::addressof(latest_key), id.value)); \
|
||||
R_RETURN(m_interface->GetContentIdByType(out, latest_key, ContentType::Kind)); \
|
||||
}
|
||||
|
||||
AMS_NCM_DEFINE_GETTERS(Program, Program)
|
||||
|
@ -79,29 +79,29 @@ namespace ams::ncm {
|
|||
|
||||
Result Remove(const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Remove(key);
|
||||
R_RETURN(m_interface->Remove(key));
|
||||
}
|
||||
|
||||
Result Remove(SystemProgramId id, u32 version) {
|
||||
return this->Remove(ContentMetaKey::Make(id, version));
|
||||
R_RETURN(this->Remove(ContentMetaKey::Make(id, version)));
|
||||
}
|
||||
|
||||
Result Remove(SystemDataId id, u32 version) {
|
||||
return this->Remove(ContentMetaKey::Make(id, version));
|
||||
R_RETURN(this->Remove(ContentMetaKey::Make(id, version)));
|
||||
}
|
||||
|
||||
Result Remove(ApplicationId id, u32 version) {
|
||||
return this->Remove(ContentMetaKey::Make(id, version));
|
||||
R_RETURN(this->Remove(ContentMetaKey::Make(id, version)));
|
||||
}
|
||||
|
||||
Result GetContentIdByType(ContentId *out_content_id, const ContentMetaKey &key, ContentType type) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetContentIdByType(out_content_id, key, type);
|
||||
R_RETURN(m_interface->GetContentIdByType(out_content_id, key, type));
|
||||
}
|
||||
|
||||
Result GetContentIdByTypeAndIdOffset(ContentId *out_content_id, const ContentMetaKey &key, ContentType type, u8 id_offset) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetContentIdByTypeAndIdOffset(out_content_id, key, type, id_offset);
|
||||
R_RETURN(m_interface->GetContentIdByTypeAndIdOffset(out_content_id, key, type, id_offset));
|
||||
}
|
||||
|
||||
ListCount ListApplication(ApplicationContentMetaKey *dst, size_t dst_size) {
|
||||
|
@ -118,32 +118,32 @@ namespace ams::ncm {
|
|||
|
||||
Result GetLatest(ContentMetaKey *out_key, u64 id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetLatestContentMetaKey(out_key, id);
|
||||
R_RETURN(m_interface->GetLatestContentMetaKey(out_key, id));
|
||||
}
|
||||
|
||||
Result ListContentInfo(s32 *out_count, ContentInfo *dst, size_t dst_size, const ContentMetaKey &key, s32 offset) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ListContentInfo(out_count, sf::OutArray<ContentInfo>(dst, dst_size), key, offset);
|
||||
R_RETURN(m_interface->ListContentInfo(out_count, sf::OutArray<ContentInfo>(dst, dst_size), key, offset));
|
||||
}
|
||||
|
||||
Result ListContentMetaInfo(s32 *out_count, ContentMetaInfo *dst, size_t dst_size, const ContentMetaKey &key, s32 offset) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ListContentMetaInfo(out_count, sf::OutArray<ContentMetaInfo>(dst, dst_size), key, offset);
|
||||
R_RETURN(m_interface->ListContentMetaInfo(out_count, sf::OutArray<ContentMetaInfo>(dst, dst_size), key, offset));
|
||||
}
|
||||
|
||||
Result Has(bool *out, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Has(out, key);
|
||||
R_RETURN(m_interface->Has(out, key));
|
||||
}
|
||||
|
||||
Result HasAll(bool *out, const ContentMetaKey *keys, size_t num_keys) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->HasAll(out, sf::InArray<ContentMetaKey>(keys, num_keys));
|
||||
R_RETURN(m_interface->HasAll(out, sf::InArray<ContentMetaKey>(keys, num_keys)));
|
||||
}
|
||||
|
||||
Result HasContent(bool *out, const ContentMetaKey &key, const ContentId &content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->HasContent(out, key, content_id);
|
||||
R_RETURN(m_interface->HasContent(out, key, content_id));
|
||||
}
|
||||
|
||||
Result GetSize(size_t *out_size, const ContentMetaKey &key) {
|
||||
|
@ -157,37 +157,37 @@ namespace ams::ncm {
|
|||
|
||||
Result GetRequiredSystemVersion(u32 *out_version, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetRequiredSystemVersion(out_version, key);
|
||||
R_RETURN(m_interface->GetRequiredSystemVersion(out_version, key));
|
||||
}
|
||||
|
||||
Result GetPatchId(PatchId *out_patch_id, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetPatchId(out_patch_id, key);
|
||||
R_RETURN(m_interface->GetPatchId(out_patch_id, key));
|
||||
}
|
||||
|
||||
Result DisableForcibly() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->DisableForcibly();
|
||||
R_RETURN(m_interface->DisableForcibly());
|
||||
}
|
||||
|
||||
Result LookupOrphanContent(bool *out_orphaned, ContentId *content_list, size_t count) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->LookupOrphanContent(sf::OutArray<bool>(out_orphaned, count), sf::InArray<ContentId>(content_list, count));
|
||||
R_RETURN(m_interface->LookupOrphanContent(sf::OutArray<bool>(out_orphaned, count), sf::InArray<ContentId>(content_list, count)));
|
||||
}
|
||||
|
||||
Result Commit() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Commit();
|
||||
R_RETURN(m_interface->Commit());
|
||||
}
|
||||
|
||||
Result GetAttributes(u8 *out_attributes, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetAttributes(out_attributes, key);
|
||||
R_RETURN(m_interface->GetAttributes(out_attributes, key));
|
||||
}
|
||||
|
||||
Result GetRequiredApplicationVersion(u32 *out_version, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetRequiredApplicationVersion(out_version, key);
|
||||
R_RETURN(m_interface->GetRequiredApplicationVersion(out_version, key));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -520,8 +520,8 @@ namespace ams::ncm {
|
|||
public:
|
||||
using AccessorBase::AccessorBase;
|
||||
public:
|
||||
Result GetHeader(ReadableStructPin<PatchMetaExtendedDataHeader> *out) { return this->AcquireReadableStructPin(out, 0); }
|
||||
Result GetHeader(PatchMetaExtendedDataHeader *out) { return this->template ReadStruct<PatchMetaExtendedDataHeader>(out, 0); }
|
||||
Result GetHeader(ReadableStructPin<PatchMetaExtendedDataHeader> *out) { R_RETURN(this->AcquireReadableStructPin(out, 0)); }
|
||||
Result GetHeader(PatchMetaExtendedDataHeader *out) { R_RETURN(this->template ReadStruct<PatchMetaExtendedDataHeader>(out, 0)); }
|
||||
|
||||
Result GetHistoryHeader(ReadableStructPin<PatchHistoryHeader> *out, s32 index) {
|
||||
/* Ensure we have our header. */
|
||||
|
|
|
@ -49,37 +49,37 @@ namespace ams::ncm {
|
|||
|
||||
Result CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, s64 size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->CreatePlaceHolder(placeholder_id, content_id, size);
|
||||
R_RETURN(m_interface->CreatePlaceHolder(placeholder_id, content_id, size));
|
||||
}
|
||||
|
||||
Result DeletePlaceHolder(PlaceHolderId placeholder_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->DeletePlaceHolder(placeholder_id);
|
||||
R_RETURN(m_interface->DeletePlaceHolder(placeholder_id));
|
||||
}
|
||||
|
||||
Result HasPlaceHolder(bool *out, PlaceHolderId placeholder_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->HasPlaceHolder(out, placeholder_id);
|
||||
R_RETURN(m_interface->HasPlaceHolder(out, placeholder_id));
|
||||
}
|
||||
|
||||
Result WritePlaceHolder(PlaceHolderId placeholder_id, s64 offset, const void *buf, size_t size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->WritePlaceHolder(placeholder_id, offset, sf::InBuffer(buf, size));
|
||||
R_RETURN(m_interface->WritePlaceHolder(placeholder_id, offset, sf::InBuffer(buf, size)));
|
||||
}
|
||||
|
||||
Result Register(PlaceHolderId placeholder_id, ContentId content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Register(placeholder_id, content_id);
|
||||
R_RETURN(m_interface->Register(placeholder_id, content_id));
|
||||
}
|
||||
|
||||
Result Delete(ContentId content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Delete(content_id);
|
||||
R_RETURN(m_interface->Delete(content_id));
|
||||
}
|
||||
|
||||
Result Has(bool *out, ContentId content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->Has(out, content_id);
|
||||
R_RETURN(m_interface->Has(out, content_id));
|
||||
}
|
||||
|
||||
void GetPath(Path *out, ContentId content_id) {
|
||||
|
@ -94,52 +94,52 @@ namespace ams::ncm {
|
|||
|
||||
Result CleanupAllPlaceHolder() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->CleanupAllPlaceHolder();
|
||||
R_RETURN(m_interface->CleanupAllPlaceHolder());
|
||||
}
|
||||
|
||||
Result ListPlaceHolder(s32 *out_count, PlaceHolderId *out_list, size_t out_list_size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ListPlaceHolder(out_count, sf::OutArray<PlaceHolderId>(out_list, out_list_size));
|
||||
R_RETURN(m_interface->ListPlaceHolder(out_count, sf::OutArray<PlaceHolderId>(out_list, out_list_size)));
|
||||
}
|
||||
|
||||
Result GetContentCount(s32 *out_count) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetContentCount(out_count);
|
||||
R_RETURN(m_interface->GetContentCount(out_count));
|
||||
}
|
||||
|
||||
Result ListContentId(s32 *out_count, ContentId *out_list, size_t out_list_size, s32 offset) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ListContentId(out_count, sf::OutArray<ContentId>(out_list, out_list_size), offset);
|
||||
R_RETURN(m_interface->ListContentId(out_count, sf::OutArray<ContentId>(out_list, out_list_size), offset));
|
||||
}
|
||||
|
||||
Result GetSize(s64 *out_size, ContentId content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetSizeFromContentId(out_size, content_id);
|
||||
R_RETURN(m_interface->GetSizeFromContentId(out_size, content_id));
|
||||
}
|
||||
|
||||
Result GetSize(s64 *out_size, PlaceHolderId placeholder_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetSizeFromPlaceHolderId(out_size, placeholder_id);
|
||||
R_RETURN(m_interface->GetSizeFromPlaceHolderId(out_size, placeholder_id));
|
||||
}
|
||||
|
||||
Result DisableForcibly() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->DisableForcibly();
|
||||
R_RETURN(m_interface->DisableForcibly());
|
||||
}
|
||||
|
||||
Result RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->RevertToPlaceHolder(placeholder_id, old_content_id, new_content_id);
|
||||
R_RETURN(m_interface->RevertToPlaceHolder(placeholder_id, old_content_id, new_content_id));
|
||||
}
|
||||
|
||||
Result SetPlaceHolderSize(PlaceHolderId placeholder_id, s64 size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->SetPlaceHolderSize(placeholder_id, size);
|
||||
R_RETURN(m_interface->SetPlaceHolderSize(placeholder_id, size));
|
||||
}
|
||||
|
||||
Result ReadContentIdFile(void *dst, size_t size, ContentId content_id, s64 offset) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->ReadContentIdFile(sf::OutBuffer(dst, size), content_id, offset);
|
||||
R_RETURN(m_interface->ReadContentIdFile(sf::OutBuffer(dst, size), content_id, offset));
|
||||
}
|
||||
|
||||
Result GetRightsId(ncm::RightsId *out_rights_id, PlaceHolderId placeholder_id) {
|
||||
|
@ -147,11 +147,11 @@ namespace ams::ncm {
|
|||
|
||||
const auto vers = hos::GetVersion();
|
||||
if (vers >= hos::Version_3_0_0) {
|
||||
return m_interface->GetRightsIdFromPlaceHolderId(out_rights_id, placeholder_id);
|
||||
R_RETURN(m_interface->GetRightsIdFromPlaceHolderId(out_rights_id, placeholder_id));
|
||||
} else {
|
||||
AMS_ABORT_UNLESS(vers >= hos::Version_2_0_0);
|
||||
*out_rights_id = {};
|
||||
return m_interface->GetRightsIdFromPlaceHolderIdDeprecated(std::addressof(out_rights_id->id), placeholder_id);
|
||||
R_RETURN(m_interface->GetRightsIdFromPlaceHolderIdDeprecated(std::addressof(out_rights_id->id), placeholder_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,42 +160,42 @@ namespace ams::ncm {
|
|||
|
||||
const auto vers = hos::GetVersion();
|
||||
if (vers >= hos::Version_3_0_0) {
|
||||
return m_interface->GetRightsIdFromContentId(out_rights_id, content_id);
|
||||
R_RETURN(m_interface->GetRightsIdFromContentId(out_rights_id, content_id));
|
||||
} else {
|
||||
AMS_ABORT_UNLESS(vers >= hos::Version_2_0_0);
|
||||
*out_rights_id = {};
|
||||
return m_interface->GetRightsIdFromContentIdDeprecated(std::addressof(out_rights_id->id), content_id);
|
||||
R_RETURN(m_interface->GetRightsIdFromContentIdDeprecated(std::addressof(out_rights_id->id), content_id));
|
||||
}
|
||||
}
|
||||
|
||||
Result WriteContentForDebug(ContentId content_id, s64 offset, const void *buf, size_t size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->WriteContentForDebug(content_id, offset, sf::InBuffer(buf, size));
|
||||
R_RETURN(m_interface->WriteContentForDebug(content_id, offset, sf::InBuffer(buf, size)));
|
||||
}
|
||||
|
||||
Result GetFreeSpaceSize(s64 *out_size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetFreeSpaceSize(out_size);
|
||||
R_RETURN(m_interface->GetFreeSpaceSize(out_size));
|
||||
}
|
||||
|
||||
Result GetTotalSpaceSize(s64 *out_size) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetTotalSpaceSize(out_size);
|
||||
R_RETURN(m_interface->GetTotalSpaceSize(out_size));
|
||||
}
|
||||
|
||||
Result FlushPlaceHolder() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->FlushPlaceHolder();
|
||||
R_RETURN(m_interface->FlushPlaceHolder());
|
||||
}
|
||||
|
||||
Result RepairInvalidFileAttribute() {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->RepairInvalidFileAttribute();
|
||||
R_RETURN(m_interface->RepairInvalidFileAttribute());
|
||||
}
|
||||
|
||||
Result GetRightsIdFromPlaceHolderIdWithCache(ncm::RightsId *out_rights_id, PlaceHolderId placeholder_id, ContentId cache_content_id) {
|
||||
AMS_ASSERT(m_interface != nullptr);
|
||||
return m_interface->GetRightsIdFromPlaceHolderIdWithCache(out_rights_id, placeholder_id, cache_content_id);
|
||||
R_RETURN(m_interface->GetRightsIdFromPlaceHolderIdWithCache(out_rights_id, placeholder_id, cache_content_id));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace ams::ncm {
|
|||
if (R_FAILED(result)) {
|
||||
this->SetLastResult(result);
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
public:
|
||||
InstallTaskBase() : m_data(), m_progress(), m_progress_mutex(), m_cancel_mutex(), m_cancel_requested(), m_throughput_mutex() { /* ... */ }
|
||||
|
@ -113,12 +113,12 @@ namespace ams::ncm {
|
|||
Result CalculateRequiredSize(s64 *out_size);
|
||||
Result Cleanup();
|
||||
Result ListContentMetaKey(s32 *out_keys_written, StorageContentMetaKey *out_keys, s32 out_keys_count, s32 offset, ListContentMetaKeyFilter filter);
|
||||
Result ListContentMetaKey(s32 *out_keys_written, StorageContentMetaKey *out_keys, s32 out_keys_count, s32 offset) { return this->ListContentMetaKey(out_keys_written, out_keys, out_keys_count, offset, ListContentMetaKeyFilter::All); }
|
||||
Result ListContentMetaKey(s32 *out_keys_written, StorageContentMetaKey *out_keys, s32 out_keys_count, s32 offset) { R_RETURN(this->ListContentMetaKey(out_keys_written, out_keys, out_keys_count, offset, ListContentMetaKeyFilter::All)); }
|
||||
Result ListApplicationContentMetaKey(s32 *out_keys_written, ApplicationContentMetaKey *out_keys, s32 out_keys_count, s32 offset);
|
||||
Result Execute();
|
||||
Result PrepareAndExecute();
|
||||
Result Commit(const StorageContentMetaKey *keys, s32 num_keys);
|
||||
Result Commit() { return this->Commit(nullptr, 0); }
|
||||
Result Commit() { R_RETURN(this->Commit(nullptr, 0)); }
|
||||
virtual InstallProgress GetProgress();
|
||||
void ResetLastResult();
|
||||
Result IncludesExFatDriver(bool *out);
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace ams::os {
|
|||
}
|
||||
|
||||
Result Map(void **out, MemoryPermission perm) {
|
||||
return MapIoRegion(out, std::addressof(m_io_region), perm);
|
||||
R_RETURN(MapIoRegion(out, std::addressof(m_io_region), perm));
|
||||
}
|
||||
|
||||
void Unmap() {
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace ams::os {
|
|||
}
|
||||
|
||||
Result Map(void **out, MemoryPermission owner_perm) {
|
||||
return MapTransferMemory(out, std::addressof(m_tmem), owner_perm);
|
||||
R_RETURN(MapTransferMemory(out, std::addressof(m_tmem), owner_perm));
|
||||
}
|
||||
|
||||
void Unmap() {
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace ams::pgl {
|
|||
}
|
||||
|
||||
virtual Result GetProcessEventInfo(pm::ProcessEventInfo *out) override {
|
||||
return m_cmif_interface->GetProcessEventInfo(out);
|
||||
R_RETURN(m_cmif_interface->GetProcessEventInfo(out));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ namespace ams::pgl {
|
|||
}
|
||||
|
||||
virtual Result GetProcessEventInfo(pm::ProcessEventInfo *out) override {
|
||||
return m_tipc_interface.GetProcessEventInfo(ams::tipc::Out<pm::ProcessEventInfo>(out));
|
||||
R_RETURN(m_tipc_interface.GetProcessEventInfo(ams::tipc::Out<pm::ProcessEventInfo>(out)));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -113,11 +113,11 @@ namespace ams::pgl {
|
|||
}
|
||||
public:
|
||||
Result GetSystemEvent(os::SystemEventType *out) {
|
||||
return m_impl->GetSystemEvent(out);
|
||||
R_RETURN(m_impl->GetSystemEvent(out));
|
||||
}
|
||||
|
||||
Result GetProcessEventInfo(pm::ProcessEventInfo *out) {
|
||||
return m_impl->GetProcessEventInfo(out);
|
||||
R_RETURN(m_impl->GetProcessEventInfo(out));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ams::scs {
|
|||
Result LaunchProgram(os::ProcessId *out, const ncm::ProgramLocation &loc, const void *args, size_t args_size, u32 process_flags);
|
||||
|
||||
inline Result LaunchProgram(os::ProcessId *out, ncm::ProgramId program_id, const void *args, size_t args_size, u32 process_flags) {
|
||||
return LaunchProgram(out, ncm::ProgramLocation::Make(program_id, ncm::StorageId::BuiltInSystem), args, args_size, process_flags);
|
||||
R_RETURN(LaunchProgram(out, ncm::ProgramLocation::Make(program_id, ncm::StorageId::BuiltInSystem), args, args_size, process_flags));
|
||||
}
|
||||
|
||||
Result SubscribeProcessEvent(s32 socket, bool is_register, u64 id);
|
||||
|
|
|
@ -95,13 +95,13 @@ namespace ams::sf::cmif {
|
|||
template<typename T>
|
||||
Result ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
|
||||
static_assert(std::is_base_of<ServiceDispatchTableBase, T>::value, "ServiceDispatchTableBase::Process<T>");
|
||||
return static_cast<const T *>(this)->ProcessMessage(ctx, in_raw_data);
|
||||
R_RETURN(static_cast<const T *>(this)->ProcessMessage(ctx, in_raw_data));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Result ProcessMessageForMitm(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
|
||||
static_assert(std::is_base_of<ServiceDispatchTableBase, T>::value, "ServiceDispatchTableBase::ProcessForMitm<T>");
|
||||
return static_cast<const T *>(this)->ProcessMessageForMitm(ctx, in_raw_data);
|
||||
R_RETURN(static_cast<const T *>(this)->ProcessMessageForMitm(ctx, in_raw_data));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -115,11 +115,11 @@ namespace ams::sf::cmif {
|
|||
explicit constexpr ServiceDispatchTableImpl(const std::array<ServiceCommandMeta, N> &e) : m_entries{e} { /* ... */ }
|
||||
|
||||
Result ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
|
||||
return this->ProcessMessageImpl(ctx, in_raw_data, m_entries.data(), m_entries.size(), InterfaceIdForDebug);
|
||||
R_RETURN(this->ProcessMessageImpl(ctx, in_raw_data, m_entries.data(), m_entries.size(), InterfaceIdForDebug));
|
||||
}
|
||||
|
||||
Result ProcessMessageForMitm(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const {
|
||||
return this->ProcessMessageForMitmImpl(ctx, in_raw_data, m_entries.data(), m_entries.size(), InterfaceIdForDebug);
|
||||
R_RETURN(this->ProcessMessageForMitmImpl(ctx, in_raw_data, m_entries.data(), m_entries.size(), InterfaceIdForDebug));
|
||||
}
|
||||
|
||||
constexpr const std::array<ServiceCommandMeta, N> &GetEntries() const {
|
||||
|
|
|
@ -190,14 +190,14 @@ namespace ams::sf::hipc {
|
|||
|
||||
template<typename Interface>
|
||||
Result AcceptImpl(Server *server, SharedPointer<Interface> p) {
|
||||
return ServerSessionManager::AcceptSession(server->m_port_handle, std::move(p));
|
||||
R_RETURN(ServerSessionManager::AcceptSession(server->m_port_handle, std::move(p)));
|
||||
}
|
||||
|
||||
#if AMS_SF_MITM_SUPPORTED
|
||||
template<typename Interface>
|
||||
Result AcceptMitmImpl(Server *server, SharedPointer<Interface> p, std::shared_ptr<::Service> forward_service) {
|
||||
AMS_ABORT_UNLESS(this->CanManageMitmServers());
|
||||
return ServerSessionManager::AcceptMitmSession(server->m_port_handle, std::move(p), std::move(forward_service));
|
||||
R_RETURN(ServerSessionManager::AcceptMitmSession(server->m_port_handle, std::move(p), std::move(forward_service)));
|
||||
}
|
||||
|
||||
template<typename Interface>
|
||||
|
@ -269,7 +269,7 @@ namespace ams::sf::hipc {
|
|||
|
||||
template<typename Interface>
|
||||
Result RegisterObjectForServer(SharedPointer<Interface> static_object, sm::ServiceName service_name, size_t max_sessions) {
|
||||
return this->RegisterServerImpl(0, cmif::ServiceObjectHolder(std::move(static_object)), service_name, max_sessions);
|
||||
R_RETURN(this->RegisterServerImpl(0, cmif::ServiceObjectHolder(std::move(static_object)), service_name, max_sessions));
|
||||
}
|
||||
|
||||
void RegisterServer(int port_index, os::NativeHandle port_handle) {
|
||||
|
@ -277,7 +277,7 @@ namespace ams::sf::hipc {
|
|||
}
|
||||
|
||||
Result RegisterServer(int port_index, sm::ServiceName service_name, size_t max_sessions) {
|
||||
return this->RegisterServerImpl(port_index, cmif::ServiceObjectHolder(), service_name, max_sessions);
|
||||
R_RETURN(this->RegisterServerImpl(port_index, cmif::ServiceObjectHolder(), service_name, max_sessions));
|
||||
}
|
||||
|
||||
/* Processing. */
|
||||
|
@ -503,7 +503,7 @@ namespace ams::sf::hipc {
|
|||
template<typename Interface, bool Enable = ManagerOptions::CanManageMitmServers, typename = typename std::enable_if<Enable>::type>
|
||||
Result RegisterMitmServer(int port_index, sm::ServiceName service_name) {
|
||||
AMS_ABORT_UNLESS(this->CanManageMitmServers());
|
||||
return this->template RegisterMitmServerImpl<Interface>(port_index, cmif::ServiceObjectHolder(), service_name);
|
||||
R_RETURN(this->template RegisterMitmServerImpl<Interface>(port_index, cmif::ServiceObjectHolder(), service_name));
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -140,36 +140,36 @@ namespace ams::sf::hipc {
|
|||
#endif
|
||||
|
||||
Result ReceiveRequest(ServerSession *session, const cmif::PointerAndSize &message) {
|
||||
return this->ReceiveRequestImpl(session, message);
|
||||
R_RETURN(this->ReceiveRequestImpl(session, message));
|
||||
}
|
||||
|
||||
Result RegisterSession(ServerSession **out, os::NativeHandle session_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->RegisterSessionImpl(session_memory, session_handle, std::forward<cmif::ServiceObjectHolder>(obj));
|
||||
R_RETURN(this->RegisterSessionImpl(session_memory, session_handle, std::forward<cmif::ServiceObjectHolder>(obj)));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
R_RETURN(this->CreateSessionImpl(out, ctor));
|
||||
}
|
||||
|
||||
Result AcceptSession(ServerSession **out, os::NativeHandle port_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->AcceptSessionImpl(session_memory, port_handle, std::forward<cmif::ServiceObjectHolder>(obj));
|
||||
R_RETURN(this->AcceptSessionImpl(session_memory, port_handle, std::forward<cmif::ServiceObjectHolder>(obj)));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
R_RETURN(this->CreateSessionImpl(out, ctor));
|
||||
}
|
||||
|
||||
#if AMS_SF_MITM_SUPPORTED
|
||||
Result RegisterMitmSession(ServerSession **out, os::NativeHandle mitm_session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->RegisterMitmSessionImpl(session_memory, mitm_session_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
R_RETURN(this->RegisterMitmSessionImpl(session_memory, mitm_session_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv)));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
R_RETURN(this->CreateSessionImpl(out, ctor));
|
||||
}
|
||||
|
||||
Result AcceptMitmSession(ServerSession **out, os::NativeHandle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->AcceptMitmSessionImpl(session_memory, mitm_port_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
R_RETURN(this->AcceptMitmSessionImpl(session_memory, mitm_port_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv)));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
R_RETURN(this->CreateSessionImpl(out, ctor));
|
||||
}
|
||||
#endif
|
||||
public:
|
||||
|
@ -183,13 +183,13 @@ namespace ams::sf::hipc {
|
|||
|
||||
template<typename Interface>
|
||||
Result AcceptSession(os::NativeHandle port_handle, SharedPointer<Interface> obj) {
|
||||
return this->AcceptSession(port_handle, cmif::ServiceObjectHolder(std::move(obj)));
|
||||
R_RETURN(this->AcceptSession(port_handle, cmif::ServiceObjectHolder(std::move(obj))));
|
||||
}
|
||||
|
||||
#if AMS_SF_MITM_SUPPORTED
|
||||
template<typename Interface>
|
||||
Result AcceptMitmSession(os::NativeHandle mitm_port_handle, SharedPointer<Interface> obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
return this->AcceptMitmSession(mitm_port_handle, cmif::ServiceObjectHolder(std::move(obj)), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
R_RETURN(this->AcceptMitmSession(mitm_port_handle, cmif::ServiceObjectHolder(std::move(obj)), std::forward<std::shared_ptr<::Service>>(fsrv)));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1197,7 +1197,7 @@ namespace ams::sf::impl {
|
|||
|
||||
sf::IServiceObject * const this_ptr = ctx.srv_obj;
|
||||
command_result = [this_ptr, invoke_impl, &args_tuple]<size_t ...Ix>(std::index_sequence<Ix...>) ALWAYS_INLINE_LAMBDA {
|
||||
return invoke_impl(this_ptr, std::forward<typename std::tuple_element<Ix, TrueArgumentsTuple>::type>(std::get<Ix>(args_tuple))...);
|
||||
R_RETURN(invoke_impl(this_ptr, std::forward<typename std::tuple_element<Ix, TrueArgumentsTuple>::type>(std::get<Ix>(args_tuple))...));
|
||||
}(std::make_index_sequence<std::tuple_size<typename CommandMeta::ArgsTypeForInvoke>::value>());
|
||||
}
|
||||
|
||||
|
@ -1205,7 +1205,7 @@ namespace ams::sf::impl {
|
|||
cmif::PointerAndSize out_raw_data;
|
||||
ctx.processor->PrepareForErrorReply(ctx, out_raw_data, runtime_metadata);
|
||||
R_TRY(GetCmifOutHeaderPointer(out_header_ptr, out_raw_data));
|
||||
return command_result;
|
||||
R_RETURN(command_result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1254,14 +1254,14 @@ namespace ams::sf::impl {
|
|||
constexpr bool ReturnsVoid = std::is_same<Return, void>::value;
|
||||
static_assert(ReturnsResult || ReturnsVoid, "Service Commands must return Result or void.");
|
||||
|
||||
return InvokeServiceCommandImplCommon<CommandMeta, Arguments...>(out_header_ptr, ctx, in_raw_data, +[](sf::IServiceObject *srv_obj, Arguments &&... args) -> Result {
|
||||
R_RETURN((InvokeServiceCommandImplCommon<CommandMeta, Arguments...>(out_header_ptr, ctx, in_raw_data, +[](sf::IServiceObject *srv_obj, Arguments &&... args) -> Result {
|
||||
if constexpr (ReturnsResult) {
|
||||
return (static_cast<ClassType *>(srv_obj)->*ServiceCommandImpl)(std::forward<Arguments>(args)...);
|
||||
R_RETURN((static_cast<ClassType *>(srv_obj)->*ServiceCommandImpl)(std::forward<Arguments>(args)...));
|
||||
} else {
|
||||
(static_cast<ClassType *>(srv_obj)->*ServiceCommandImpl)(std::forward<Arguments>(args)...);
|
||||
R_SUCCEED();
|
||||
}
|
||||
});
|
||||
})));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace ams::spl {
|
|||
R_UNLESS(spl::ResultSecureMonitorError::Includes(converted), spl::ResultUnexpectedSecureMonitorResult());
|
||||
|
||||
/* Return the error. */
|
||||
return converted;
|
||||
R_RETURN(converted);
|
||||
}
|
||||
|
||||
enum class CipherMode {
|
||||
|
|
|
@ -23,32 +23,32 @@
|
|||
namespace aarch64::lp64 {
|
||||
|
||||
ALWAYS_INLINE Result SetHeapSize(::ams::svc::Address *out_address, ::ams::svc::Size size) {
|
||||
return ::svcSetHeapSize(reinterpret_cast<void **>(out_address), size);
|
||||
R_RETURN(::svcSetHeapSize(reinterpret_cast<void **>(out_address), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetHeapSize(uintptr_t *out_address, ::ams::svc::Size size) {
|
||||
static_assert(sizeof(::ams::svc::Address) == sizeof(uintptr_t));
|
||||
return ::svcSetHeapSize(reinterpret_cast<void **>(out_address), size);
|
||||
R_RETURN(::svcSetHeapSize(reinterpret_cast<void **>(out_address), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetMemoryPermission(::ams::svc::Address address, ::ams::svc::Size size, ::ams::svc::MemoryPermission perm) {
|
||||
return ::svcSetMemoryPermission(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(perm));
|
||||
R_RETURN(::svcSetMemoryPermission(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetMemoryAttribute(::ams::svc::Address address, ::ams::svc::Size size, uint32_t mask, uint32_t attr) {
|
||||
return ::svcSetMemoryAttribute(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, mask, attr);
|
||||
R_RETURN(::svcSetMemoryAttribute(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, mask, attr));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapMemory(::ams::svc::Address dst_address, ::ams::svc::Address src_address, ::ams::svc::Size size) {
|
||||
return ::svcMapMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), reinterpret_cast<void *>(static_cast<uintptr_t>(src_address)), size);
|
||||
R_RETURN(::svcMapMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), reinterpret_cast<void *>(static_cast<uintptr_t>(src_address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapMemory(::ams::svc::Address dst_address, ::ams::svc::Address src_address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), reinterpret_cast<void *>(static_cast<uintptr_t>(src_address)), size);
|
||||
R_RETURN(::svcUnmapMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), reinterpret_cast<void *>(static_cast<uintptr_t>(src_address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result QueryMemory(::ams::svc::UserPointer< ::ams::svc::lp64::MemoryInfo *> out_memory_info, ::ams::svc::PageInfo *out_page_info, ::ams::svc::Address address) {
|
||||
return ::svcQueryMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), address);
|
||||
R_RETURN(::svcQueryMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), address));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ExitProcess() {
|
||||
|
@ -56,11 +56,11 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateThread(::ams::svc::Handle *out_handle, ::ams::svc::ThreadFunc func, ::ams::svc::Address arg, ::ams::svc::Address stack_bottom, int32_t priority, int32_t core_id) {
|
||||
return ::svcCreateThread(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(func)), reinterpret_cast<void *>(static_cast<uintptr_t>(arg)), reinterpret_cast<void *>(static_cast<uintptr_t>(stack_bottom)), priority, core_id);
|
||||
R_RETURN(::svcCreateThread(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(func)), reinterpret_cast<void *>(static_cast<uintptr_t>(arg)), reinterpret_cast<void *>(static_cast<uintptr_t>(stack_bottom)), priority, core_id));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result StartThread(::ams::svc::Handle thread_handle) {
|
||||
return ::svcStartThread(thread_handle);
|
||||
R_RETURN(::svcStartThread(thread_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ExitThread() {
|
||||
|
@ -72,19 +72,19 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result GetThreadPriority(int32_t *out_priority, ::ams::svc::Handle thread_handle) {
|
||||
return ::svcGetThreadPriority(out_priority, thread_handle);
|
||||
R_RETURN(::svcGetThreadPriority(out_priority, thread_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetThreadPriority(::ams::svc::Handle thread_handle, int32_t priority) {
|
||||
return ::svcSetThreadPriority(thread_handle, priority);
|
||||
R_RETURN(::svcSetThreadPriority(thread_handle, priority));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetThreadCoreMask(int32_t *out_core_id, uint64_t *out_affinity_mask, ::ams::svc::Handle thread_handle) {
|
||||
return ::svcGetThreadCoreMask(out_core_id, out_affinity_mask, thread_handle);
|
||||
R_RETURN(::svcGetThreadCoreMask(out_core_id, out_affinity_mask, thread_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetThreadCoreMask(::ams::svc::Handle thread_handle, int32_t core_id, uint64_t affinity_mask) {
|
||||
return ::svcSetThreadCoreMask(thread_handle, core_id, affinity_mask);
|
||||
R_RETURN(::svcSetThreadCoreMask(thread_handle, core_id, affinity_mask));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE int32_t GetCurrentProcessorNumber() {
|
||||
|
@ -92,51 +92,51 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result SignalEvent(::ams::svc::Handle event_handle) {
|
||||
return ::svcSignalEvent(event_handle);
|
||||
R_RETURN(::svcSignalEvent(event_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ClearEvent(::ams::svc::Handle event_handle) {
|
||||
return ::svcClearEvent(event_handle);
|
||||
R_RETURN(::svcClearEvent(event_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapSharedMemory(::ams::svc::Handle shmem_handle, ::ams::svc::Address address, ::ams::svc::Size size, ::ams::svc::MemoryPermission map_perm) {
|
||||
return ::svcMapSharedMemory(shmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(map_perm));
|
||||
R_RETURN(::svcMapSharedMemory(shmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(map_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapSharedMemory(::ams::svc::Handle shmem_handle, ::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapSharedMemory(shmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcUnmapSharedMemory(shmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateTransferMemory(::ams::svc::Handle *out_handle, ::ams::svc::Address address, ::ams::svc::Size size, ::ams::svc::MemoryPermission map_perm) {
|
||||
return ::svcCreateTransferMemory(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(map_perm));
|
||||
R_RETURN(::svcCreateTransferMemory(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(map_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CloseHandle(::ams::svc::Handle handle) {
|
||||
return ::svcCloseHandle(handle);
|
||||
R_RETURN(::svcCloseHandle(handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ResetSignal(::ams::svc::Handle handle) {
|
||||
return ::svcResetSignal(handle);
|
||||
R_RETURN(::svcResetSignal(handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result WaitSynchronization(int32_t *out_index, ::ams::svc::UserPointer<const ::ams::svc::Handle *> handles, int32_t num_handles, int64_t timeout_ns) {
|
||||
return ::svcWaitSynchronization(out_index, handles.GetPointerUnsafe(), num_handles, timeout_ns);
|
||||
R_RETURN(::svcWaitSynchronization(out_index, handles.GetPointerUnsafe(), num_handles, timeout_ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CancelSynchronization(::ams::svc::Handle handle) {
|
||||
return ::svcCancelSynchronization(handle);
|
||||
R_RETURN(::svcCancelSynchronization(handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ArbitrateLock(::ams::svc::Handle thread_handle, ::ams::svc::Address address, uint32_t tag) {
|
||||
return ::svcArbitrateLock(thread_handle, reinterpret_cast<u32 *>(static_cast<uintptr_t>(address)), tag);
|
||||
R_RETURN(::svcArbitrateLock(thread_handle, reinterpret_cast<u32 *>(static_cast<uintptr_t>(address)), tag));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ArbitrateUnlock(::ams::svc::Address address) {
|
||||
return ::svcArbitrateUnlock(reinterpret_cast<u32 *>(static_cast<uintptr_t>(address)));
|
||||
R_RETURN(::svcArbitrateUnlock(reinterpret_cast<u32 *>(static_cast<uintptr_t>(address))));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result WaitProcessWideKeyAtomic(::ams::svc::Address address, ::ams::svc::Address cv_key, uint32_t tag, int64_t timeout_ns) {
|
||||
return ::svcWaitProcessWideKeyAtomic(reinterpret_cast<u32 *>(static_cast<uintptr_t>(address)), reinterpret_cast<u32 *>(static_cast<uintptr_t>(cv_key)), tag, timeout_ns);
|
||||
R_RETURN(::svcWaitProcessWideKeyAtomic(reinterpret_cast<u32 *>(static_cast<uintptr_t>(address)), reinterpret_cast<u32 *>(static_cast<uintptr_t>(cv_key)), tag, timeout_ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SignalProcessWideKey(::ams::svc::Address cv_key, int32_t count) {
|
||||
|
@ -148,31 +148,31 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result ConnectToNamedPort(::ams::svc::Handle *out_handle, ::ams::svc::UserPointer<const char *> name) {
|
||||
return ::svcConnectToNamedPort(out_handle, name.GetPointerUnsafe());
|
||||
R_RETURN(::svcConnectToNamedPort(out_handle, name.GetPointerUnsafe()));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SendSyncRequestLight(::ams::svc::Handle session_handle) {
|
||||
return ::svcSendSyncRequestLight(session_handle);
|
||||
R_RETURN(::svcSendSyncRequestLight(session_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SendSyncRequest(::ams::svc::Handle session_handle) {
|
||||
return ::svcSendSyncRequest(session_handle);
|
||||
R_RETURN(::svcSendSyncRequest(session_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SendSyncRequestWithUserBuffer(::ams::svc::Address message_buffer, ::ams::svc::Size message_buffer_size, ::ams::svc::Handle session_handle) {
|
||||
return ::svcSendSyncRequestWithUserBuffer(reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, session_handle);
|
||||
R_RETURN(::svcSendSyncRequestWithUserBuffer(reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, session_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SendAsyncRequestWithUserBuffer(::ams::svc::Handle *out_event_handle, ::ams::svc::Address message_buffer, ::ams::svc::Size message_buffer_size, ::ams::svc::Handle session_handle) {
|
||||
return ::svcSendAsyncRequestWithUserBuffer(out_event_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, session_handle);
|
||||
R_RETURN(::svcSendAsyncRequestWithUserBuffer(out_event_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, session_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetProcessId(uint64_t *out_process_id, ::ams::svc::Handle process_handle) {
|
||||
return ::svcGetProcessId(out_process_id, process_handle);
|
||||
R_RETURN(::svcGetProcessId(out_process_id, process_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetThreadId(uint64_t *out_thread_id, ::ams::svc::Handle thread_handle) {
|
||||
return ::svcGetThreadId(out_thread_id, thread_handle);
|
||||
R_RETURN(::svcGetThreadId(out_thread_id, thread_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void Break(::ams::svc::BreakReason break_reason, ::ams::svc::Address arg, ::ams::svc::Size size) {
|
||||
|
@ -180,7 +180,7 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result OutputDebugString(::ams::svc::UserPointer<const char *> debug_str, ::ams::svc::Size len) {
|
||||
return ::svcOutputDebugString(debug_str.GetPointerUnsafe(), len);
|
||||
R_RETURN(::svcOutputDebugString(debug_str.GetPointerUnsafe(), len));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void ReturnFromException(::ams::Result result) {
|
||||
|
@ -188,7 +188,7 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result GetInfo(uint64_t *out, ::ams::svc::InfoType info_type, ::ams::svc::Handle handle, uint64_t info_subtype) {
|
||||
return ::svcGetInfo(out, static_cast<u32>(info_type), handle, info_subtype);
|
||||
R_RETURN(::svcGetInfo(out, static_cast<u32>(info_type), handle, info_subtype));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void FlushEntireDataCache() {
|
||||
|
@ -196,47 +196,47 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result FlushDataCache(::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcFlushDataCache(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcFlushDataCache(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapPhysicalMemory(::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcMapPhysicalMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcMapPhysicalMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapPhysicalMemory(::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapPhysicalMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcUnmapPhysicalMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetDebugFutureThreadInfo(::ams::svc::lp64::LastThreadContext *out_context, uint64_t *thread_id, ::ams::svc::Handle debug_handle, int64_t ns) {
|
||||
return ::svcGetDebugFutureThreadInfo(reinterpret_cast<::LastThreadContext *>(out_context), thread_id, debug_handle, ns);
|
||||
R_RETURN(::svcGetDebugFutureThreadInfo(reinterpret_cast<::LastThreadContext *>(out_context), thread_id, debug_handle, ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetLastThreadInfo(::ams::svc::lp64::LastThreadContext *out_context, ::ams::svc::Address *out_tls_address, uint32_t *out_flags) {
|
||||
return ::svcGetLastThreadInfo(reinterpret_cast<::LastThreadContext *>(out_context), reinterpret_cast<u64 *>(out_tls_address), out_flags);
|
||||
R_RETURN(::svcGetLastThreadInfo(reinterpret_cast<::LastThreadContext *>(out_context), reinterpret_cast<u64 *>(out_tls_address), out_flags));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetResourceLimitLimitValue(int64_t *out_limit_value, ::ams::svc::Handle resource_limit_handle, ::ams::svc::LimitableResource which) {
|
||||
return ::svcGetResourceLimitLimitValue(out_limit_value, resource_limit_handle, static_cast<::LimitableResource>(which));
|
||||
R_RETURN(::svcGetResourceLimitLimitValue(out_limit_value, resource_limit_handle, static_cast<::LimitableResource>(which)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetResourceLimitCurrentValue(int64_t *out_current_value, ::ams::svc::Handle resource_limit_handle, ::ams::svc::LimitableResource which) {
|
||||
return ::svcGetResourceLimitCurrentValue(out_current_value, resource_limit_handle, static_cast<::LimitableResource>(which));
|
||||
R_RETURN(::svcGetResourceLimitCurrentValue(out_current_value, resource_limit_handle, static_cast<::LimitableResource>(which)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetThreadActivity(::ams::svc::Handle thread_handle, ::ams::svc::ThreadActivity thread_activity) {
|
||||
return ::svcSetThreadActivity(thread_handle, static_cast<::ThreadActivity>(thread_activity));
|
||||
R_RETURN(::svcSetThreadActivity(thread_handle, static_cast<::ThreadActivity>(thread_activity)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetThreadContext3(::ams::svc::UserPointer< ::ams::svc::ThreadContext *> out_context, ::ams::svc::Handle thread_handle) {
|
||||
return ::svcGetThreadContext3(reinterpret_cast<::ThreadContext *>(out_context.GetPointerUnsafe()), thread_handle);
|
||||
R_RETURN(::svcGetThreadContext3(reinterpret_cast<::ThreadContext *>(out_context.GetPointerUnsafe()), thread_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result WaitForAddress(::ams::svc::Address address, ::ams::svc::ArbitrationType arb_type, int32_t value, int64_t timeout_ns) {
|
||||
return ::svcWaitForAddress(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), arb_type, value, timeout_ns);
|
||||
R_RETURN(::svcWaitForAddress(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), arb_type, value, timeout_ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SignalToAddress(::ams::svc::Address address, ::ams::svc::SignalType signal_type, int32_t value, int32_t count) {
|
||||
return ::svcSignalToAddress(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), signal_type, value, count);
|
||||
R_RETURN(::svcSignalToAddress(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), signal_type, value, count));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SynchronizePreemptionState() {
|
||||
|
@ -244,7 +244,7 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result GetResourceLimitPeakValue(int64_t *out_peak_value, ::ams::svc::Handle resource_limit_handle, ::ams::svc::LimitableResource which) {
|
||||
return ::svcGetResourceLimitPeakValue(out_peak_value, resource_limit_handle, static_cast<::LimitableResource>(which));
|
||||
R_RETURN(::svcGetResourceLimitPeakValue(out_peak_value, resource_limit_handle, static_cast<::LimitableResource>(which)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void KernelDebug(::ams::svc::KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2) {
|
||||
|
@ -256,47 +256,47 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateSession(::ams::svc::Handle *out_server_session_handle, ::ams::svc::Handle *out_client_session_handle, bool is_light, ::ams::svc::Address name) {
|
||||
return ::svcCreateSession(out_server_session_handle, out_client_session_handle, is_light, name);
|
||||
R_RETURN(::svcCreateSession(out_server_session_handle, out_client_session_handle, is_light, name));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result AcceptSession(::ams::svc::Handle *out_handle, ::ams::svc::Handle port) {
|
||||
return ::svcAcceptSession(out_handle, port);
|
||||
R_RETURN(::svcAcceptSession(out_handle, port));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ReplyAndReceiveLight(::ams::svc::Handle handle) {
|
||||
return ::svcReplyAndReceiveLight(handle);
|
||||
R_RETURN(::svcReplyAndReceiveLight(handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ReplyAndReceive(int32_t *out_index, ::ams::svc::UserPointer<const ::ams::svc::Handle *> handles, int32_t num_handles, ::ams::svc::Handle reply_target, int64_t timeout_ns) {
|
||||
return ::svcReplyAndReceive(out_index, handles.GetPointerUnsafe(), num_handles, reply_target, timeout_ns);
|
||||
R_RETURN(::svcReplyAndReceive(out_index, handles.GetPointerUnsafe(), num_handles, reply_target, timeout_ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ReplyAndReceiveWithUserBuffer(int32_t *out_index, ::ams::svc::Address message_buffer, ::ams::svc::Size message_buffer_size, ::ams::svc::UserPointer<const ::ams::svc::Handle *> handles, int32_t num_handles, ::ams::svc::Handle reply_target, int64_t timeout_ns) {
|
||||
return ::svcReplyAndReceiveWithUserBuffer(out_index, reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, handles.GetPointerUnsafe(), num_handles, reply_target, timeout_ns);
|
||||
R_RETURN(::svcReplyAndReceiveWithUserBuffer(out_index, reinterpret_cast<void *>(static_cast<uintptr_t>(message_buffer)), message_buffer_size, handles.GetPointerUnsafe(), num_handles, reply_target, timeout_ns));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateEvent(::ams::svc::Handle *out_write_handle, ::ams::svc::Handle *out_read_handle) {
|
||||
return ::svcCreateEvent(out_write_handle, out_read_handle);
|
||||
R_RETURN(::svcCreateEvent(out_write_handle, out_read_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapPhysicalMemoryUnsafe(::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcMapPhysicalMemoryUnsafe(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcMapPhysicalMemoryUnsafe(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapPhysicalMemoryUnsafe(::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapPhysicalMemoryUnsafe(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcUnmapPhysicalMemoryUnsafe(reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetUnsafeLimit(::ams::svc::Size limit) {
|
||||
return ::svcSetUnsafeLimit(limit);
|
||||
R_RETURN(::svcSetUnsafeLimit(limit));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateCodeMemory(::ams::svc::Handle *out_handle, ::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcCreateCodeMemory(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcCreateCodeMemory(out_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ControlCodeMemory(::ams::svc::Handle code_memory_handle, ::ams::svc::CodeMemoryOperation operation, uint64_t address, uint64_t size, ::ams::svc::MemoryPermission perm) {
|
||||
return ::svcControlCodeMemory(code_memory_handle, static_cast<::CodeMapOperation>(operation), reinterpret_cast<void *>(address), size, static_cast<u32>(perm));
|
||||
R_RETURN(::svcControlCodeMemory(code_memory_handle, static_cast<::CodeMapOperation>(operation), reinterpret_cast<void *>(address), size, static_cast<u32>(perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SleepSystem() {
|
||||
|
@ -304,199 +304,199 @@
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result ReadWriteRegister(uint32_t *out_value, ::ams::svc::PhysicalAddress address, uint32_t mask, uint32_t value) {
|
||||
return ::svcReadWriteRegister(out_value, address, mask, value);
|
||||
R_RETURN(::svcReadWriteRegister(out_value, address, mask, value));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetProcessActivity(::ams::svc::Handle process_handle, ::ams::svc::ProcessActivity process_activity) {
|
||||
return ::svcSetProcessActivity(process_handle, static_cast<::ProcessActivity>(process_activity));
|
||||
R_RETURN(::svcSetProcessActivity(process_handle, static_cast<::ProcessActivity>(process_activity)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateSharedMemory(::ams::svc::Handle *out_handle, ::ams::svc::Size size, ::ams::svc::MemoryPermission owner_perm, ::ams::svc::MemoryPermission remote_perm) {
|
||||
return ::svcCreateSharedMemory(out_handle, size, static_cast<u32>(owner_perm), static_cast<u32>(remote_perm));
|
||||
R_RETURN(::svcCreateSharedMemory(out_handle, size, static_cast<u32>(owner_perm), static_cast<u32>(remote_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapTransferMemory(::ams::svc::Handle trmem_handle, ::ams::svc::Address address, ::ams::svc::Size size, ::ams::svc::MemoryPermission owner_perm) {
|
||||
return ::svcMapTransferMemory(trmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(owner_perm));
|
||||
R_RETURN(::svcMapTransferMemory(trmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size, static_cast<u32>(owner_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapTransferMemory(::ams::svc::Handle trmem_handle, ::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapTransferMemory(trmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size);
|
||||
R_RETURN(::svcUnmapTransferMemory(trmem_handle, reinterpret_cast<void *>(static_cast<uintptr_t>(address)), size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateInterruptEvent(::ams::svc::Handle *out_read_handle, int32_t interrupt_id, ::ams::svc::InterruptType interrupt_type) {
|
||||
return ::svcCreateInterruptEvent(out_read_handle, interrupt_id, static_cast<u32>(interrupt_type));
|
||||
R_RETURN(::svcCreateInterruptEvent(out_read_handle, interrupt_id, static_cast<u32>(interrupt_type)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result QueryPhysicalAddress(::ams::svc::lp64::PhysicalMemoryInfo *out_info, ::ams::svc::Address address) {
|
||||
return ::svcQueryPhysicalAddress(reinterpret_cast<::PhysicalMemoryInfo *>(out_info), address);
|
||||
R_RETURN(::svcQueryPhysicalAddress(reinterpret_cast<::PhysicalMemoryInfo *>(out_info), address));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result QueryIoMapping(::ams::svc::Address *out_address, ::ams::svc::Size *out_size, ::ams::svc::PhysicalAddress physical_address, ::ams::svc::Size size) {
|
||||
return ::svcQueryIoMapping(reinterpret_cast<u64 *>(out_address), reinterpret_cast<u64 *>(out_size), physical_address, size);
|
||||
R_RETURN(::svcQueryIoMapping(reinterpret_cast<u64 *>(out_address), reinterpret_cast<u64 *>(out_size), physical_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result LegacyQueryIoMapping(::ams::svc::Address *out_address, ::ams::svc::PhysicalAddress physical_address, ::ams::svc::Size size) {
|
||||
return ::svcLegacyQueryIoMapping(reinterpret_cast<u64 *>(out_address), physical_address, size);
|
||||
R_RETURN(::svcLegacyQueryIoMapping(reinterpret_cast<u64 *>(out_address), physical_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateDeviceAddressSpace(::ams::svc::Handle *out_handle, uint64_t das_address, uint64_t das_size) {
|
||||
return ::svcCreateDeviceAddressSpace(out_handle, das_address, das_size);
|
||||
R_RETURN(::svcCreateDeviceAddressSpace(out_handle, das_address, das_size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result AttachDeviceAddressSpace(::ams::svc::DeviceName device_name, ::ams::svc::Handle das_handle) {
|
||||
return ::svcAttachDeviceAddressSpace(static_cast<u64>(device_name), das_handle);
|
||||
R_RETURN(::svcAttachDeviceAddressSpace(static_cast<u64>(device_name), das_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result DetachDeviceAddressSpace(::ams::svc::DeviceName device_name, ::ams::svc::Handle das_handle) {
|
||||
return ::svcDetachDeviceAddressSpace(static_cast<u64>(device_name), das_handle);
|
||||
R_RETURN(::svcDetachDeviceAddressSpace(static_cast<u64>(device_name), das_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapDeviceAddressSpaceByForce(::ams::svc::Handle das_handle, ::ams::svc::Handle process_handle, uint64_t process_address, ::ams::svc::Size size, uint64_t device_address, ::ams::svc::MemoryPermission device_perm) {
|
||||
return ::svcMapDeviceAddressSpaceByForce(das_handle, process_handle, process_address, size, device_address, static_cast<u32>(device_perm));
|
||||
R_RETURN(::svcMapDeviceAddressSpaceByForce(das_handle, process_handle, process_address, size, device_address, static_cast<u32>(device_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapDeviceAddressSpaceAligned(::ams::svc::Handle das_handle, ::ams::svc::Handle process_handle, uint64_t process_address, ::ams::svc::Size size, uint64_t device_address, ::ams::svc::MemoryPermission device_perm) {
|
||||
return ::svcMapDeviceAddressSpaceAligned(das_handle, process_handle, process_address, size, device_address, static_cast<u32>(device_perm));
|
||||
R_RETURN(::svcMapDeviceAddressSpaceAligned(das_handle, process_handle, process_address, size, device_address, static_cast<u32>(device_perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapDeviceAddressSpace(::ams::svc::Handle das_handle, ::ams::svc::Handle process_handle, uint64_t process_address, ::ams::svc::Size size, uint64_t device_address) {
|
||||
return ::svcUnmapDeviceAddressSpace(das_handle, process_handle, process_address, size, device_address);
|
||||
R_RETURN(::svcUnmapDeviceAddressSpace(das_handle, process_handle, process_address, size, device_address));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result InvalidateProcessDataCache(::ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return ::svcInvalidateProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(::svcInvalidateProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result StoreProcessDataCache(::ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return ::svcStoreProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(::svcStoreProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result FlushProcessDataCache(::ams::svc::Handle process_handle, uint64_t address, uint64_t size) {
|
||||
return ::svcFlushProcessDataCache(process_handle, address, size);
|
||||
R_RETURN(::svcFlushProcessDataCache(process_handle, address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result DebugActiveProcess(::ams::svc::Handle *out_handle, uint64_t process_id) {
|
||||
return ::svcDebugActiveProcess(out_handle, process_id);
|
||||
R_RETURN(::svcDebugActiveProcess(out_handle, process_id));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result BreakDebugProcess(::ams::svc::Handle debug_handle) {
|
||||
return ::svcBreakDebugProcess(debug_handle);
|
||||
R_RETURN(::svcBreakDebugProcess(debug_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result TerminateDebugProcess(::ams::svc::Handle debug_handle) {
|
||||
return ::svcTerminateDebugProcess(debug_handle);
|
||||
R_RETURN(::svcTerminateDebugProcess(debug_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetDebugEvent(::ams::svc::UserPointer< ::ams::svc::lp64::DebugEventInfo *> out_info, ::ams::svc::Handle debug_handle) {
|
||||
return ::svcGetDebugEvent(out_info.GetPointerUnsafe(), debug_handle);
|
||||
R_RETURN(::svcGetDebugEvent(out_info.GetPointerUnsafe(), debug_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ContinueDebugEvent(::ams::svc::Handle debug_handle, uint32_t flags, ::ams::svc::UserPointer<const uint64_t *> thread_ids, int32_t num_thread_ids) {
|
||||
return ::svcContinueDebugEvent(debug_handle, flags, const_cast<u64 *>(thread_ids.GetPointerUnsafe()), num_thread_ids);
|
||||
R_RETURN(::svcContinueDebugEvent(debug_handle, flags, const_cast<u64 *>(thread_ids.GetPointerUnsafe()), num_thread_ids));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result LegacyContinueDebugEvent(::ams::svc::Handle debug_handle, uint32_t flags, uint64_t thread_id) {
|
||||
return ::svcLegacyContinueDebugEvent(debug_handle, flags, thread_id);
|
||||
R_RETURN(::svcLegacyContinueDebugEvent(debug_handle, flags, thread_id));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetProcessList(int32_t *out_num_processes, ::ams::svc::UserPointer<uint64_t *> out_process_ids, int32_t max_out_count) {
|
||||
return ::svcGetProcessList(out_num_processes, out_process_ids.GetPointerUnsafe(), max_out_count);
|
||||
R_RETURN(::svcGetProcessList(out_num_processes, out_process_ids.GetPointerUnsafe(), max_out_count));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetThreadList(int32_t *out_num_threads, ::ams::svc::UserPointer<uint64_t *> out_thread_ids, int32_t max_out_count, ::ams::svc::Handle debug_handle) {
|
||||
return ::svcGetThreadList(out_num_threads, out_thread_ids.GetPointerUnsafe(), max_out_count, debug_handle);
|
||||
R_RETURN(::svcGetThreadList(out_num_threads, out_thread_ids.GetPointerUnsafe(), max_out_count, debug_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetDebugThreadContext(::ams::svc::UserPointer< ::ams::svc::ThreadContext *> out_context, ::ams::svc::Handle debug_handle, uint64_t thread_id, uint32_t context_flags) {
|
||||
return ::svcGetDebugThreadContext(reinterpret_cast<::ThreadContext *>(out_context.GetPointerUnsafe()), debug_handle, thread_id, context_flags);
|
||||
R_RETURN(::svcGetDebugThreadContext(reinterpret_cast<::ThreadContext *>(out_context.GetPointerUnsafe()), debug_handle, thread_id, context_flags));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetDebugThreadContext(::ams::svc::Handle debug_handle, uint64_t thread_id, ::ams::svc::UserPointer<const ::ams::svc::ThreadContext *> context, uint32_t context_flags) {
|
||||
return ::svcSetDebugThreadContext(debug_handle, thread_id, reinterpret_cast<const ::ThreadContext *>(context.GetPointerUnsafe()), context_flags);
|
||||
R_RETURN(::svcSetDebugThreadContext(debug_handle, thread_id, reinterpret_cast<const ::ThreadContext *>(context.GetPointerUnsafe()), context_flags));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result QueryDebugProcessMemory(::ams::svc::UserPointer< ::ams::svc::lp64::MemoryInfo *> out_memory_info, ::ams::svc::PageInfo *out_page_info, ::ams::svc::Handle process_handle, ::ams::svc::Address address) {
|
||||
return ::svcQueryDebugProcessMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), process_handle, address);
|
||||
R_RETURN(::svcQueryDebugProcessMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), process_handle, address));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ReadDebugProcessMemory(::ams::svc::Address buffer, ::ams::svc::Handle debug_handle, ::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcReadDebugProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(buffer)), debug_handle, address, size);
|
||||
R_RETURN(::svcReadDebugProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(buffer)), debug_handle, address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result WriteDebugProcessMemory(::ams::svc::Handle debug_handle, ::ams::svc::Address buffer, ::ams::svc::Address address, ::ams::svc::Size size) {
|
||||
return ::svcWriteDebugProcessMemory(debug_handle, reinterpret_cast<const void *>(static_cast<uintptr_t>(buffer)), address, size);
|
||||
R_RETURN(::svcWriteDebugProcessMemory(debug_handle, reinterpret_cast<const void *>(static_cast<uintptr_t>(buffer)), address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetHardwareBreakPoint(::ams::svc::HardwareBreakPointRegisterName name, uint64_t flags, uint64_t value) {
|
||||
return ::svcSetHardwareBreakPoint(static_cast<u32>(name), flags, value);
|
||||
R_RETURN(::svcSetHardwareBreakPoint(static_cast<u32>(name), flags, value));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetDebugThreadParam(uint64_t *out_64, uint32_t *out_32, ::ams::svc::Handle debug_handle, uint64_t thread_id, ::ams::svc::DebugThreadParam param) {
|
||||
return ::svcGetDebugThreadParam(out_64, out_32, debug_handle, thread_id, static_cast<::DebugThreadParam>(param));
|
||||
R_RETURN(::svcGetDebugThreadParam(out_64, out_32, debug_handle, thread_id, static_cast<::DebugThreadParam>(param)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetSystemInfo(uint64_t *out, ::ams::svc::SystemInfoType info_type, ::ams::svc::Handle handle, uint64_t info_subtype) {
|
||||
return ::svcGetSystemInfo(out, static_cast<u64>(info_type), handle, info_subtype);
|
||||
R_RETURN(::svcGetSystemInfo(out, static_cast<u64>(info_type), handle, info_subtype));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreatePort(::ams::svc::Handle *out_server_handle, ::ams::svc::Handle *out_client_handle, int32_t max_sessions, bool is_light, ::ams::svc::Address name) {
|
||||
return ::svcCreatePort(out_server_handle, out_client_handle, max_sessions, is_light, reinterpret_cast<const char *>(static_cast<uintptr_t>(name)));
|
||||
R_RETURN(::svcCreatePort(out_server_handle, out_client_handle, max_sessions, is_light, reinterpret_cast<const char *>(static_cast<uintptr_t>(name))));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ManageNamedPort(::ams::svc::Handle *out_server_handle, ::ams::svc::UserPointer<const char *> name, int32_t max_sessions) {
|
||||
return ::svcManageNamedPort(out_server_handle, name.GetPointerUnsafe(), max_sessions);
|
||||
R_RETURN(::svcManageNamedPort(out_server_handle, name.GetPointerUnsafe(), max_sessions));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result ConnectToPort(::ams::svc::Handle *out_handle, ::ams::svc::Handle port) {
|
||||
return ::svcConnectToPort(out_handle, port);
|
||||
R_RETURN(::svcConnectToPort(out_handle, port));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetProcessMemoryPermission(::ams::svc::Handle process_handle, uint64_t address, uint64_t size, ::ams::svc::MemoryPermission perm) {
|
||||
return ::svcSetProcessMemoryPermission(process_handle, address, size, static_cast<u32>(perm));
|
||||
R_RETURN(::svcSetProcessMemoryPermission(process_handle, address, size, static_cast<u32>(perm)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapProcessMemory(::ams::svc::Address dst_address, ::ams::svc::Handle process_handle, uint64_t src_address, ::ams::svc::Size size) {
|
||||
return ::svcMapProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), process_handle, src_address, size);
|
||||
R_RETURN(::svcMapProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), process_handle, src_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapProcessMemory(::ams::svc::Address dst_address, ::ams::svc::Handle process_handle, uint64_t src_address, ::ams::svc::Size size) {
|
||||
return ::svcUnmapProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), process_handle, src_address, size);
|
||||
R_RETURN(::svcUnmapProcessMemory(reinterpret_cast<void *>(static_cast<uintptr_t>(dst_address)), process_handle, src_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result QueryProcessMemory(::ams::svc::UserPointer< ::ams::svc::lp64::MemoryInfo *> out_memory_info, ::ams::svc::PageInfo *out_page_info, ::ams::svc::Handle process_handle, uint64_t address) {
|
||||
return ::svcQueryProcessMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), process_handle, address);
|
||||
R_RETURN(::svcQueryProcessMemory(reinterpret_cast<::MemoryInfo *>(out_memory_info.GetPointerUnsafe()), reinterpret_cast<u32 *>(out_page_info), process_handle, address));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result MapProcessCodeMemory(::ams::svc::Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size) {
|
||||
return ::svcMapProcessCodeMemory(process_handle, dst_address, src_address, size);
|
||||
R_RETURN(::svcMapProcessCodeMemory(process_handle, dst_address, src_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result UnmapProcessCodeMemory(::ams::svc::Handle process_handle, uint64_t dst_address, uint64_t src_address, uint64_t size) {
|
||||
return ::svcUnmapProcessCodeMemory(process_handle, dst_address, src_address, size);
|
||||
R_RETURN(::svcUnmapProcessCodeMemory(process_handle, dst_address, src_address, size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateProcess(::ams::svc::Handle *out_handle, ::ams::svc::UserPointer<const ::ams::svc::lp64::CreateProcessParameter *> parameters, ::ams::svc::UserPointer<const uint32_t *> caps, int32_t num_caps) {
|
||||
return ::svcCreateProcess(out_handle, parameters.GetPointerUnsafe(), caps.GetPointerUnsafe(), num_caps);
|
||||
R_RETURN(::svcCreateProcess(out_handle, parameters.GetPointerUnsafe(), caps.GetPointerUnsafe(), num_caps));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result StartProcess(::ams::svc::Handle process_handle, int32_t priority, int32_t core_id, uint64_t main_thread_stack_size) {
|
||||
return ::svcStartProcess(process_handle, priority, core_id, main_thread_stack_size);
|
||||
R_RETURN(::svcStartProcess(process_handle, priority, core_id, main_thread_stack_size));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result TerminateProcess(::ams::svc::Handle process_handle) {
|
||||
return ::svcTerminateProcess(process_handle);
|
||||
R_RETURN(::svcTerminateProcess(process_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetProcessInfo(int64_t *out_info, ::ams::svc::Handle process_handle, ::ams::svc::ProcessInfoType info_type) {
|
||||
return ::svcGetProcessInfo(out_info, process_handle, static_cast<::ProcessInfoType>(info_type));
|
||||
R_RETURN(::svcGetProcessInfo(out_info, process_handle, static_cast<::ProcessInfoType>(info_type)));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateResourceLimit(::ams::svc::Handle *out_handle) {
|
||||
return ::svcCreateResourceLimit(out_handle);
|
||||
R_RETURN(::svcCreateResourceLimit(out_handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result SetResourceLimitLimitValue(::ams::svc::Handle resource_limit_handle, ::ams::svc::LimitableResource which, int64_t limit_value) {
|
||||
return ::svcSetResourceLimitLimitValue(resource_limit_handle, static_cast<::LimitableResource>(which), limit_value);
|
||||
R_RETURN(::svcSetResourceLimitLimitValue(resource_limit_handle, static_cast<::LimitableResource>(which), limit_value));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void CallSecureMonitor(::ams::svc::lp64::SecureMonitorArguments *args) {
|
||||
|
|
|
@ -91,16 +91,16 @@ namespace ams::tipc::impl {
|
|||
|
||||
#define AMS_TIPC_IMPL_PROCESS_METHOD_REQUEST(CLASSNAME, CMD_ID, RETURN, NAME, ARGS, ARGNAMES, VERSION_MIN, VERSION_MAX) \
|
||||
else if (constexpr u16 TipcCommandId = CMD_ID + 0x10; tag == TipcCommandId) { \
|
||||
return this->ProcessMethodById<TipcCommandId, ImplType>(impl, message_buffer, fw_ver); \
|
||||
R_RETURN((this->ProcessMethodById<TipcCommandId, ImplType>(impl, message_buffer, fw_ver))); \
|
||||
}
|
||||
|
||||
#define AMS_TIPC_IMPL_PROCESS_METHOD_REQUEST_BY_ID(CLASSNAME, CMD_ID, RETURN, NAME, ARGS, ARGNAMES, VERSION_MIN, VERSION_MAX) \
|
||||
if constexpr (constexpr u16 TipcCommandId = CMD_ID + 0x10; CommandId == TipcCommandId) { \
|
||||
constexpr bool MinValid = VERSION_MIN == hos::Version_Min; \
|
||||
constexpr bool MaxValid = VERSION_MAX == hos::Version_Max; \
|
||||
if ((MinValid || VERSION_MIN <= fw_ver) && (MaxValid || fw_ver <= VERSION_MAX)) { \
|
||||
return ::ams::tipc::impl::InvokeServiceCommandImpl<TipcCommandId, &ImplType::NAME, ImplType>(impl, message_buffer); \
|
||||
} \
|
||||
#define AMS_TIPC_IMPL_PROCESS_METHOD_REQUEST_BY_ID(CLASSNAME, CMD_ID, RETURN, NAME, ARGS, ARGNAMES, VERSION_MIN, VERSION_MAX) \
|
||||
if constexpr (constexpr u16 TipcCommandId = CMD_ID + 0x10; CommandId == TipcCommandId) { \
|
||||
constexpr bool MinValid = VERSION_MIN == hos::Version_Min; \
|
||||
constexpr bool MaxValid = VERSION_MAX == hos::Version_Max; \
|
||||
if ((MinValid || VERSION_MIN <= fw_ver) && (MaxValid || fw_ver <= VERSION_MAX)) { \
|
||||
R_RETURN((::ams::tipc::impl::InvokeServiceCommandImpl<TipcCommandId, &ImplType::NAME, ImplType>(impl, message_buffer))); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define AMS_TIPC_IMPL_IS_FIRMWARE_VERSION_ALWAYS_VALID(CLASSNAME, CMD_ID, RETURN, NAME, ARGS, ARGNAMES, VERSION_MIN, VERSION_MAX) \
|
||||
|
@ -133,9 +133,9 @@ namespace ams::tipc::impl {
|
|||
ALWAYS_INLINE Result ProcessDefaultMethod(ImplType *impl, const MessageBuffer &message_buffer) const { \
|
||||
/* Handle a default command. */ \
|
||||
if constexpr (HasDefaultServiceCommandProcessor<ImplType>) { \
|
||||
return impl->ProcessDefaultServiceCommand(message_buffer); \
|
||||
R_RETURN(impl->ProcessDefaultServiceCommand(message_buffer)); \
|
||||
} else { \
|
||||
R_THROW(tipc::ResultInvalidMethod()); \
|
||||
R_THROW(tipc::ResultInvalidMethod()); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
|
@ -143,7 +143,7 @@ namespace ams::tipc::impl {
|
|||
ALWAYS_INLINE Result ProcessMethodById(ImplType *impl, const MessageBuffer &message_buffer, hos::Version fw_ver) const { \
|
||||
CMD_MACRO(ImplType, AMS_TIPC_IMPL_PROCESS_METHOD_REQUEST_BY_ID) \
|
||||
\
|
||||
return this->ProcessDefaultMethod<ImplType>(impl, message_buffer); \
|
||||
R_RETURN(this->ProcessDefaultMethod<ImplType>(impl, message_buffer)); \
|
||||
} \
|
||||
\
|
||||
static consteval bool IsFirmwareVersionAlwaysValid() { \
|
||||
|
@ -170,7 +170,7 @@ namespace ams::tipc::impl {
|
|||
if (false) { } \
|
||||
CMD_MACRO(ImplType, AMS_TIPC_IMPL_PROCESS_METHOD_REQUEST) \
|
||||
else { \
|
||||
return this->ProcessDefaultMethod<ImplType>(impl, message_buffer); \
|
||||
R_RETURN(this->ProcessDefaultMethod<ImplType>(impl, message_buffer)); \
|
||||
} \
|
||||
} \
|
||||
}; \
|
||||
|
|
|
@ -628,7 +628,7 @@ namespace ams::tipc::impl {
|
|||
typename Processor::OutHandleHolderType out_handles_holder;
|
||||
const Result command_result = [&]<size_t... Ix>(std::index_sequence<Ix...>) ALWAYS_INLINE_LAMBDA {
|
||||
if constexpr (ReturnsResult) {
|
||||
return (object->*ServiceCommandImpl)(Processor::template DeserializeArgument<Ix>(message_buffer, out_raw_holder, out_handles_holder)...);
|
||||
R_RETURN((object->*ServiceCommandImpl)(Processor::template DeserializeArgument<Ix>(message_buffer, out_raw_holder, out_handles_holder)...));
|
||||
} else {
|
||||
(object->*ServiceCommandImpl)(Processor::template DeserializeArgument<Ix>(message_buffer, out_raw_holder, out_handles_holder)...);
|
||||
R_SUCCEED();
|
||||
|
|
|
@ -34,15 +34,15 @@ namespace ams::tipc::impl {
|
|||
}
|
||||
|
||||
ALWAYS_INLINE Result CloseHandle(tipc::NativeHandle handle) {
|
||||
return svc::CloseHandle(handle);
|
||||
R_RETURN(svc::CloseHandle(handle));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result CreateSession(tipc::NativeHandle *out_server_session_handle, tipc::NativeHandle *out_client_session_handle, bool is_light, uintptr_t name) {
|
||||
return svc::CreateSession(out_server_session_handle, out_client_session_handle, is_light, name);
|
||||
R_RETURN(svc::CreateSession(out_server_session_handle, out_client_session_handle, is_light, name));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result AcceptSession(tipc::NativeHandle *out_handle, tipc::NativeHandle port) {
|
||||
return svc::AcceptSession(out_handle, port);
|
||||
R_RETURN(svc::AcceptSession(out_handle, port));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -74,11 +74,9 @@ namespace ams::tipc {
|
|||
|
||||
template<IsResumeKey ResumeKey, typename F>
|
||||
ALWAYS_INLINE Result RegisterRetryIfDeferred(ResumeKey key, F f) {
|
||||
const Result result = f();
|
||||
if (tipc::ResultRequestDeferred::Includes(result)) {
|
||||
this->RegisterRetry(key);
|
||||
}
|
||||
return result;
|
||||
ON_RESULT_INCLUDED(tipc::ResultRequestDeferred) { this->RegisterRetry(key); };
|
||||
|
||||
R_RETURN(f());
|
||||
}
|
||||
|
||||
template<typename PortManager>
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace ams::tipc {
|
|||
*out_object = GetReference(entry->object);
|
||||
*out_holder = nullptr;
|
||||
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
} else {
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ namespace ams::tipc {
|
|||
const Result method_result = message_buffer.GetRaw<u32>(raw_data_offset);
|
||||
|
||||
/* Check that the result is the special deferral result. */
|
||||
R_THROW(tipc::ResultRequestDeferred::Includes(method_result));
|
||||
return tipc::ResultRequestDeferred::Includes(method_result);
|
||||
} else {
|
||||
/* If deferral isn't supported, requests are never deferred. */
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue