libstrat: enable -Wextra, -Werror

This caught an embarrassingly large number of bugs.
This commit is contained in:
Michael Scire 2021-10-06 15:20:48 -07:00
parent e1fbf27398
commit 7ca83c9d3b
160 changed files with 691 additions and 152 deletions

View file

@ -21,7 +21,7 @@ PRECOMPILED_HEADERS := $(CURRENT_DIRECTORY)/include/stratosphere.hpp
#PRECOMPILED_HEADERS :=
DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -flto
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -Wextra -Werror -Wno-missing-field-initializers -flto
CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS)
ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS)

View file

@ -107,46 +107,57 @@ namespace ams::fs {
}
virtual Result DoCreateFile(const char *path, s64 size, int flags) override final {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoDeleteFile(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoCreateDirectory(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoDeleteDirectory(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoDeleteDirectoryRecursively(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoRenameFile(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoRenameDirectory(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoCleanDirectoryRecursively(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateA();
}
virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB();
}
virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateB();
}
virtual Result DoCommitProvisionally(s64 counter) override final {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInReadOnlyFileSystemTemplateC();
}
};

View file

@ -34,6 +34,7 @@ namespace ams::fssystem::buffers {
R_CATCH(fs::ResultBufferAllocationFailed) {
if ((1 <= count && count <= BufferAllocationRetryLogCountMax) || ((count % BufferAllocationRetryLogInterval) == 0)) {
/* TODO: Log */
AMS_UNUSED(function_name);
}
R_TRY(on_failure());

View file

@ -29,10 +29,10 @@ namespace ams::fssystem {
template<typename T>
class StdAllocator : public std::allocator<T> {
public:
StdAllocator() { /* ... */ }
StdAllocator(const StdAllocator &) { /* ... */ }
StdAllocator() = default;
StdAllocator(const StdAllocator &) = default;
template<class U>
StdAllocator(const StdAllocator<U> &) { /* ... */ }
StdAllocator(const StdAllocator<U> &) : std::allocator<T>() { /* ... */ };
template<typename U>
struct rebind {
@ -40,6 +40,7 @@ namespace ams::fssystem {
};
T *Allocate(size_t size, const T *hint = nullptr) {
AMS_UNUSED(hint);
return static_cast<T *>(::ams::fssystem::Allocate(sizeof(T) * size));
}

View file

@ -292,13 +292,17 @@ namespace ams::sf::hipc {
}
protected:
virtual ServerSession *AllocateSession() override final {
std::scoped_lock lk(this->resource_mutex);
for (size_t i = 0; i < MaxSessions; i++) {
if (!this->session_allocated[i]) {
this->session_allocated[i] = true;
return GetPointer(this->session_storages[i]);
if constexpr (MaxSessions > 0) {
std::scoped_lock lk(this->resource_mutex);
for (size_t i = 0; i < MaxSessions; i++) {
if (!this->session_allocated[i]) {
this->session_allocated[i] = true;
return GetPointer(this->session_storages[i]);
}
}
}
return nullptr;
}
@ -310,13 +314,17 @@ namespace ams::sf::hipc {
}
virtual Server *AllocateServer() override final {
std::scoped_lock lk(this->resource_mutex);
for (size_t i = 0; i < MaxServers; i++) {
if (!this->server_allocated[i]) {
this->server_allocated[i] = true;
return GetPointer(this->server_storages[i]);
if constexpr (MaxServers > 0) {
std::scoped_lock lk(this->resource_mutex);
for (size_t i = 0; i < MaxServers; i++) {
if (!this->server_allocated[i]) {
this->server_allocated[i] = true;
return GetPointer(this->server_storages[i]);
}
}
}
return nullptr;
}
@ -390,16 +398,20 @@ namespace ams::sf::hipc {
~ServerManager() {
/* Close all sessions. */
for (size_t i = 0; i < MaxSessions; i++) {
if (this->session_allocated[i]) {
this->CloseSessionImpl(GetPointer(this->session_storages[i]));
if constexpr (MaxSessions > 0) {
for (size_t i = 0; i < MaxSessions; i++) {
if (this->session_allocated[i]) {
this->CloseSessionImpl(GetPointer(this->session_storages[i]));
}
}
}
/* Close all servers. */
for (size_t i = 0; i < MaxServers; i++) {
if (this->server_allocated[i]) {
this->DestroyServer(GetPointer(this->server_storages[i]));
if constexpr (MaxServers > 0) {
for (size_t i = 0; i < MaxServers; i++) {
if (this->server_allocated[i]) {
this->DestroyServer(GetPointer(this->server_storages[i]));
}
}
}
}

View file

@ -835,6 +835,8 @@ namespace ams::sf::impl {
}
virtual void SetOutObjects(const cmif::ServiceDispatchContext &ctx, const HipcRequest &response, cmif::ServiceObjectHolder *out_objects, cmif::DomainObjectId *ids) override final {
AMS_UNUSED(ids);
#define _SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(n) do { if constexpr (CommandMeta::NumOutObjects > n) { SetOutObjectImpl<n>(response, ctx.manager, std::move(out_objects[n])); } } while (0)
_SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(0);
_SF_IMPL_PROCESSOR_SET_OUT_OBJECT_IMPL(1);

View file

@ -36,11 +36,13 @@ namespace ams::sf {
template<typename>
static void *AllocateAligned(size_t size, size_t align) {
AMS_UNUSED(align);
return A().Allocate(size);
}
template<typename>
static void DeallocateAligned(void *ptr, size_t size, size_t align) {
AMS_UNUSED(align);
A().Deallocate(ptr, size);
}
};
@ -56,11 +58,13 @@ namespace ams::sf {
template<typename T>
static void *AllocateAligned(size_t size, size_t align) {
AMS_UNUSED(align);
return StatelessAllocator<T>().Allocate(size);
}
template<typename T>
static void DeallocateAligned(void *ptr, size_t size, size_t align) {
AMS_UNUSED(align);
StatelessAllocator<T>().Deallocate(ptr, size);
}
};
@ -72,10 +76,12 @@ namespace ams::sf {
using Allocator = A;
static void *AllocateAligned(Allocator *allocator, size_t size, size_t align) {
AMS_UNUSED(align);
return allocator->Allocate(size);
}
static void DeallocateAligned(Allocator *allocator, void *ptr, size_t size, size_t align) {
AMS_UNUSED(align);
allocator->Deallocate(ptr, size);
}
};

View file

@ -34,11 +34,13 @@ namespace ams::sf {
public:
void *Allocate(size_t size) {
AMS_ASSERT(size == sizeof(T));
AMS_UNUSED(size);
return DefaultAllocateImpl(sizeof(Holder), alignof(Holder), offsetof(Holder, storage));
}
void Deallocate(void *ptr, size_t size) {
AMS_ASSERT(size == sizeof(T));
AMS_UNUSED(size);
return DefaultDeallocateImpl(ptr, sizeof(Holder), alignof(Holder), offsetof(Holder, storage));
}
};

View file

@ -100,7 +100,7 @@ namespace ams::sf {
static void *operator new(size_t size);
static void operator delete(void *ptr, size_t size) {
/* ... */
AMS_UNUSED(ptr, size);
}
static void *operator new(size_t size, Allocator *a) {

View file

@ -37,11 +37,13 @@ namespace ams::sf {
template<typename T>
static void *AllocateAligned(size_t size, size_t align) {
AMS_UNUSED(align);
return StdAllocator<T>().allocate(size / sizeof(T));
}
template<typename T>
static void DeallocateAligned(void *ptr, size_t size, size_t align) {
AMS_UNUSED(align);
StdAllocator<T>().deallocate(static_cast<T *>(ptr), size / sizeof(T));
}
};

View file

@ -37,6 +37,10 @@ namespace ams::capsrv::server::jpeg {
}
static Result GetResult(int msg_code, int msg_param) {
/* NOTE: Nintendo uses msg_param for error codes that we never trigger. */
/* TODO: Fully support all J_MESSAGE_CODEs that Nintendo handles? */
AMS_UNUSED(msg_param);
switch (msg_code) {
case JpegLibraryType::J_MESSAGE_CODE::JERR_BUFFER_SIZE:
case JpegLibraryType::J_MESSAGE_CODE::JERR_NO_BACKING_STORE:

View file

@ -186,6 +186,8 @@ namespace ams::cfg {
}
int OverrideConfigIniHandler(void *user, const char *section, const char *name, const char *value) {
AMS_UNUSED(user);
/* Taken and modified, with love, from Rajkosto's implementation. */
if (strcasecmp(section, "hbl_config") == 0) {
if (strcasecmp(name, "program_id") == 0 || strcasecmp(name, "program_id_0") == 0) {

View file

@ -57,7 +57,7 @@ namespace ams::diag {
}
#else
void DebugLog(const char *format, ...) { /* ... */ }
void DebugLog(const char *format, ...) { AMS_UNUSED(format); }
#endif
}
@ -76,6 +76,8 @@ namespace ams::diag {
DebugLogImpl(format, vl);
va_end(vl);
}
#else
AMS_UNUSED(format);
#endif
DebugLog("\n");
@ -108,6 +110,8 @@ namespace ams::diag {
DebugLogImpl(format, vl);
va_end(vl);
}
#else
AMS_UNUSED(format);
#endif
DebugLog("\n");

View file

@ -44,6 +44,8 @@ namespace ams::erpt::srv {
}
inline void DeallocateWithSize(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_heap_handle, p);
}

View file

@ -82,7 +82,7 @@ namespace ams::erpt::srv {
}
Result ContextImpl::SubmitMultipleCategoryContext(const MultipleCategoryContextEntry &ctx_entry, const ams::sf::InBuffer &str_buffer) {
R_UNLESS(0 <= ctx_entry.category_count && ctx_entry.category_count <= CategoriesPerMultipleCategoryContext, erpt::ResultInvalidArgument());
R_UNLESS(ctx_entry.category_count <= CategoriesPerMultipleCategoryContext, erpt::ResultInvalidArgument());
const u8 *str = reinterpret_cast<const u8 *>(str_buffer.GetPointer());
const u32 str_size = static_cast<u32>(str_buffer.GetSize());

View file

@ -132,6 +132,7 @@ namespace ams::erpt::srv {
}
static Result End(Report *report) {
AMS_UNUSED(report);
return ResultSuccess();
}

View file

@ -138,7 +138,9 @@ namespace ams::erpt::srv {
JournalRecord<AttachmentInfo> *JournalForAttachments::RetrieveRecord(AttachmentId attachment_id) {
for (auto it = s_attachment_list.begin(); it != s_attachment_list.end(); it++) {
return std::addressof(*it);
if (auto *record = std::addressof(*it); record->info.attachment_id == attachment_id) {
return record;
}
}
return nullptr;
}
@ -213,6 +215,8 @@ namespace ams::erpt::srv {
R_TRY(StoreRecord(record));
}
*out = info.attachment_id;
return ResultSuccess();
}

View file

@ -174,8 +174,11 @@ namespace ams::erpt::srv {
JournalRecord<ReportInfo> *JournalForReports::RetrieveRecord(ReportId report_id) {
for (auto it = s_record_list.begin(); it != s_record_list.end(); it++) {
return std::addressof(*it);
if (auto *record = std::addressof(*it); record->info.id == report_id) {
return record;
}
}
return nullptr;
}

View file

@ -280,6 +280,7 @@ namespace ams::erpt::srv {
if (needs_save_syslog) {
/* Here nintendo sends a report to srepo:u (vtable offset 0xE8) with data report_id. */
/* We will not send report ids to srepo:u. */
AMS_UNUSED(report_id);
}
}
@ -308,6 +309,7 @@ namespace ams::erpt::srv {
const auto program_id_len = program_id_entry->value_array.size;
AMS_ASSERT(16 <= program_id_len && program_id_len <= 17);
AMS_ASSERT(program_id_ofs + program_id_len <= data_size);
AMS_UNUSED(data_size);
/* Get the program id string. */
char program_id_str[17];

View file

@ -92,6 +92,7 @@ namespace ams::fs {
.dir = InvalidPosition,
.file = InvalidPosition,
};
AMS_UNUSED(info);
Position new_pos = 0;
R_TRY_CATCH(this->dir_table.Add(std::addressof(new_pos), new_key, new_entry)) {
@ -221,6 +222,8 @@ namespace ams::fs {
RomDirectoryEntry entry = {};
R_TRY(this->GetDirectoryEntry(std::addressof(entry), id));
AMS_UNUSED(out);
return ResultSuccess();
}
@ -275,6 +278,7 @@ namespace ams::fs {
AMS_ASSERT(out != nullptr);
AMS_ASSERT(find != nullptr);
AMS_ASSERT(length > RomPathTool::MaxPathLength);
AMS_UNUSED(length);
R_UNLESS(find->next_dir != InvalidPosition, fs::ResultDbmFindFinished());
@ -294,6 +298,7 @@ namespace ams::fs {
AMS_ASSERT(out != nullptr);
AMS_ASSERT(find != nullptr);
AMS_ASSERT(length > RomPathTool::MaxPathLength);
AMS_UNUSED(length);
R_UNLESS(find->next_file != InvalidPosition, fs::ResultDbmFindFinished());
@ -544,6 +549,8 @@ namespace ams::fs {
RomDirectoryEntry entry = {};
R_TRY(this->GetDirectoryEntry(std::addressof(pos), std::addressof(entry), key));
AMS_UNUSED(out);
return ResultSuccess();
}

View file

@ -161,6 +161,8 @@ namespace ams::fs {
}
Result FileHandleStorage::OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
AMS_UNUSED(src, src_size);
switch (op_id) {
case OperationId::QueryRange:
/* Validate buffer and size. */

View file

@ -72,6 +72,8 @@ namespace ams::fs {
} else {
g_local_access_log_target &= ~(fs::impl::AccessLogTarget_Application | fs::impl::AccessLogTarget_System);
}
#else
AMS_UNUSED(enabled);
#endif
}
@ -511,6 +513,7 @@ namespace ams::fs::impl {
}
bool IsEnabledHandleAccessLog(fs::impl::IdentifyAccessLogHandle handle) {
AMS_UNUSED(handle);
return true;
}

View file

@ -50,7 +50,8 @@ namespace ams::fs {
R_TRY(impl::CheckMountNameAllowingReserved(name));
/* Open the partition. This uses libnx bindings. */
/* Note: Nintendo ignores the root_path here. */
/* NOTE: Nintendo ignores the root_path here. */
AMS_UNUSED(root_path);
FsFileSystem fs;
R_TRY(fsOpenBisFileSystem(std::addressof(fs), static_cast<::FsBisPartitionId>(id), ""));
@ -80,6 +81,7 @@ namespace ams::fs {
}
/* TODO: Libnx binding for fsSetBisRootForHost */
AMS_UNUSED(id);
AMS_ABORT();
}

View file

@ -184,54 +184,67 @@ namespace ams::fs {
}
virtual Result DoOpenDirectory(std::unique_ptr<fsa::IDirectory> *out_dir, const char *path, OpenDirectoryMode mode) override final {
AMS_UNUSED(out_dir, path, mode);
return fs::ResultUnsupportedOperation();
}
virtual Result DoGetEntryType(DirectoryEntryType *out, const char *path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoCreateFile(const char *path, s64 size, int flags) override final {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteFile(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoCreateDirectory(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteDirectory(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteDirectoryRecursively(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoRenameFile(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoRenameDirectory(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoCleanDirectoryRecursively(const char *path) override final {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) override final {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperation();
}
virtual Result DoCommitProvisionally(s64 counter) override final {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperation();
}
};

View file

@ -31,6 +31,7 @@ namespace ams::fs {
}
AbortSpecifier DefaultResultHandler(Result result) {
AMS_UNUSED(result);
if (g_auto_abort_enabled) {
return AbortSpecifier::Default;
} else {
@ -39,6 +40,7 @@ namespace ams::fs {
}
AbortSpecifier AlwaysReturnResultHandler(Result result) {
AMS_UNUSED(result);
return AbortSpecifier::Return;
}

View file

@ -27,6 +27,7 @@ namespace ams::fs {
}
void DefaultDeallocate(void *ptr, size_t size) {
AMS_UNUSED(size);
ams::Free(ptr);
}

View file

@ -53,6 +53,7 @@ namespace ams::fs {
void LogResultErrorMessage(Result result) {
/* TODO: log specific results */
AMS_UNUSED(result);
}
void LogErrorMessage(Result result, const char *function) {
@ -62,6 +63,7 @@ namespace ams::fs {
}
/* TODO: Actually log stuff. */
AMS_UNUSED(function);
}
}

View file

@ -179,6 +179,7 @@ namespace ams::fs {
AMS_ASSERT(this->GetStorage() != nullptr);
AMS_ASSERT(offset >= 0);
AMS_ASSERT(buf != nullptr || size == 0);
AMS_UNUSED(buf);
return ResultSuccess();
}
@ -219,10 +220,12 @@ namespace ams::fs {
}
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
AMS_UNUSED(offset, buffer, size, option);
return fs::ResultUnsupportedOperationInRomFsFileA();
}
virtual Result DoSetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInRomFsFileA();
}
@ -441,30 +444,37 @@ namespace ams::fs {
}
Result RomFsFileSystem::DoCreateFile(const char *path, s64 size, int flags) {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteFile(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoCreateDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoRenameFile(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoRenameDirectory(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
@ -522,19 +532,24 @@ namespace ams::fs {
}
Result RomFsFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(path);
*out = 0;
return ResultSuccess();
}
Result RomFsFileSystem::DoGetTotalSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultUnsupportedOperationInRomFsFileSystemC();
}
Result RomFsFileSystem::DoCleanDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInRomFsFileSystemB();
}

View file

@ -78,6 +78,7 @@ namespace ams::fs {
Result DeleteSaveData(SaveDataId id) {
/* TODO: Libnx binding for DeleteSaveDataFileSystem */
AMS_UNUSED(id);
AMS_ABORT();
}
@ -89,7 +90,7 @@ namespace ams::fs {
const auto attribute = SaveDataAttribute::Make(ncm::InvalidProgramId, SaveDataType::System, user_id, id);
/* TODO: Libnx binding for DeleteSaveDataFileSystemBySaveDataAttribute */
AMS_UNUSED(attribute);
AMS_UNUSED(space_id, attribute);
AMS_ABORT();
}

View file

@ -41,6 +41,7 @@ namespace ams::fs::impl {
Result FileAccessor::ReadWithCacheAccessLog(size_t *out, s64 offset, void *buf, size_t size, const ReadOption &option, bool use_path_cache, bool use_data_cache) {
/* TODO */
AMS_UNUSED(out, offset, buf, size, option, use_path_cache, use_data_cache);
AMS_ABORT();
}

View file

@ -19,6 +19,7 @@ namespace ams::fssrv {
void InitializeForFileSystemProxy(fscreator::FileSystemCreatorInterfaces *fs_creator_interfaces, fssystem::IBufferManager *buffer_manager, bool is_development_function_enabled) {
/* TODO FS-REIMPL */
AMS_UNUSED(fs_creator_interfaces, buffer_manager, is_development_function_enabled);
}
}

View file

@ -123,7 +123,7 @@ namespace ams::fssrv::impl {
Result DirectoryInterfaceAdapter::Read(ams::sf::Out<s64> out, const ams::sf::OutBuffer &out_entries) {
auto read_lock = this->parent_filesystem->AcquireCacheInvalidationReadLock();
const size_t max_num_entries = out_entries.GetSize() / sizeof(fs::DirectoryEntry);
const s64 max_num_entries = out_entries.GetSize() / sizeof(fs::DirectoryEntry);
R_UNLESS(max_num_entries >= 0, fs::ResultInvalidSize());
/* TODO: N retries on ResultDataCorrupted, we may want to eventually. */

View file

@ -27,6 +27,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::OnAllocate(void *p, size_t size) {
AMS_UNUSED(size);
if (p != nullptr) {
this->current_free_size = GetUsedSize(p);
this->peak_free_size = std::min(this->peak_free_size, this->current_free_size);
@ -34,6 +36,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::OnDeallocate(void *p, size_t size) {
AMS_UNUSED(size);
if (p != nullptr) {
this->current_free_size += GetUsedSize(p);
}
@ -48,6 +52,8 @@ namespace ams::fssrv {
}
void PeakCheckableMemoryResourceFromExpHeap::DeallocateImpl(void *p, size_t size, size_t align) {
AMS_UNUSED(align);
std::scoped_lock lk(this->mutex);
this->OnDeallocate(p, size);

View file

@ -44,6 +44,8 @@ namespace ams::fssrv {
}
void MemoryResourceFromStandardAllocator::DeallocateImpl(void *p, size_t size, size_t align) {
AMS_UNUSED(size, align);
std::scoped_lock lk(this->mutex);
this->current_free_size += this->allocator->GetSizeOf(p);

View file

@ -127,6 +127,8 @@ namespace ams::fssystem {
}
bool FileSystemBufferManager::CacheHandleTable::UnregisterOldest(uintptr_t *out_address, size_t *out_size, const BufferAttribute &attr, size_t required_size) {
AMS_UNUSED(attr, required_size);
/* Validate pre-conditions. */
AMS_ASSERT(this->entries != nullptr);
AMS_ASSERT(out_address != nullptr);

View file

@ -261,6 +261,7 @@ namespace ams::fssystem {
AMS_ASSERT(enc_key_size == KeySize);
AMS_ASSERT(iv != nullptr);
AMS_ASSERT(iv_size == IvSize);
AMS_UNUSED(iv_size);
/* Copy the ctr. */
u8 ctr[IvSize];

View file

@ -22,6 +22,7 @@ namespace ams::fssystem {
AMS_ASSERT(dst != nullptr);
AMS_ASSERT(dst_size == IvSize);
AMS_ASSERT(offset >= 0);
AMS_UNUSED(dst_size);
const uintptr_t out_addr = reinterpret_cast<uintptr_t>(dst);
@ -35,6 +36,7 @@ namespace ams::fssystem {
AMS_ASSERT(iv != nullptr);
AMS_ASSERT(key_size == KeySize);
AMS_ASSERT(iv_size == IvSize);
AMS_UNUSED(key_size, iv_size);
std::memcpy(this->key, key, KeySize);
std::memcpy(this->iv, iv, IvSize);
@ -127,6 +129,7 @@ namespace ams::fssystem {
}
Result AesCtrStorage::SetSize(s64 size) {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInAesCtrStorageA();
}

View file

@ -25,6 +25,7 @@ namespace ams::fssystem {
AMS_ASSERT(key_size == KeySize);
AMS_ASSERT(iv_size == IvSize);
AMS_ASSERT(util::IsAligned(this->block_size, AesBlockSize));
AMS_UNUSED(key_size, iv_size);
std::memcpy(this->key[0], key1, KeySize);
std::memcpy(this->key[1], key2, KeySize);

View file

@ -39,6 +39,7 @@ namespace ams::fssystem {
Result AlignmentMatchingStorageImpl::Read(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) {
/* Check preconditions. */
AMS_ASSERT(work_buf_size >= data_alignment);
AMS_UNUSED(work_buf_size);
/* Succeed if zero size. */
R_SUCCEED_IF(size == 0);
@ -120,6 +121,7 @@ namespace ams::fssystem {
Result AlignmentMatchingStorageImpl::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) {
/* Check preconditions. */
AMS_ASSERT(work_buf_size >= data_alignment);
AMS_UNUSED(work_buf_size);
/* Succeed if zero size. */
R_SUCCEED_IF(size == 0);

View file

@ -29,6 +29,7 @@ namespace ams::fssystem {
}
void DefaultDeallocate(void *ptr, size_t size) {
AMS_UNUSED(size);
std::free(ptr);
}

View file

@ -130,6 +130,8 @@ namespace ams::fssystem {
}
void GenerateNcaKey(void *dst, size_t dst_size, const void *src, size_t src_size, s32 key_type, const NcaCryptoConfiguration &cfg) {
AMS_UNUSED(cfg);
R_ABORT_UNLESS(spl::GenerateAesKey(dst, dst_size, GetNcaKekAccessKey(key_type), src, src_size));
}

View file

@ -240,6 +240,7 @@ namespace ams::fssystem {
/* Overridden from IPathResolutionFileSystem but not commands. */
Result DirectorySaveDataFileSystem::DoCommitProvisionally(s64 counter) {
/* Nintendo does nothing here. */
AMS_UNUSED(counter);
return ResultSuccess();
}
@ -250,18 +251,22 @@ namespace ams::fssystem {
/* Explicitly overridden to be not implemented. */
Result DirectorySaveDataFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
Result DirectorySaveDataFileSystem::DoGetTotalSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
Result DirectorySaveDataFileSystem::DoGetFileTimeStampRaw(fs::FileTimeStampRaw *out, const char *path) {
AMS_UNUSED(out, path);
return fs::ResultNotImplemented();
}
Result DirectorySaveDataFileSystem::DoQueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, fs::fsa::QueryId query, const char *path) {
AMS_UNUSED(dst, dst_size, src, src_size, query, path);
return fs::ResultNotImplemented();
}

View file

@ -38,6 +38,7 @@ namespace ams::fssystem {
AMS_ASSERT(layer_count == LayerCount);
AMS_ASSERT(util::IsPowerOfTwo(htbs));
AMS_ASSERT(hash_buf != nullptr);
AMS_UNUSED(layer_count);
/* Set size tracking members. */
this->hash_target_block_size = htbs;

View file

@ -50,6 +50,7 @@ namespace ams::fssystem {
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInHierarchicalSha256StorageA();
}
};

View file

@ -131,6 +131,7 @@ namespace ams::fssystem {
/* Operate on our entries. */
R_TRY(this->OperatePerEntry<false>(offset, size, [=](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result {
AMS_UNUSED(cur_offset);
R_TRY(storage->OperateRange(dst, dst_size, op_id, data_offset, cur_size, src, src_size));
return ResultSuccess();
}));
@ -155,6 +156,8 @@ namespace ams::fssystem {
/* Operate on our entries. */
R_TRY(this->OperatePerEntry<false>(offset, size, [=, &merged_info](fs::IStorage *storage, s64 data_offset, s64 cur_offset, s64 cur_size) -> Result {
AMS_UNUSED(cur_offset);
fs::QueryRangeInfo cur_info;
R_TRY(storage->OperateRange(std::addressof(cur_info), sizeof(cur_info), op_id, data_offset, cur_size, src, src_size));
merged_info.Merge(cur_info);

View file

@ -46,6 +46,8 @@ namespace ams::fssystem {
bool Contains(const void *key, size_t key_size, s32 key2) const {
AMS_ASSERT(key_size == KeySize);
AMS_UNUSED(key_size);
return key2 == this->key2 && std::memcmp(this->key1, key, KeySize) == 0;
}

View file

@ -149,6 +149,7 @@ namespace ams::fssystem {
AMS_ASSERT(enc_key_size == KeySize);
AMS_ASSERT(iv != nullptr);
AMS_ASSERT(iv_size == IvSize);
AMS_UNUSED(iv_size);
std::memcpy(this->iv, iv, IvSize);
std::memcpy(this->encrypted_key, enc_key, enc_key_size);
@ -221,6 +222,10 @@ namespace ams::fssystem {
fs::QueryRangeInfo new_info;
new_info.Clear();
new_info.aes_ctr_key_type = static_cast<s32>(this->key_index >= 0 ? fs::AesCtrKeyTypeFlag::InternalKeyForHardwareAes : fs::AesCtrKeyTypeFlag::ExternalKeyForHardwareAes);
/* Merge the new info in. */
reinterpret_cast<fs::QueryRangeInfo *>(dst)->Merge(new_info);
return ResultSuccess();
}
default:
{
@ -240,10 +245,12 @@ namespace ams::fssystem {
}
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedOperationInAesCtrStorageExternalA();
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInAesCtrStorageExternalB();
}
};

View file

@ -187,6 +187,8 @@ namespace ams::fssystem {
void NcaReader::GetRightsId(u8 *dst, size_t dst_size) const {
AMS_ASSERT(dst != nullptr);
AMS_ASSERT(dst_size >= NcaHeader::RightsIdSize);
AMS_UNUSED(dst_size);
std::memcpy(dst, this->header.rights_id, NcaHeader::RightsIdSize);
}
@ -247,6 +249,8 @@ namespace ams::fssystem {
AMS_ASSERT(this->body_storage != nullptr);
AMS_ASSERT(dst != nullptr);
AMS_ASSERT(size >= NcaHeader::EncryptedKeyAreaSize);
AMS_UNUSED(size);
std::memcpy(dst, this->header.encrypted_key_area, NcaHeader::EncryptedKeyAreaSize);
}
@ -291,6 +295,8 @@ namespace ams::fssystem {
void NcaReader::SetExternalDecryptionKey(const void *src, size_t size) {
AMS_ASSERT(src != nullptr);
AMS_ASSERT(size == sizeof(this->external_decryption_key));
AMS_UNUSED(size);
std::memcpy(this->external_decryption_key, src, sizeof(this->external_decryption_key));
}
@ -298,6 +304,7 @@ namespace ams::fssystem {
AMS_ASSERT(this->body_storage != nullptr);
AMS_ASSERT(dst != nullptr);
AMS_ASSERT(dst_size >= sizeof(NcaHeader));
AMS_UNUSED(dst_size);
std::memcpy(dst, std::addressof(this->header), sizeof(NcaHeader));
}
@ -363,6 +370,8 @@ namespace ams::fssystem {
AMS_ASSERT(this->IsInitialized());
AMS_ASSERT(dst != nullptr);
AMS_ASSERT(dst_size >= sizeof(NcaFsHeader));
AMS_UNUSED(dst_size);
std::memcpy(dst, std::addressof(this->data), sizeof(NcaFsHeader));
}

View file

@ -22,10 +22,12 @@ namespace ams::fssystem {
class PartitionFileSystemDefaultAllocator : public MemoryResource {
private:
virtual void *AllocateImpl(size_t size, size_t alignment) override {
AMS_UNUSED(alignment);
return ::ams::fs::impl::Allocate(size);
}
virtual void DeallocateImpl(void *buffer, size_t size, size_t alignment) override {
AMS_UNUSED(alignment);
::ams::fs::impl::Deallocate(buffer, size);
}
@ -401,46 +403,55 @@ namespace ams::fssystem {
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCleanDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCreateDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCreateFile(const char *path, s64 size, int option) {
AMS_UNUSED(path, size, option);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoDeleteFile(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoRenameDirectory(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoRenameFile(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInPartitionFileSystemA();
}
template <typename MetaType>
Result PartitionFileSystemCore<MetaType>::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInPartitionFileSystemB();
}

View file

@ -35,7 +35,7 @@ namespace ams::fssystem {
if (!this->is_registered) {
this->is_registered = true;
this->address = addr;
this->size = size;
this->size = sz;
}
}

View file

@ -36,6 +36,7 @@ namespace ams::fssystem {
AMS_ASSERT(util::IsPowerOfTwo(this->block_size));
AMS_ASSERT(cache_block_count > 0);
AMS_ASSERT(buf_size >= static_cast<size_t>(this->block_size * cache_block_count));
AMS_UNUSED(buf_size);
/* Create a node for each cache block. */
for (auto i = 0; i < cache_block_count; i++) {
@ -128,10 +129,12 @@ namespace ams::fssystem {
}
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
AMS_UNUSED(offset, buffer, size);
return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageA();
}
virtual Result SetSize(s64 size) override {
AMS_UNUSED(size);
return fs::ResultUnsupportedOperationInReadOnlyBlockCacheStorageB();
}
};

View file

@ -60,9 +60,12 @@ namespace ams::fssystem {
}
virtual Result DoWrite(s64 offset, const void *buffer, size_t size, const fs::WriteOption &option) override {
AMS_UNUSED(buffer);
bool needs_append;
R_TRY(this->DryWrite(std::addressof(needs_append), offset, size, option, fs::OpenMode_Read));
AMS_ASSERT(needs_append == false);
return fs::ResultUnsupportedOperationInRomFsFileA();
}
@ -297,30 +300,37 @@ namespace ams::fssystem {
}
Result RomFsFileSystem::DoCreateFile(const char *path, s64 size, int flags) {
AMS_UNUSED(path, size, flags);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteFile(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoCreateDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteDirectory(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoDeleteDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoRenameFile(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoRenameDirectory(const char *old_path, const char *new_path) {
AMS_UNUSED(old_path, new_path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
@ -381,15 +391,19 @@ namespace ams::fssystem {
}
Result RomFsFileSystem::DoGetFreeSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(path);
*out = 0;
return ResultSuccess();
}
Result RomFsFileSystem::DoCleanDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return fs::ResultUnsupportedOperationInRomFsFileSystemA();
}
Result RomFsFileSystem::DoCommitProvisionally(s64 counter) {
AMS_UNUSED(counter);
return fs::ResultUnsupportedOperationInRomFsFileSystemB();
}

View file

@ -19,6 +19,7 @@ namespace ams::fssystem {
s32 ScopedThreadPriorityChangerByAccessPriority::GetThreadPriorityByAccessPriority(AccessMode mode) {
/* TODO: Actually implement this for real. */
AMS_UNUSED(mode);
return os::GetThreadPriority(os::GetCurrentThread());
}

View file

@ -108,12 +108,16 @@ namespace ams::fssystem {
return IterateDirectoryRecursively(src_fs, src_path,
[&](const char *path, const fs::DirectoryEntry &entry) -> Result { /* On Enter Directory */
AMS_UNUSED(path);
/* Update path, create new dir. */
std::strncat(dst_path_buf, entry.name, sizeof(dst_path_buf) - strnlen(dst_path_buf, sizeof(dst_path_buf) - 1) - 1);
std::strncat(dst_path_buf, "/", sizeof(dst_path_buf) - strnlen(dst_path_buf, sizeof(dst_path_buf) - 1) - 1);
return dst_fs->CreateDirectory(dst_path_buf);
},
[&](const char *path, const fs::DirectoryEntry &entry) -> Result { /* On Exit Directory */
AMS_UNUSED(path, entry);
/* Check we have a parent directory. */
const size_t len = strnlen(dst_path_buf, sizeof(dst_path_buf));
R_UNLESS(len >= 2, fs::ResultInvalidPathFormat());

View file

@ -385,6 +385,8 @@ namespace ams::fssystem::save {
}
Result BlockCacheBufferedStorage::OperateRange(void *dst, size_t dst_size, fs::OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
AMS_UNUSED(src, src_size);
/* Validate pre-conditions. */
AMS_ASSERT(this->data_storage != nullptr);
@ -636,6 +638,8 @@ namespace ams::fssystem::save {
}
Result BlockCacheBufferedStorage::GetAssociateBuffer(MemoryRange *out_range, CacheEntry *out_entry, s64 offset, size_t ideal_size, bool is_allocate_for_write) {
AMS_UNUSED(is_allocate_for_write);
/* Validate pre-conditions. */
AMS_ASSERT(this->data_storage != nullptr);
AMS_ASSERT(this->buffer_manager != nullptr);

View file

@ -315,6 +315,7 @@ namespace ams::fssystem::save {
this->CalcFetchParameter(std::addressof(fetch_param), offset);
AMS_ASSERT(fetch_param.offset == offset);
AMS_ASSERT(fetch_param.size <= buffer_size);
AMS_UNUSED(buffer_size);
std::memcpy(fetch_param.buffer, buffer, fetch_param.size);
this->offset = fetch_param.offset;

View file

@ -390,6 +390,7 @@ namespace ams::fssystem::save {
const s64 sign_offset = (offset >> this->verification_block_order) * HashSize;
const auto sign_size = static_cast<size_t>((size >> this->verification_block_order) * HashSize);
AMS_ASSERT(dst_size >= sign_size);
AMS_UNUSED(dst_size);
/* Create a guard in the event of failure. */
auto clear_guard = SCOPE_GUARD { std::memset(dst, 0, sign_size); };
@ -418,6 +419,7 @@ namespace ams::fssystem::save {
const s64 sign_offset = (offset >> this->verification_block_order) * HashSize;
const auto sign_size = static_cast<size_t>((size >> this->verification_block_order) * HashSize);
AMS_ASSERT(src_size >= sign_size);
AMS_UNUSED(src_size);
/* Write the signature. */
R_TRY(this->hash_storage.Write(sign_offset, src, sign_size));

View file

@ -256,41 +256,49 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
Result DriverImpl::SetInterruptEnabled(Pad *pad, bool en) {
/* TODO */
AMS_UNUSED(pad, en);
AMS_ABORT();
}
Result DriverImpl::GetInterruptStatus(InterruptStatus *out, Pad *pad) {
/* TODO */
AMS_UNUSED(out, pad);
AMS_ABORT();
}
Result DriverImpl::ClearInterruptStatus(Pad *pad) {
/* TODO */
AMS_UNUSED(pad);
AMS_ABORT();
}
Result DriverImpl::GetDebounceEnabled(bool *out, Pad *pad) const {
/* TODO */
AMS_UNUSED(out, pad);
AMS_ABORT();
}
Result DriverImpl::SetDebounceEnabled(Pad *pad, bool en) {
AMS_UNUSED(pad, en);
/* TODO */
AMS_ABORT();
}
Result DriverImpl::GetDebounceTime(s32 *out_ms, Pad *pad) const {
/* TODO */
AMS_UNUSED(out_ms, pad);
AMS_ABORT();
}
Result DriverImpl::SetDebounceTime(Pad *pad, s32 ms) {
/* TODO */
AMS_UNUSED(pad, ms);
AMS_ABORT();
}
Result DriverImpl::GetUnknown22(u32 *out) {
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -301,21 +309,25 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
Result DriverImpl::SetValueForSleepState(Pad *pad, GpioValue value) {
/* TODO */
AMS_UNUSED(pad, value);
AMS_ABORT();
}
Result DriverImpl::IsWakeEventActive(bool *out, Pad *pad) const {
/* TODO */
AMS_UNUSED(out, pad);
AMS_ABORT();
}
Result DriverImpl::SetWakeEventActiveFlagSetForDebug(Pad *pad, bool en) {
/* TODO */
AMS_UNUSED(pad, en);
AMS_ABORT();
}
Result DriverImpl::SetWakePinDebugMode(WakePinDebugMode mode) {
/* TODO */
AMS_UNUSED(mode);
AMS_ABORT();
}

View file

@ -28,21 +28,25 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
void SuspendHandler::SetValueForSleepState(TegraPad *pad, GpioValue value) {
/* TODO */
AMS_UNUSED(pad, value);
AMS_ABORT();
}
Result SuspendHandler::IsWakeEventActive(bool *out, TegraPad *pad) const {
/* TODO */
AMS_UNUSED(out, pad);
AMS_ABORT();
}
Result SuspendHandler::SetWakeEventActiveFlagSetForDebug(TegraPad *pad, bool en) {
/* TODO */
AMS_UNUSED(pad, en);
AMS_ABORT();
}
void SuspendHandler::SetWakePinDebugMode(WakePinDebugMode mode) {
/* TODO */
AMS_UNUSED(mode);
AMS_ABORT();
}

View file

@ -366,7 +366,7 @@ namespace ams::gpio::driver::board::nintendo::nx::impl {
void SetParameters(int pad, const PadInfo &i) {
Base::SetPadNumber(pad);
this->info = info;
this->info = i;
}
bool IsLinkedToInterruptBoundPadList() const {

View file

@ -28,6 +28,7 @@ namespace ams::gpio {
/* Actual commands. */
Result OpenSessionForDev(ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, s32 pad_descriptor) {
/* TODO: libnx bindings */
AMS_UNUSED(out, pad_descriptor);
AMS_ABORT();
}
@ -35,6 +36,7 @@ namespace ams::gpio {
Result OpenSessionForTest(ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name) {
/* TODO: libnx bindings */
AMS_UNUSED(out, pad_name);
AMS_ABORT();
}
@ -44,16 +46,19 @@ namespace ams::gpio {
Result GetWakeEventActiveFlagSet(ams::sf::Out<gpio::WakeBitFlag> out) {
/* TODO: libnx bindings */
AMS_UNUSED(out);
AMS_ABORT();
}
Result SetWakeEventActiveFlagSetForDebug(gpio::GpioPadName pad_name, bool is_enabled) {
/* TODO: libnx bindings */
AMS_UNUSED(pad_name, is_enabled);
AMS_ABORT();
}
Result SetWakePinDebugMode(s32 mode) {
/* TODO: libnx bindings */
AMS_UNUSED(mode);
AMS_ABORT();
}
@ -65,11 +70,13 @@ namespace ams::gpio {
Result SetWakeEventActiveFlagSetForDebug2(DeviceCode device_code, bool is_enabled) {
/* TODO: libnx bindings */
AMS_UNUSED(device_code, is_enabled);
AMS_ABORT();
}
Result SetRetryValues(u32 arg0, u32 arg1) {
/* TODO: libnx bindings */
AMS_UNUSED(arg0, arg1);
AMS_ABORT();
}

View file

@ -100,11 +100,13 @@ namespace ams::gpio {
Result SetValueForSleepState(gpio::GpioValue value) {
/* TODO: libnx bindings. */
AMS_UNUSED(value);
AMS_ABORT();
}
Result GetValueForSleepState(ams::sf::Out<gpio::GpioValue> out) {
/* TODO: libnx bindings. */
AMS_UNUSED(out);
AMS_ABORT();
}
};

View file

@ -29,6 +29,7 @@ namespace ams::gpio::server {
Result ManagerImpl::OpenSessionForDev(ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, s32 pad_descriptor) {
/* TODO */
AMS_UNUSED(out, pad_descriptor);
AMS_ABORT();
}
@ -38,26 +39,31 @@ namespace ams::gpio::server {
Result ManagerImpl::OpenSessionForTest(ams::sf::Out<ams::sf::SharedPointer<gpio::sf::IPadSession>> out, gpio::GpioPadName pad_name) {
/* TODO */
AMS_UNUSED(out, pad_name);
AMS_ABORT();
}
Result ManagerImpl::IsWakeEventActive(ams::sf::Out<bool> out, gpio::GpioPadName pad_name) {
/* TODO */
AMS_UNUSED(out, pad_name);
AMS_ABORT();
}
Result ManagerImpl::GetWakeEventActiveFlagSet(ams::sf::Out<gpio::WakeBitFlag> out) {
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
Result ManagerImpl::SetWakeEventActiveFlagSetForDebug(gpio::GpioPadName pad_name, bool is_enabled) {
/* TODO */
AMS_UNUSED(pad_name, is_enabled);
AMS_ABORT();
}
Result ManagerImpl::SetWakePinDebugMode(s32 mode) {
/* TODO */
AMS_UNUSED(mode);
AMS_ABORT();
}
@ -75,16 +81,19 @@ namespace ams::gpio::server {
Result ManagerImpl::IsWakeEventActive2(ams::sf::Out<bool> out, DeviceCode device_code) {
/* TODO */
AMS_UNUSED(out, device_code);
AMS_ABORT();
}
Result ManagerImpl::SetWakeEventActiveFlagSetForDebug2(DeviceCode device_code, bool is_enabled) {
/* TODO */
AMS_UNUSED(device_code, is_enabled);
AMS_ABORT();
}
Result ManagerImpl::SetRetryValues(u32 arg0, u32 arg1) {
/* TODO */
AMS_UNUSED(arg0, arg1);
AMS_ABORT();
}

View file

@ -72,6 +72,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(mode);
AMS_ABORT();
}
@ -80,6 +81,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -88,6 +90,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(enable);
AMS_ABORT();
}
@ -96,6 +99,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -104,6 +108,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -143,6 +148,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -159,6 +165,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(enable);
AMS_ABORT();
}
@ -167,6 +174,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -175,6 +183,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(ms);
AMS_ABORT();
}
@ -183,6 +192,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
@ -191,6 +201,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(value);
AMS_ABORT();
}
@ -199,6 +210,7 @@ namespace ams::gpio::server {
AMS_ASSERT(this->has_session);
/* TODO */
AMS_UNUSED(out);
AMS_ABORT();
}
};

View file

@ -36,6 +36,7 @@ namespace ams::htc::server::driver {
void HtclowDriver::SetDisconnectionEmulationEnabled(bool en) {
/* NOTE: Nintendo ignores the input, here. */
AMS_UNUSED(en);
m_disconnection_emulation_enabled = false;
}

View file

@ -69,11 +69,13 @@ namespace ams::htc::server {
Result HtcServiceObject::GetHostConnectionEventForSystem(sf::OutCopyHandle out) {
/* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */
AMS_UNUSED(out);
AMS_ABORT("HostEventForSystem not implemented.");
}
Result HtcServiceObject::GetHostDisconnectionEventForSystem(sf::OutCopyHandle out) {
/* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */
AMS_UNUSED(out);
AMS_ABORT("HostEventForSystem not implemented.");
}
@ -114,41 +116,49 @@ namespace ams::htc::server {
Result HtcServiceObject::GetBridgeIpAddress(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgePort(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetCradleAttached(bool attached) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(attached);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgeSubnetMask(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgeMacAddress(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgeIpAddress(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgeSubnetMask(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgePort(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}

View file

@ -31,6 +31,8 @@ namespace ams::htc::server {
}
void InitializePowerStateMonitor(htclow::impl::DriverType driver_type, htclow::HtclowManager *htclow_manager) {
AMS_UNUSED(driver_type);
/* Set the htclow manager. */
g_htclow_manager = htclow_manager;

View file

@ -135,6 +135,7 @@ namespace ams::htc::server::rpc {
Result HtcmiscRpcServer::ProcessSetTargetNameRequest(const char *name, size_t size, u32 task_id) {
/* TODO: we need to use settings::fwdbg::SetSettingsItemValue here, but this will require ams support for set:fd re-enable? */
/* Needs some thought. */
AMS_UNUSED(name, size, task_id);
AMS_ABORT("HtcmiscRpcServer::ProcessSetTargetNameRequest");
}

View file

@ -84,6 +84,7 @@ namespace ams::htc::server::rpc {
Result GetEnvironmentVariableTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@ -182,6 +183,7 @@ namespace ams::htc::server::rpc {
Result GetEnvironmentVariableLengthTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@ -257,6 +259,7 @@ namespace ams::htc::server::rpc {
Result RunOnHostTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@ -282,6 +285,10 @@ namespace ams::htc::server::rpc {
}
Result RunOnHostTask::ProcessResponse(const char *data, size_t size) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
this->Complete(reinterpret_cast<const HtcmiscRpcPacket *>(data)->params[0]);
return ResultSuccess();
}

View file

@ -360,6 +360,8 @@ namespace ams::htc::server::rpc {
/* Copy the received data. */
AMS_ASSERT(0 <= result_size && result_size <= buffer_size);
AMS_UNUSED(buffer_size);
std::memcpy(buffer, result_buffer, result_size);
return ResultSuccess();

View file

@ -88,18 +88,22 @@ namespace ams::htc::server::rpc {
}
virtual Result ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
}
virtual Result CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
}
virtual Result ProcessNotification(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
}
virtual Result CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
}

View file

@ -20,16 +20,19 @@ namespace ams::htc::tenv {
Result Service::GetVariable(sf::Out<s64> out_size, const sf::OutBuffer &out_buffer, const htc::tenv::VariableName &name) {
/* TODO */
AMS_UNUSED(out_size, out_buffer, name);
AMS_ABORT("Service::GetVariable");
}
Result Service::GetVariableLength(sf::Out<s64> out_size,const htc::tenv::VariableName &name) {
Result Service::GetVariableLength(sf::Out<s64> out_size, const htc::tenv::VariableName &name) {
/* TODO */
AMS_UNUSED(out_size, name);
AMS_ABORT("Service::GetVariableLength");
}
Result Service::WaitUntilVariableAvailable(s64 timeout_ms) {
/* TODO */
AMS_UNUSED(timeout_ms);
AMS_ABORT("Service::WaitUntilVariableAvailable");
}

View file

@ -1170,6 +1170,8 @@ namespace ams::htcfs {
}
Result ClientImpl::ReadFile(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) {
AMS_UNUSED(option);
/* Lock ourselves. */
std::scoped_lock lk(m_mutex);
@ -1229,6 +1231,8 @@ namespace ams::htcfs {
}
Result ClientImpl::ReadFileLarge(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) {
AMS_UNUSED(option);
/* Check our buffer size. */
R_UNLESS(util::IsIntValueRepresentable<size_t>(buffer_size), htcfs::ResultInvalidArgument());

View file

@ -107,7 +107,7 @@ namespace ams::htclow::ctrl {
R_UNLESS(header.body_size == 0, htclow::ResultProtocolError());
break;
case HtcctrlPacketType_ReadyFromHost:
R_UNLESS(0 <= header.body_size && header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError());
R_UNLESS(header.body_size <= sizeof(HtcctrlPacketBody), htclow::ResultProtocolError());
break;
default:
return htclow::ResultProtocolError();

View file

@ -26,6 +26,8 @@ namespace ams::htclow::ctrl {
}
bool JsonHandler::Key(const Ch *str, rapidjson::SizeType len, bool copy) {
AMS_UNUSED(len, copy);
if (m_state == State::ParseObject) {
if (!util::Strncmp(str, ChannelKey, sizeof(ChannelKey))) {
m_state = State::ParseServiceChannels;
@ -45,6 +47,8 @@ namespace ams::htclow::ctrl {
}
bool JsonHandler::String(const Ch *str, rapidjson::SizeType len, bool copy) {
AMS_UNUSED(len, copy);
if (m_state == State::ParseServiceChannelsArray && *m_num_strings < m_max_strings) {
m_strings[(*m_num_strings)++] = str;
}

View file

@ -24,6 +24,8 @@ namespace ams::htclow::ctrl {
constexpr auto JsonParseFlags = rapidjson::kParseTrailingCommasFlag | rapidjson::kParseInsituFlag;
void ParseBody(s16 *out_version, const char **out_channels, int *out_num_channels, int max_channels, void *str, size_t str_size) {
AMS_UNUSED(str_size);
/* Create JSON handler. */
JsonHandler json_handler(out_version, out_channels, out_num_channels, max_channels);

View file

@ -59,7 +59,7 @@ namespace ams::htclow::driver {
}
void SocketDiscoveryManager::OnSocketAcceptBegin(u16 port) {
/* ... */
AMS_UNUSED(port);
}
void SocketDiscoveryManager::OnSocketAcceptEnd() {

View file

@ -272,7 +272,7 @@ namespace ams::htclow::driver {
return ResultSuccess();
}
void UsbIndicationThreadFunction(void *arg) {
void UsbIndicationThreadFunction(void *) {
/* Get the state change event. */
os::SystemEventType *state_change_event = g_ds_client.GetStateChangeEvent();

View file

@ -157,6 +157,8 @@ namespace ams::htclow::mux {
}
bool Mux::IsSendable(PacketType packet_type) const {
AMS_UNUSED(packet_type);
switch (m_state) {
case MuxState::Normal:
return true;

View file

@ -48,13 +48,13 @@ namespace ams::htcs::client {
RemoteSocket(::HtcsSocket &s) : m_s(s) { /* ... */ }
~RemoteSocket() { ::htcsCloseSocket(std::addressof(m_s)); }
public:
Result Accept(sf::Out<s32> out_err, sf::Out<sf::SharedPointer<tma::ISocket>> out, sf::Out<htcs::SockAddrHtcs> out_address) { AMS_ABORT("Not Implemented"); }
Result Recv(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::OutAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); }
Result Send(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); }
Result RecvLargeStart(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, s32 unaligned_size_start, s32 unaligned_size_end, s64 aligned_size, sf::CopyHandle &&mem_handle, s32 flags) { AMS_ABORT("Not Implemented"); }
Result SendStartOld(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); }
Result SendLargeStart(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &start_buffer, const sf::InAutoSelectBuffer &end_buffer, sf::CopyHandle &&mem_handle, s64 aligned_size, s32 flags) { AMS_ABORT("Not Implemented"); }
Result ContinueSendOld(sf::Out<s64> out_size, sf::Out<bool> out_wait, const sf::InAutoSelectBuffer &buffer, u32 task_id) { AMS_ABORT("Not Implemented"); }
Result Accept(sf::Out<s32> out_err, sf::Out<sf::SharedPointer<tma::ISocket>> out, sf::Out<htcs::SockAddrHtcs> out_address) { AMS_UNUSED(out_err, out, out_address); AMS_ABORT("Not Implemented"); }
Result Recv(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::OutAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, flags); AMS_ABORT("Not Implemented"); }
Result Send(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, flags); AMS_ABORT("Not Implemented"); }
Result RecvLargeStart(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, s32 unaligned_size_start, s32 unaligned_size_end, s64 aligned_size, sf::CopyHandle &&mem_handle, s32 flags) { AMS_UNUSED(out_task_id, out_event, unaligned_size_start, unaligned_size_end, aligned_size, mem_handle, flags); AMS_ABORT("Not Implemented"); }
Result SendStartOld(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &buffer, s32 flags) { AMS_UNUSED(out_task_id, out_event, buffer, flags); AMS_ABORT("Not Implemented"); }
Result SendLargeStart(sf::Out<u32> out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &start_buffer, const sf::InAutoSelectBuffer &end_buffer, sf::CopyHandle &&mem_handle, s64 aligned_size, s32 flags) { AMS_UNUSED(out_task_id, out_event, start_buffer, end_buffer, mem_handle, aligned_size, flags); AMS_ABORT("Not Implemented"); }
Result ContinueSendOld(sf::Out<s64> out_size, sf::Out<bool> out_wait, const sf::InAutoSelectBuffer &buffer, u32 task_id) { AMS_UNUSED(out_size, out_wait, buffer, task_id); AMS_ABORT("Not Implemented"); }
Result Close(sf::Out<s32> out_err, sf::Out<s32> out_res);
Result Connect(sf::Out<s32> out_err, sf::Out<s32> out_res, const htcs::SockAddrHtcs &address);
@ -85,17 +85,17 @@ namespace ams::htcs::client {
class RemoteManager {
public:
Result Socket(sf::Out<s32> out_err, sf::Out<s32> out_sock) { AMS_ABORT("Not Implemented"); }
Result Close(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc) { AMS_ABORT("Not Implemented"); }
Result Connect(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_ABORT("Not Implemented"); }
Result Bind(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_ABORT("Not Implemented"); }
Result Listen(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 backlog_count) { AMS_ABORT("Not Implemented"); }
Result Accept(sf::Out<s32> out_err, sf::Out<s32> out_res, sf::Out<htcs::SockAddrHtcs> out_address, s32 desc) { AMS_ABORT("Not Implemented"); }
Result Recv(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) { AMS_ABORT("Not Implemented"); }
Result Send(sf::Out<s32> out_err, sf::Out<s64> out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) { AMS_ABORT("Not Implemented"); }
Result Shutdown(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 how) { AMS_ABORT("Not Implemented"); }
Result Fcntl(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 command, s32 value) { AMS_ABORT("Not Implemented"); }
Result CreateSocketOld(sf::Out<s32> out_err, sf::Out<sf::SharedPointer<tma::ISocket>> out) { AMS_ABORT("Not Implemented"); }
Result Socket(sf::Out<s32> out_err, sf::Out<s32> out_sock) { AMS_UNUSED(out_err, out_sock); AMS_ABORT("Not Implemented"); }
Result Close(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc) { AMS_UNUSED(out_err, out_res, desc); AMS_ABORT("Not Implemented"); }
Result Connect(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_UNUSED(out_err, out_res, desc, address); AMS_ABORT("Not Implemented"); }
Result Bind(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) { AMS_UNUSED(out_err, out_res, desc, address); AMS_ABORT("Not Implemented"); }
Result Listen(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 backlog_count) { AMS_UNUSED(out_err, out_res, desc, backlog_count); AMS_ABORT("Not Implemented"); }
Result Accept(sf::Out<s32> out_err, sf::Out<s32> out_res, sf::Out<htcs::SockAddrHtcs> out_address, s32 desc) { AMS_UNUSED(out_err, out_res, out_address, desc); AMS_ABORT("Not Implemented"); }
Result Recv(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) { AMS_UNUSED(out_err, out_size, buffer, desc, flags); AMS_ABORT("Not Implemented"); }
Result Send(sf::Out<s32> out_err, sf::Out<s64> out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) { AMS_UNUSED(out_err, out_size, desc, buffer, flags); AMS_ABORT("Not Implemented"); }
Result Shutdown(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 how) { AMS_UNUSED(out_err, out_res, desc, how); AMS_ABORT("Not Implemented"); }
Result Fcntl(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 command, s32 value) { AMS_UNUSED(out_err, out_res, desc, command, value); AMS_ABORT("Not Implemented"); }
Result CreateSocketOld(sf::Out<s32> out_err, sf::Out<sf::SharedPointer<tma::ISocket>> out) { AMS_UNUSED(out_err, out); AMS_ABORT("Not Implemented"); }
Result GetPeerNameAny(sf::Out<htcs::HtcsPeerName> out);
Result GetDefaultHostName(sf::Out<htcs::HtcsPeerName> out);
@ -129,11 +129,13 @@ namespace ams::htcs::client {
Result RemoteManager::RegisterProcessId(const sf::ClientProcessId &client_pid) {
/* Handled by libnx init. */
AMS_UNUSED(client_pid);
return ResultSuccess();
}
Result RemoteManager::MonitorManager(const sf::ClientProcessId &client_pid) {
/* Handled by libnx init. */
AMS_UNUSED(client_pid);
return ResultSuccess();
}

View file

@ -602,7 +602,7 @@ namespace ams::htcs::client {
}
void VirtualSocketCollection::SetSize(s32 size) {
/* ... */
AMS_UNUSED(size);
}
s32 VirtualSocketCollection::Find(s32 id, s32 *error_code) {

View file

@ -357,6 +357,8 @@ namespace ams::htcs {
}
s32 Select(s32 count, FdSet *read, FdSet *write, FdSet *exception, TimeVal *timeout) {
AMS_UNUSED(count);
/* Check that we have a manager. */
AMS_ASSERT(g_manager != nullptr);

View file

@ -128,6 +128,7 @@ namespace ams::htcs::impl {
Result HtcsManagerImpl::SendLargeStart(u32 *out_task_id, os::NativeHandle *out_handle, const char **buffers, const s64 *sizes, s32 count, s32 desc, s32 flags) {
/* NOTE: Nintendo aborts here, too. */
AMS_UNUSED(out_task_id, out_handle, buffers, sizes, count, desc, flags);
AMS_ABORT("HtcsManagerImpl::SendLargeStart is not implemented");
}

View file

@ -209,6 +209,8 @@ namespace ams::htcs::impl {
}
Result HtcsService::AcceptResults(s32 *out_err, s32 *out_desc, SockAddrHtcs *out_address, u32 task_id, s32 desc) {
AMS_UNUSED(out_address);
/* Finish the task. */
htcs::SocketError err;
s32 ret_desc;
@ -233,6 +235,8 @@ namespace ams::htcs::impl {
}
Result HtcsService::ReceiveSmallResults(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc) {
AMS_UNUSED(desc);
/* Continue the task. */
m_rpc_client->ReceiveContinue<rpc::ReceiveSmallTask>(task_id, buffer, buffer_size);
@ -270,6 +274,7 @@ namespace ams::htcs::impl {
}
Result HtcsService::SendSmallResults(s32 *out_err, s64 *out_size, u32 task_id, s32 desc) {
AMS_UNUSED(desc);
/* Finish the task. */
htcs::SocketError err;
R_TRY(m_rpc_client->End<rpc::SendSmallTask>(task_id, std::addressof(err), out_size));

View file

@ -52,6 +52,8 @@ namespace ams::htcs::impl::rpc {
}
Result AcceptTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -62,6 +64,8 @@ namespace ams::htcs::impl::rpc {
}
Result AcceptTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc {
}
Result BindTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc {
}
Result BindTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -44,6 +44,8 @@ namespace ams::htcs::impl::rpc {
}
Result CloseTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -54,6 +56,8 @@ namespace ams::htcs::impl::rpc {
}
Result CloseTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc {
}
Result ConnectTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc {
}
Result ConnectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -48,6 +48,8 @@ namespace ams::htcs::impl::rpc {
}
Result FcntlTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -58,6 +60,8 @@ namespace ams::htcs::impl::rpc {
}
Result FcntlTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc {
}
Result ListenTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc {
}
Result ListenTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveSmallTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -64,6 +66,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -61,6 +63,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {
@ -85,6 +89,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -49,7 +49,7 @@ namespace ams::htcs::impl::rpc {
AMS_ASSERT(0 <= write_handle_count && write_handle_count < SocketCountMax);
AMS_ASSERT(0 <= exception_handle_count && exception_handle_count < SocketCountMax);
AMS_ASSERT(handle_count * static_cast<s64>(sizeof(s32)) == body_size);
AMS_UNUSED(handle_count);
AMS_UNUSED(handle_count, body_size);
/* Set our results. */
m_err = err;
@ -106,6 +106,8 @@ namespace ams::htcs::impl::rpc {
}
Result SelectTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -116,6 +118,8 @@ namespace ams::htcs::impl::rpc {
}
Result SelectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Determine the body size. */
const auto handle_count = m_read_handle_count + m_write_handle_count + m_exception_handle_count;
const s64 body_size = static_cast<s64>(handle_count * sizeof(s32));

View file

@ -86,6 +86,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendSmallTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -96,6 +98,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Sanity check our size. */
AMS_ASSERT(sizeof(HtcsRpcPacket) + this->GetBufferSize() <= size);

View file

@ -81,6 +81,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -91,6 +93,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {
@ -115,11 +119,15 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::ProcessNotification(const char *data, size_t size) {
AMS_UNUSED(data, size);
this->NotifyDataChannelReady();
return ResultSuccess();
}
Result SendTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc {
}
Result ShutdownTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc {
}
Result ShutdownTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -53,6 +53,8 @@ namespace ams::htcs::impl::rpc {
}
Result SocketTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -66,6 +68,8 @@ namespace ams::htcs::impl::rpc {
}
Result SocketTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -66,11 +66,13 @@ namespace ams::htcs::server {
Result ManagerServiceObject::RegisterProcessId(const sf::ClientProcessId &client_pid) {
/* NOTE: Nintendo does nothing here. */
AMS_UNUSED(client_pid);
return ResultSuccess();
}
Result ManagerServiceObject::MonitorManager(const sf::ClientProcessId &client_pid) {
/* NOTE: Nintendo does nothing here. */
AMS_UNUSED(client_pid);
return ResultSuccess();
}

View file

@ -19,56 +19,56 @@
namespace ams::htcs::server {
#define AMS_HTCS_MANAGER_DEPRECATED_API() AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME)
#define AMS_HTCS_MANAGER_DEPRECATED_API(...) ({ AMS_UNUSED(__VA_ARGS__); AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME); })
Result ManagerServiceObject::Socket(sf::Out<s32> out_err, sf::Out<s32> out_sock) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_sock);
}
Result ManagerServiceObject::Close(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc);
}
Result ManagerServiceObject::Connect(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, address);
}
Result ManagerServiceObject::Bind(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, const htcs::SockAddrHtcs &address) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, address);
}
Result ManagerServiceObject::Listen(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 backlog_count) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, backlog_count);
}
Result ManagerServiceObject::Accept(sf::Out<s32> out_err, sf::Out<s32> out_res, sf::Out<htcs::SockAddrHtcs> out_address, s32 desc) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, out_address, desc);
}
Result ManagerServiceObject::Recv(sf::Out<s32> out_err, sf::Out<s64> out_size, const sf::OutBuffer &buffer, s32 desc, s32 flags) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_size, buffer, desc, flags);
}
Result ManagerServiceObject::Send(sf::Out<s32> out_err, sf::Out<s64> out_size, s32 desc, const sf::InBuffer &buffer, s32 flags) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_size, desc, buffer, flags);
}
Result ManagerServiceObject::Shutdown(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 how) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, how);
}
Result ManagerServiceObject::Fcntl(sf::Out<s32> out_err, sf::Out<s32> out_res, s32 desc, s32 command, s32 value) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out_res, desc, command, value);
}
}

View file

@ -19,11 +19,11 @@
namespace ams::htcs::server {
#define AMS_HTCS_MANAGER_DEPRECATED_API() AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME)
#define AMS_HTCS_MANAGER_DEPRECATED_API(...) ({ AMS_UNUSED(__VA_ARGS__); AMS_ABORT("Deprecated IHtcsManager API %s was called.\n", AMS_CURRENT_FUNCTION_NAME); })
Result SocketServiceObject::Accept(sf::Out<s32> out_err, sf::Out<sf::SharedPointer<tma::ISocket>> out, sf::Out<htcs::SockAddrHtcs> out_address) {
/* NOTE: This is a deprecated API, and Nintendo aborts when it is called. */
AMS_HTCS_MANAGER_DEPRECATED_API();
AMS_HTCS_MANAGER_DEPRECATED_API(out_err, out, out_address);
}
}

Some files were not shown because too many files have changed in this diff Show more