strat: build sysmodules with -Wextra/-Werror

This commit is contained in:
Michael Scire
2021-10-06 23:22:54 -07:00
parent e8f1efd01b
commit 6a53726833
61 changed files with 433 additions and 217 deletions

View File

@@ -85,33 +85,37 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
@@ -131,6 +135,8 @@ namespace ams::lm::srv {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Check thread priority. */
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(LogManager, MainThread));

View File

@@ -69,6 +69,8 @@ namespace ams::tio {
}
void DeallocateForFs(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_fs_heap_handle, p);
}
@@ -117,38 +119,44 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(TioServer, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(TioServer, Main));

View File

@@ -145,7 +145,7 @@ namespace ams::mitm {
}
/* Initialization implementation */
void InitializeThreadFunc(void *arg) {
void InitializeThreadFunc(void *) {
/* Wait for the SD card to be ready. */
cfg::WaitSdCardInitialized();

View File

@@ -104,18 +104,23 @@ void __appExit(void) {
}
void *__libnx_alloc(size_t size) {
AMS_UNUSED(size);
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
AMS_UNUSED(alignment, size);
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
AMS_UNUSED(mem);
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv) {
AMS_UNUSED(argc, argv);
/* Register "ams" port, use up its session. */
{
svc::Handle ams_port;

View File

@@ -34,7 +34,7 @@ namespace ams::mitm::bpc_ams {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Create bpc:ams. */
{
os::NativeHandle bpcams_h;

View File

@@ -56,7 +56,7 @@ namespace ams::mitm::bpc {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -64,7 +64,7 @@ namespace ams::mitm::socket::resolver {
os::ThreadType g_extra_threads[NumExtraThreads];
void LoopServerThread(void *arg) {
void LoopServerThread(void *) {
/* Loop forever, servicing our services. */
g_server_manager.LoopProcess();
}
@@ -114,7 +114,7 @@ namespace ams::mitm::socket::resolver {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -40,6 +40,8 @@ namespace ams::mitm::socket::resolver {
}
ssize_t SerializeRedirectedAddrInfo(u8 * const dst, size_t dst_size, const char *hostname, ams::socket::InAddrT redirect_addr, u16 redirect_port, const struct addrinfo *hint) {
AMS_UNUSED(hostname);
struct addrinfo ai = {
.ai_flags = 0,
.ai_family = AF_UNSPEC,
@@ -85,6 +87,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetHostByNameRequest(u32 cancel_handle, const sf::ClientProcessId &client_pid, bool use_nsd_resolve, const sf::InBuffer &name, sf::Out<u32> out_host_error, sf::Out<u32> out_errno, const sf::OutBuffer &out_hostent, sf::Out<u32> out_size) {
AMS_UNUSED(cancel_handle, client_pid, use_nsd_resolve);
const char *hostname = reinterpret_cast<const char *>(name.GetPointer());
LogDebug("[%016lx]: GetHostByNameRequest(%s)\n", this->client_info.program_id.value, hostname);
@@ -105,6 +109,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetAddrInfoRequest(u32 cancel_handle, const sf::ClientProcessId &client_pid, bool use_nsd_resolve, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutBuffer &out_addrinfo, sf::Out<u32> out_errno, sf::Out<s32> out_retval, sf::Out<u32> out_size) {
AMS_UNUSED(cancel_handle, client_pid, use_nsd_resolve);
const char *hostname = reinterpret_cast<const char *>(node.GetPointer());
LogDebug("[%016lx]: GetAddrInfoRequest(%s, %s)\n", this->client_info.program_id.value, reinterpret_cast<const char *>(node.GetPointer()), reinterpret_cast<const char *>(srv.GetPointer()));
@@ -142,6 +148,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetHostByNameRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InAutoSelectBuffer &name, const sf::OutAutoSelectBuffer &out_hostent, sf::Out<u32> out_size, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
AMS_UNUSED(client_pid, options_version, options, num_options);
const char *hostname = reinterpret_cast<const char *>(name.GetPointer());
LogDebug("[%016lx]: GetHostByNameRequestWithOptions(%s)\n", this->client_info.program_id.value, hostname);
@@ -162,6 +170,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetAddrInfoRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutAutoSelectBuffer &out_addrinfo, sf::Out<u32> out_size, sf::Out<s32> out_retval, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
AMS_UNUSED(client_pid, options_version, options, num_options);
const char *hostname = reinterpret_cast<const char *>(node.GetPointer());
LogDebug("[%016lx]: GetAddrInfoRequestWithOptions(%s, %s)\n", this->client_info.program_id.value, hostname, reinterpret_cast<const char *>(srv.GetPointer()));

View File

@@ -35,6 +35,7 @@ namespace ams::mitm::socket::resolver {
/* We will mitm:
* - everything.
*/
AMS_UNUSED(client_info);
return true;
}
public:

View File

@@ -20,6 +20,9 @@
namespace ams::mitm::socket::resolver::serializer {
ssize_t DNSSerializer::CheckToBufferArguments(const u8 *dst, size_t dst_size, size_t required, int error_id) {
/* TODO: Logging, using error_id */
AMS_UNUSED(error_id);
if (dst == nullptr) {
return -1;
} else if (dst_size < required) {

View File

@@ -26,7 +26,7 @@ namespace ams::mitm::socket::resolver::serializer {
concept IsInAddr = std::same_as<T, ams::socket::InAddr> || std::same_as<T, struct in_addr>;
template<typename T> requires IsInAddr<T>
size_t SizeOfImpl(const T &in) {
size_t SizeOfImpl(const T &) {
return sizeof(u32);
}

View File

@@ -99,7 +99,7 @@ namespace ams::mitm::fs {
return sf::CreateSharedObjectEmplaced<ams::fssrv::sf::IStorage, ams::fssrv::impl::StorageInterfaceAdapter>(std::forward<Arguments>(args)...);
}
Result OpenHblWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId client_program_id, ncm::ProgramId program_id, FsFileSystemType filesystem_type) {
Result OpenHblWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId program_id) {
/* Verify eligibility. */
bool is_hbl;
R_UNLESS(R_SUCCEEDED(pm::info::IsHblProgramId(&is_hbl, program_id)), sm::mitm::ResultShouldForwardToSession());
@@ -122,7 +122,7 @@ namespace ams::mitm::fs {
return ResultSuccess();
}
Result OpenProgramSpecificWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId client_program_id, ncm::ProgramId program_id, FsFileSystemType filesystem_type, Service *fwd, const fssrv::sf::Path *path, bool with_id) {
Result OpenProgramSpecificWebContentFileSystem(sf::Out<sf::SharedPointer<ams::fssrv::sf::IFileSystem>> &out, ncm::ProgramId program_id, FsFileSystemType filesystem_type, Service *fwd, const fssrv::sf::Path *path, bool with_id) {
/* Directory must exist. */
{
FsDir d;
@@ -174,13 +174,13 @@ namespace ams::mitm::fs {
R_UNLESS(filesystem_type == FsFileSystemType_ContentManual, sm::mitm::ResultShouldForwardToSession());
/* Try to mount the HBL web filesystem. If this succeeds then we're done. */
R_UNLESS(R_FAILED(OpenHblWebContentFileSystem(out, client_program_id, program_id, filesystem_type)), ResultSuccess());
R_SUCCEED_IF(R_SUCCEEDED(OpenHblWebContentFileSystem(out, program_id)));
/* If program specific override shouldn't be attempted, fall back. */
R_UNLESS(try_program_specific, sm::mitm::ResultShouldForwardToSession());
/* If we're not opening a HBL filesystem, just try to open a generic one. */
return OpenProgramSpecificWebContentFileSystem(out, client_program_id, program_id, filesystem_type, fwd, path, with_id);
return OpenProgramSpecificWebContentFileSystem(out, program_id, filesystem_type, fwd, path, with_id);
}
}

View File

@@ -28,7 +28,7 @@ namespace ams::mitm::fs {
os::MessageQueue g_req_mq(g_mq_storage + 0, 1);
os::MessageQueue g_ack_mq(g_mq_storage + 1, 1);
void RomfsInitializerThreadFunction(void *arg) {
void RomfsInitializerThreadFunction(void *) {
while (true) {
uintptr_t storage_uptr = 0;
g_req_mq.Receive(&storage_uptr);
@@ -100,7 +100,6 @@ namespace ams::mitm::fs {
Result LayeredRomfsStorage::Read(s64 offset, void *buffer, size_t size) {
/* Check if we can succeed immediately. */
R_UNLESS(size >= 0, fs::ResultInvalidSize());
R_SUCCEED_IF(size == 0);
/* Ensure we're initialized. */
@@ -112,8 +111,8 @@ namespace ams::mitm::fs {
const s64 virt_size = this->GetSize();
R_UNLESS(offset >= 0, fs::ResultInvalidOffset());
R_UNLESS(offset < virt_size, fs::ResultInvalidOffset());
if (size_t(virt_size - offset) < size) {
size = size_t(virt_size - offset);
if (static_cast<size_t>(virt_size - offset) < size) {
size = static_cast<size_t>(virt_size - offset);
}
/* Find first source info via binary search. */
@@ -130,7 +129,7 @@ namespace ams::mitm::fs {
if (offset < cur_source.virtual_offset + cur_source.size) {
const s64 offset_within_source = offset - cur_source.virtual_offset;
const size_t cur_read_size = std::min(size - read_so_far, size_t(cur_source.size - offset_within_source));
const size_t cur_read_size = std::min(size - read_so_far, static_cast<size_t>(cur_source.size - offset_within_source));
switch (cur_source.source_type) {
case romfs::DataSourceType::Storage:
R_ABORT_UNLESS(this->storage_romfs->Read(cur_source.storage_source_info.offset + offset_within_source, cur_dst, cur_read_size));
@@ -167,7 +166,7 @@ namespace ams::mitm::fs {
} else {
/* Explicitly handle padding. */
const auto &next_source = *(++it);
const size_t padding_size = size_t(next_source.virtual_offset - offset);
const size_t padding_size = static_cast<size_t>(next_source.virtual_offset - offset);
std::memset(cur_dst, 0, padding_size);
read_so_far += padding_size;
@@ -194,6 +193,8 @@ namespace ams::mitm::fs {
}
Result LayeredRomfsStorage::OperateRange(void *dst, size_t dst_size, OperationId op_id, s64 offset, s64 size, const void *src, size_t src_size) {
AMS_UNUSED(offset, src, src_size);
switch (op_id) {
case OperationId::Invalidate:
case OperationId::QueryRange:

View File

@@ -52,11 +52,13 @@ namespace ams::mitm::fs {
virtual Result Write(s64 offset, const void *buffer, size_t size) override {
/* TODO: Better result code? */
AMS_UNUSED(offset, buffer, size);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result SetSize(s64 size) override {
/* TODO: Better result code? */
AMS_UNUSED(size);
return ams::fs::ResultUnsupportedOperation();
}
};

View File

@@ -64,7 +64,7 @@ namespace ams::mitm::fs {
os::ThreadType g_extra_threads[NumExtraThreads];
void LoopServerThread(void *arg) {
void LoopServerThread(void *) {
/* Loop forever, servicing our services. */
g_server_manager.LoopProcess();
}
@@ -98,7 +98,7 @@ namespace ams::mitm::fs {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Create fs mitm. */
R_ABORT_UNLESS((g_server_manager.RegisterMitmServer<FsMitmService>(PortIndex_Mitm, MitmServiceName)));

View File

@@ -28,45 +28,52 @@ namespace ams::mitm::fs {
virtual ~ReadOnlyLayeredFileSystem() { /* ... */ }
private:
virtual Result DoCreateFile(const char *path, s64 size, int flags) override final {
AMS_UNUSED(path, size, flags);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteFile(const char *path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoCreateDirectory(const char *path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteDirectory(const char *path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoDeleteDirectoryRecursively(const char *path) override final {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoRenameFile(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoRenameDirectory(const char *old_path, const char *new_path) override final {
AMS_UNUSED(old_path, new_path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoGetEntryType(ams::fs::DirectoryEntryType *out, const char *path) override final {
R_UNLESS(R_FAILED(this->fs_1.GetEntryType(out, path)), ResultSuccess());
R_SUCCEED_IF(R_SUCCEEDED(this->fs_1.GetEntryType(out, path)));
return this->fs_2.GetEntryType(out, path);
}
virtual Result DoOpenFile(std::unique_ptr<ams::fs::fsa::IFile> *out_file, const char *path, ams::fs::OpenMode mode) override final {
R_UNLESS(R_FAILED(this->fs_1.OpenFile(out_file, path, mode)), ResultSuccess());
R_SUCCEED_IF(R_SUCCEEDED(this->fs_1.OpenFile(out_file, path, mode)));
return this->fs_2.OpenFile(out_file, path, mode);
}
virtual Result DoOpenDirectory(std::unique_ptr<ams::fs::fsa::IDirectory> *out_dir, const char *path, ams::fs::OpenDirectoryMode mode) override final {
R_UNLESS(R_FAILED(this->fs_1.OpenDirectory(out_dir, path, mode)), ResultSuccess());
R_SUCCEED_IF(R_SUCCEEDED(this->fs_1.OpenDirectory(out_dir, path, mode)));
return this->fs_2.OpenDirectory(out_dir, path, mode);
}
@@ -75,19 +82,22 @@ namespace ams::mitm::fs {
}
virtual Result DoGetFreeSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoGetTotalSpaceSize(s64 *out, const char *path) {
AMS_UNUSED(out, path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoCleanDirectoryRecursively(const char *path) {
AMS_UNUSED(path);
return ams::fs::ResultUnsupportedOperation();
}
virtual Result DoGetFileTimeStampRaw(ams::fs::FileTimeStampRaw *out, const char *path) {
R_UNLESS(R_FAILED(this->fs_1.GetFileTimeStampRaw(out, path)), ResultSuccess());
R_SUCCEED_IF(R_SUCCEEDED(this->fs_1.GetFileTimeStampRaw(out, path)));
return this->fs_2.GetFileTimeStampRaw(out, path);
}
};

View File

@@ -61,7 +61,7 @@ namespace ams::mitm::ns {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -64,7 +64,7 @@ namespace ams::mitm::settings {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -35,6 +35,7 @@ namespace ams::mitm::settings {
/* We will mitm:
* - everything, because we want to intercept all settings requests.
*/
AMS_UNUSED(client_info);
return true;
}
public:

View File

@@ -45,7 +45,7 @@ namespace ams::mitm::sysupdater {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -111,6 +111,8 @@ namespace ams {
}
void SetClockRate(const ClkRstDefinition &def, u32 hz) {
AMS_UNUSED(hz);
/* Enable clock. */
reg::ReadWrite(g_clkrst_registers + def.clk_en_ofs, 1u << def.clk_en_index, 1u << def.clk_en_index);
@@ -166,6 +168,7 @@ namespace ams {
}
void SetClockDisabled(ClkRstSession *session) {
AMS_UNUSED(session);
AMS_ABORT("SetClockDisabled not implemented for boot system module");
}

View File

@@ -34,7 +34,8 @@ namespace ams::boot {
bool present;
R_TRY(powctl::IsBatteryPresent(std::addressof(present), this->battery_session));
return present == false;
*out = !present;
return ResultSuccess();
}
Result GetSocRep(float *out) {

View File

@@ -143,25 +143,25 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *__libnx_alloc(size_t size) {
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
@@ -177,6 +177,10 @@ void operator delete(void *p) {
return Deallocate(p, 0);
}
void operator delete(void *p, size_t size) {
return Deallocate(p, size);
}
void *operator new[](size_t size) {
return Allocate(size);
}
@@ -189,8 +193,14 @@ void operator delete[](void *p) {
return Deallocate(p, 0);
}
void operator delete[](void *p, size_t size) {
return Deallocate(p, size);
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(boot, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(boot, Main));

View File

@@ -68,6 +68,7 @@ namespace {
}
void DeallocateForFs(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_fs_heap_handle, p);
}
@@ -111,38 +112,44 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(boot2, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(boot2, Main));

View File

@@ -71,6 +71,7 @@ namespace {
}
void DeallocateForFs(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_fs_heap_handle, p);
}
@@ -100,33 +101,37 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}

View File

@@ -76,6 +76,8 @@ namespace ams::cs {
}
void Deallocate(void *p, size_t size) {
AMS_UNUSED(size);
std::scoped_lock lk(g_heap_mutex);
lmem::FreeToExpHeap(g_heap_handle, p);
}
@@ -131,33 +133,37 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
@@ -178,6 +184,8 @@ namespace ams::cs {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
using namespace ams::cs;
/* Set thread name. */

View File

@@ -389,6 +389,7 @@ namespace ams::dmnt {
}
} else {
/* TODO aarch32 branch decoding */
AMS_UNUSED(ctx);
}
}

View File

@@ -1096,6 +1096,7 @@ namespace ams::dmnt {
reply = true;
}
}
break;
case svc::DebugEvent_ExitThread:
{
AMS_DMNT2_GDB_LOG_DEBUG("ExitThread %lx\n", thread_id);

View File

@@ -91,6 +91,8 @@ namespace ams::dmnt {
}
Result HardwareBreakPoint::Clear(DebugProcess *debug_process) {
AMS_UNUSED(debug_process);
Result result = svc::ResultInvalidArgument();
if (m_in_use) {
AMS_DMNT2_GDB_LOG_DEBUG("HardwareBreakPoint::Clear %p 0x%lx\n", this, m_address);

View File

@@ -93,6 +93,8 @@ namespace ams::dmnt {
}
Result WatchPoint::Clear(DebugProcess *debug_process) {
AMS_UNUSED(debug_process);
Result result = svc::ResultInvalidArgument();
if (m_in_use) {
AMS_DMNT2_GDB_LOG_DEBUG("WatchPoint::Clear %p 0x%lx\n", this, m_address);

View File

@@ -95,38 +95,44 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* TODO ThreadName */
/* Initialize htcs. */

View File

@@ -81,6 +81,8 @@ namespace ams::dmnt::cheat::impl {
}
fs::WriteFile(this->debug_log_file, this->debug_log_offset, this->debug_log_format_buf, fmt_len, fs::WriteOption::Flush);
#else
AMS_UNUSED(format);
#endif
}

View File

@@ -61,6 +61,7 @@ namespace {
}
void DeallocateForFs(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_fs_heap_handle, p);
}
@@ -126,7 +127,7 @@ namespace {
constinit sf::UnmanagedServiceObject<dmnt::cheat::impl::ICheatInterface, dmnt::cheat::CheatService> g_cheat_service;
void LoopServerThread(void *arg) {
void LoopServerThread(void *) {
g_server_manager.LoopProcess();
}
@@ -140,40 +141,48 @@ namespace {
}
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(dmnt, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(dmnt, Main));

View File

@@ -62,6 +62,7 @@ void __appExit(void) {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
return 0;
}

View File

@@ -115,38 +115,44 @@ namespace ams::erpt {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(erpt, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(erpt, Main));

View File

@@ -143,6 +143,7 @@ namespace ams::fatal::srv {
if (request.meta.num_send_buffers != 1) {
return false;
}
break;
default:
return false;
}

View File

@@ -60,6 +60,7 @@ namespace ams::fatal {
}
void DeallocateForFs(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_fs_heap_handle, p);
}
@@ -162,38 +163,44 @@ namespace {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Disable auto-abort in fs operations. */
fs::SetEnabledAutoAbort(false);

View File

@@ -67,6 +67,8 @@ namespace ams::htc {
}
void Deallocate(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_heap_handle, p);
}
@@ -117,48 +119,51 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
void *MallocForRapidJson(size_t size) {
void *MallocForRapidJson(size_t) {
AMS_ABORT("ams::MallocForRapidJson was called");
}
void *ReallocForRapidJson(void *ptr, size_t size) {
void *ReallocForRapidJson(void *, size_t) {
AMS_ABORT("ams::ReallocForRapidJson was called");
}
void FreeForRapidJson(void *ptr) {
if (ptr == nullptr) {
return;
if (ptr != nullptr) {
AMS_ABORT("ams::FreeForRapidJson was called");
}
AMS_ABORT("ams::FreeForRapidJson was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
@@ -211,15 +216,15 @@ namespace ams::htc {
}
}
void HtcIpcThreadFunction(void *arg) {
void HtcIpcThreadFunction(void *) {
htc::server::LoopHtcmiscServer();
}
void HtcfsIpcThreadFunction(void *arg) {
void HtcfsIpcThreadFunction(void *) {
htcfs::LoopHipcServer();
}
void HtcsIpcThreadFunction(void *arg) {
void HtcsIpcThreadFunction(void *) {
htcs::server::LoopHipcServer();
}
@@ -244,6 +249,8 @@ namespace ams::htclow::driver {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(htc, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(htc, Main));

View File

@@ -67,6 +67,8 @@ void __appExit(void) {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(jpegdec, Main));

View File

@@ -34,10 +34,12 @@ namespace ams::ldr {
R_TRY(ldr::GetProgramInfo(out, &status, loc));
if (loc.storage_id != static_cast<u8>(ncm::StorageId::None) && loc.program_id != out->program_id) {
char path[FS_MAX_PATH];
char path[fs::EntryNameLengthMax];
const ncm::ProgramLocation new_loc = ncm::ProgramLocation::Make(out->program_id, static_cast<ncm::StorageId>(loc.storage_id));
R_TRY(ResolveContentPath(path, loc));
path[sizeof(path) - 1] = '\x00';
R_TRY(RedirectContentPath(path, new_loc));
const auto arg_info = args::Get(loc.program_id);
@@ -59,13 +61,16 @@ namespace ams::ldr {
Result LoaderService::CreateProcess(sf::OutMoveHandle out, PinId id, u32 flags, sf::CopyHandle &&reslimit_h) {
ncm::ProgramLocation loc;
cfg::OverrideStatus override_status;
char path[FS_MAX_PATH];
char path[fs::EntryNameLengthMax];
/* Get location and override status. */
R_TRY(ldr::ro::GetProgramLocationAndStatus(&loc, &override_status, id));
if (loc.storage_id != static_cast<u8>(ncm::StorageId::None)) {
R_TRY(ResolveContentPath(path, loc));
path[sizeof(path) - 1] = '\x00';
} else {
path[0] = '\x00';
}
/* Create the process. */

View File

@@ -60,6 +60,7 @@ namespace ams::ldr {
}
void Deallocate(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_server_heap_handle, p);
}
@@ -159,11 +160,11 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
@@ -177,20 +178,26 @@ void operator delete(void *p) {
return ldr::Deallocate(p, 0);
}
void *__libnx_alloc(size_t size) {
void operator delete(void *p, size_t size) {
return ldr::Deallocate(p, size);
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Disable auto-abort in fs operations. */
fs::SetEnabledAutoAbort(false);

View File

@@ -123,6 +123,8 @@ namespace ams::ldr {
R_UNLESS(entries[i].version <= version, ResultInvalidVersion());
}
}
#else
AMS_UNUSED(program_id, version);
#endif
return ResultSuccess();
}
@@ -662,6 +664,7 @@ namespace ams::ldr {
{
/* Mount code. */
AMS_UNUSED(path);
ScopedCodeMount mount(loc, override_status);
R_TRY(mount.GetResult());

View File

@@ -103,25 +103,25 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *__libnx_alloc(size_t size) {
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
@@ -137,6 +137,10 @@ void operator delete(void *p) {
return Deallocate(p, 0);
}
void operator delete(void *p, size_t size) {
return Deallocate(p, size);
}
void *operator new[](size_t size) {
return Allocate(size);
}
@@ -149,6 +153,11 @@ void operator delete[](void *p) {
return Deallocate(p, 0);
}
void operator delete[](void *p, size_t size) {
return Deallocate(p, size);
}
namespace {
struct ContentManagerServerOptions {
@@ -265,6 +274,8 @@ namespace {
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Disable auto-abort in fs operations. */
fs::SetEnabledAutoAbort(false);

View File

@@ -87,11 +87,11 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
@@ -105,20 +105,26 @@ void operator delete(void *p) {
return pgl::srv::Deallocate(p, 0);
}
void *__libnx_alloc(size_t size) {
void operator delete(void *p, size_t size) {
return pgl::srv::Deallocate(p, size);
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Disable auto-abort in fs operations. */
fs::SetEnabledAutoAbort(false);

View File

@@ -118,7 +118,7 @@ namespace ams::pm::impl {
};
/* Process Tracking globals. */
void ProcessTrackingMain(void *arg);
void ProcessTrackingMain(void *);
constinit os::ThreadType g_process_track_thread;
alignas(os::ThreadStackAlignment) constinit u8 g_process_track_thread_stack[16_KB];
@@ -154,7 +154,7 @@ namespace ams::pm::impl {
void OnProcessSignaled(ProcessListAccessor &list, ProcessInfo *process_info);
/* Helpers. */
void ProcessTrackingMain(void *arg) {
void ProcessTrackingMain(void *) {
/* This is the main loop of the process tracking thread. */
/* Setup multi wait/holders. */
@@ -552,6 +552,7 @@ namespace ams::pm::impl {
/* Information Getters. */
Result GetModuleIdList(u32 *out_count, u8 *out_buf, size_t max_out_count, u64 unused) {
/* This function was always stubbed... */
AMS_UNUSED(out_buf, max_out_count, unused);
*out_count = 0;
return ResultSuccess();
}
@@ -560,11 +561,19 @@ namespace ams::pm::impl {
ProcessListAccessor list(g_process_list);
size_t count = 0;
for (auto &process : *list) {
if (process.HasExceptionWaitingAttach()) {
out_process_ids[count++] = process.GetProcessId();
if (max_out_count > 0) {
for (auto &process : *list) {
if (process.HasExceptionWaitingAttach()) {
out_process_ids[count++] = process.GetProcessId();
if (count >= max_out_count) {
break;
}
}
}
}
*out_count = static_cast<u32>(count);
return ResultSuccess();
}

View File

@@ -218,28 +218,46 @@ namespace {
}
void *operator new(size_t size) {
namespace ams {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(pm, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(pm, Main));

View File

@@ -95,6 +95,8 @@ namespace ams::ro {
}
void Deallocate(void *p, size_t size) {
AMS_UNUSED(size);
return lmem::FreeToExpHeap(g_server_heap_handle, p);
}
@@ -158,38 +160,44 @@ void __appExit(void) {
namespace ams {
void *Malloc(size_t size) {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *ptr) {
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(ro, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(ro, Main));

View File

@@ -52,6 +52,7 @@ namespace {
namespace ams {
void NORETURN Exit(int rc) {
AMS_UNUSED(rc);
AMS_ABORT("Exit called by immortal process");
}
@@ -92,28 +93,34 @@ void __appExit(void) {
/* Nothing to clean up, because we're sm. */
}
void *operator new(size_t size) {
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(sm, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(sm, Main));

View File

@@ -52,6 +52,8 @@ namespace ams::sm {
}
Result UserService::DetachClient(const tipc::ClientProcessId client_process_id) {
AMS_UNUSED(client_process_id);
m_initialized = false;
return ResultSuccess();
}

View File

@@ -175,28 +175,46 @@ namespace {
}
void *operator new(size_t size) {
namespace ams {
void *Malloc(size_t) {
AMS_ABORT("ams::Malloc was called");
}
void Free(void *) {
AMS_ABORT("ams::Free was called");
}
}
void *operator new(size_t) {
AMS_ABORT("operator new(size_t) was called");
}
void operator delete(void *p) {
void operator delete(void *) {
AMS_ABORT("operator delete(void *) was called");
}
void *__libnx_alloc(size_t size) {
void operator delete(void *, size_t) {
AMS_ABORT("operator delete(void *, size_t) was called");
}
void *__libnx_alloc(size_t) {
AMS_ABORT("__libnx_alloc was called");
}
void *__libnx_aligned_alloc(size_t alignment, size_t size) {
void *__libnx_aligned_alloc(size_t, size_t) {
AMS_ABORT("__libnx_aligned_alloc was called");
}
void __libnx_free(void *mem) {
void __libnx_free(void *) {
AMS_ABORT("__libnx_free was called");
}
int main(int argc, char **argv)
{
AMS_UNUSED(argc, argv);
/* Set thread name. */
os::SetThreadNamePointer(os::GetCurrentThread(), AMS_GET_SYSTEM_THREAD_NAME(spl, Main));
AMS_ASSERT(os::GetThreadPriority(os::GetCurrentThread()) == AMS_GET_SYSTEM_THREAD_PRIORITY(spl, Main));