diff --git a/stratosphere/ams_mitm/source/amsmitm_main.cpp b/stratosphere/ams_mitm/source/amsmitm_main.cpp index b5afc65d5..396c844c5 100644 --- a/stratosphere/ams_mitm/source/amsmitm_main.cpp +++ b/stratosphere/ams_mitm/source/amsmitm_main.cpp @@ -46,7 +46,7 @@ extern "C" { void __libstratosphere_exception_handler(AtmosphereFatalErrorContext *ctx); } -sts::ncm::TitleId __stratosphere_title_id = sts::ncm::TitleId::AtmosphereMitm; +ams::ncm::TitleId __stratosphere_title_id = ams::ncm::TitleId::AtmosphereMitm; void __libnx_exception_handler(ThreadExceptionDump *ctx) { StratosphereCrashHandler(ctx); @@ -93,7 +93,7 @@ void __appExit(void) { int main(int argc, char **argv) { consoleDebugInit(debugDevice_SVC); - sts::os::Thread initializer_thread; + ams::os::Thread initializer_thread; LaunchAllMitmModules(); diff --git a/stratosphere/ams_mitm/source/amsmitm_modules.cpp b/stratosphere/ams_mitm/source/amsmitm_modules.cpp index 3556729cb..84c538843 100644 --- a/stratosphere/ams_mitm/source/amsmitm_modules.cpp +++ b/stratosphere/ams_mitm/source/amsmitm_modules.cpp @@ -27,7 +27,7 @@ #include "ns_mitm/nsmitm_main.hpp" #include "hid_mitm/hidmitm_main.hpp" -static sts::os::Thread g_module_threads[MitmModuleId_Count]; +static ams::os::Thread g_module_threads[MitmModuleId_Count]; static const struct { ThreadFunc main; diff --git a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp index 5ba913fb8..032975850 100644 --- a/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/bpc_mitm/bpc_mitm_service.hpp @@ -27,17 +27,17 @@ class BpcMitmService : public IMitmServiceObject { RebootSystem = 1, }; public: - BpcMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + BpcMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { /* ... */ } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* We will mitm: * - am, to intercept the Reboot/Power buttons in the overlay menu. * - fatal, to simplify payload reboot logic significantly * - applications, to allow homebrew to take advantage of the feature. */ - return tid == sts::ncm::TitleId::Am || tid == sts::ncm::TitleId::Fatal || sts::ncm::IsApplicationTitleId(tid) || Utils::IsHblTid(static_cast(tid)); + return tid == ams::ncm::TitleId::Am || tid == ams::ncm::TitleId::Fatal || ams::ncm::IsApplicationTitleId(tid) || Utils::IsHblTid(static_cast(tid)); } static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx); diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_dir_utils.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_dir_utils.cpp index 1f8f4735b..4dabcfdc4 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_dir_utils.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_dir_utils.cpp @@ -32,7 +32,7 @@ Result FsDirUtils::CopyFile(IFileSystem *dst_fs, IFileSystem *src_fs, const FsPa { FsPath dst_path; /* TODO: Error code? N aborts here. */ - STS_ASSERT(static_cast(snprintf(dst_path.str, sizeof(dst_path.str), "%s%s", dst_parent_path.str, dir_ent->name)) < sizeof(dst_path)); + AMS_ASSERT(static_cast(snprintf(dst_path.str, sizeof(dst_path.str), "%s%s", dst_parent_path.str, dir_ent->name)) < sizeof(dst_path)); R_TRY(dst_fs->CreateFile(dst_path, file_size)); R_TRY(dst_fs->OpenFile(dst_file, dst_path, OpenMode_Write)); diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_redirection_filesystem.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_redirection_filesystem.cpp index 8853ede40..7be3e5bff 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_redirection_filesystem.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_redirection_filesystem.cpp @@ -30,14 +30,14 @@ static char *GetNormalizedDirectory(const char *dir_prefix) { /* Ensure terminating '/' */ if (normal_path[normal_path_len-1] != '/') { - STS_ASSERT(normal_path_len + 2 <= sizeof(normal_path)); + AMS_ASSERT(normal_path_len + 2 <= sizeof(normal_path)); strncat(normal_path, "/", 2); normal_path[sizeof(normal_path)-1] = 0; normal_path_len++; } char *output = static_cast(std::malloc(normal_path_len + 1)); - STS_ASSERT(output != nullptr); + AMS_ASSERT(output != nullptr); std::strncpy(output, normal_path, normal_path_len + 1); output[normal_path_len] = 0; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.cpp index f1883a48c..d705404f9 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.cpp @@ -119,7 +119,7 @@ Result DirectorySaveDataFileSystem::AllocateWorkBuffer(void **out_buf, size_t *o /* Divide size by two. */ try_size >>= 1; - STS_ASSERT(try_size > 0x200); + AMS_ASSERT(try_size > 0x200); } /* TODO: Return a result here? Nintendo does not, but they have other allocation failed results. */ diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.hpp b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.hpp index 3fa5c61b8..9780024b5 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_directory_savedata_filesystem.hpp @@ -37,7 +37,7 @@ class DirectorySaveDataFileSystem : public IFileSystem { std::unique_ptr unique_fs; std::unique_ptr proxy_save_fs; IFileSystem *fs; - sts::os::Mutex lock; + ams::os::Mutex lock; size_t open_writable_files = 0; public: diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp index 4409e87b4..4c2872a1a 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_path_utils.cpp @@ -261,7 +261,7 @@ Result FsPathUtils::Normalize(char *out, size_t max_out_size, const char *src, s /* Assert normalized. */ bool normalized = false; R_ASSERT(FsPathUtils::IsNormalized(&normalized, out)); - STS_ASSERT(normalized); + AMS_ASSERT(normalized); return ResultSuccess(); } diff --git a/stratosphere/ams_mitm/source/fs_mitm/fs_subdirectory_filesystem.cpp b/stratosphere/ams_mitm/source/fs_mitm/fs_subdirectory_filesystem.cpp index c7a737fb0..fa55ba8cf 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fs_subdirectory_filesystem.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fs_subdirectory_filesystem.cpp @@ -34,7 +34,7 @@ Result SubDirectoryFileSystem::Initialize(const char *bp) { /* Ensure terminating '/' */ if (normal_path[normal_path_len-1] != '/') { - STS_ASSERT(normal_path_len + 2 <= sizeof(normal_path)); + AMS_ASSERT(normal_path_len + 2 <= sizeof(normal_path)); strncat(normal_path, "/", 2); normal_path[sizeof(normal_path)-1] = 0; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.cpp index 06148bcb4..e49e9030f 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.cpp @@ -20,7 +20,7 @@ #include "fsmitm_boot0storage.hpp" -static sts::os::Mutex g_boot0_mutex; +static ams::os::Mutex g_boot0_mutex; static u8 g_boot0_bct_buffer[Boot0Storage::BctEndOffset]; bool Boot0Storage::CanModifyBctPubks() { @@ -28,11 +28,11 @@ bool Boot0Storage::CanModifyBctPubks() { /* RCM bug patched. */ /* Only allow NS to update the BCT pubks. */ /* AutoRCM on a patched unit will cause a brick, so homebrew should NOT be allowed to write. */ - return this->title_id == sts::ncm::TitleId::Ns; + return this->title_id == ams::ncm::TitleId::Ns; } else { /* RCM bug unpatched. */ /* Allow homebrew but not NS to update the BCT pubks. */ - return this->title_id != sts::ncm::TitleId::Ns; + return this->title_id != ams::ncm::TitleId::Ns; } } diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.hpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.hpp index d15a2bdbb..68a1091a6 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_boot0storage.hpp @@ -131,12 +131,12 @@ class Boot0Storage : public SectoredProxyStorage<0x200> { static constexpr u64 EksSize = 0x4000; static constexpr u64 EksEnd = EksStart + EksSize; private: - sts::ncm::TitleId title_id; + ams::ncm::TitleId title_id; private: bool CanModifyBctPubks(); public: - Boot0Storage(FsStorage *s, sts::ncm::TitleId t) : Base(s), title_id(t) { } - Boot0Storage(FsStorage s, sts::ncm::TitleId t) : Base(s), title_id(t) { } + Boot0Storage(FsStorage *s, ams::ncm::TitleId t) : Base(s), title_id(t) { } + Boot0Storage(FsStorage s, ams::ncm::TitleId t) : Base(s), title_id(t) { } public: virtual Result Read(void *_buffer, size_t size, u64 offset) override; virtual Result Write(void *_buffer, size_t size, u64 offset) override; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_layeredrom.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_layeredrom.cpp index 44f35ae71..763d4c2ca 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_layeredrom.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_layeredrom.cpp @@ -93,7 +93,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) { R_ASSERT(Utils::OpenSdFileForAtmosphere(this->title_id, ROMFS_METADATA_FILE_PATH, FS_OPEN_READ, &file)); size_t out_read; R_ASSERT(fsFileRead(&file, (offset - cur_source->virtual_offset), (void *)((uintptr_t)buffer + read_so_far), cur_read_size, FS_READOPTION_NONE, &out_read)); - STS_ASSERT(out_read == cur_read_size); + AMS_ASSERT(out_read == cur_read_size); fsFileClose(&file); } break; @@ -103,7 +103,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) { R_ASSERT(Utils::OpenRomFSSdFile(this->title_id, cur_source->loose_source_info.path, FS_OPEN_READ, &file)); size_t out_read; R_ASSERT(fsFileRead(&file, (offset - cur_source->virtual_offset), (void *)((uintptr_t)buffer + read_so_far), cur_read_size, FS_READOPTION_NONE, &out_read)); - STS_ASSERT(out_read == cur_read_size); + AMS_ASSERT(out_read == cur_read_size); fsFileClose(&file); } break; @@ -122,7 +122,7 @@ Result LayeredRomFS::Read(void *buffer, size_t size, u64 offset) { R_ASSERT(this->file_romfs->Read((void *)((uintptr_t)buffer + read_so_far), cur_read_size, cur_source->base_source_info.offset + (offset - cur_source->virtual_offset))); } break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } read_so_far += cur_read_size; offset += cur_read_size; diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_romfsbuild.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_romfsbuild.cpp index 6fe31b3ac..5c6ca7c0b 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_romfsbuild.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_romfsbuild.cpp @@ -39,7 +39,7 @@ void RomFSBuildContext::VisitDirectory(FsFileSystem *filesys, RomFSBuildDirector break; } - STS_ASSERT(this->dir_entry.type == ENTRYTYPE_DIR || this->dir_entry.type == ENTRYTYPE_FILE); + AMS_ASSERT(this->dir_entry.type == ENTRYTYPE_DIR || this->dir_entry.type == ENTRYTYPE_FILE); if (this->dir_entry.type == ENTRYTYPE_DIR) { RomFSBuildDirectoryContext *child = new RomFSBuildDirectoryContext({0}); /* Set child's path. */ @@ -179,7 +179,7 @@ void RomFSBuildContext::VisitDirectory(RomFSBuildDirectoryContext *parent, u32 p void RomFSBuildContext::MergeRomStorage(IROStorage *storage, RomFSDataSource source) { RomFSHeader header; R_ASSERT(storage->Read(&header, sizeof(header), 0)); - STS_ASSERT(header.header_size == sizeof(header)); + AMS_ASSERT(header.header_size == sizeof(header)); /* Read tables. */ auto dir_table = std::make_unique(header.dir_table_size); diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp index 35c1ecea1..54aa32fcc 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp @@ -36,10 +36,10 @@ #include "../debug.hpp" -static sts::os::Mutex g_StorageCacheLock; +static ams::os::Mutex g_StorageCacheLock; static std::unordered_map> g_StorageCache; -static bool StorageCacheGetEntry(sts::ncm::TitleId title_id, std::shared_ptr *out) { +static bool StorageCacheGetEntry(ams::ncm::TitleId title_id, std::shared_ptr *out) { std::scoped_lock lock(g_StorageCacheLock); if (g_StorageCache.find(static_cast(title_id)) == g_StorageCache.end()) { return false; @@ -53,7 +53,7 @@ static bool StorageCacheGetEntry(sts::ncm::TitleId title_id, std::shared_ptr *ptr) { +static void StorageCacheSetEntry(ams::ncm::TitleId title_id, std::shared_ptr *ptr) { std::scoped_lock lock(g_StorageCacheLock); /* Ensure we always use the cached copy if present. */ @@ -145,7 +145,7 @@ Result FsMitmService::OpenFileSystemWithId(Out> out_fs) { /* We only care about redirecting this for NS/Emummc. */ - if (this->title_id != sts::ncm::TitleId::Ns) { + if (this->title_id != ams::ncm::TitleId::Ns) { return ResultAtmosphereMitmShouldForwardToSession; } if (!IsEmummc()) { @@ -234,7 +234,7 @@ Result FsMitmService::OpenBisStorage(Out> out FsStorage bis_storage; R_TRY(fsOpenBisStorageFwd(this->forward_service.get(), &bis_storage, bis_partition_id)); - const bool is_sysmodule = sts::ncm::IsSystemTitleId(this->title_id); + const bool is_sysmodule = ams::ncm::IsSystemTitleId(this->title_id); const bool has_bis_write_flag = Utils::HasFlag(static_cast(this->title_id), "bis_write"); const bool has_cal0_read_flag = Utils::HasFlag(static_cast(this->title_id), "cal_read"); @@ -345,7 +345,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out cached_storage = nullptr; - bool has_cache = StorageCacheGetEntry(sts::ncm::TitleId{data_id}, &cached_storage); + bool has_cache = StorageCacheGetEntry(ams::ncm::TitleId{data_id}, &cached_storage); if (has_cache) { if (out_storage.IsDomain()) { @@ -374,7 +374,7 @@ Result FsMitmService::OpenDataStorageByDataId(Out(new LayeredRomFS(std::make_shared(new ProxyStorage(data_storage)), nullptr, data_id)); } - StorageCacheSetEntry(sts::ncm::TitleId{data_id}, &storage_to_cache); + StorageCacheSetEntry(ams::ncm::TitleId{data_id}, &storage_to_cache); out_storage.SetValue(std::move(storage_to_cache)); if (out_storage.IsDomain()) { diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp index 757daf8a4..ae8e52387 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.hpp @@ -44,15 +44,15 @@ class FsMitmService : public IMitmServiceObject { bool has_initialized = false; bool should_override_contents; public: - FsMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + FsMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { if (Utils::HasSdDisableMitMFlag(static_cast(this->title_id))) { this->should_override_contents = false; } else { - this->should_override_contents = (this->title_id >= sts::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast(this->title_id))) && Utils::HasOverrideButton(static_cast(this->title_id)); + this->should_override_contents = (this->title_id >= ams::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast(this->title_id))) && Utils::HasOverrideButton(static_cast(this->title_id)); } } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* Don't Mitm KIPs */ if (pid < 0x50) { return false; @@ -62,11 +62,11 @@ class FsMitmService : public IMitmServiceObject { /* TODO: intercepting everything seems to cause issues with sleep mode, for some reason. */ /* Figure out why, and address it. */ - if (tid == sts::ncm::TitleId::AppletQlaunch || tid == sts::ncm::TitleId::AppletMaintenanceMenu) { + if (tid == ams::ncm::TitleId::AppletQlaunch || tid == ams::ncm::TitleId::AppletMaintenanceMenu) { has_launched_qlaunch = true; } - return has_launched_qlaunch || tid == sts::ncm::TitleId::Ns || tid >= sts::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast(tid)); + return has_launched_qlaunch || tid == ams::ncm::TitleId::Ns || tid >= ams::ncm::TitleId::ApplicationStart || Utils::HasSdMitMFlag(static_cast(tid)); } static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx); diff --git a/stratosphere/ams_mitm/source/hid_mitm/hid_mitm_service.hpp b/stratosphere/ams_mitm/source/hid_mitm/hid_mitm_service.hpp index 22d09f9a3..f621051c5 100644 --- a/stratosphere/ams_mitm/source/hid_mitm/hid_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/hid_mitm/hid_mitm_service.hpp @@ -28,13 +28,13 @@ class HidMitmService : public IMitmServiceObject { private: bool should_set_system_ext = false; public: - HidMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + HidMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { /* ... */ } ~HidMitmService(); - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* TODO: Consider removing in Atmosphere 0.10.0/1.0.0. */ /* We will mitm: * - hbl, to help homebrew not need to be recompiled. diff --git a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp index b682ffe88..fb88a4932 100644 --- a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp +++ b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_am_service.hpp @@ -28,11 +28,11 @@ class NsAmMitmService : public IMitmServiceObject { GetRunningApplicationProgramId = 92, }; public: - NsAmMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + NsAmMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { /* ... */ } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* We will mitm: * - web applets, to facilitate hbl web browser launching. */ diff --git a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp index 039fe5797..36a2b5f4e 100644 --- a/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp +++ b/stratosphere/ams_mitm/source/ns_mitm/nsmitm_web_service.hpp @@ -67,11 +67,11 @@ class NsWebMitmService : public IMitmServiceObject { GetDocumentInterface = 7999, }; public: - NsWebMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + NsWebMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { /* ... */ } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* We will mitm: * - web applets, to facilitate hbl web browser launching. */ diff --git a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.cpp b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.cpp index df381b878..cc575bd32 100644 --- a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.cpp +++ b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.cpp @@ -43,7 +43,7 @@ bool SetMitmService::IsValidLanguageCode(u64 lang_code) { LanguageCode_SimplifiedChinese, LanguageCode_TraditionalChinese, }; - size_t num_language_codes = sts::util::size(s_valid_language_codes); + size_t num_language_codes = ams::util::size(s_valid_language_codes); if (GetRuntimeFirmwareVersion() < FirmwareVersion_400) { /* 4.0.0 added simplified and traditional chinese. */ num_language_codes -= 2; @@ -67,7 +67,7 @@ Result SetMitmService::EnsureLocale() { if (!this->got_locale) { std::memset(&this->locale, 0xCC, sizeof(this->locale)); - if (this->title_id == sts::ncm::TitleId::Ns) { + if (this->title_id == ams::ncm::TitleId::Ns) { u64 app_pid = 0; u64 app_tid = 0; R_TRY(pmdmntGetApplicationPid(&app_pid)); diff --git a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp index d40532cb9..cf1efa0db 100644 --- a/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/set_mitm/set_mitm_service.hpp @@ -27,17 +27,17 @@ class SetMitmService : public IMitmServiceObject { GetRegionCode = 4, }; private: - sts::os::Mutex lock; + ams::os::Mutex lock; OverrideLocale locale; bool got_locale; public: - SetMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + SetMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { this->got_locale = false; } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* Mitm all applications. */ - return tid == sts::ncm::TitleId::Ns || sts::ncm::IsApplicationTitleId(tid); + return tid == ams::ncm::TitleId::Ns || ams::ncm::IsApplicationTitleId(tid); } static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx); diff --git a/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.cpp b/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.cpp index c037e547b..53daec4e3 100644 --- a/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.cpp +++ b/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.cpp @@ -19,7 +19,7 @@ #include "setsys_firmware_version.hpp" -static sts::os::Mutex g_version_mutex; +static ams::os::Mutex g_version_mutex; static bool g_got_version = false; static SetSysFirmwareVersion g_ams_fw_version = {0}; static SetSysFirmwareVersion g_fw_version = {0}; @@ -32,7 +32,7 @@ void VersionManager::Initialize() { } /* Mount firmware version data archive. */ - R_ASSERT(romfsMountFromDataArchive(static_cast(sts::ncm::TitleId::ArchiveSystemVersion), FsStorageId_NandSystem, "sysver")); + R_ASSERT(romfsMountFromDataArchive(static_cast(ams::ncm::TitleId::ArchiveSystemVersion), FsStorageId_NandSystem, "sysver")); { ON_SCOPE_EXIT { romfsUnmount("sysver"); }; @@ -40,11 +40,11 @@ void VersionManager::Initialize() { /* Firmware version file must exist. */ FILE *f = fopen("sysver:/file", "rb"); - STS_ASSERT(f != NULL); + AMS_ASSERT(f != NULL); ON_SCOPE_EXIT { fclose(f); }; /* Must be possible to read firmware version from file. */ - STS_ASSERT(fread(&fw_ver, sizeof(fw_ver), 1, f) == 1); + AMS_ASSERT(fread(&fw_ver, sizeof(fw_ver), 1, f) == 1); g_fw_version = fw_ver; g_ams_fw_version = fw_ver; @@ -65,11 +65,11 @@ void VersionManager::Initialize() { g_got_version = true; } -Result VersionManager::GetFirmwareVersion(sts::ncm::TitleId title_id, SetSysFirmwareVersion *out) { +Result VersionManager::GetFirmwareVersion(ams::ncm::TitleId title_id, SetSysFirmwareVersion *out) { VersionManager::Initialize(); /* Report atmosphere string to qlaunch, maintenance and nothing else. */ - if (title_id == sts::ncm::TitleId::AppletQlaunch || title_id == sts::ncm::TitleId::AppletMaintenanceMenu) { + if (title_id == ams::ncm::TitleId::AppletQlaunch || title_id == ams::ncm::TitleId::AppletMaintenanceMenu) { *out = g_ams_fw_version; } else { *out = g_fw_version; diff --git a/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.hpp b/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.hpp index 3711a4b5d..a45c9d5bf 100644 --- a/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.hpp +++ b/stratosphere/ams_mitm/source/set_mitm/setsys_firmware_version.hpp @@ -21,5 +21,5 @@ class VersionManager { public: static void Initialize(); - static Result GetFirmwareVersion(sts::ncm::TitleId title_id, SetSysFirmwareVersion *out); + static Result GetFirmwareVersion(ams::ncm::TitleId title_id, SetSysFirmwareVersion *out); }; diff --git a/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp b/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp index 5b4798a17..e13069f36 100644 --- a/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp +++ b/stratosphere/ams_mitm/source/set_mitm/setsys_mitm_service.hpp @@ -29,11 +29,11 @@ class SetSysMitmService : public IMitmServiceObject { GetSettingsItemValue = 38, }; public: - SetSysMitmService(std::shared_ptr s, u64 pid, sts::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { + SetSysMitmService(std::shared_ptr s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) { /* ... */ } - static bool ShouldMitm(u64 pid, sts::ncm::TitleId tid) { + static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) { /* Mitm everything. */ return true; } diff --git a/stratosphere/ams_mitm/source/set_mitm/setsys_settings_items.cpp b/stratosphere/ams_mitm/source/set_mitm/setsys_settings_items.cpp index 9fb787db9..e3ee3c32a 100644 --- a/stratosphere/ams_mitm/source/set_mitm/setsys_settings_items.cpp +++ b/stratosphere/ams_mitm/source/set_mitm/setsys_settings_items.cpp @@ -35,7 +35,7 @@ struct SettingsItemValue { std::map g_settings_items; static bool g_threw_fatal = false; -static sts::os::Thread g_fatal_thread; +static ams::os::Thread g_fatal_thread; static void FatalThreadFunc(void *arg) { svcSleepThread(5000000000ULL); diff --git a/stratosphere/ams_mitm/source/utils.cpp b/stratosphere/ams_mitm/source/utils.cpp index 38781d1be..8777df48a 100644 --- a/stratosphere/ams_mitm/source/utils.cpp +++ b/stratosphere/ams_mitm/source/utils.cpp @@ -31,7 +31,7 @@ static FsFileSystem g_sd_filesystem = {0}; /* Non-autoclear events for SD/HID init. */ -static sts::os::Event g_sd_event(false), g_hid_event(false); +static ams::os::Event g_sd_event(false), g_hid_event(false); static std::vector g_mitm_flagged_tids; static std::vector g_disable_mitm_flagged_tids; @@ -55,7 +55,7 @@ static HblOverrideConfig g_hbl_override_config = { .key_combination = KEY_R, .override_by_default = false }, - .title_id = static_cast(sts::ncm::TitleId::AppletPhotoViewer), + .title_id = static_cast(ams::ncm::TitleId::AppletPhotoViewer), .override_any_app = true }; @@ -88,7 +88,7 @@ void Utils::InitializeThreadFunc(void *args) { DoWithSmSession([&]() { Handle tmp_hnd = 0; static const char * const required_active_services[] = {"pcv", "gpio", "pinmux", "psc:m"}; - for (unsigned int i = 0; i < sts::util::size(required_active_services); i++) { + for (unsigned int i = 0; i < ams::util::size(required_active_services); i++) { R_ASSERT(smGetServiceOriginal(&tmp_hnd, smEncodeName(required_active_services[i]))); svcCloseHandle(tmp_hnd); } @@ -186,7 +186,7 @@ void Utils::InitializeThreadFunc(void *args) { 0x34, 0xC1, 0xA0, 0xC4, 0x82, 0x58, 0xF8, 0xB4, 0xFA, 0x9E, 0x5E, 0x6A, 0xDA, 0xFC, 0x7E, 0x4F, }; - const u32 option = (partition == 3 && sts::spl::IsRecoveryBoot()) ? 0x4 : 0x1; + const u32 option = (partition == 3 && ams::spl::IsRecoveryBoot()) ? 0x4 : 0x1; u8 access_key[0x10]; R_ASSERT(splCryptoGenerateAesKek(BisKekSource, key_generation, option, access_key)); @@ -455,13 +455,13 @@ Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data, } bool Utils::IsHblTid(u64 _tid) { - const sts::ncm::TitleId tid{_tid}; - return (g_hbl_override_config.override_any_app && sts::ncm::IsApplicationTitleId(tid)) || (_tid == g_hbl_override_config.title_id); + const ams::ncm::TitleId tid{_tid}; + return (g_hbl_override_config.override_any_app && ams::ncm::IsApplicationTitleId(tid)) || (_tid == g_hbl_override_config.title_id); } bool Utils::IsWebAppletTid(u64 _tid) { - const sts::ncm::TitleId tid{_tid}; - return tid == sts::ncm::TitleId::AppletWeb || tid == sts::ncm::TitleId::AppletOfflineWeb || tid == sts::ncm::TitleId::AppletLoginShare || tid == sts::ncm::TitleId::AppletWifiWebAuth; + const ams::ncm::TitleId tid{_tid}; + return tid == ams::ncm::TitleId::AppletWeb || tid == ams::ncm::TitleId::AppletOfflineWeb || tid == ams::ncm::TitleId::AppletLoginShare || tid == ams::ncm::TitleId::AppletWifiWebAuth; } bool Utils::HasTitleFlag(u64 tid, const char *flag) { @@ -550,7 +550,7 @@ static bool HasOverrideKey(OverrideKey *cfg) { bool Utils::HasOverrideButton(u64 tid) { - if ((!sts::ncm::IsApplicationTitleId(sts::ncm::TitleId{tid})) || (!IsSdInitialized())) { + if ((!ams::ncm::IsApplicationTitleId(ams::ncm::TitleId{tid})) || (!IsSdInitialized())) { /* Disable button override disable for non-applications. */ return true; } diff --git a/stratosphere/boot/source/boot_battery_driver.cpp b/stratosphere/boot/source/boot_battery_driver.cpp index b89ec5f3f..6c88101d2 100644 --- a/stratosphere/boot/source/boot_battery_driver.cpp +++ b/stratosphere/boot/source/boot_battery_driver.cpp @@ -18,7 +18,7 @@ #include "boot_calibration.hpp" #include "boot_i2c_utils.hpp" -namespace sts::boot { +namespace ams::boot { /* Include configuration into anonymous namespace. */ namespace { diff --git a/stratosphere/boot/source/boot_battery_driver.hpp b/stratosphere/boot/source/boot_battery_driver.hpp index 50d14ae0d..58e890234 100644 --- a/stratosphere/boot/source/boot_battery_driver.hpp +++ b/stratosphere/boot/source/boot_battery_driver.hpp @@ -20,7 +20,7 @@ #include "i2c/driver/i2c_api.hpp" -namespace sts::boot { +namespace ams::boot { class BatteryDriver { private: diff --git a/stratosphere/boot/source/boot_battery_icons.cpp b/stratosphere/boot/source/boot_battery_icons.cpp index ea1c79acb..d4cc6d5ae 100644 --- a/stratosphere/boot/source/boot_battery_icons.cpp +++ b/stratosphere/boot/source/boot_battery_icons.cpp @@ -17,7 +17,7 @@ #include "boot_battery_icons.hpp" #include "boot_display.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_battery_icons.hpp b/stratosphere/boot/source/boot_battery_icons.hpp index d9fe65c08..ca5254bbe 100644 --- a/stratosphere/boot/source/boot_battery_icons.hpp +++ b/stratosphere/boot/source/boot_battery_icons.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* Battery Display utilities. */ void ShowLowBatteryIcon(); diff --git a/stratosphere/boot/source/boot_boot_reason.cpp b/stratosphere/boot/source/boot_boot_reason.cpp index c42a01e98..3aac96e67 100644 --- a/stratosphere/boot/source/boot_boot_reason.cpp +++ b/stratosphere/boot/source/boot_boot_reason.cpp @@ -20,7 +20,7 @@ #include "boot_pmic_driver.hpp" #include "boot_rtc_driver.hpp" -namespace sts::boot { +namespace ams::boot { namespace { @@ -104,7 +104,7 @@ namespace sts::boot { } u32 GetBootReason() { - STS_ASSERT(g_detected_boot_reason); + AMS_ASSERT(g_detected_boot_reason); return g_boot_reason; } diff --git a/stratosphere/boot/source/boot_boot_reason.hpp b/stratosphere/boot/source/boot_boot_reason.hpp index b3bcaed24..476eb14c6 100644 --- a/stratosphere/boot/source/boot_boot_reason.hpp +++ b/stratosphere/boot/source/boot_boot_reason.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* Boot Reason utilities. */ void DetectBootReason(); diff --git a/stratosphere/boot/source/boot_bq24193_charger.hpp b/stratosphere/boot/source/boot_bq24193_charger.hpp index 768bbeb88..c5fd7ba70 100644 --- a/stratosphere/boot/source/boot_bq24193_charger.hpp +++ b/stratosphere/boot/source/boot_bq24193_charger.hpp @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -namespace sts::boot::bq24193 { +namespace ams::boot::bq24193 { constexpr u8 InputSourceControl = 0x00; constexpr u8 PowerOnConfiguration = 0x01; @@ -38,8 +38,8 @@ namespace sts::boot::bq24193 { constexpr u32 ChargeVoltageLimitMax = 4208; inline u8 EncodeChargeVoltageLimit(u32 voltage) { - STS_ASSERT(voltage >= ChargeVoltageLimitMin); - STS_ASSERT(voltage <= ChargeVoltageLimitMax); + AMS_ASSERT(voltage >= ChargeVoltageLimitMin); + AMS_ASSERT(voltage <= ChargeVoltageLimitMax); voltage -= ChargeVoltageLimitMin; voltage >>= 4; @@ -54,8 +54,8 @@ namespace sts::boot::bq24193 { constexpr u32 FastChargeCurrentLimitMax = 4544; inline u8 EncodeFastChargeCurrentLimit(u32 current) { - STS_ASSERT(current >= FastChargeCurrentLimitMin); - STS_ASSERT(current <= FastChargeCurrentLimitMax); + AMS_ASSERT(current >= FastChargeCurrentLimitMin); + AMS_ASSERT(current <= FastChargeCurrentLimitMax); current -= FastChargeCurrentLimitMin; current >>= 6; @@ -81,8 +81,8 @@ namespace sts::boot::bq24193 { constexpr u32 PreChargeCurrentLimitMax = 2048; inline u8 EncodePreChargeCurrentLimit(u32 current) { - STS_ASSERT(current >= PreChargeCurrentLimitMin); - STS_ASSERT(current <= PreChargeCurrentLimitMax); + AMS_ASSERT(current >= PreChargeCurrentLimitMin); + AMS_ASSERT(current <= PreChargeCurrentLimitMax); current -= PreChargeCurrentLimitMin; current >>= 7; @@ -97,8 +97,8 @@ namespace sts::boot::bq24193 { constexpr u32 TerminationCurrentLimitMax = 2048; inline u8 EncodeTerminationCurrentLimit(u32 current) { - STS_ASSERT(current >= TerminationCurrentLimitMin); - STS_ASSERT(current <= TerminationCurrentLimitMax); + AMS_ASSERT(current >= TerminationCurrentLimitMin); + AMS_ASSERT(current <= TerminationCurrentLimitMax); current -= TerminationCurrentLimitMin; current >>= 7; @@ -113,8 +113,8 @@ namespace sts::boot::bq24193 { constexpr u32 MinimumSystemVoltageLimitMax = 3700; inline u8 EncodeMinimumSystemVoltageLimit(u32 voltage) { - STS_ASSERT(voltage >= MinimumSystemVoltageLimitMin); - STS_ASSERT(voltage <= MinimumSystemVoltageLimitMax); + AMS_ASSERT(voltage >= MinimumSystemVoltageLimitMin); + AMS_ASSERT(voltage <= MinimumSystemVoltageLimitMax); voltage -= MinimumSystemVoltageLimitMin; voltage /= 100; diff --git a/stratosphere/boot/source/boot_calibration.cpp b/stratosphere/boot/source/boot_calibration.cpp index 84e4c9eed..839001e60 100644 --- a/stratosphere/boot/source/boot_calibration.cpp +++ b/stratosphere/boot/source/boot_calibration.cpp @@ -16,7 +16,7 @@ #include "boot_calibration.hpp" -namespace sts::boot { +namespace ams::boot { namespace { @@ -36,7 +36,7 @@ namespace sts::boot { 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400 }; - STS_ASSERT(data != nullptr); + AMS_ASSERT(data != nullptr); u16 crc16 = 0x55AA; const u8 *data_u8 = reinterpret_cast(data); diff --git a/stratosphere/boot/source/boot_calibration.hpp b/stratosphere/boot/source/boot_calibration.hpp index 1d33f028b..0b53fd035 100644 --- a/stratosphere/boot/source/boot_calibration.hpp +++ b/stratosphere/boot/source/boot_calibration.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* Calibration utilities. */ u32 GetBatteryVersion(); diff --git a/stratosphere/boot/source/boot_change_voltage.cpp b/stratosphere/boot/source/boot_change_voltage.cpp index cd32391a6..553c2344b 100644 --- a/stratosphere/boot/source/boot_change_voltage.cpp +++ b/stratosphere/boot/source/boot_change_voltage.cpp @@ -17,7 +17,7 @@ #include "boot_change_voltage.hpp" #include "boot_pmc_wrapper.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_change_voltage.hpp b/stratosphere/boot/source/boot_change_voltage.hpp index 8a5f9fee2..c5c6a1f7a 100644 --- a/stratosphere/boot/source/boot_change_voltage.hpp +++ b/stratosphere/boot/source/boot_change_voltage.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void ChangeGpioVoltageTo1_8v();; diff --git a/stratosphere/boot/source/boot_charger_driver.cpp b/stratosphere/boot/source/boot_charger_driver.cpp index 2cd2916c4..402fe0aa0 100644 --- a/stratosphere/boot/source/boot_charger_driver.cpp +++ b/stratosphere/boot/source/boot_charger_driver.cpp @@ -19,7 +19,7 @@ #include "boot_charger_driver.hpp" -namespace sts::boot { +namespace ams::boot { Result ChargerDriver::Read(u8 addr, u8 *out) { return ReadI2cRegister(this->i2c_session, reinterpret_cast(out), sizeof(*out), &addr, sizeof(addr)); diff --git a/stratosphere/boot/source/boot_charger_driver.hpp b/stratosphere/boot/source/boot_charger_driver.hpp index a09990806..d770ce0e9 100644 --- a/stratosphere/boot/source/boot_charger_driver.hpp +++ b/stratosphere/boot/source/boot_charger_driver.hpp @@ -23,7 +23,7 @@ #include "gpio/gpio_utils.hpp" -namespace sts::boot { +namespace ams::boot { class ChargerDriver { private: diff --git a/stratosphere/boot/source/boot_check_battery.cpp b/stratosphere/boot/source/boot_check_battery.cpp index c4aa3443d..e47c37a6d 100644 --- a/stratosphere/boot/source/boot_check_battery.cpp +++ b/stratosphere/boot/source/boot_check_battery.cpp @@ -23,7 +23,7 @@ #include "boot_pmic_driver.hpp" #include "boot_power_utils.hpp" -namespace sts::boot { +namespace ams::boot { namespace { @@ -100,7 +100,7 @@ namespace sts::boot { return &BatteryChargeParameters1; case 2: return &BatteryChargeParameters2; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -280,7 +280,7 @@ namespace sts::boot { case CheckBatteryResult::Reboot: RebootSystem(); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/boot/source/boot_check_battery.hpp b/stratosphere/boot/source/boot_check_battery.hpp index de05f0056..63be38e69 100644 --- a/stratosphere/boot/source/boot_check_battery.hpp +++ b/stratosphere/boot/source/boot_check_battery.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void CheckBatteryCharge(); diff --git a/stratosphere/boot/source/boot_check_clock.cpp b/stratosphere/boot/source/boot_check_clock.cpp index 4884e1548..f5f536576 100644 --- a/stratosphere/boot/source/boot_check_clock.cpp +++ b/stratosphere/boot/source/boot_check_clock.cpp @@ -18,7 +18,7 @@ #include "boot_check_clock.hpp" #include "boot_power_utils.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_check_clock.hpp b/stratosphere/boot/source/boot_check_clock.hpp index 9f35a4673..5fea378d8 100644 --- a/stratosphere/boot/source/boot_check_clock.hpp +++ b/stratosphere/boot/source/boot_check_clock.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void CheckClock(); diff --git a/stratosphere/boot/source/boot_clock_initial_configuration.cpp b/stratosphere/boot/source/boot_clock_initial_configuration.cpp index b09e83941..043e4f207 100644 --- a/stratosphere/boot/source/boot_clock_initial_configuration.cpp +++ b/stratosphere/boot/source/boot_clock_initial_configuration.cpp @@ -18,7 +18,7 @@ #include "boot_pmc_wrapper.hpp" #include "boot_registers_pmc.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_clock_initial_configuration.hpp b/stratosphere/boot/source/boot_clock_initial_configuration.hpp index 047ee2744..660d6c1e7 100644 --- a/stratosphere/boot/source/boot_clock_initial_configuration.hpp +++ b/stratosphere/boot/source/boot_clock_initial_configuration.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void SetInitialClockConfiguration(); diff --git a/stratosphere/boot/source/boot_display.cpp b/stratosphere/boot/source/boot_display.cpp index 02ff79aa9..8418f3ae6 100644 --- a/stratosphere/boot/source/boot_display.cpp +++ b/stratosphere/boot/source/boot_display.cpp @@ -28,7 +28,7 @@ #include "boot_registers_pinmux.hpp" #include "boot_registers_pmc.hpp" -namespace sts::boot { +namespace ams::boot { /* Display configuration included into anonymous namespace. */ namespace { @@ -110,7 +110,7 @@ namespace sts::boot { case DsiSleepOrRegisterWriteKind_Sleep: svcSleepThread(1'000'000ul * u64(reg_writes[i].offset)); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } } diff --git a/stratosphere/boot/source/boot_display.hpp b/stratosphere/boot/source/boot_display.hpp index c4a565d7b..a01450abc 100644 --- a/stratosphere/boot/source/boot_display.hpp +++ b/stratosphere/boot/source/boot_display.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* Splash Screen/Display utilities. */ void InitializeDisplay(); diff --git a/stratosphere/boot/source/boot_fan_enable.cpp b/stratosphere/boot/source/boot_fan_enable.cpp index d235cc518..0fd2b38df 100644 --- a/stratosphere/boot/source/boot_fan_enable.cpp +++ b/stratosphere/boot/source/boot_fan_enable.cpp @@ -20,7 +20,7 @@ #include "gpio/gpio_utils.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_fan_enable.hpp b/stratosphere/boot/source/boot_fan_enable.hpp index 3b676b556..05dc983f5 100644 --- a/stratosphere/boot/source/boot_fan_enable.hpp +++ b/stratosphere/boot/source/boot_fan_enable.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void SetFanEnabled(); diff --git a/stratosphere/boot/source/boot_i2c_utils.cpp b/stratosphere/boot/source/boot_i2c_utils.cpp index 9627b4013..a7adaee0b 100644 --- a/stratosphere/boot/source/boot_i2c_utils.cpp +++ b/stratosphere/boot/source/boot_i2c_utils.cpp @@ -16,7 +16,7 @@ #include "boot_i2c_utils.hpp" -namespace sts::boot { +namespace ams::boot { namespace { @@ -43,8 +43,8 @@ namespace sts::boot { } Result ReadI2cRegister(i2c::driver::Session &session, u8 *dst, size_t dst_size, const u8 *cmd, size_t cmd_size) { - STS_ASSERT(dst != nullptr && dst_size > 0); - STS_ASSERT(cmd != nullptr && cmd_size > 0); + AMS_ASSERT(dst != nullptr && dst_size > 0); + AMS_ASSERT(cmd != nullptr && cmd_size > 0); u8 cmd_list[i2c::CommandListFormatter::MaxCommandListSize]; @@ -56,8 +56,8 @@ namespace sts::boot { } Result WriteI2cRegister(i2c::driver::Session &session, const u8 *src, size_t src_size, const u8 *cmd, size_t cmd_size) { - STS_ASSERT(src != nullptr && src_size > 0); - STS_ASSERT(cmd != nullptr && cmd_size > 0); + AMS_ASSERT(src != nullptr && src_size > 0); + AMS_ASSERT(cmd != nullptr && cmd_size > 0); u8 cmd_list[0x20]; diff --git a/stratosphere/boot/source/boot_i2c_utils.hpp b/stratosphere/boot/source/boot_i2c_utils.hpp index 32fe6a208..6f617e9b7 100644 --- a/stratosphere/boot/source/boot_i2c_utils.hpp +++ b/stratosphere/boot/source/boot_i2c_utils.hpp @@ -20,7 +20,7 @@ #include "i2c/driver/i2c_api.hpp" -namespace sts::boot { +namespace ams::boot { /* I2C Utilities. */ Result ReadI2cRegister(i2c::driver::Session &session, u8 *dst, size_t dst_size, const u8 *cmd, size_t cmd_size); diff --git a/stratosphere/boot/source/boot_main.cpp b/stratosphere/boot/source/boot_main.cpp index 952c42767..125b7cd38 100644 --- a/stratosphere/boot/source/boot_main.cpp +++ b/stratosphere/boot/source/boot_main.cpp @@ -39,7 +39,7 @@ #include "boot_power_utils.hpp" -using namespace sts; +using namespace ams; extern "C" { extern u32 __start__; @@ -61,24 +61,24 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Boot; + ncm::TitleId CurrentTitleId = ncm::TitleId::Boot; void ExceptionHandler(FatalErrorContext *ctx) { /* We're boot sysmodule, so manually reboot to fatal error. */ boot::RebootForFatalError(ctx); } -} + namespace result { -namespace sts::result { + bool CallFatalOnResultAssertion = false; - bool CallFatalOnResultAssertion = false; + } } -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/boot/source/boot_pcv.cpp b/stratosphere/boot/source/boot_pcv.cpp index 01390e3cd..fa9380a2c 100644 --- a/stratosphere/boot/source/boot_pcv.cpp +++ b/stratosphere/boot/source/boot_pcv.cpp @@ -21,9 +21,9 @@ #include "i2c/driver/impl/i2c_pcv.hpp" #include "i2c/driver/impl/i2c_registers.hpp" -using namespace sts::i2c::driver::impl; +using namespace ams::i2c::driver::impl; -namespace sts::pcv { +namespace ams::pcv { void Initialize() { /* Don't do anything. */ diff --git a/stratosphere/boot/source/boot_pmc_wrapper.cpp b/stratosphere/boot/source/boot_pmc_wrapper.cpp index 59a269f89..4b3058d69 100644 --- a/stratosphere/boot/source/boot_pmc_wrapper.cpp +++ b/stratosphere/boot/source/boot_pmc_wrapper.cpp @@ -17,7 +17,7 @@ #include #include "boot_pmc_wrapper.hpp" -namespace sts::boot { +namespace ams::boot { namespace { @@ -41,12 +41,12 @@ namespace sts::boot { } u32 ReadPmcRegister(u32 phys_addr) { - STS_ASSERT(IsValidPmcAddress(phys_addr)); + AMS_ASSERT(IsValidPmcAddress(phys_addr)); return ReadWriteRegisterImpl(phys_addr, 0, 0); } void WritePmcRegister(u32 phys_addr, u32 value, u32 mask) { - STS_ASSERT(IsValidPmcAddress(phys_addr)); + AMS_ASSERT(IsValidPmcAddress(phys_addr)); ReadWriteRegisterImpl(phys_addr, value, mask); } diff --git a/stratosphere/boot/source/boot_pmc_wrapper.hpp b/stratosphere/boot/source/boot_pmc_wrapper.hpp index 50d876fd3..8d25622a7 100644 --- a/stratosphere/boot/source/boot_pmc_wrapper.hpp +++ b/stratosphere/boot/source/boot_pmc_wrapper.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* PMC Access Utilities. */ u32 ReadPmcRegister(u32 phys_addr); diff --git a/stratosphere/boot/source/boot_pmic_driver.cpp b/stratosphere/boot/source/boot_pmic_driver.cpp index 9550a19e9..afa098dc0 100644 --- a/stratosphere/boot/source/boot_pmic_driver.cpp +++ b/stratosphere/boot/source/boot_pmic_driver.cpp @@ -20,7 +20,7 @@ #include "boot_i2c_utils.hpp" #include "boot_pmic_driver.hpp" -namespace sts::boot { +namespace ams::boot { void PmicDriver::ShutdownSystem() { R_ASSERT(this->ShutdownSystem(false)); @@ -89,7 +89,7 @@ namespace sts::boot { /* Allow up to 5 seconds for shutdown/reboot to take place. */ svcSleepThread(5'000'000'000ul); - STS_ASSERT(false); + AMS_ASSERT(false); } void PmicDriver::FinalizeBattery(BatteryDriver *battery_driver) { diff --git a/stratosphere/boot/source/boot_pmic_driver.hpp b/stratosphere/boot/source/boot_pmic_driver.hpp index 4b29c742b..8ff07e8b9 100644 --- a/stratosphere/boot/source/boot_pmic_driver.hpp +++ b/stratosphere/boot/source/boot_pmic_driver.hpp @@ -20,7 +20,7 @@ #include "boot_battery_driver.hpp" -namespace sts::boot { +namespace ams::boot { /* Driver object. */ class PmicDriver { diff --git a/stratosphere/boot/source/boot_power_utils.cpp b/stratosphere/boot/source/boot_power_utils.cpp index 0253d2af6..dfa9074cc 100644 --- a/stratosphere/boot/source/boot_power_utils.cpp +++ b/stratosphere/boot/source/boot_power_utils.cpp @@ -21,7 +21,7 @@ #include "boot_power_utils.hpp" #include "fusee-primary_bin.h" -namespace sts::boot { +namespace ams::boot { namespace { @@ -41,7 +41,7 @@ namespace sts::boot { /* Overwrite all of IRAM with FFs. */ for (size_t ofs = 0; ofs < IramSize; ofs += sizeof(g_work_page)) { - ams::CopyToIram(IramBase + ofs, g_work_page, sizeof(g_work_page)); + exosphere::CopyToIram(IramBase + ofs, g_work_page, sizeof(g_work_page)); } } @@ -52,7 +52,7 @@ namespace sts::boot { /* Copy in payload. */ for (size_t ofs = 0; ofs < fusee_primary_bin_size; ofs += 0x1000) { std::memcpy(g_work_page, &fusee_primary_bin[ofs], std::min(static_cast(fusee_primary_bin_size - ofs), size_t(0x1000))); - ams::CopyToIram(IramPayloadBase + ofs, g_work_page, 0x1000); + exosphere::CopyToIram(IramPayloadBase + ofs, g_work_page, 0x1000); } @@ -60,10 +60,10 @@ namespace sts::boot { if (ctx != nullptr) { std::memset(g_work_page, 0xCC, sizeof(g_work_page)); std::memcpy(g_work_page, ctx, sizeof(*ctx)); - ams::CopyToIram(IramPayloadBase + IramPayloadMaxSize, g_work_page, sizeof(g_work_page)); + exosphere::CopyToIram(IramPayloadBase + IramPayloadMaxSize, g_work_page, sizeof(g_work_page)); } - ams::ForceRebootToIramPayload(); + exosphere::ForceRebootToIramPayload(); } } diff --git a/stratosphere/boot/source/boot_power_utils.hpp b/stratosphere/boot/source/boot_power_utils.hpp index 6efe66190..31a59b80f 100644 --- a/stratosphere/boot/source/boot_power_utils.hpp +++ b/stratosphere/boot/source/boot_power_utils.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { /* Power utilities. */ void RebootSystem(); diff --git a/stratosphere/boot/source/boot_repair_boot_images.cpp b/stratosphere/boot/source/boot_repair_boot_images.cpp index 7eba04b4d..5323910e3 100644 --- a/stratosphere/boot/source/boot_repair_boot_images.cpp +++ b/stratosphere/boot/source/boot_repair_boot_images.cpp @@ -20,7 +20,7 @@ #include "boot_power_utils.hpp" #include "boot_repair_boot_images.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_repair_boot_images.hpp b/stratosphere/boot/source/boot_repair_boot_images.hpp index 34fa223c9..7b53ed2e6 100644 --- a/stratosphere/boot/source/boot_repair_boot_images.hpp +++ b/stratosphere/boot/source/boot_repair_boot_images.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void CheckAndRepairBootImages(); diff --git a/stratosphere/boot/source/boot_rtc_driver.cpp b/stratosphere/boot/source/boot_rtc_driver.cpp index 13c201ad5..932a70184 100644 --- a/stratosphere/boot/source/boot_rtc_driver.cpp +++ b/stratosphere/boot/source/boot_rtc_driver.cpp @@ -19,7 +19,7 @@ #include "boot_rtc_driver.hpp" -namespace sts::boot { +namespace ams::boot { Result RtcDriver::ReadRtcRegister(u8 *out, u8 address) { const u8 update_addr = 0x04; diff --git a/stratosphere/boot/source/boot_rtc_driver.hpp b/stratosphere/boot/source/boot_rtc_driver.hpp index c4d014b1f..740a49e10 100644 --- a/stratosphere/boot/source/boot_rtc_driver.hpp +++ b/stratosphere/boot/source/boot_rtc_driver.hpp @@ -20,7 +20,7 @@ #include "boot_i2c_utils.hpp" -namespace sts::boot { +namespace ams::boot { class RtcDriver { private: diff --git a/stratosphere/boot/source/boot_splash_screen.cpp b/stratosphere/boot/source/boot_splash_screen.cpp index 814216d88..786b74da8 100644 --- a/stratosphere/boot/source/boot_splash_screen.cpp +++ b/stratosphere/boot/source/boot_splash_screen.cpp @@ -18,7 +18,7 @@ #include "boot_display.hpp" #include "boot_splash_screen.hpp" -namespace sts::boot { +namespace ams::boot { namespace { diff --git a/stratosphere/boot/source/boot_splash_screen.hpp b/stratosphere/boot/source/boot_splash_screen.hpp index 44dac59d4..a357141dc 100644 --- a/stratosphere/boot/source/boot_splash_screen.hpp +++ b/stratosphere/boot/source/boot_splash_screen.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void ShowSplashScreen(); diff --git a/stratosphere/boot/source/boot_wake_pins.cpp b/stratosphere/boot/source/boot_wake_pins.cpp index c32c2d19f..f4cebbd8e 100644 --- a/stratosphere/boot/source/boot_wake_pins.cpp +++ b/stratosphere/boot/source/boot_wake_pins.cpp @@ -21,7 +21,7 @@ #include "boot_registers_pmc.hpp" -namespace sts::boot { +namespace ams::boot { /* Include configuration into anonymous namespace. */ namespace { diff --git a/stratosphere/boot/source/boot_wake_pins.hpp b/stratosphere/boot/source/boot_wake_pins.hpp index a74cb98a2..92e7b72f1 100644 --- a/stratosphere/boot/source/boot_wake_pins.hpp +++ b/stratosphere/boot/source/boot_wake_pins.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot { +namespace ams::boot { void SetInitialWakePinConfiguration(); diff --git a/stratosphere/boot/source/gpio/gpio_initial_configuration.cpp b/stratosphere/boot/source/gpio/gpio_initial_configuration.cpp index 10c420dc9..2ff27bb96 100644 --- a/stratosphere/boot/source/gpio/gpio_initial_configuration.cpp +++ b/stratosphere/boot/source/gpio/gpio_initial_configuration.cpp @@ -19,7 +19,7 @@ #include "gpio_initial_configuration.hpp" #include "gpio_utils.hpp" -namespace sts::gpio { +namespace ams::gpio { namespace { @@ -70,7 +70,7 @@ namespace sts::gpio { num_configs = NumInitialConfigsIowa; break; /* Unknown hardware type, we can't proceed. */ - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } else { /* Until 2.0.0, the GPIO map for Icosa was used for all hardware types. */ @@ -79,7 +79,7 @@ namespace sts::gpio { } /* Ensure we found an appropriate config. */ - STS_ASSERT(configs != nullptr); + AMS_ASSERT(configs != nullptr); for (size_t i = 0; i < num_configs; i++) { /* Configure the GPIO. */ diff --git a/stratosphere/boot/source/gpio/gpio_initial_configuration.hpp b/stratosphere/boot/source/gpio/gpio_initial_configuration.hpp index 030ef89df..981785ab8 100644 --- a/stratosphere/boot/source/gpio/gpio_initial_configuration.hpp +++ b/stratosphere/boot/source/gpio/gpio_initial_configuration.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::gpio { +namespace ams::gpio { void SetInitialConfiguration(); diff --git a/stratosphere/boot/source/gpio/gpio_utils.cpp b/stratosphere/boot/source/gpio/gpio_utils.cpp index 32ad05adc..1b642293f 100644 --- a/stratosphere/boot/source/gpio/gpio_utils.cpp +++ b/stratosphere/boot/source/gpio/gpio_utils.cpp @@ -18,7 +18,7 @@ #include "gpio_utils.hpp" -namespace sts::gpio { +namespace ams::gpio { namespace { @@ -33,7 +33,7 @@ namespace sts::gpio { /* Helpers. */ inline u32 GetPadDescriptor(u32 gpio_pad_name) { - STS_ASSERT(gpio_pad_name < PadNameMax); + AMS_ASSERT(gpio_pad_name < PadNameMax); return Map[gpio_pad_name]; } diff --git a/stratosphere/boot/source/gpio/gpio_utils.hpp b/stratosphere/boot/source/gpio/gpio_utils.hpp index ce395148d..bdc92d2d3 100644 --- a/stratosphere/boot/source/gpio/gpio_utils.hpp +++ b/stratosphere/boot/source/gpio/gpio_utils.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::gpio { +namespace ams::gpio { /* GPIO Utilities. */ u32 Configure(u32 gpio_pad_name); diff --git a/stratosphere/boot/source/i2c/driver/i2c_api.cpp b/stratosphere/boot/source/i2c/driver/i2c_api.cpp index 6b9a99132..74b732169 100644 --- a/stratosphere/boot/source/i2c/driver/i2c_api.cpp +++ b/stratosphere/boot/source/i2c/driver/i2c_api.cpp @@ -20,7 +20,7 @@ #include "i2c_api.hpp" #include "impl/i2c_resource_manager.hpp" -namespace sts::i2c::driver { +namespace ams::i2c::driver { namespace { @@ -70,7 +70,7 @@ namespace sts::i2c::driver { svcSleepThread(us * 1'000ul); } break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } return ResultSuccess(); } @@ -87,7 +87,7 @@ namespace sts::i2c::driver { } inline void CheckInitialized() { - STS_ASSERT(GetResourceManager().IsInitialized()); + AMS_ASSERT(GetResourceManager().IsInitialized()); } } @@ -104,7 +104,7 @@ namespace sts::i2c::driver { /* Session management. */ void OpenSession(Session *out_session, I2cDevice device) { CheckInitialized(); - STS_ASSERT(impl::IsDeviceSupported(device)); + AMS_ASSERT(impl::IsDeviceSupported(device)); const auto bus = impl::GetDeviceBus(device); const auto slave_address = impl::GetDeviceSlaveAddress(device); @@ -123,8 +123,8 @@ namespace sts::i2c::driver { /* Communication. */ Result Send(Session &session, const void *src, size_t size, I2cTransactionOption option) { CheckInitialized(); - STS_ASSERT(src != nullptr); - STS_ASSERT(size > 0); + AMS_ASSERT(src != nullptr); + AMS_ASSERT(size > 0); std::scoped_lock lk(GetResourceManager().GetTransactionMutex(impl::ConvertFromIndex(session.bus_idx))); return GetResourceManager().GetSession(session.session_id).DoTransactionWithRetry(nullptr, src, size, option, impl::Command::Send); @@ -132,8 +132,8 @@ namespace sts::i2c::driver { Result Receive(Session &session, void *dst, size_t size, I2cTransactionOption option) { CheckInitialized(); - STS_ASSERT(dst != nullptr); - STS_ASSERT(size > 0); + AMS_ASSERT(dst != nullptr); + AMS_ASSERT(size > 0); std::scoped_lock lk(GetResourceManager().GetTransactionMutex(impl::ConvertFromIndex(session.bus_idx))); return GetResourceManager().GetSession(session.session_id).DoTransactionWithRetry(dst, nullptr, size, option, impl::Command::Receive); @@ -141,8 +141,8 @@ namespace sts::i2c::driver { Result ExecuteCommandList(Session &session, void *dst, size_t size, const void *cmd_list, size_t cmd_list_size) { CheckInitialized(); - STS_ASSERT(dst != nullptr && size > 0); - STS_ASSERT(cmd_list != nullptr && cmd_list_size > 0); + AMS_ASSERT(dst != nullptr && size > 0); + AMS_ASSERT(cmd_list != nullptr && cmd_list_size > 0); u8 *cur_dst = static_cast(dst); const u8 *cur_cmd = static_cast(cmd_list); @@ -150,7 +150,7 @@ namespace sts::i2c::driver { while (cur_cmd < cmd_list_end) { Command cmd = static_cast((*cur_cmd) & 3); - STS_ASSERT(cmd < Command::Count); + AMS_ASSERT(cmd < Command::Count); R_TRY(g_cmd_handlers[static_cast(cmd)](&cur_cmd, &cur_dst, session)); } diff --git a/stratosphere/boot/source/i2c/driver/i2c_api.hpp b/stratosphere/boot/source/i2c/driver/i2c_api.hpp index 134e00d4f..2b8e1dd02 100644 --- a/stratosphere/boot/source/i2c/driver/i2c_api.hpp +++ b/stratosphere/boot/source/i2c/driver/i2c_api.hpp @@ -21,7 +21,7 @@ #include "../i2c_types.hpp" #include "../i2c_command_list.hpp" -namespace sts::i2c::driver { +namespace ams::i2c::driver { struct Session { size_t bus_idx; diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.cpp b/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.cpp index 87791bc0a..2b590abbf 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.cpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.cpp @@ -20,7 +20,7 @@ #include "i2c_pcv.hpp" #include "i2c_bus_accessor.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { void BusAccessor::Open(Bus bus, SpeedMode speed_mode) { std::scoped_lock lk(this->open_mutex); @@ -29,7 +29,7 @@ namespace sts::i2c::driver::impl { /* Ensure we're good if this isn't our first session. */ if (this->open_sessions > 1) { - STS_ASSERT(this->speed_mode == speed_mode); + AMS_ASSERT(this->speed_mode == speed_mode); return; } @@ -244,7 +244,7 @@ namespace sts::i2c::driver::impl { 0x46, 0x74, 0x7C, 0x98, 0x55, 0x5F }; const auto index = ConvertToIndex(bus); - STS_ASSERT(index < util::size(s_interrupts)); + AMS_ASSERT(index < util::size(s_interrupts)); R_ASSERT(this->interrupt_event.Initialize(s_interrupts[index], false)); } @@ -282,7 +282,7 @@ namespace sts::i2c::driver::impl { src_div = 0x02; debounce = 0; break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } if (speed_mode == SpeedMode::HighSpeed) { diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.hpp index c7f75ccea..3595867d5 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_bus_accessor.hpp @@ -21,7 +21,7 @@ #include "i2c_driver_types.hpp" #include "i2c_registers.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { class BusAccessor { private: diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_device_config.cpp b/stratosphere/boot/source/i2c/driver/impl/i2c_device_config.cpp index a80f6c017..584a00c0a 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_device_config.cpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_device_config.cpp @@ -19,7 +19,7 @@ #include "i2c_driver_types.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { namespace { @@ -88,37 +88,37 @@ namespace sts::i2c::driver::impl { Bus GetDeviceBus(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].bus; } u32 GetDeviceSlaveAddress(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].slave_address; } AddressingMode GetDeviceAddressingMode(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].addressing_mode; } SpeedMode GetDeviceSpeedMode(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].speed_mode; } u32 GetDeviceMaxRetries(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].max_retries; } u64 GetDeviceRetryWaitTime(I2cDevice dev) { const size_t dev_idx = GetDeviceIndex(dev); - STS_ASSERT(dev_idx != DeviceInvalidIndex); + AMS_ASSERT(dev_idx != DeviceInvalidIndex); return g_device_configs[dev_idx].retry_wait_time; } diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_driver_types.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_driver_types.hpp index 0848246b4..c80695fba 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_driver_types.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_driver_types.hpp @@ -20,7 +20,7 @@ #include "../../i2c_types.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { enum class Command { Send = 0, @@ -43,7 +43,7 @@ namespace sts::i2c::driver::impl { } constexpr inline Bus ConvertFromIndex(size_t idx) { - STS_ASSERT(idx < static_cast(Bus::Count)); + AMS_ASSERT(idx < static_cast(Bus::Count)); return static_cast(idx); } @@ -61,7 +61,7 @@ namespace sts::i2c::driver::impl { return PcvModule_I2C5; case Bus::I2C6: return PcvModule_I2C6; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -79,7 +79,7 @@ namespace sts::i2c::driver::impl { return Bus::I2C5; case PcvModule_I2C6: return Bus::I2C6; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_pcv.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_pcv.hpp index 3658784e2..fc0db11c1 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_pcv.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_pcv.hpp @@ -20,7 +20,7 @@ /* This forward declares the functionality from pcv that i2c::driver uses. */ /* This allows for overriding at compile-time (e.g., for boot sysmodule). */ -namespace sts::pcv { +namespace ams::pcv { void Initialize(); void Finalize(); diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_registers.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_registers.hpp index 7cbd25e25..255e48ba7 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_registers.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_registers.hpp @@ -21,7 +21,7 @@ #include "i2c_driver_types.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { struct Registers { volatile u32 I2C_I2C_CNFG_0; diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.cpp b/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.cpp index b35d5e875..03648925b 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.cpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.cpp @@ -20,7 +20,7 @@ #include "i2c_pcv.hpp" #include "i2c_resource_manager.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { void ResourceManager::Initialize() { std::scoped_lock lk(this->initialize_mutex); @@ -29,7 +29,7 @@ namespace sts::i2c::driver::impl { void ResourceManager::Finalize() { std::scoped_lock lk(this->initialize_mutex); - STS_ASSERT(this->ref_cnt > 0); + AMS_ASSERT(this->ref_cnt > 0); this->ref_cnt--; if (this->ref_cnt > 0) { return; @@ -59,11 +59,11 @@ namespace sts::i2c::driver::impl { /* Get, open session. */ { std::scoped_lock lk(this->session_open_mutex); - STS_ASSERT(out_session != nullptr); - STS_ASSERT(bus < Bus::Count); + AMS_ASSERT(out_session != nullptr); + AMS_ASSERT(bus < Bus::Count); session_id = GetFreeSessionId(); - STS_ASSERT(session_id != InvalidSessionId); + AMS_ASSERT(session_id != InvalidSessionId); if ((bus == Bus::I2C2 || bus == Bus::I2C3) && (this->bus_accessors[ConvertToIndex(Bus::I2C2)].GetOpenSessions() == 0 && this->bus_accessors[ConvertToIndex(Bus::I2C3)].GetOpenSessions() == 0)) { @@ -90,7 +90,7 @@ namespace sts::i2c::driver::impl { /* Get, open session. */ { std::scoped_lock lk(this->session_open_mutex); - STS_ASSERT(this->sessions[session.session_id].IsOpen()); + AMS_ASSERT(this->sessions[session.session_id].IsOpen()); this->sessions[session.session_id].Close(); @@ -109,7 +109,7 @@ namespace sts::i2c::driver::impl { } void ResourceManager::SuspendBuses() { - STS_ASSERT(this->ref_cnt > 0); + AMS_ASSERT(this->ref_cnt > 0); if (!this->suspended) { { @@ -128,7 +128,7 @@ namespace sts::i2c::driver::impl { } void ResourceManager::ResumeBuses() { - STS_ASSERT(this->ref_cnt > 0); + AMS_ASSERT(this->ref_cnt > 0); if (this->suspended) { if (this->bus_accessors[ConvertToIndex(Bus::I2C2)].GetOpenSessions() > 0 || this->bus_accessors[ConvertToIndex(Bus::I2C3)].GetOpenSessions() > 0) { @@ -151,7 +151,7 @@ namespace sts::i2c::driver::impl { } void ResourceManager::SuspendPowerBus() { - STS_ASSERT(this->ref_cnt > 0); + AMS_ASSERT(this->ref_cnt > 0); std::scoped_lock lk(this->session_open_mutex); if (!this->power_bus_suspended) { @@ -163,7 +163,7 @@ namespace sts::i2c::driver::impl { } void ResourceManager::ResumePowerBus() { - STS_ASSERT(this->ref_cnt > 0); + AMS_ASSERT(this->ref_cnt > 0); std::scoped_lock lk(this->session_open_mutex); if (this->power_bus_suspended) { diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.hpp index 8f16e21de..ba8110098 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_resource_manager.hpp @@ -23,7 +23,7 @@ #include "i2c_bus_accessor.hpp" #include "i2c_session.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { class ResourceManager { public: diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_session.cpp b/stratosphere/boot/source/i2c/driver/impl/i2c_session.cpp index f9641e757..f0e194131 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_session.cpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_session.cpp @@ -19,7 +19,7 @@ #include "i2c_session.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { void Session::Open(Bus bus, u32 slave_address, AddressingMode addr_mode, SpeedMode speed_mode, BusAccessor *bus_accessor, u32 max_retries, u64 retry_wait_time) { std::scoped_lock lk(this->bus_accessor_mutex); @@ -74,7 +74,7 @@ namespace sts::i2c::driver::impl { case Command::Receive: R_TRY(this->bus_accessor->Receive(reinterpret_cast(dst), num_bytes, option, this->addressing_mode, this->slave_address)); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } return ResultSuccess(); diff --git a/stratosphere/boot/source/i2c/driver/impl/i2c_session.hpp b/stratosphere/boot/source/i2c/driver/impl/i2c_session.hpp index 6ae8bbee8..49e58ad8e 100644 --- a/stratosphere/boot/source/i2c/driver/impl/i2c_session.hpp +++ b/stratosphere/boot/source/i2c/driver/impl/i2c_session.hpp @@ -21,7 +21,7 @@ #include "i2c_driver_types.hpp" #include "i2c_bus_accessor.hpp" -namespace sts::i2c::driver::impl { +namespace ams::i2c::driver::impl { class Session { private: diff --git a/stratosphere/boot/source/i2c/i2c_command_list.cpp b/stratosphere/boot/source/i2c/i2c_command_list.cpp index 27bdd4422..16a874c8a 100644 --- a/stratosphere/boot/source/i2c/i2c_command_list.cpp +++ b/stratosphere/boot/source/i2c/i2c_command_list.cpp @@ -20,7 +20,7 @@ #include "i2c_types.hpp" #include "i2c_command_list.hpp" -namespace sts::i2c { +namespace ams::i2c { namespace { diff --git a/stratosphere/boot/source/i2c/i2c_command_list.hpp b/stratosphere/boot/source/i2c/i2c_command_list.hpp index 6689f4885..de1c475cf 100644 --- a/stratosphere/boot/source/i2c/i2c_command_list.hpp +++ b/stratosphere/boot/source/i2c/i2c_command_list.hpp @@ -20,7 +20,7 @@ #include "i2c_types.hpp" -namespace sts::i2c { +namespace ams::i2c { enum class Command { Send = 0, @@ -43,7 +43,7 @@ namespace sts::i2c { size_t cur_index = 0; public: CommandListFormatter(void *cmd_list, size_t cmd_list_size) : cmd_list(static_cast(cmd_list)), cmd_list_size(cmd_list_size) { - STS_ASSERT(cmd_list_size <= MaxCommandListSize); + AMS_ASSERT(cmd_list_size <= MaxCommandListSize); } ~CommandListFormatter() { this->cmd_list = nullptr; diff --git a/stratosphere/boot/source/i2c/i2c_types.hpp b/stratosphere/boot/source/i2c/i2c_types.hpp index e529d7f6d..a64f8b470 100644 --- a/stratosphere/boot/source/i2c/i2c_types.hpp +++ b/stratosphere/boot/source/i2c/i2c_types.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::i2c { +namespace ams::i2c { enum class AddressingMode { SevenBit = 0, diff --git a/stratosphere/boot/source/pinmux/pinmux_initial_configuration.cpp b/stratosphere/boot/source/pinmux/pinmux_initial_configuration.cpp index f54f1c630..13a1550e4 100644 --- a/stratosphere/boot/source/pinmux/pinmux_initial_configuration.cpp +++ b/stratosphere/boot/source/pinmux/pinmux_initial_configuration.cpp @@ -19,7 +19,7 @@ #include "pinmux_initial_configuration.hpp" #include "pinmux_utils.hpp" -namespace sts::pinmux { +namespace ams::pinmux { namespace { @@ -61,11 +61,11 @@ namespace sts::pinmux { num_configs = NumInitialConfigsIowa; break; /* Unknown hardware type, we can't proceed. */ - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } /* Ensure we found an appropriate config. */ - STS_ASSERT(configs != nullptr); + AMS_ASSERT(configs != nullptr); for (size_t i = 0; i < num_configs; i++) { UpdatePad(configs[i].name, configs[i].val, configs[i].mask); diff --git a/stratosphere/boot/source/pinmux/pinmux_initial_configuration.hpp b/stratosphere/boot/source/pinmux/pinmux_initial_configuration.hpp index 8fee79525..814d02f91 100644 --- a/stratosphere/boot/source/pinmux/pinmux_initial_configuration.hpp +++ b/stratosphere/boot/source/pinmux/pinmux_initial_configuration.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::pinmux { +namespace ams::pinmux { void SetInitialConfiguration(); diff --git a/stratosphere/boot/source/pinmux/pinmux_utils.cpp b/stratosphere/boot/source/pinmux/pinmux_utils.cpp index 9000b520e..d140bf5e3 100644 --- a/stratosphere/boot/source/pinmux/pinmux_utils.cpp +++ b/stratosphere/boot/source/pinmux/pinmux_utils.cpp @@ -18,7 +18,7 @@ #include "pinmux_utils.hpp" -namespace sts::pinmux { +namespace ams::pinmux { namespace { @@ -33,12 +33,12 @@ namespace sts::pinmux { /* Helpers. */ inline const Definition *GetDefinition(u32 pinmux_name) { - STS_ASSERT(pinmux_name < PadNameMax); + AMS_ASSERT(pinmux_name < PadNameMax); return &Map[pinmux_name]; } inline const DrivePadDefinition *GetDrivePadDefinition(u32 drivepad_name) { - STS_ASSERT(drivepad_name < DrivePadNameMax); + AMS_ASSERT(drivepad_name < DrivePadNameMax); return &DrivePadMap[drivepad_name]; } @@ -104,7 +104,7 @@ namespace sts::pinmux { u32 pinmux_val = reg::Read(pinmux_reg); /* This PINMUX register is locked */ - STS_ASSERT((pinmux_val & 0x80) == 0); + AMS_ASSERT((pinmux_val & 0x80) == 0); u32 pm_val = (pinmux_config_val & 0x07); diff --git a/stratosphere/boot/source/pinmux/pinmux_utils.hpp b/stratosphere/boot/source/pinmux/pinmux_utils.hpp index 5e9a38be4..9f0eac9b0 100644 --- a/stratosphere/boot/source/pinmux/pinmux_utils.hpp +++ b/stratosphere/boot/source/pinmux/pinmux_utils.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::pinmux { +namespace ams::pinmux { /* Pinmux Utilities. */ u32 UpdatePark(u32 pinmux_name); diff --git a/stratosphere/boot2/source/boot2_main.cpp b/stratosphere/boot2/source/boot2_main.cpp index 58a2d4fe8..f4b6748f1 100644 --- a/stratosphere/boot2/source/boot2_main.cpp +++ b/stratosphere/boot2/source/boot2_main.cpp @@ -40,19 +40,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Boot2; + ncm::TitleId CurrentTitleId = ncm::TitleId::Boot2; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/creport/source/creport_crash_report.cpp b/stratosphere/creport/source/creport_crash_report.cpp index f9d4c2508..e65f61ff8 100644 --- a/stratosphere/creport/source/creport_crash_report.cpp +++ b/stratosphere/creport/source/creport_crash_report.cpp @@ -21,7 +21,7 @@ #include "creport_crash_report.hpp" #include "creport_utils.hpp" -namespace sts::creport { +namespace ams::creport { namespace { @@ -116,8 +116,8 @@ namespace sts::creport { } void CrashReport::GetFatalContext(FatalContext *_out) const { - static_assert(sizeof(*_out) == sizeof(sts::fatal::CpuContext)); - sts::fatal::CpuContext *out = reinterpret_cast(_out); + static_assert(sizeof(*_out) == sizeof(ams::fatal::CpuContext)); + ams::fatal::CpuContext *out = reinterpret_cast(_out); std::memset(out, 0, sizeof(*out)); /* TODO: Support generating 32-bit fatal contexts? */ diff --git a/stratosphere/creport/source/creport_crash_report.hpp b/stratosphere/creport/source/creport_crash_report.hpp index c5959c141..42ad93209 100644 --- a/stratosphere/creport/source/creport_crash_report.hpp +++ b/stratosphere/creport/source/creport_crash_report.hpp @@ -22,7 +22,7 @@ #include "creport_threads.hpp" #include "creport_modules.hpp" -namespace sts::creport { +namespace ams::creport { class CrashReport { private: diff --git a/stratosphere/creport/source/creport_main.cpp b/stratosphere/creport/source/creport_main.cpp index a53b4438a..7f902acd7 100644 --- a/stratosphere/creport/source/creport_main.cpp +++ b/stratosphere/creport/source/creport_main.cpp @@ -46,19 +46,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Creport; + ncm::TitleId CurrentTitleId = ncm::TitleId::Creport; + + namespace result { + + bool CallFatalOnResultAssertion = true; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = true; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/creport/source/creport_modules.cpp b/stratosphere/creport/source/creport_modules.cpp index 734cf3802..3e3665fcf 100644 --- a/stratosphere/creport/source/creport_modules.cpp +++ b/stratosphere/creport/source/creport_modules.cpp @@ -17,7 +17,7 @@ #include "creport_modules.hpp" #include "creport_utils.hpp" -namespace sts::creport { +namespace ams::creport { namespace { diff --git a/stratosphere/creport/source/creport_modules.hpp b/stratosphere/creport/source/creport_modules.hpp index ac17c8c39..9a6ff9f4f 100644 --- a/stratosphere/creport/source/creport_modules.hpp +++ b/stratosphere/creport/source/creport_modules.hpp @@ -19,7 +19,7 @@ #include #include "creport_threads.hpp" -namespace sts::creport { +namespace ams::creport { class ModuleList { private: diff --git a/stratosphere/creport/source/creport_threads.cpp b/stratosphere/creport/source/creport_threads.cpp index 413c0aed7..2570de53c 100644 --- a/stratosphere/creport/source/creport_threads.cpp +++ b/stratosphere/creport/source/creport_threads.cpp @@ -17,7 +17,7 @@ #include "creport_threads.hpp" #include "creport_modules.hpp" -namespace sts::creport { +namespace ams::creport { namespace { diff --git a/stratosphere/creport/source/creport_threads.hpp b/stratosphere/creport/source/creport_threads.hpp index bc5575352..91700905a 100644 --- a/stratosphere/creport/source/creport_threads.hpp +++ b/stratosphere/creport/source/creport_threads.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::creport { +namespace ams::creport { /* Forward declare ModuleList class. */ class ModuleList; diff --git a/stratosphere/creport/source/creport_utils.cpp b/stratosphere/creport/source/creport_utils.cpp index 63dfb7122..ed0ea682b 100644 --- a/stratosphere/creport/source/creport_utils.cpp +++ b/stratosphere/creport/source/creport_utils.cpp @@ -16,7 +16,7 @@ #include "creport_utils.hpp" -namespace sts::creport { +namespace ams::creport { namespace { diff --git a/stratosphere/creport/source/creport_utils.hpp b/stratosphere/creport/source/creport_utils.hpp index 0fb654ca6..b67597208 100644 --- a/stratosphere/creport/source/creport_utils.hpp +++ b/stratosphere/creport/source/creport_utils.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::creport { +namespace ams::creport { /* Utility functions. */ void DumpMemoryHexToFile(FILE *f, const char *prefix, const void *data, size_t size); diff --git a/stratosphere/dmnt/source/cheat/dmnt_cheat_service.cpp b/stratosphere/dmnt/source/cheat/dmnt_cheat_service.cpp index 76f3dc56c..2de80e3e0 100644 --- a/stratosphere/dmnt/source/cheat/dmnt_cheat_service.cpp +++ b/stratosphere/dmnt/source/cheat/dmnt_cheat_service.cpp @@ -18,7 +18,7 @@ #include "dmnt_cheat_service.hpp" #include "impl/dmnt_cheat_api.hpp" -namespace sts::dmnt::cheat { +namespace ams::dmnt::cheat { /* ========================================================================================= */ /* ==================================== Meta Commands ==================================== */ diff --git a/stratosphere/dmnt/source/cheat/dmnt_cheat_service.hpp b/stratosphere/dmnt/source/cheat/dmnt_cheat_service.hpp index 6bd4cf79e..18f969d37 100644 --- a/stratosphere/dmnt/source/cheat/dmnt_cheat_service.hpp +++ b/stratosphere/dmnt/source/cheat/dmnt_cheat_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::dmnt::cheat { +namespace ams::dmnt::cheat { class CheatService final : public sf::IServiceObject { private: diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp index 6d8e2a66a..fc188cd8b 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp @@ -20,7 +20,7 @@ #include "dmnt_cheat_debug_events_manager.hpp" #include -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { namespace { diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.hpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.hpp index ed901034a..1fdc447c0 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.hpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { bool GetHasActiveCheatProcess(); Handle GetCheatProcessEventHandle(); diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.cpp index a36c90d21..696794962 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.cpp @@ -18,7 +18,7 @@ /* WORKAROUND: This design prevents a kernel deadlock from occurring on 6.0.0+ */ -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { namespace { diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.hpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.hpp index 047ca3cdd..145dd23fc 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.hpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_debug_events_manager.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { void ContinueCheatProcess(Handle cheat_dbg_hnd); diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp index a6e818758..d718f6596 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp @@ -18,7 +18,7 @@ #include "dmnt_cheat_vm.hpp" #include "dmnt_cheat_api.hpp" -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { void CheatVirtualMachine::DebugLog(u32 log_id, u64 value) { /* Just unconditionally try to create the log folder. */ diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.hpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.hpp index 0a07f7220..2f4d24af5 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.hpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::dmnt::cheat::impl { +namespace ams::dmnt::cheat::impl { enum CheatVmOpcodeType : u32 { CheatVmOpcodeType_StoreStatic = 0, diff --git a/stratosphere/dmnt/source/dmnt_main.cpp b/stratosphere/dmnt/source/dmnt_main.cpp index 63350b25f..74f38bf1f 100644 --- a/stratosphere/dmnt/source/dmnt_main.cpp +++ b/stratosphere/dmnt/source/dmnt_main.cpp @@ -43,19 +43,19 @@ extern "C" { void __appExit(void); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Dmnt; + ncm::TitleId CurrentTitleId = ncm::TitleId::Dmnt; + + namespace result { + + bool CallFatalOnResultAssertion = true; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = true; - -} - -using namespace sts; +using namespace ams; void __libnx_initheap(void) { void* addr = nx_inner_heap; diff --git a/stratosphere/dmnt/source/dmnt_service.hpp b/stratosphere/dmnt/source/dmnt_service.hpp index dec1771bf..b2ccf4c1d 100644 --- a/stratosphere/dmnt/source/dmnt_service.hpp +++ b/stratosphere/dmnt/source/dmnt_service.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::dmnt { +namespace ams::dmnt { /* TODO: Move into libstratosphere, eventually. */ struct TargetIOFileHandle : sf::LargeData, sf::PrefersMapAliasTransferMode { diff --git a/stratosphere/dmnt/source/dmnt_service_debug.cpp b/stratosphere/dmnt/source/dmnt_service_debug.cpp index 09fc53d30..73220a647 100644 --- a/stratosphere/dmnt/source/dmnt_service_debug.cpp +++ b/stratosphere/dmnt/source/dmnt_service_debug.cpp @@ -16,7 +16,7 @@ #include "dmnt_service.hpp" -namespace sts::dmnt { +namespace ams::dmnt { Result DebugMonitorService::BreakDebugProcess(Handle debug_hnd) { /* Nintendo discards the output of this command, but we will return it. */ diff --git a/stratosphere/dmnt/source/dmnt_service_target_io.cpp b/stratosphere/dmnt/source/dmnt_service_target_io.cpp index 6893cbb07..49fc41cf2 100644 --- a/stratosphere/dmnt/source/dmnt_service_target_io.cpp +++ b/stratosphere/dmnt/source/dmnt_service_target_io.cpp @@ -20,15 +20,15 @@ namespace std { template<> - struct hash { - u64 operator()(sts::dmnt::TargetIOFileHandle const &handle) const noexcept { + struct hash { + u64 operator()(ams::dmnt::TargetIOFileHandle const &handle) const noexcept { return handle.GetValue(); } }; } -namespace sts::dmnt { +namespace ams::dmnt { namespace { diff --git a/stratosphere/eclct.stub/source/eclct_stub.cpp b/stratosphere/eclct.stub/source/eclct_stub.cpp index 2a96ffa27..e62b5a30b 100644 --- a/stratosphere/eclct.stub/source/eclct_stub.cpp +++ b/stratosphere/eclct.stub/source/eclct_stub.cpp @@ -42,19 +42,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Eclct; + ncm::TitleId CurrentTitleId = ncm::TitleId::Eclct; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/fatal/source/fatal_config.cpp b/stratosphere/fatal/source/fatal_config.cpp index da8429568..a3247d552 100644 --- a/stratosphere/fatal/source/fatal_config.cpp +++ b/stratosphere/fatal/source/fatal_config.cpp @@ -16,7 +16,7 @@ #include "fatal_config.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_config.hpp b/stratosphere/fatal/source/fatal_config.hpp index aa039f76f..fa26459d1 100644 --- a/stratosphere/fatal/source/fatal_config.hpp +++ b/stratosphere/fatal/source/fatal_config.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { class FatalConfig { private: diff --git a/stratosphere/fatal/source/fatal_debug.cpp b/stratosphere/fatal/source/fatal_debug.cpp index 812ad7523..bc68154d7 100644 --- a/stratosphere/fatal/source/fatal_debug.cpp +++ b/stratosphere/fatal/source/fatal_debug.cpp @@ -17,7 +17,7 @@ #include "fatal_debug.hpp" #include "fatal_config.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_debug.hpp b/stratosphere/fatal/source/fatal_debug.hpp index e08aac274..1642eac0b 100644 --- a/stratosphere/fatal/source/fatal_debug.hpp +++ b/stratosphere/fatal/source/fatal_debug.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { void TryCollectDebugInformation(ThrowContext *ctx, os::ProcessId process_id); diff --git a/stratosphere/fatal/source/fatal_event_manager.cpp b/stratosphere/fatal/source/fatal_event_manager.cpp index d581dda44..90dcc6e30 100644 --- a/stratosphere/fatal/source/fatal_event_manager.cpp +++ b/stratosphere/fatal/source/fatal_event_manager.cpp @@ -16,7 +16,7 @@ #include "fatal_event_manager.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { FatalEventManager::FatalEventManager() { /* Just create all the events. */ diff --git a/stratosphere/fatal/source/fatal_event_manager.hpp b/stratosphere/fatal/source/fatal_event_manager.hpp index b58e417eb..d7d79f8fd 100644 --- a/stratosphere/fatal/source/fatal_event_manager.hpp +++ b/stratosphere/fatal/source/fatal_event_manager.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { class FatalEventManager { private: diff --git a/stratosphere/fatal/source/fatal_font.cpp b/stratosphere/fatal/source/fatal_font.cpp index 67ee8880f..09feecb31 100644 --- a/stratosphere/fatal/source/fatal_font.cpp +++ b/stratosphere/fatal/source/fatal_font.cpp @@ -26,7 +26,7 @@ #define RGB565_GET_G8(c) ((((c >> 5) & 0x3F) << 2) | ((c >> 9) & 3)) #define RGB565_GET_B8(c) ((((c >> 0) & 0x1F) << 3) | ((c >> 2) & 7)) -namespace sts::fatal::srv::font { +namespace ams::fatal::srv::font { namespace { diff --git a/stratosphere/fatal/source/fatal_font.hpp b/stratosphere/fatal/source/fatal_font.hpp index 5ece5e004..18c7f1368 100644 --- a/stratosphere/fatal/source/fatal_font.hpp +++ b/stratosphere/fatal/source/fatal_font.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::fatal::srv::font { +namespace ams::fatal::srv::font { Result InitializeSharedFont(); void ConfigureFontFramebuffer(u16 *fb, u32 (*unswizzle_func)(u32, u32)); diff --git a/stratosphere/fatal/source/fatal_main.cpp b/stratosphere/fatal/source/fatal_main.cpp index 566e9f267..1e6bb512d 100644 --- a/stratosphere/fatal/source/fatal_main.cpp +++ b/stratosphere/fatal/source/fatal_main.cpp @@ -51,19 +51,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Fatal; + ncm::TitleId CurrentTitleId = ncm::TitleId::Fatal; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); @@ -163,8 +163,8 @@ int main(int argc, char **argv) R_ASSERT((g_server_manager.RegisterServer(UserServiceName, UserMaxSessions))); /* Add dirty event holder. */ - /* TODO: s_server_manager.AddWaitable(sts::fatal::srv::GetFatalDirtyEvent()); */ - auto *dirty_event_holder = sts::fatal::srv::GetFatalDirtyWaitableHolder(); + /* TODO: s_server_manager.AddWaitable(ams::fatal::srv::GetFatalDirtyEvent()); */ + auto *dirty_event_holder = ams::fatal::srv::GetFatalDirtyWaitableHolder(); g_server_manager.AddUserWaitableHolder(dirty_event_holder); /* Loop forever, servicing our services. */ diff --git a/stratosphere/fatal/source/fatal_repair.cpp b/stratosphere/fatal/source/fatal_repair.cpp index 496799db4..6fde8267b 100644 --- a/stratosphere/fatal/source/fatal_repair.cpp +++ b/stratosphere/fatal/source/fatal_repair.cpp @@ -17,7 +17,7 @@ #include "fatal_repair.hpp" #include "fatal_service_for_self.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_repair.hpp b/stratosphere/fatal/source/fatal_repair.hpp index aa2d2b3a6..da72164c3 100644 --- a/stratosphere/fatal/source/fatal_repair.hpp +++ b/stratosphere/fatal/source/fatal_repair.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { void CheckRepairStatus(); diff --git a/stratosphere/fatal/source/fatal_service.cpp b/stratosphere/fatal/source/fatal_service.cpp index e17a6d0d4..646a34cab 100644 --- a/stratosphere/fatal/source/fatal_service.cpp +++ b/stratosphere/fatal/source/fatal_service.cpp @@ -21,7 +21,7 @@ #include "fatal_event_manager.hpp" #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { @@ -119,7 +119,7 @@ namespace sts::fatal::srv { } break; /* N aborts here. Should we just return an error code? */ - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } return ResultSuccess(); diff --git a/stratosphere/fatal/source/fatal_service.hpp b/stratosphere/fatal/source/fatal_service.hpp index 2b3bcde41..70eabf2e6 100644 --- a/stratosphere/fatal/source/fatal_service.hpp +++ b/stratosphere/fatal/source/fatal_service.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { class UserService final : public sf::IServiceObject { private: diff --git a/stratosphere/fatal/source/fatal_service_for_self.hpp b/stratosphere/fatal/source/fatal_service_for_self.hpp index e1a84b938..d1c4bef75 100644 --- a/stratosphere/fatal/source/fatal_service_for_self.hpp +++ b/stratosphere/fatal/source/fatal_service_for_self.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::fatal::srv { +namespace ams::fatal::srv { Result ThrowFatalForSelf(Result error_code); diff --git a/stratosphere/fatal/source/fatal_task.cpp b/stratosphere/fatal/source/fatal_task.cpp index d67fdf6e1..b8e77a7ea 100644 --- a/stratosphere/fatal/source/fatal_task.cpp +++ b/stratosphere/fatal/source/fatal_task.cpp @@ -24,7 +24,7 @@ #include "fatal_task_clock.hpp" #include "fatal_task_power.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { @@ -60,7 +60,7 @@ namespace sts::fatal::srv { public: TaskManager() { /* ... */ } void StartTask(ITask *task) { - STS_ASSERT(this->task_count < MaxTasks); + AMS_ASSERT(this->task_count < MaxTasks); this->task_threads[this->task_count++].StartTask(task); } }; diff --git a/stratosphere/fatal/source/fatal_task.hpp b/stratosphere/fatal/source/fatal_task.hpp index b0ad228d9..0ac774aa9 100644 --- a/stratosphere/fatal/source/fatal_task.hpp +++ b/stratosphere/fatal/source/fatal_task.hpp @@ -19,7 +19,7 @@ #include #include "fatal_service.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { class ITask { protected: diff --git a/stratosphere/fatal/source/fatal_task_clock.cpp b/stratosphere/fatal/source/fatal_task_clock.cpp index 5e34dcae4..418b2919b 100644 --- a/stratosphere/fatal/source/fatal_task_clock.cpp +++ b/stratosphere/fatal/source/fatal_task_clock.cpp @@ -16,7 +16,7 @@ #include "fatal_task_clock.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_task_clock.hpp b/stratosphere/fatal/source/fatal_task_clock.hpp index 117312b51..e0445bcf5 100644 --- a/stratosphere/fatal/source/fatal_task_clock.hpp +++ b/stratosphere/fatal/source/fatal_task_clock.hpp @@ -17,7 +17,7 @@ #pragma once #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { ITask *GetAdjustClockTask(const ThrowContext *ctx); diff --git a/stratosphere/fatal/source/fatal_task_error_report.cpp b/stratosphere/fatal/source/fatal_task_error_report.cpp index 1397114a2..7c3a2a1b8 100644 --- a/stratosphere/fatal/source/fatal_task_error_report.cpp +++ b/stratosphere/fatal/source/fatal_task_error_report.cpp @@ -22,7 +22,7 @@ #include "fatal_config.hpp" #include "fatal_task_error_report.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_task_error_report.hpp b/stratosphere/fatal/source/fatal_task_error_report.hpp index 10338c68e..316134fc5 100644 --- a/stratosphere/fatal/source/fatal_task_error_report.hpp +++ b/stratosphere/fatal/source/fatal_task_error_report.hpp @@ -17,7 +17,7 @@ #pragma once #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { ITask *GetErrorReportTask(const ThrowContext *ctx); diff --git a/stratosphere/fatal/source/fatal_task_power.cpp b/stratosphere/fatal/source/fatal_task_power.cpp index 19ad485b4..af6513b15 100644 --- a/stratosphere/fatal/source/fatal_task_power.cpp +++ b/stratosphere/fatal/source/fatal_task_power.cpp @@ -17,7 +17,7 @@ #include "fatal_config.hpp" #include "fatal_task_power.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_task_power.hpp b/stratosphere/fatal/source/fatal_task_power.hpp index 763ef14bf..7d9f62a6e 100644 --- a/stratosphere/fatal/source/fatal_task_power.hpp +++ b/stratosphere/fatal/source/fatal_task_power.hpp @@ -17,7 +17,7 @@ #pragma once #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { ITask *GetPowerControlTask(const ThrowContext *ctx); ITask *GetPowerButtonObserveTask(const ThrowContext *ctx); diff --git a/stratosphere/fatal/source/fatal_task_screen.cpp b/stratosphere/fatal/source/fatal_task_screen.cpp index 81e864092..7aece027e 100644 --- a/stratosphere/fatal/source/fatal_task_screen.cpp +++ b/stratosphere/fatal/source/fatal_task_screen.cpp @@ -21,7 +21,7 @@ #include "fatal_config.hpp" #include "fatal_font.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { /* Include Atmosphere logo into its own anonymous namespace. */ @@ -218,7 +218,7 @@ namespace sts::fatal::srv { font::AddSpacingLines(0.5f); font::PrintFormatLine(u8"Firmware: %s (Atmosphère %u.%u.%u-%s)", config.GetFirmwareVersion().display_version, ATMOSPHERE_RELEASE_VERSION, ams::GetGitRevision()); font::AddSpacingLines(1.5f); - if (!ams::ResultVersionMismatch::Includes(this->context->result)) { + if (!exosphere::ResultVersionMismatch::Includes(this->context->result)) { font::Print(config.GetErrorDescription()); } else { /* Print a special message for atmosphere version mismatch. */ diff --git a/stratosphere/fatal/source/fatal_task_screen.hpp b/stratosphere/fatal/source/fatal_task_screen.hpp index b9384f93a..8c96a42a5 100644 --- a/stratosphere/fatal/source/fatal_task_screen.hpp +++ b/stratosphere/fatal/source/fatal_task_screen.hpp @@ -17,7 +17,7 @@ #pragma once #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { ITask *GetShowFatalTask(const ThrowContext *ctx); ITask *GetBacklightControlTask(const ThrowContext *ctx); diff --git a/stratosphere/fatal/source/fatal_task_sound.cpp b/stratosphere/fatal/source/fatal_task_sound.cpp index 9b0463eac..ab03c740b 100644 --- a/stratosphere/fatal/source/fatal_task_sound.cpp +++ b/stratosphere/fatal/source/fatal_task_sound.cpp @@ -16,7 +16,7 @@ #include "fatal_task_sound.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { namespace { diff --git a/stratosphere/fatal/source/fatal_task_sound.hpp b/stratosphere/fatal/source/fatal_task_sound.hpp index 4e231d715..069bc800b 100644 --- a/stratosphere/fatal/source/fatal_task_sound.hpp +++ b/stratosphere/fatal/source/fatal_task_sound.hpp @@ -17,7 +17,7 @@ #pragma once #include "fatal_task.hpp" -namespace sts::fatal::srv { +namespace ams::fatal::srv { ITask *GetStopSoundTask(const ThrowContext *ctx); diff --git a/stratosphere/libstratosphere/Makefile b/stratosphere/libstratosphere/Makefile index 81873295e..ad13188bb 100644 --- a/stratosphere/libstratosphere/Makefile +++ b/stratosphere/libstratosphere/Makefile @@ -16,7 +16,7 @@ include $(DEVKITPRO)/libnx/switch_rules # INCLUDES is a list of directories containing header files #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) -SOURCES := source source/ams source/result source/os source/os/impl source/dd source/sf source/sf/cmif source/sf/hipc source/dmnt source/spl source/spl/smc source/updater source/patcher source/map source/rnd source/util source/sm source/cfg source/pm source/hid source/ldr source/kvdb source/boot2 +SOURCES := source source/ams source/hos source/result source/os source/os/impl source/dd source/sf source/sf/cmif source/sf/hipc source/dmnt source/spl source/spl/smc source/updater source/patcher source/map source/rnd source/util source/sm source/cfg source/pm source/hid source/ldr source/kvdb source/boot2 DATA := data INCLUDES := include diff --git a/stratosphere/libstratosphere/include/stratosphere/ams.hpp b/stratosphere/libstratosphere/include/stratosphere/ams.hpp index 666633bdb..8abd99240 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ams.hpp @@ -17,7 +17,6 @@ #pragma once #include "ams/ams_types.hpp" -#include "ams/ams_hos_version_api.hpp" #include "ams/ams_exosphere_api.hpp" #include "ams/ams_emummc_api.hpp" #include "ams/ams_environment.hpp" diff --git a/stratosphere/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp b/stratosphere/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp index 5a6661403..e1d3d21ec 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ams/ams_emummc_api.hpp @@ -17,7 +17,7 @@ #pragma once #include "ams_types.hpp" -namespace sts::ams::emummc { +namespace ams::emummc { /* Get whether emummc is active. */ bool IsActive(); diff --git a/stratosphere/libstratosphere/include/stratosphere/ams/ams_environment.hpp b/stratosphere/libstratosphere/include/stratosphere/ams/ams_environment.hpp index 55265ee3d..d6138e1ca 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams/ams_environment.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ams/ams_environment.hpp @@ -17,7 +17,7 @@ #pragma once #include "ams_types.hpp" -namespace sts::ams { +namespace ams { /* Will be called by libstratosphere on crash. */ void CrashHandler(ThreadExceptionDump *ctx); diff --git a/stratosphere/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp b/stratosphere/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp index 1c1dc7eba..9307ae7ba 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp @@ -17,7 +17,7 @@ #pragma once #include "ams_types.hpp" -namespace sts::ams { +namespace ams::exosphere { ApiInfo GetApiInfo(); @@ -30,32 +30,24 @@ namespace sts::ams { void CopyToIram(uintptr_t iram_dst, const void *dram_src, size_t size); void CopyFromIram(void *dram_dst, uintptr_t iram_src, size_t size); +} + +namespace ams { + /* Version checking utility. */ #ifdef ATMOSPHERE_RELEASE_VERSION_MAJOR #define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO inline void CheckApiVersion() { - const u32 runtime_version = GetApiInfo().GetVersion(); - const u32 build_version = GetVersion(ATMOSPHERE_RELEASE_VERSION); + const u32 runtime_version = exosphere::GetApiInfo().GetVersion(); + const u32 build_version = exosphere::GetVersion(ATMOSPHERE_RELEASE_VERSION); if (runtime_version < build_version) { - R_ASSERT(ams::ResultVersionMismatch()); + R_ASSERT(exosphere::ResultVersionMismatch()); } } #endif -#ifdef ATMOSPHERE_GIT_BRANCH - NX_CONSTEXPR const char *GetGitBranch() { - return ATMOSPHERE_GIT_BRANCH; - } -#endif - -#ifdef ATMOSPHERE_GIT_REV - NX_CONSTEXPR const char *GetGitRevision() { - return ATMOSPHERE_GIT_REV; - } -#endif - } diff --git a/stratosphere/libstratosphere/include/stratosphere/ams/ams_types.hpp b/stratosphere/libstratosphere/include/stratosphere/ams/ams_types.hpp index 15e29808b..661d940ac 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams/ams_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ams/ams_types.hpp @@ -15,37 +15,12 @@ */ #pragma once -#include #include "../defines.hpp" #include "../results.hpp" #include "../sf/sf_buffer_tags.hpp" +#include "../hos.hpp" -/* Define firmware version in global namespace, for convenience. */ -namespace sts { - - namespace hos { - - enum Version : u16 { - Version_Min = 0, - Version_100 = Version_Min, - Version_200 = 1, - Version_300 = 2, - Version_400 = 3, - Version_500 = 4, - Version_600 = 5, - Version_700 = 6, - Version_800 = 7, - Version_810 = 8, - Version_900 = 9, - Version_Current = Version_900, - Version_Max = 32, - }; - - } - -} - -namespace sts::ams { +namespace ams::exosphere { enum TargetFirmware : u32 { TargetFirmware_100 = 1, @@ -73,7 +48,7 @@ namespace sts::ams { u32 master_key_revision; constexpr u32 GetVersion() const { - return ::sts::ams::GetVersion(this->major_version, this->minor_version, this->micro_version); + return ::ams::exosphere::GetVersion(this->major_version, this->minor_version, this->micro_version); } constexpr TargetFirmware GetTargetFirmware() const { @@ -85,6 +60,10 @@ namespace sts::ams { } }; +} + +namespace ams { + struct FatalErrorContext : sf::LargeData, sf::PrefersMapAliasTransferMode { static constexpr size_t MaxStackTrace = 0x20; static constexpr size_t MaxStackDumpSize = 0x100; @@ -124,4 +103,16 @@ namespace sts::ams { static_assert(sizeof(FatalErrorContext) == 0x350, "sizeof(FatalErrorContext)"); static_assert(std::is_pod::value, "FatalErrorContext"); +#ifdef ATMOSPHERE_GIT_BRANCH + NX_CONSTEXPR const char *GetGitBranch() { + return ATMOSPHERE_GIT_BRANCH; + } +#endif + +#ifdef ATMOSPHERE_GIT_REV + NX_CONSTEXPR const char *GetGitRevision() { + return ATMOSPHERE_GIT_REV; + } +#endif + } diff --git a/stratosphere/libstratosphere/include/stratosphere/boot2/boot2_api.hpp b/stratosphere/libstratosphere/include/stratosphere/boot2/boot2_api.hpp index 4dc788e0b..468d8cdf3 100644 --- a/stratosphere/libstratosphere/include/stratosphere/boot2/boot2_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/boot2/boot2_api.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::boot2 { +namespace ams::boot2 { /* Boot2 API. */ diff --git a/stratosphere/libstratosphere/include/stratosphere/cfg/cfg_api.hpp b/stratosphere/libstratosphere/include/stratosphere/cfg/cfg_api.hpp index e00e0f797..292f18b04 100644 --- a/stratosphere/libstratosphere/include/stratosphere/cfg/cfg_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/cfg/cfg_api.hpp @@ -19,7 +19,7 @@ #include "../os/os_common_types.hpp" #include "../ncm/ncm_types.hpp" -namespace sts::cfg { +namespace ams::cfg { /* Privileged Process configuration. */ bool IsInitialProcess(); diff --git a/stratosphere/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp b/stratosphere/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp index a0ba2fd9a..c0d913f0a 100644 --- a/stratosphere/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/dd/dd_io_mappings.hpp @@ -18,7 +18,7 @@ #include #include "../defines.hpp" -namespace sts::dd { +namespace ams::dd { uintptr_t QueryIoMapping(uintptr_t phys_addr, size_t size); @@ -30,7 +30,7 @@ namespace sts::dd { inline uintptr_t GetIoMapping(uintptr_t phys_addr, size_t size) { const uintptr_t io_mapping = QueryIoMapping(phys_addr, size); - STS_ASSERT(io_mapping); + AMS_ASSERT(io_mapping); return io_mapping; } } diff --git a/stratosphere/libstratosphere/include/stratosphere/defines.hpp b/stratosphere/libstratosphere/include/stratosphere/defines.hpp index 79c7d7ec9..d2dbd52d8 100644 --- a/stratosphere/libstratosphere/include/stratosphere/defines.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/defines.hpp @@ -20,9 +20,9 @@ /* Any broadly useful language defines should go here. */ -#define STS_ASSERT(expr) do { if (!(expr)) { std::abort(); } } while (0) +#define AMS_ASSERT(expr) do { if (!(expr)) { std::abort(); } } while (0) -#define STS_UNREACHABLE_DEFAULT_CASE() default: std::abort() +#define AMS_UNREACHABLE_DEFAULT_CASE() default: std::abort() #define NON_COPYABLE(cls) \ cls(const cls&) = delete; \ diff --git a/stratosphere/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp b/stratosphere/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp index 40413c307..3c5ed2dab 100644 --- a/stratosphere/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp @@ -20,7 +20,7 @@ #include "../ncm/ncm_types.hpp" #include "../sf/sf_buffer_tags.hpp" -namespace sts::dmnt::cheat { +namespace ams::dmnt::cheat { struct CheatProcessMetadata { struct MemoryRegionExtents { diff --git a/stratosphere/libstratosphere/include/stratosphere/fatal/fatal_types.hpp b/stratosphere/libstratosphere/include/stratosphere/fatal/fatal_types.hpp index c464a7b48..69996d374 100644 --- a/stratosphere/libstratosphere/include/stratosphere/fatal/fatal_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/fatal/fatal_types.hpp @@ -21,7 +21,7 @@ #include "../ncm/ncm_types.hpp" #include "../sf/sf_buffer_tags.hpp" -namespace sts::fatal { +namespace ams::fatal { namespace aarch64 { diff --git a/stratosphere/libstratosphere/include/stratosphere/hid/hid_api.hpp b/stratosphere/libstratosphere/include/stratosphere/hid/hid_api.hpp index b1b97c63d..b9cb82516 100644 --- a/stratosphere/libstratosphere/include/stratosphere/hid/hid_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/hid/hid_api.hpp @@ -16,7 +16,7 @@ #pragma once -namespace sts::hid { +namespace ams::hid { /* Key API. */ Result GetKeysHeld(u64 *out); diff --git a/stratosphere/libstratosphere/include/stratosphere/hos.hpp b/stratosphere/libstratosphere/include/stratosphere/hos.hpp new file mode 100644 index 000000000..530989193 --- /dev/null +++ b/stratosphere/libstratosphere/include/stratosphere/hos.hpp @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018-2019 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "hos/hos_types.hpp" +#include "hos/hos_version_api.hpp" diff --git a/stratosphere/libstratosphere/include/stratosphere/hos/hos_types.hpp b/stratosphere/libstratosphere/include/stratosphere/hos/hos_types.hpp new file mode 100644 index 000000000..79b58a09a --- /dev/null +++ b/stratosphere/libstratosphere/include/stratosphere/hos/hos_types.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2019 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once +#include +#include "../defines.hpp" +#include "../results.hpp" + +namespace ams::hos { + + enum Version : u16 { + Version_Min = 0, + Version_100 = Version_Min, + Version_200 = 1, + Version_300 = 2, + Version_400 = 3, + Version_500 = 4, + Version_600 = 5, + Version_700 = 6, + Version_800 = 7, + Version_810 = 8, + Version_900 = 9, + Version_Current = Version_900, + Version_Max = 32, + }; + +} diff --git a/stratosphere/libstratosphere/include/stratosphere/ams/ams_hos_version_api.hpp b/stratosphere/libstratosphere/include/stratosphere/hos/hos_version_api.hpp similarity index 89% rename from stratosphere/libstratosphere/include/stratosphere/ams/ams_hos_version_api.hpp rename to stratosphere/libstratosphere/include/stratosphere/hos/hos_version_api.hpp index 6197e489a..3ccd99ac2 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ams/ams_hos_version_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/hos/hos_version_api.hpp @@ -15,11 +15,11 @@ */ #pragma once -#include "ams_types.hpp" +#include "hos_types.hpp" -namespace sts::hos { +namespace ams::hos { - sts::hos::Version GetVersion(); + ::ams::hos::Version GetVersion(); void SetVersionForLibnx(); } diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_archive.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_archive.hpp index 64fe074dc..5b7ab3e8b 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_archive.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_archive.hpp @@ -21,7 +21,7 @@ #include "kvdb_auto_buffer.hpp" -namespace sts::kvdb { +namespace ams::kvdb { /* Functionality for parsing/generating a key value archive. */ class ArchiveReader { diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp index dd5df0986..3b315e54d 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_auto_buffer.hpp @@ -19,7 +19,7 @@ #include "../defines.hpp" #include "../results.hpp" -namespace sts::kvdb { +namespace ams::kvdb { class AutoBuffer { NON_COPYABLE(AutoBuffer); @@ -68,7 +68,7 @@ namespace sts::kvdb { Result Initialize(size_t size) { /* Check that we're not already initialized. */ - STS_ASSERT(this->buffer == nullptr); + AMS_ASSERT(this->buffer == nullptr); /* Allocate a buffer. */ this->buffer = static_cast(std::malloc(size)); diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp index 8ab11dc89..f9aac8d5c 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_bounded_string.hpp @@ -21,7 +21,7 @@ #include "../defines.hpp" #include "../results.hpp" -namespace sts::kvdb { +namespace ams::kvdb { /* Represents a string with a backing buffer of N bytes. */ template @@ -32,7 +32,7 @@ namespace sts::kvdb { private: /* Utility. */ static inline void CheckLength(size_t len) { - STS_ASSERT(len < N); + AMS_ASSERT(len < N); } public: /* Constructors. */ @@ -113,8 +113,8 @@ namespace sts::kvdb { /* Substring utilities. */ void GetSubstring(char *dst, size_t dst_size, size_t offset, size_t length) const { /* Make sure output buffer can hold the substring. */ - STS_ASSERT(offset + length <= GetLength()); - STS_ASSERT(dst_size > length); + AMS_ASSERT(offset + length <= GetLength()); + AMS_ASSERT(dst_size > length); /* Copy substring to dst. */ std::strncpy(dst, this->buffer + offset, length); dst[length] = 0; diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_cache.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_cache.hpp index dc5a3f56e..4c7b5b356 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_cache.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_cache.hpp @@ -19,7 +19,7 @@ #include "kvdb_bounded_string.hpp" #include "kvdb_file_key_value_store.hpp" -namespace sts::kvdb { +namespace ams::kvdb { namespace impl { @@ -60,7 +60,7 @@ namespace sts::kvdb { } private: void RemoveIndex(size_t i) { - STS_ASSERT(i < this->GetCount()); + AMS_ASSERT(i < this->GetCount()); std::memmove(this->keys + i, this->keys + i + 1, sizeof(*this->keys) * (this->GetCount() - (i + 1))); this->DecrementCount(); } @@ -77,7 +77,7 @@ namespace sts::kvdb { Result Initialize(const char *path, void *buf, size_t size) { /* Only initialize once, and ensure we have sufficient memory. */ - STS_ASSERT(this->keys == nullptr); + AMS_ASSERT(this->keys == nullptr); SSS_ASSERT(size >= BufferSize); /* Setup member variables. */ @@ -145,23 +145,23 @@ namespace sts::kvdb { } Key Get(size_t i) const { - STS_ASSERT(i < this->GetCount()); + AMS_ASSERT(i < this->GetCount()); return this->keys[i]; } Key Peek() const { - STS_ASSERT(!this->IsEmpty()); + AMS_ASSERT(!this->IsEmpty()); return this->Get(0); } void Push(const Key &key) { - STS_ASSERT(!this->IsFull()); + AMS_ASSERT(!this->IsFull()); this->keys[this->GetCount()] = key; this->IncrementCount(); } Key Pop() { - STS_ASSERT(!this->IsEmpty()); + AMS_ASSERT(!this->IsEmpty()); this->RemoveIndex(0); } diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_store.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_store.hpp index a58f89d4c..83ce93be9 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_store.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_file_key_value_store.hpp @@ -21,7 +21,7 @@ #include "kvdb_bounded_string.hpp" -namespace sts::kvdb { +namespace ams::kvdb { class FileKeyValueStore { NON_COPYABLE(FileKeyValueStore); @@ -96,7 +96,7 @@ namespace sts::kvdb { static_assert(std::is_pod::value && !std::is_pointer::value, "Invalid FileKeyValueStore Value!"); size_t size = 0; R_TRY(this->Get(&size, out_value, sizeof(Value), key)); - STS_ASSERT(size >= sizeof(Value)); + AMS_ASSERT(size >= sizeof(Value)); return ResultSuccess(); } diff --git a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_memory_key_value_store.hpp b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_memory_key_value_store.hpp index dfdb5c676..e18a9a8cf 100644 --- a/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_memory_key_value_store.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/kvdb/kvdb_memory_key_value_store.hpp @@ -25,7 +25,7 @@ #include "kvdb_archive.hpp" #include "kvdb_bounded_string.hpp" -namespace sts::kvdb { +namespace ams::kvdb { template class MemoryKeyValueStore { @@ -50,7 +50,7 @@ namespace sts::kvdb { Value *GetValuePointer() { /* Size check. Note: Nintendo does not size check. */ if constexpr (!std::is_same::value) { - STS_ASSERT(sizeof(Value) <= this->value_size); + AMS_ASSERT(sizeof(Value) <= this->value_size); /* Ensure we only get pod. */ static_assert(std::is_pod::value, "KeyValueStore Values must be pod"); } @@ -61,7 +61,7 @@ namespace sts::kvdb { const Value *GetValuePointer() const { /* Size check. Note: Nintendo does not size check. */ if constexpr (!std::is_same::value) { - STS_ASSERT(sizeof(Value) <= this->value_size); + AMS_ASSERT(sizeof(Value) <= this->value_size); /* Ensure we only get pod. */ static_assert(std::is_pod::value, "KeyValueStore Values must be pod"); } diff --git a/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_pm_api.hpp b/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_pm_api.hpp index 823c34b1b..87a194282 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_pm_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_pm_api.hpp @@ -18,7 +18,7 @@ #include "ldr_types.hpp" -namespace sts::ldr::pm { +namespace ams::ldr::pm { /* Process Manager API. */ Result CreateProcess(Handle *out, PinId pin_id, u32 flags, Handle reslimit); diff --git a/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_types.hpp b/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_types.hpp index ab92463e9..b0b25a5d4 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ldr/ldr_types.hpp @@ -22,7 +22,7 @@ #include "../ncm/ncm_types.hpp" #include "../sf/sf_buffer_tags.hpp" -namespace sts::ldr { +namespace ams::ldr { /* General types. */ struct ProgramInfo : sf::LargeData { diff --git a/stratosphere/libstratosphere/include/stratosphere/map/map_api.hpp b/stratosphere/libstratosphere/include/stratosphere/map/map_api.hpp index 75065447b..26aca5c21 100644 --- a/stratosphere/libstratosphere/include/stratosphere/map/map_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/map/map_api.hpp @@ -19,7 +19,7 @@ #include "map_types.hpp" -namespace sts::map { +namespace ams::map { /* Public API. */ Result GetProcessAddressSpaceInfo(AddressSpaceInfo *out, Handle process_h); diff --git a/stratosphere/libstratosphere/include/stratosphere/map/map_types.hpp b/stratosphere/libstratosphere/include/stratosphere/map/map_types.hpp index 28a0b8d17..ad33a9c43 100644 --- a/stratosphere/libstratosphere/include/stratosphere/map/map_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/map/map_types.hpp @@ -18,7 +18,7 @@ #include #include "../results.hpp" -namespace sts::map { +namespace ams::map { /* Types. */ struct AddressSpaceInfo { diff --git a/stratosphere/libstratosphere/include/stratosphere/ncm/ncm_types.hpp b/stratosphere/libstratosphere/include/stratosphere/ncm/ncm_types.hpp index 722fc4acc..61aff6765 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ncm/ncm_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ncm/ncm_types.hpp @@ -18,7 +18,7 @@ #include -namespace sts::ncm { +namespace ams::ncm { /* Storage IDs. */ enum class StorageId : u8 { diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_common_types.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_common_types.hpp index 9ed484058..0e581d933 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_common_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_common_types.hpp @@ -18,7 +18,7 @@ #include "../results.hpp" #include "../util.hpp" -namespace sts::os { +namespace ams::os { enum class TriBool { False = 0, diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_condvar.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_condvar.hpp index eed8e16c4..4e00ade0f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_condvar.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_condvar.hpp @@ -17,7 +17,7 @@ #pragma once #include "os_mutex.hpp" -namespace sts::os { +namespace ams::os { class ConditionVariable { NON_COPYABLE(ConditionVariable); diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_event.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_event.hpp index 461e0a239..b19ce3a69 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_event.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_event.hpp @@ -19,7 +19,7 @@ #include "os_condvar.hpp" #include "os_timeout_helper.hpp" -namespace sts::os { +namespace ams::os { namespace impl { diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_interrupt_event.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_interrupt_event.hpp index d1fd15925..d11ab5296 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_interrupt_event.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_interrupt_event.hpp @@ -18,7 +18,7 @@ #include "os_common_types.hpp" #include "os_managed_handle.hpp" -namespace sts::os { +namespace ams::os { namespace impl { diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_managed_handle.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_managed_handle.hpp index 0d2d91ffe..3f127d119 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_managed_handle.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_managed_handle.hpp @@ -19,7 +19,7 @@ #include "../defines.hpp" #include "../results.hpp" -namespace sts::os { +namespace ams::os { class ManagedHandle { NON_COPYABLE(ManagedHandle); diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_message_queue.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_message_queue.hpp index a320e29cc..f7e925b03 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_message_queue.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_message_queue.hpp @@ -20,7 +20,7 @@ #include "os_mutex.hpp" #include "os_condvar.hpp" -namespace sts::os { +namespace ams::os { namespace impl { diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_mutex.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_mutex.hpp index c17038d84..d11dc7e0f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_mutex.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_mutex.hpp @@ -19,14 +19,14 @@ #include #include "../util.hpp" -namespace sts::os { +namespace ams::os { class ConditionVariable; class Mutex { NON_COPYABLE(Mutex); NON_MOVEABLE(Mutex); - friend class sts::os::ConditionVariable; + friend class ams::os::ConditionVariable; private: ::Mutex m; private: diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_semaphore.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_semaphore.hpp index 3b8ac7063..ae8c49ca7 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_semaphore.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_semaphore.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::os { +namespace ams::os { class Semaphore { NON_COPYABLE(Semaphore); diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_system_event.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_system_event.hpp index 506544553..564ee407f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_system_event.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_system_event.hpp @@ -18,7 +18,7 @@ #include "os_common_types.hpp" #include "os_event.hpp" -namespace sts::os { +namespace ams::os { class WaitableHolder; diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_thread.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_thread.hpp index a647e571a..0c5da0bea 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_thread.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_thread.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::os { +namespace ams::os { class Thread { NON_COPYABLE(Thread); diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_timeout_helper.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_timeout_helper.hpp index 31c52b385..f91398a29 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_timeout_helper.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_timeout_helper.hpp @@ -16,7 +16,7 @@ #pragma once #include -namespace sts::os { +namespace ams::os { class TimeoutHelper { private: diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_holder.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_holder.hpp index 6118a3a2c..dccbb6dba 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_holder.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_holder.hpp @@ -17,7 +17,7 @@ #include "../util.hpp" #include "os_common_types.hpp" -namespace sts::os { +namespace ams::os { class WaitableManager; diff --git a/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_manager.hpp b/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_manager.hpp index c4eaf721a..b2b2fba8e 100644 --- a/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_manager.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/os/os_waitable_manager.hpp @@ -18,7 +18,7 @@ #include "os_common_types.hpp" #include "os_mutex.hpp" -namespace sts::os { +namespace ams::os { class WaitableHolder; diff --git a/stratosphere/libstratosphere/include/stratosphere/patcher/patcher_api.hpp b/stratosphere/libstratosphere/include/stratosphere/patcher/patcher_api.hpp index 5be0f5891..16735500f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/patcher/patcher_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/patcher/patcher_api.hpp @@ -18,7 +18,7 @@ #include "../ro/ro_types.hpp" -namespace sts::patcher { +namespace ams::patcher { /* Helper for applying to code binaries. */ void LocateAndApplyIpsPatchesToModule(const char *patch_dir, size_t protected_size, size_t offset, const ro::ModuleId *module_id, u8 *mapped_module, size_t mapped_size); diff --git a/stratosphere/libstratosphere/include/stratosphere/pm/pm_boot_mode_api.hpp b/stratosphere/libstratosphere/include/stratosphere/pm/pm_boot_mode_api.hpp index dee49a0a7..326dc12ee 100644 --- a/stratosphere/libstratosphere/include/stratosphere/pm/pm_boot_mode_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/pm/pm_boot_mode_api.hpp @@ -18,7 +18,7 @@ #include "pm_types.hpp" -namespace sts::pm::bm { +namespace ams::pm::bm { /* Boot Mode API. */ BootMode GetBootMode(); diff --git a/stratosphere/libstratosphere/include/stratosphere/pm/pm_dmnt_api.hpp b/stratosphere/libstratosphere/include/stratosphere/pm/pm_dmnt_api.hpp index a9dc38941..01e7063a2 100644 --- a/stratosphere/libstratosphere/include/stratosphere/pm/pm_dmnt_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/pm/pm_dmnt_api.hpp @@ -19,7 +19,7 @@ #include "../ldr.hpp" #include "pm_types.hpp" -namespace sts::pm::dmnt { +namespace ams::pm::dmnt { /* Debug Monitor API. */ Result StartProcess(os::ProcessId process_id); diff --git a/stratosphere/libstratosphere/include/stratosphere/pm/pm_info_api.hpp b/stratosphere/libstratosphere/include/stratosphere/pm/pm_info_api.hpp index ab330ba22..1fb5248a5 100644 --- a/stratosphere/libstratosphere/include/stratosphere/pm/pm_info_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/pm/pm_info_api.hpp @@ -19,7 +19,7 @@ #include "pm_types.hpp" #include "../ncm/ncm_types.hpp" -namespace sts::pm::info { +namespace ams::pm::info { /* Information API. */ Result GetTitleId(ncm::TitleId *out_title_id, os::ProcessId process_id); diff --git a/stratosphere/libstratosphere/include/stratosphere/pm/pm_shell_api.hpp b/stratosphere/libstratosphere/include/stratosphere/pm/pm_shell_api.hpp index 4277e3f85..d513dff78 100644 --- a/stratosphere/libstratosphere/include/stratosphere/pm/pm_shell_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/pm/pm_shell_api.hpp @@ -19,7 +19,7 @@ #include "../ldr.hpp" #include "pm_types.hpp" -namespace sts::pm::shell { +namespace ams::pm::shell { /* Shell API. */ Result LaunchTitle(os::ProcessId *out_process_id, const ncm::TitleLocation &loc, u32 launch_flags); diff --git a/stratosphere/libstratosphere/include/stratosphere/pm/pm_types.hpp b/stratosphere/libstratosphere/include/stratosphere/pm/pm_types.hpp index d7ad6ce62..36671b836 100644 --- a/stratosphere/libstratosphere/include/stratosphere/pm/pm_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/pm/pm_types.hpp @@ -18,7 +18,7 @@ #include #include "../os/os_common_types.hpp" -namespace sts::pm { +namespace ams::pm { enum class BootMode { Normal = 0, diff --git a/stratosphere/libstratosphere/include/stratosphere/reg.hpp b/stratosphere/libstratosphere/include/stratosphere/reg.hpp index 5ff90518c..b3748199d 100644 --- a/stratosphere/libstratosphere/include/stratosphere/reg.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/reg.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::reg { +namespace ams::reg { inline void Write(volatile u32 *reg, u32 val) { *reg = val; diff --git a/stratosphere/libstratosphere/include/stratosphere/results.hpp b/stratosphere/libstratosphere/include/stratosphere/results.hpp index b3f113549..595235bc6 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results.hpp @@ -45,4 +45,4 @@ #include "results/vi_results.hpp" /* Unofficial. */ -#include "results/ams_results.hpp" +#include "results/exosphere_results.hpp" diff --git a/stratosphere/libstratosphere/include/stratosphere/results/cal_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/cal_results.hpp index cdb7c81cf..69f3a8b1f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/cal_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/cal_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::cal { +namespace ams::cal { R_DEFINE_NAMESPACE_RESULT_MODULE(198); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/creport_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/creport_results.hpp index eb3d0bc3b..6f836d8bf 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/creport_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/creport_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::creport { +namespace ams::creport { R_DEFINE_NAMESPACE_RESULT_MODULE(168); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/debug_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/debug_results.hpp index 868df16fb..fcf9d6613 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/debug_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/debug_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::dbg { +namespace ams::dbg { R_DEFINE_NAMESPACE_RESULT_MODULE(183); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/dmnt_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/dmnt_results.hpp index ec2fdd693..aaa1a3d80 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/dmnt_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/dmnt_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::dmnt { +namespace ams::dmnt { R_DEFINE_NAMESPACE_RESULT_MODULE(13); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/err_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/err_results.hpp index 05612b493..dd46dc539 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/err_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/err_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::err { +namespace ams::err { R_DEFINE_NAMESPACE_RESULT_MODULE(162); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/ams_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/exosphere_results.hpp similarity index 72% rename from stratosphere/libstratosphere/include/stratosphere/results/ams_results.hpp rename to stratosphere/libstratosphere/include/stratosphere/results/exosphere_results.hpp index beb605e45..8804473bb 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/ams_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/exosphere_results.hpp @@ -17,22 +17,14 @@ #pragma once #include "results_common.hpp" -namespace sts::ams { +namespace ams::exosphere { /* Please note: These results are all custom, and not official. */ R_DEFINE_NAMESPACE_RESULT_MODULE(444); /* Result 1-1000 reserved for Atmosphere. */ - R_DEFINE_ERROR_RESULT(ExosphereNotPresent, 1); - R_DEFINE_ERROR_RESULT(VersionMismatch, 2); - - /* Results 1000-2000 reserved for Atmosphere Mitm. */ - namespace mitm { - - R_DEFINE_ERROR_RESULT(ShouldForwardToSession, 1000); - R_DEFINE_ERROR_RESULT(ProcessNotAssociated, 1100); - - } + R_DEFINE_ERROR_RESULT(NotPresent, 1); + R_DEFINE_ERROR_RESULT(VersionMismatch, 2); } diff --git a/stratosphere/libstratosphere/include/stratosphere/results/fatal_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/fatal_results.hpp index fda9db86b..076171d59 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/fatal_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/fatal_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::fatal { +namespace ams::fatal { R_DEFINE_NAMESPACE_RESULT_MODULE(163); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/fs_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/fs_results.hpp index 821a3e200..b3877c337 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/fs_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/fs_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::fs { +namespace ams::fs { R_DEFINE_NAMESPACE_RESULT_MODULE(2); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/hipc_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/hipc_results.hpp index 930bdf66d..65f396f01 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/hipc_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/hipc_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::sf::hipc { +namespace ams::sf::hipc { R_DEFINE_NAMESPACE_RESULT_MODULE(11); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/i2c_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/i2c_results.hpp index c25a7e9a5..bd7f7955b 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/i2c_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/i2c_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::i2c { +namespace ams::i2c { R_DEFINE_NAMESPACE_RESULT_MODULE(101); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/kvdb_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/kvdb_results.hpp index 3a4528016..2c19921a9 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/kvdb_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/kvdb_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::kvdb { +namespace ams::kvdb { R_DEFINE_NAMESPACE_RESULT_MODULE(20); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/loader_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/loader_results.hpp index 01cb0a443..29b80bf42 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/loader_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/loader_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::ldr { +namespace ams::ldr { R_DEFINE_NAMESPACE_RESULT_MODULE(9); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/lr_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/lr_results.hpp index 615d52393..c1983ee07 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/lr_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/lr_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::lr { +namespace ams::lr { R_DEFINE_NAMESPACE_RESULT_MODULE(8); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/ncm_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/ncm_results.hpp index 5406064d8..cdba12c7c 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/ncm_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/ncm_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::ncm { +namespace ams::ncm { R_DEFINE_NAMESPACE_RESULT_MODULE(5); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/os_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/os_results.hpp index 93ff349a0..5fd716d00 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/os_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/os_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::os { +namespace ams::os { R_DEFINE_NAMESPACE_RESULT_MODULE(3); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/pm_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/pm_results.hpp index 463ce62db..50d4c3f7e 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/pm_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/pm_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::pm { +namespace ams::pm { R_DEFINE_NAMESPACE_RESULT_MODULE(15); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/results_common.hpp b/stratosphere/libstratosphere/include/stratosphere/results/results_common.hpp index 00d0d6581..a52a99086 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/results_common.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/results_common.hpp @@ -19,7 +19,7 @@ #include #include "../defines.hpp" -namespace sts { +namespace ams { namespace result::impl { @@ -179,17 +179,17 @@ namespace sts { } /* Macros for defining new results. */ -#define R_DEFINE_NAMESPACE_RESULT_MODULE(value) namespace impl::result { static constexpr inline ::sts::result::impl::ResultTraits::BaseType ResultModuleId = value; } +#define R_DEFINE_NAMESPACE_RESULT_MODULE(value) namespace impl::result { static constexpr inline ::ams::result::impl::ResultTraits::BaseType ResultModuleId = value; } #define R_CURRENT_NAMESPACE_RESULT_MODULE impl::result::ResultModuleId #define R_NAMESPACE_MODULE_ID(nmspc) nmspc::R_CURRENT_NAMESPACE_RESULT_MODULE -#define R_MAKE_NAMESPACE_RESULT(nmspc, desc) static_cast<::sts::Result>(::sts::result::impl::ResultTraits::MakeValue(R_NAMESPACE_MODULE_ID(nmspc), desc)) +#define R_MAKE_NAMESPACE_RESULT(nmspc, desc) static_cast<::ams::Result>(::ams::result::impl::ResultTraits::MakeValue(R_NAMESPACE_MODULE_ID(nmspc), desc)) #define R_DEFINE_ERROR_RESULT_IMPL(name, desc_start, desc_end) \ - class Result##name final : public ::sts::result::impl::ResultErrorBase, public ::sts::result::impl::ResultErrorRangeBase {} + class Result##name final : public ::ams::result::impl::ResultErrorBase, public ::ams::result::impl::ResultErrorRangeBase {} #define R_DEFINE_ABSTRACT_ERROR_RESULT_IMPL(name, desc_start, desc_end) \ - class Result##name final : public ::sts::result::impl::ResultErrorRangeBase {} + class Result##name final : public ::ams::result::impl::ResultErrorRangeBase {} #define R_DEFINE_ERROR_RESULT(name, desc) R_DEFINE_ERROR_RESULT_IMPL(name, desc, desc) @@ -211,8 +211,8 @@ namespace sts { #undef R_FAILED -#define R_SUCCEEDED(res) (static_cast<::sts::Result>(res).IsSuccess()) -#define R_FAILED(res) (static_cast<::sts::Result>(res).IsFailure()) +#define R_SUCCEEDED(res) (static_cast<::ams::Result>(res).IsSuccess()) +#define R_FAILED(res) (static_cast<::ams::Result>(res).IsFailure()) /// Evaluates an expression that returns a result, and returns the result if it would fail. @@ -229,7 +229,7 @@ namespace sts { ({ \ const auto _tmp_r_assert_rc = res_expr; \ if (R_FAILED(_tmp_r_assert_rc)) { \ - ::sts::result::impl::OnResultAssertion(_tmp_r_assert_rc); \ + ::ams::result::impl::OnResultAssertion(_tmp_r_assert_rc); \ } \ }) @@ -237,7 +237,7 @@ namespace sts { #define R_UNLESS(expr, res) \ ({ \ if (!(expr)) { \ - return static_cast<::sts::Result>(res); \ + return static_cast<::ams::Result>(res); \ } \ }) @@ -250,7 +250,7 @@ namespace sts { if (R_FAILED(R_CURRENT_RESULT)) { \ if (false) -namespace sts::result::impl { +namespace ams::result::impl { template NX_CONSTEXPR bool AnyIncludes(Result result) { @@ -260,18 +260,18 @@ namespace sts::result::impl { } #define R_CATCH(...) \ - } else if (::sts::result::impl::AnyIncludes<__VA_ARGS__>(R_CURRENT_RESULT)) { \ + } else if (::ams::result::impl::AnyIncludes<__VA_ARGS__>(R_CURRENT_RESULT)) { \ if (true) #define R_CONVERT(catch_type, convert_type) \ - R_CATCH(catch_type) { return static_cast<::sts::Result>(convert_type); } + R_CATCH(catch_type) { return static_cast<::ams::Result>(convert_type); } #define R_CATCH_ALL() \ } else if (R_FAILED(R_CURRENT_RESULT)) { \ if (true) #define R_CONVERT_ALL(convert_type) \ - R_CATCH_ALL() { return static_cast<::sts::Result>(convert_type); } + R_CATCH_ALL() { return static_cast<::ams::Result>(convert_type); } #define R_END_TRY_CATCH \ else if (R_FAILED(R_CURRENT_RESULT)) { \ diff --git a/stratosphere/libstratosphere/include/stratosphere/results/ro_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/ro_results.hpp index a83a809f0..672270507 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/ro_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/ro_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::ro { +namespace ams::ro { R_DEFINE_NAMESPACE_RESULT_MODULE(22); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/settings_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/settings_results.hpp index a72325103..6f015cdf6 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/settings_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/settings_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::settings { +namespace ams::settings { R_DEFINE_NAMESPACE_RESULT_MODULE(105); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/sf_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/sf_results.hpp index ceb635bcb..192525538 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/sf_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/sf_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::sf { +namespace ams::sf { R_DEFINE_NAMESPACE_RESULT_MODULE(10); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/sm_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/sm_results.hpp index 0a66c81c6..89829f798 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/sm_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/sm_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::sm { +namespace ams::sm { R_DEFINE_NAMESPACE_RESULT_MODULE(21); @@ -31,4 +31,12 @@ namespace sts::sm { R_DEFINE_ERROR_RESULT(NotAllowed, 8); R_DEFINE_ERROR_RESULT(TooLargeAccessControl, 9); + /* Results 1000-2000 used as extension for Atmosphere Mitm. */ + namespace mitm { + + R_DEFINE_ERROR_RESULT(ShouldForwardToSession, 1000); + R_DEFINE_ERROR_RESULT(ProcessNotAssociated, 1100); + + } + } diff --git a/stratosphere/libstratosphere/include/stratosphere/results/spl_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/spl_results.hpp index c54c3671d..0670c6fae 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/spl_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/spl_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::spl { +namespace ams::spl { R_DEFINE_NAMESPACE_RESULT_MODULE(26); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/svc_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/svc_results.hpp index 29acd1aa6..8b5149e35 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/svc_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/svc_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::svc { +namespace ams::svc { R_DEFINE_NAMESPACE_RESULT_MODULE(1); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/updater_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/updater_results.hpp index 160284412..ea40f962d 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/updater_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/updater_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::updater { +namespace ams::updater { R_DEFINE_NAMESPACE_RESULT_MODULE(158); diff --git a/stratosphere/libstratosphere/include/stratosphere/results/vi_results.hpp b/stratosphere/libstratosphere/include/stratosphere/results/vi_results.hpp index 7c5e5c0c5..30b5190cf 100644 --- a/stratosphere/libstratosphere/include/stratosphere/results/vi_results.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/results/vi_results.hpp @@ -17,7 +17,7 @@ #pragma once #include "results_common.hpp" -namespace sts::vi { +namespace ams::vi { R_DEFINE_NAMESPACE_RESULT_MODULE(114); diff --git a/stratosphere/libstratosphere/include/stratosphere/rnd/rnd_api.hpp b/stratosphere/libstratosphere/include/stratosphere/rnd/rnd_api.hpp index 073a41342..ae352f56b 100644 --- a/stratosphere/libstratosphere/include/stratosphere/rnd/rnd_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/rnd/rnd_api.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::rnd { +namespace ams::rnd { /* Random utilities. */ void GenerateRandomBytes(void* out, size_t size); diff --git a/stratosphere/libstratosphere/include/stratosphere/ro/ro_types.hpp b/stratosphere/libstratosphere/include/stratosphere/ro/ro_types.hpp index 19c3d2b54..b4f857eb9 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ro/ro_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ro/ro_types.hpp @@ -20,7 +20,7 @@ #include "../defines.hpp" #include "../ncm.hpp" -namespace sts::ro { +namespace ams::ro { enum class ModuleType : u8 { ForSelf = 0, @@ -63,7 +63,7 @@ namespace sts::ro { ModuleType GetType() const { const ModuleType type = static_cast(this->type); - STS_ASSERT(type < ModuleType::Count); + AMS_ASSERT(type < ModuleType::Count); return type; } diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_api.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_api.hpp index 68ae2ed99..9e792d1b0 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_api.hpp @@ -18,7 +18,7 @@ #include "../sf_common.hpp" #include "sf_cmif_service_object_holder.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { struct DomainObjectId { u32 value; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_manager.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_manager.hpp index 90beb3a28..27d70b847 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_manager.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_manager.hpp @@ -19,7 +19,7 @@ #include "sf_cmif_domain_api.hpp" #include "sf_cmif_domain_service_object.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { class ServerDomainManager { NON_COPYABLE(ServerDomainManager); @@ -85,7 +85,7 @@ namespace sts::sf::cmif { inline DomainObjectId GetId(Entry *e) { const size_t index = e - this->entries; - STS_ASSERT(index < this->num_entries); + AMS_ASSERT(index < this->num_entries); return DomainObjectId{ u32(index + 1) }; } diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_service_object.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_service_object.hpp index ad11979ed..9dbea1009 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_service_object.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_domain_service_object.hpp @@ -19,7 +19,7 @@ #include "sf_cmif_domain_api.hpp" #include "sf_cmif_server_message_processor.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { class DomainServiceObjectDispatchTable : public impl::ServiceDispatchTableBase { private: @@ -41,8 +41,8 @@ namespace sts::sf::cmif { ServerMessageRuntimeMetadata impl_metadata; public: DomainServiceObjectProcessor(ServerDomainBase *d, DomainObjectId *in_obj_ids, size_t num_in_objs) : domain(d), in_object_ids(in_obj_ids), num_in_objects(num_in_objs) { - STS_ASSERT(this->domain != nullptr); - STS_ASSERT(this->in_object_ids != nullptr); + AMS_ASSERT(this->domain != nullptr); + AMS_ASSERT(this->in_object_ids != nullptr); this->impl_processor = nullptr; this->out_object_ids = nullptr; this->impl_metadata = {}; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_pointer_and_size.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_pointer_and_size.hpp index 13f1858c0..e957b1942 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_pointer_and_size.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_pointer_and_size.hpp @@ -17,7 +17,7 @@ #pragma once #include "../sf_common.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { class PointerAndSize { private: diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_server_message_processor.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_server_message_processor.hpp index 547551754..ef4d1f2d6 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_server_message_processor.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_server_message_processor.hpp @@ -18,7 +18,7 @@ #include "../sf_service_object.hpp" #include "sf_cmif_pointer_and_size.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { /* Forward declare ServiceDispatchContext, ServiceObjectHolder. */ struct ServiceDispatchContext; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_dispatch.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_dispatch.hpp index 511aa125a..ee8aef1ec 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_dispatch.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_dispatch.hpp @@ -19,14 +19,14 @@ #include "sf_cmif_pointer_and_size.hpp" #include "sf_cmif_server_message_processor.hpp" -namespace sts::sf::hipc { +namespace ams::sf::hipc { class ServerSessionManager; class ServerSession; } -namespace sts::sf::cmif { +namespace ams::sf::cmif { class ServerMessageProcessor; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_object_holder.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_object_holder.hpp index 2d8baff6d..12c8969b9 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_object_holder.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/cmif/sf_cmif_service_object_holder.hpp @@ -18,7 +18,7 @@ #include "../sf_service_object.hpp" #include "sf_cmif_service_dispatch.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { class ServiceObjectHolder { private: diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_api.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_api.hpp index 0478ca495..cd4b3535f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_api.hpp @@ -18,7 +18,7 @@ #include "../sf_common.hpp" #include "../cmif/sf_cmif_pointer_and_size.hpp" -namespace sts::sf::hipc { +namespace ams::sf::hipc { constexpr size_t TlsMessageBufferSize = 0x100; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_domain_session_manager.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_domain_session_manager.hpp index a8d6b74ef..6d5c45274 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_domain_session_manager.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_domain_session_manager.hpp @@ -18,7 +18,7 @@ #include "sf_hipc_server_session_manager.hpp" #include "../cmif/sf_cmif_domain_manager.hpp" -namespace sts::sf::hipc { +namespace ams::sf::hipc { class ServerDomainSessionManager : public ServerSessionManager, private cmif::ServerDomainManager { protected: diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp index fffeebc4d..43cdc5018 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_manager.hpp @@ -17,7 +17,7 @@ #pragma once #include "sf_hipc_server_domain_session_manager.hpp" -namespace sts::sf::hipc { +namespace ams::sf::hipc { struct DefaultServerManagerOptions { static constexpr size_t PointerBufferSize = 0; @@ -148,7 +148,7 @@ namespace sts::sf::hipc { void RegisterServerImpl(Handle port_handle, sm::ServiceName service_name, bool managed, cmif::ServiceObjectHolder &&static_holder) { /* Allocate server memory. */ auto *server = this->AllocateServer(); - STS_ASSERT(server != nullptr); + AMS_ASSERT(server != nullptr); new (server) Server(port_handle, service_name, managed, std::forward(static_holder)); if constexpr (!ServiceObjectTraits::IsMitmServiceObject) { @@ -253,13 +253,13 @@ namespace sts::sf::hipc { private: constexpr inline size_t GetServerIndex(const ServerBase *server) const { const size_t i = server - GetPointer(this->server_storages[0]); - STS_ASSERT(i < MaxServers); + AMS_ASSERT(i < MaxServers); return i; } constexpr inline size_t GetSessionIndex(const ServerSession *session) const { const size_t i = session - GetPointer(this->session_storages[0]); - STS_ASSERT(i < MaxSessions); + AMS_ASSERT(i < MaxSessions); return i; } @@ -281,7 +281,7 @@ namespace sts::sf::hipc { virtual void FreeSession(ServerSession *session) override final { std::scoped_lock lk(this->resource_mutex); const size_t index = this->GetSessionIndex(session); - STS_ASSERT(this->session_allocated[index]); + AMS_ASSERT(this->session_allocated[index]); this->session_allocated[index] = false; } @@ -299,7 +299,7 @@ namespace sts::sf::hipc { virtual void DestroyServer(ServerBase *server) override final { std::scoped_lock lk(this->resource_mutex); const size_t index = this->GetServerIndex(server); - STS_ASSERT(this->server_allocated[index]); + AMS_ASSERT(this->server_allocated[index]); server->~ServerBase(); this->server_allocated[index] = false; } @@ -319,8 +319,8 @@ namespace sts::sf::hipc { std::scoped_lock lk(this->resource_mutex); DomainStorage *ptr = static_cast(domain); const size_t index = ptr - this->domain_storages; - STS_ASSERT(index < ManagerOptions::MaxDomains); - STS_ASSERT(this->domain_allocated[index]); + AMS_ASSERT(index < ManagerOptions::MaxDomains); + AMS_ASSERT(this->domain_allocated[index]); this->domain_allocated[index] = false; } diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_session_manager.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_session_manager.hpp index 2cb74f602..bc3da6fa6 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_session_manager.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/hipc/sf_hipc_server_session_manager.hpp @@ -21,13 +21,13 @@ #include "../cmif/sf_cmif_service_object_holder.hpp" #include "sf_hipc_api.hpp" -namespace sts::sf::cmif { +namespace ams::sf::cmif { struct ServiceDispatchContext; } -namespace sts::sf::hipc { +namespace ams::sf::hipc { class ServerSessionManager; class ServerManagerBase; @@ -58,14 +58,14 @@ namespace sts::sf::hipc { this->is_closed = false; this->has_received = false; this->forward_service = nullptr; - STS_ASSERT(!this->IsMitmSession()); + AMS_ASSERT(!this->IsMitmSession()); } ServerSession(Handle h, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) : WaitableHolder(h), srv_obj_holder(std::move(obj)), session_handle(h) { this->is_closed = false; this->has_received = false; this->forward_service = std::move(fsrv); - STS_ASSERT(this->IsMitmSession()); + AMS_ASSERT(this->IsMitmSession()); } bool IsMitmSession() const { diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp index e2cfc1a2f..0dfdd763f 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/impl/sf_impl_command_serialization.hpp @@ -28,7 +28,7 @@ #include "../hipc/sf_hipc_server_session_manager.hpp" /* Serialization classes. */ -namespace sts::sf { +namespace ams::sf { namespace impl { @@ -99,7 +99,7 @@ namespace sts::sf { } -namespace sts::sf::impl { +namespace ams::sf::impl { /* Machinery for filtering type lists. */ template @@ -167,7 +167,7 @@ namespace sts::sf::impl { return ArgumentType::OutData; } else if constexpr (std::is_trivial::value && !std::is_pointer::value) { return ArgumentType::InData; - } else if constexpr (std::is_same::value) { + } else if constexpr (std::is_same::value) { return ArgumentType::InData; } else { static_assert(!std::is_same::value, "Invalid ArgumentType"); @@ -1020,7 +1020,7 @@ namespace sts::sf::impl { /* Fake buffer. This is either InData or OutData, but serializing over buffers. */ constexpr auto Attributes = CommandMeta::BufferAttributes[Info.buffer_index]; if constexpr (Attributes & SfBufferAttr_In) { - /* TODO: STS_ASSERT()? N does not bother. */ + /* TODO: AMS_ASSERT()? N does not bother. */ return *reinterpret_cast(buffers[Info.buffer_index].GetAddress()); } else if constexpr (Attributes & SfBufferAttr_Out) { return T(buffers[Info.buffer_index]); @@ -1139,7 +1139,7 @@ namespace sts::sf::impl { } -namespace sts::sf { +namespace ams::sf { template inline static constexpr cmif::ServiceCommandMeta MakeServiceCommandMeta() { @@ -1147,10 +1147,10 @@ namespace sts::sf { .hosver_low = Low, .hosver_high = High, .cmd_id = static_cast(CommandId), - .handler = ::sts::sf::impl::InvokeServiceCommandImpl, + .handler = ::ams::sf::impl::InvokeServiceCommandImpl, }; } } -#define MAKE_SERVICE_COMMAND_META(Name, ...) ::sts::sf::MakeServiceCommandMeta() +#define MAKE_SERVICE_COMMAND_META(Name, ...) ::ams::sf::MakeServiceCommandMeta() diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffer_tags.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffer_tags.hpp index 2c278f70b..62c53ff89 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffer_tags.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffer_tags.hpp @@ -16,7 +16,7 @@ #pragma once -namespace sts::sf { +namespace ams::sf { /* Helper structs for serialization of buffers. */ struct LargeData{}; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp index 03e03fca1..9497d1707 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp @@ -20,7 +20,7 @@ #include "cmif/sf_cmif_pointer_and_size.hpp" #include "sf_buffer_tags.hpp" -namespace sts::sf { +namespace ams::sf { enum class BufferTransferMode { MapAlias, diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_handles.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_handles.hpp index 2003a1230..29c860ba3 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_handles.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_handles.hpp @@ -19,7 +19,7 @@ #include "sf_out.hpp" #include "cmif/sf_cmif_pointer_and_size.hpp" -namespace sts::sf { +namespace ams::sf { namespace impl { diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_out.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_out.hpp index ea6877f4c..cfdc79b14 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_out.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_out.hpp @@ -18,7 +18,7 @@ #include "sf_common.hpp" #include "cmif/sf_cmif_pointer_and_size.hpp" -namespace sts::sf { +namespace ams::sf { namespace impl { @@ -30,7 +30,7 @@ namespace sts::sf { struct IsOutForceEnabled : public std::false_type{}; template<> - struct IsOutForceEnabled<::sts::Result> : public std::true_type{}; + struct IsOutForceEnabled<::ams::Result> : public std::true_type{}; template using IsOutEnabled = typename std::enable_if::value || IsOutForceEnabled::value>::type; @@ -44,7 +44,7 @@ namespace sts::sf { public: constexpr Out(uintptr_t p) : ptr(reinterpret_cast(p)) { /* ... */ } constexpr Out(T *p) : ptr(p) { /* ... */ } - constexpr Out(const cmif::PointerAndSize &pas) : ptr(reinterpret_cast(pas.GetAddress())) { /* TODO: Is STS_ASSERT(pas.GetSize() >= sizeof(T)); necessary? */ } + constexpr Out(const cmif::PointerAndSize &pas) : ptr(reinterpret_cast(pas.GetAddress())) { /* TODO: Is AMS_ASSERT(pas.GetSize() >= sizeof(T)); necessary? */ } void SetValue(const T& value) const { *this->ptr = value; diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_service_object.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_service_object.hpp index 15e86cd7d..052154d66 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_service_object.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_service_object.hpp @@ -18,7 +18,7 @@ #include "sf_common.hpp" #include "sf_out.hpp" -namespace sts::sf { +namespace ams::sf { class IServiceObject{}; @@ -35,7 +35,7 @@ namespace sts::sf { template struct ServiceObjectTraits { - static_assert(std::is_base_of::value, "ServiceObjectTraits requires ServiceObject"); + static_assert(std::is_base_of::value, "ServiceObjectTraits requires ServiceObject"); static constexpr bool IsMitmServiceObject = std::is_base_of::value; diff --git a/stratosphere/libstratosphere/include/stratosphere/sm/sm_api.hpp b/stratosphere/libstratosphere/include/stratosphere/sm/sm_api.hpp index 2fb4f9381..28c9b0fc6 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sm/sm_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sm/sm_api.hpp @@ -18,7 +18,7 @@ #include "sm_types.hpp" -namespace sts::sm { +namespace ams::sm { /* Ordinary SM API. */ Result GetService(Service *out, ServiceName name); diff --git a/stratosphere/libstratosphere/include/stratosphere/sm/sm_manager_api.hpp b/stratosphere/libstratosphere/include/stratosphere/sm/sm_manager_api.hpp index a2279fac9..ba76fcbc5 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sm/sm_manager_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sm/sm_manager_api.hpp @@ -20,7 +20,7 @@ #include "../ncm/ncm_types.hpp" #include "../os/os_common_types.hpp" -namespace sts::sm::manager { +namespace ams::sm::manager { /* Manager API. */ Result RegisterProcess(os::ProcessId process_id, ncm::TitleId title_id, const void *acid, size_t acid_size, const void *aci, size_t aci_size); diff --git a/stratosphere/libstratosphere/include/stratosphere/sm/sm_mitm_api.hpp b/stratosphere/libstratosphere/include/stratosphere/sm/sm_mitm_api.hpp index fd51fb2e1..ecb1abbe2 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sm/sm_mitm_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sm/sm_mitm_api.hpp @@ -19,7 +19,7 @@ #include "sm_types.hpp" #include "../ncm/ncm_types.hpp" -namespace sts::sm::mitm { +namespace ams::sm::mitm { /* Mitm API. */ Result InstallMitm(Handle *out_port, Handle *out_query, ServiceName name); diff --git a/stratosphere/libstratosphere/include/stratosphere/sm/sm_scoped_holder.hpp b/stratosphere/libstratosphere/include/stratosphere/sm/sm_scoped_holder.hpp index ae416dd8c..0a2d1d970 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sm/sm_scoped_holder.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sm/sm_scoped_holder.hpp @@ -18,7 +18,7 @@ #include "sm_api.hpp" -namespace sts::sm { +namespace ams::sm { /* Utility, for scoped access to libnx services. */ template @@ -62,7 +62,7 @@ namespace sts::sm { } Result Initialize() { - STS_ASSERT(!this->has_initialized); + AMS_ASSERT(!this->has_initialized); sm::DoWithSession([&]() { this->result = Initializer(); @@ -73,7 +73,7 @@ namespace sts::sm { } void Finalize() { - STS_ASSERT(this->has_initialized); + AMS_ASSERT(this->has_initialized); Finalizer(); this->has_initialized = false; } diff --git a/stratosphere/libstratosphere/include/stratosphere/sm/sm_types.hpp b/stratosphere/libstratosphere/include/stratosphere/sm/sm_types.hpp index 30d97b3b3..d61777f40 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sm/sm_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sm/sm_types.hpp @@ -22,7 +22,7 @@ #include "../results.hpp" #include "../os.hpp" -namespace sts::sm { +namespace ams::sm { struct ServiceName { static constexpr size_t MaxLength = 8; diff --git a/stratosphere/libstratosphere/include/stratosphere/spl/smc/spl_smc.hpp b/stratosphere/libstratosphere/include/stratosphere/spl/smc/spl_smc.hpp index fe39687bd..5d1c05b73 100644 --- a/stratosphere/libstratosphere/include/stratosphere/spl/smc/spl_smc.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/spl/smc/spl_smc.hpp @@ -20,7 +20,7 @@ #include "../spl_types.hpp" -namespace sts::spl::smc { +namespace ams::spl::smc { /* Helpers for converting arguments. */ inline u32 GetCryptAesMode(CipherMode mode, u32 keyslot) { diff --git a/stratosphere/libstratosphere/include/stratosphere/spl/spl_api.hpp b/stratosphere/libstratosphere/include/stratosphere/spl/spl_api.hpp index b511ad9e4..d49c15183 100644 --- a/stratosphere/libstratosphere/include/stratosphere/spl/spl_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/spl/spl_api.hpp @@ -18,7 +18,7 @@ #include "spl_types.hpp" -namespace sts::spl { +namespace ams::spl { HardwareType GetHardwareType(); MemoryArrangement GetMemoryArrangement(); diff --git a/stratosphere/libstratosphere/include/stratosphere/spl/spl_types.hpp b/stratosphere/libstratosphere/include/stratosphere/spl/spl_types.hpp index 4dd0d285f..1cd3f7215 100644 --- a/stratosphere/libstratosphere/include/stratosphere/spl/spl_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/spl/spl_types.hpp @@ -18,7 +18,7 @@ #include #include "../results.hpp" -namespace sts::spl { +namespace ams::spl { namespace smc { @@ -64,12 +64,12 @@ namespace sts::spl { NotPermitted = 6, }; - constexpr inline ::sts::Result ConvertResult(Result smc_result) { + constexpr inline ::ams::Result ConvertResult(Result smc_result) { /* smc::Result::Success becomes ResultSuccess() directly. */ R_UNLESS(smc_result != Result::Success, ResultSuccess()); /* Convert to the list of known SecureMonitorErrors. */ - const auto converted = R_MAKE_NAMESPACE_RESULT(::sts::spl, static_cast(smc_result)); + const auto converted = R_MAKE_NAMESPACE_RESULT(::ams::spl, static_cast(smc_result)); if (spl::ResultSecureMonitorError::Includes(converted)) { return converted; } diff --git a/stratosphere/libstratosphere/include/stratosphere/svc/svc_types.hpp b/stratosphere/libstratosphere/include/stratosphere/svc/svc_types.hpp index 74612d49c..275cbe08d 100644 --- a/stratosphere/libstratosphere/include/stratosphere/svc/svc_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/svc/svc_types.hpp @@ -20,7 +20,7 @@ #include "../defines.hpp" #include "../results.hpp" -namespace sts::svc { +namespace ams::svc { /* Debug event types. */ enum class DebugEventType : u32 { diff --git a/stratosphere/libstratosphere/include/stratosphere/updater/updater_api.hpp b/stratosphere/libstratosphere/include/stratosphere/updater/updater_api.hpp index e8f37263e..55482efce 100644 --- a/stratosphere/libstratosphere/include/stratosphere/updater/updater_api.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/updater/updater_api.hpp @@ -20,7 +20,7 @@ #include "../spl/spl_types.hpp" #include "updater_types.hpp" -namespace sts::updater { +namespace ams::updater { /* Public API. */ BootImageUpdateType GetBootImageUpdateType(spl::HardwareType hw_type); diff --git a/stratosphere/libstratosphere/include/stratosphere/updater/updater_types.hpp b/stratosphere/libstratosphere/include/stratosphere/updater/updater_types.hpp index da5ef7e99..6675f3d4c 100644 --- a/stratosphere/libstratosphere/include/stratosphere/updater/updater_types.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/updater/updater_types.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::updater { +namespace ams::updater { /* Types. */ enum class BootImageUpdateType { diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_alignment.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_alignment.hpp index 90a482db3..7ef5c053b 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_alignment.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_alignment.hpp @@ -19,7 +19,7 @@ #include "../defines.hpp" #include -namespace sts::util { +namespace ams::util { /* Utilities for alignment to power of two. */ diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_compression.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_compression.hpp index d86652e7e..644cfef5e 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_compression.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_compression.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::util { +namespace ams::util { /* Compression utilities. */ int CompressLZ4(void *dst, size_t dst_size, const void *src, size_t src_size); diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_ini.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_ini.hpp index 235d7c48e..ba398cfcd 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_ini.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_ini.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::util::ini { +namespace ams::util::ini { /* Ini handler type. */ using Handler = int (*)(void *user_ctx, const char *section, const char *name, const char *value); diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_list.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_list.hpp index a4f3bf7d8..36f643170 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_list.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_list.hpp @@ -21,7 +21,7 @@ #include "util_parent_of_member.hpp" -namespace sts::util { +namespace ams::util { /* Forward declare implementation class for Node. */ namespace impl { @@ -49,7 +49,7 @@ namespace sts::util { private: void LinkPrev(IntrusiveListNode *node) { /* We can't link an already linked node. */ - STS_ASSERT(!node->IsLinked()); + AMS_ASSERT(!node->IsLinked()); this->SplicePrev(node, node); } @@ -64,7 +64,7 @@ namespace sts::util { void LinkNext(IntrusiveListNode *node) { /* We can't link an already linked node. */ - STS_ASSERT(!node->IsLinked()); + AMS_ASSERT(!node->IsLinked()); return this->SpliceNext(node, node); } @@ -210,13 +210,13 @@ namespace sts::util { iterator iterator_to(reference v) { /* Only allow iterator_to for values in lists. */ - STS_ASSERT(v.IsLinked()); + AMS_ASSERT(v.IsLinked()); return iterator(&v); } const_iterator iterator_to(const_reference v) const { /* Only allow iterator_to for values in lists. */ - STS_ASSERT(v.IsLinked()); + AMS_ASSERT(v.IsLinked()); return const_iterator(&v); } @@ -334,9 +334,9 @@ namespace sts::util { template class Iterator { public: - friend class sts::util::IntrusiveList; + friend class ams::util::IntrusiveList; - using ImplIterator = typename std::conditional::type; + using ImplIterator = typename std::conditional::type; using iterator_category = std::bidirectional_iterator_tag; using value_type = typename IntrusiveList::value_type; @@ -480,22 +480,22 @@ namespace sts::util { } reference back() { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); return GetParent(this->impl.back()); } const_reference back() const { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); return GetParent(this->impl.back()); } reference front() { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); return GetParent(this->impl.front()); } const_reference front() const { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); return GetParent(this->impl.front()); } @@ -508,12 +508,12 @@ namespace sts::util { } void pop_back() { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); this->impl.pop_back(); } void pop_front() { - STS_ASSERT(!this->impl.empty()); + AMS_ASSERT(!this->impl.empty()); this->impl.pop_front(); } diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_red_black_tree.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_red_black_tree.hpp index eef853077..b1769f185 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_red_black_tree.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_intrusive_red_black_tree.hpp @@ -22,7 +22,7 @@ #include "util_parent_of_member.hpp" -namespace sts::util { +namespace ams::util { struct IntrusiveRedBlackTreeNode { NON_COPYABLE(IntrusiveRedBlackTreeNode); diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_parent_of_member.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_parent_of_member.hpp index 88fe61e48..55efae08e 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_parent_of_member.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_parent_of_member.hpp @@ -18,7 +18,7 @@ #include #include "../defines.hpp" -namespace sts::util { +namespace ams::util { namespace impl { diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_scope_guard.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_scope_guard.hpp index 275c1368d..462f797e4 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_scope_guard.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_scope_guard.hpp @@ -19,7 +19,7 @@ #include #include "../defines.hpp" -namespace sts::util { +namespace ams::util { namespace impl { @@ -55,5 +55,5 @@ namespace sts::util { } -#define SCOPE_GUARD ::sts::util::impl::ScopeGuardOnExit() + [&]() +#define SCOPE_GUARD ::ams::util::impl::ScopeGuardOnExit() + [&]() #define ON_SCOPE_EXIT auto ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE_) = SCOPE_GUARD diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_size.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_size.hpp index 8f1785c5e..78e9cbe49 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_size.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_size.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::util { +namespace ams::util { /* std::size() does not support zero-size C arrays. We're fixing that. */ template diff --git a/stratosphere/libstratosphere/include/stratosphere/util/util_typed_storage.hpp b/stratosphere/libstratosphere/include/stratosphere/util/util_typed_storage.hpp index 54999a87e..9b3960dd9 100644 --- a/stratosphere/libstratosphere/include/stratosphere/util/util_typed_storage.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/util/util_typed_storage.hpp @@ -19,14 +19,14 @@ #include "../defines.hpp" #include -namespace sts::util { +namespace ams::util { template struct TypedStorage { typename std::aligned_storage::type _storage; }; - #define TYPED_STORAGE(T) ::sts::util::TypedStorage + #define TYPED_STORAGE(T) ::ams::util::TypedStorage template static constexpr inline __attribute__((always_inline)) T *GetPointer(TYPED_STORAGE(T) &ts) { diff --git a/stratosphere/libstratosphere/source/ams/ams_environment.cpp b/stratosphere/libstratosphere/source/ams/ams_environment.cpp index c28e8d461..36a31d148 100644 --- a/stratosphere/libstratosphere/source/ams/ams_environment.cpp +++ b/stratosphere/libstratosphere/source/ams/ams_environment.cpp @@ -17,7 +17,7 @@ #include #include "ams_bpc.h" -namespace sts::ams { +namespace ams { namespace { @@ -34,7 +34,7 @@ namespace sts::ams { } - extern ncm::TitleId StratosphereTitleId; + extern ncm::TitleId CurrentTitleId; void WEAK ExceptionHandler(FatalErrorContext *ctx) { R_ASSERT(amsBpcInitialize()); @@ -49,7 +49,7 @@ namespace sts::ams { { ams_ctx.magic = FatalErrorContext::Magic; ams_ctx.error_desc = ctx->error_desc; - ams_ctx.title_id = static_cast(StratosphereTitleId); + ams_ctx.title_id = static_cast(CurrentTitleId); for (size_t i = 0; i < FatalErrorContext::NumGprs; i++) { ams_ctx.gprs[i] = ctx->cpu_gprs[i].x; } @@ -122,7 +122,7 @@ namespace sts::ams { } /* Just call the user exception handler. */ - ::sts::ams::ExceptionHandler(&ams_ctx); + ::ams::ExceptionHandler(&ams_ctx); } inline NORETURN void AbortImpl() { @@ -160,7 +160,7 @@ extern "C" { /* Custom abort handler, so that std::abort will trigger these. */ void abort() { - sts::ams::AbortImpl(); + ams::AbortImpl(); } void *__cxa_allocate_ecxeption(size_t thrown_size) { diff --git a/stratosphere/libstratosphere/source/ams/ams_exosphere_api.cpp b/stratosphere/libstratosphere/source/ams/ams_exosphere_api.cpp index 2ad9d9974..9d97f2c69 100644 --- a/stratosphere/libstratosphere/source/ams/ams_exosphere_api.cpp +++ b/stratosphere/libstratosphere/source/ams/ams_exosphere_api.cpp @@ -18,12 +18,12 @@ #include #include -namespace sts::ams { +namespace ams::exosphere { ApiInfo GetApiInfo() { u64 exosphere_cfg; if (spl::smc::GetConfig(&exosphere_cfg, 1, SplConfigItem_ExosphereApiVersion) != spl::smc::Result::Success) { - R_ASSERT(ResultExosphereNotPresent()); + R_ASSERT(ResultNotPresent()); } return ApiInfo{ diff --git a/stratosphere/libstratosphere/source/boot2/boot2_api.cpp b/stratosphere/libstratosphere/source/boot2/boot2_api.cpp index e81ce6195..6cf08901a 100644 --- a/stratosphere/libstratosphere/source/boot2/boot2_api.cpp +++ b/stratosphere/libstratosphere/source/boot2/boot2_api.cpp @@ -21,7 +21,7 @@ #include #include -namespace sts::boot2 { +namespace ams::boot2 { namespace { @@ -145,9 +145,9 @@ namespace sts::boot2 { /* Launch, lightly validate result. */ { const auto launch_result = pm::shell::LaunchTitle(&process_id, loc, launch_flags); - STS_ASSERT(!(svc::ResultOutOfResource::Includes(launch_result))); - STS_ASSERT(!(svc::ResultOutOfMemory::Includes(launch_result))); - STS_ASSERT(!(svc::ResultLimitReached::Includes(launch_result))); + AMS_ASSERT(!(svc::ResultOutOfResource::Includes(launch_result))); + AMS_ASSERT(!(svc::ResultOutOfMemory::Includes(launch_result))); + AMS_ASSERT(!(svc::ResultLimitReached::Includes(launch_result))); } if (out_process_id) { @@ -271,7 +271,7 @@ namespace sts::boot2 { } /* Don't allow invalid lines. */ - STS_ASSERT(name_len <= sizeof(sm::ServiceName)); + AMS_ASSERT(name_len <= sizeof(sm::ServiceName)); /* Declare the service. */ R_ASSERT(sm::mitm::DeclareFutureMitm(sm::ServiceName::Encode(mitm_list + offset, name_len))); diff --git a/stratosphere/libstratosphere/source/cfg/cfg_flags.cpp b/stratosphere/libstratosphere/source/cfg/cfg_flags.cpp index 1d4647844..ed0ea9d20 100644 --- a/stratosphere/libstratosphere/source/cfg/cfg_flags.cpp +++ b/stratosphere/libstratosphere/source/cfg/cfg_flags.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::cfg { +namespace ams::cfg { namespace { diff --git a/stratosphere/libstratosphere/source/cfg/cfg_override.cpp b/stratosphere/libstratosphere/source/cfg/cfg_override.cpp index 218f3055c..76a20fb4d 100644 --- a/stratosphere/libstratosphere/source/cfg/cfg_override.cpp +++ b/stratosphere/libstratosphere/source/cfg/cfg_override.cpp @@ -22,7 +22,7 @@ #include #include -namespace sts::cfg { +namespace ams::cfg { namespace { diff --git a/stratosphere/libstratosphere/source/cfg/cfg_privileged_process.cpp b/stratosphere/libstratosphere/source/cfg/cfg_privileged_process.cpp index 406a6233d..670e590e2 100644 --- a/stratosphere/libstratosphere/source/cfg/cfg_privileged_process.cpp +++ b/stratosphere/libstratosphere/source/cfg/cfg_privileged_process.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::cfg { +namespace ams::cfg { namespace { diff --git a/stratosphere/libstratosphere/source/cfg/cfg_sd_card.cpp b/stratosphere/libstratosphere/source/cfg/cfg_sd_card.cpp index 6aaeccc2f..150047851 100644 --- a/stratosphere/libstratosphere/source/cfg/cfg_sd_card.cpp +++ b/stratosphere/libstratosphere/source/cfg/cfg_sd_card.cpp @@ -19,7 +19,7 @@ #include #include -namespace sts::cfg { +namespace ams::cfg { namespace { diff --git a/stratosphere/libstratosphere/source/dd/dd_io_mappings.cpp b/stratosphere/libstratosphere/source/dd/dd_io_mappings.cpp index 7bc09ab50..c423fd4aa 100644 --- a/stratosphere/libstratosphere/source/dd/dd_io_mappings.cpp +++ b/stratosphere/libstratosphere/source/dd/dd_io_mappings.cpp @@ -15,7 +15,7 @@ */ #include -namespace sts::dd { +namespace ams::dd { uintptr_t QueryIoMapping(uintptr_t phys_addr, size_t size) { u64 virtual_addr; diff --git a/stratosphere/libstratosphere/source/hid/hid_api.cpp b/stratosphere/libstratosphere/source/hid/hid_api.cpp index 4ee4db6b7..0419f96d2 100644 --- a/stratosphere/libstratosphere/source/hid/hid_api.cpp +++ b/stratosphere/libstratosphere/source/hid/hid_api.cpp @@ -19,7 +19,7 @@ #include #include -namespace sts::hid { +namespace ams::hid { namespace { diff --git a/stratosphere/libstratosphere/source/ams/ams_hos_version_api.cpp b/stratosphere/libstratosphere/source/hos/hos_version_api.cpp similarity index 81% rename from stratosphere/libstratosphere/source/ams/ams_hos_version_api.cpp rename to stratosphere/libstratosphere/source/hos/hos_version_api.cpp index 5f6ac7b35..d0118a752 100644 --- a/stratosphere/libstratosphere/source/ams/ams_hos_version_api.cpp +++ b/stratosphere/libstratosphere/source/hos/hos_version_api.cpp @@ -16,7 +16,7 @@ #include -namespace sts::hos { +namespace ams::hos { namespace { @@ -35,39 +35,39 @@ namespace sts::hos { return; } - switch (ams::GetApiInfo().GetTargetFirmware()) { - case ams::TargetFirmware_100: + switch (exosphere::GetApiInfo().GetTargetFirmware()) { + case exosphere::TargetFirmware_100: g_hos_version = hos::Version_100; break; - case ams::TargetFirmware_200: + case exosphere::TargetFirmware_200: g_hos_version = hos::Version_200; break; - case ams::TargetFirmware_300: + case exosphere::TargetFirmware_300: g_hos_version = hos::Version_300; break; - case ams::TargetFirmware_400: + case exosphere::TargetFirmware_400: g_hos_version = hos::Version_400; break; - case ams::TargetFirmware_500: + case exosphere::TargetFirmware_500: g_hos_version = hos::Version_500; break; - case ams::TargetFirmware_600: - case ams::TargetFirmware_620: + case exosphere::TargetFirmware_600: + case exosphere::TargetFirmware_620: g_hos_version = hos::Version_600; break; - case ams::TargetFirmware_700: + case exosphere::TargetFirmware_700: g_hos_version = hos::Version_700; break; - case ams::TargetFirmware_800: + case exosphere::TargetFirmware_800: g_hos_version = hos::Version_800; break; - case ams::TargetFirmware_810: + case exosphere::TargetFirmware_810: g_hos_version = hos::Version_810; break; - case ams::TargetFirmware_900: + case exosphere::TargetFirmware_900: g_hos_version = hos::Version_900; break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } __atomic_store_n(&g_has_cached, true, __ATOMIC_SEQ_CST); @@ -75,7 +75,7 @@ namespace sts::hos { } - ::sts::hos::Version GetVersion() { + ::ams::hos::Version GetVersion() { CacheValues(); return g_hos_version; } @@ -133,7 +133,7 @@ namespace sts::hos { minor = 0; micro = 0; break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } hosversionSet(MAKEHOSVERSION(major, minor, micro)); } diff --git a/stratosphere/libstratosphere/source/kvdb/kvdb_archive.cpp b/stratosphere/libstratosphere/source/kvdb/kvdb_archive.cpp index 3dce172df..f7f3418de 100644 --- a/stratosphere/libstratosphere/source/kvdb/kvdb_archive.cpp +++ b/stratosphere/libstratosphere/source/kvdb/kvdb_archive.cpp @@ -17,7 +17,7 @@ #include #include -namespace sts::kvdb { +namespace ams::kvdb { namespace { @@ -90,7 +90,7 @@ namespace sts::kvdb { Result ArchiveReader::ReadEntryCount(size_t *out) { /* This should only be called at the start of reading stream. */ - STS_ASSERT(this->offset == 0); + AMS_ASSERT(this->offset == 0); /* Read and validate header. */ ArchiveHeader header; @@ -103,7 +103,7 @@ namespace sts::kvdb { Result ArchiveReader::GetEntrySize(size_t *out_key_size, size_t *out_value_size) { /* This should only be called after ReadEntryCount. */ - STS_ASSERT(this->offset != 0); + AMS_ASSERT(this->offset != 0); /* Peek the next entry header. */ ArchiveEntryHeader header; @@ -117,7 +117,7 @@ namespace sts::kvdb { Result ArchiveReader::ReadEntry(void *out_key, size_t key_size, void *out_value, size_t value_size) { /* This should only be called after ReadEntryCount. */ - STS_ASSERT(this->offset != 0); + AMS_ASSERT(this->offset != 0); /* Read the next entry header. */ ArchiveEntryHeader header; @@ -125,8 +125,8 @@ namespace sts::kvdb { R_TRY(header.Validate()); /* Key size and Value size must be correct. */ - STS_ASSERT(key_size == header.key_size); - STS_ASSERT(value_size == header.value_size); + AMS_ASSERT(key_size == header.key_size); + AMS_ASSERT(value_size == header.value_size); R_ASSERT(this->Read(out_key, key_size)); R_ASSERT(this->Read(out_value, value_size)); @@ -147,7 +147,7 @@ namespace sts::kvdb { void ArchiveWriter::WriteHeader(size_t entry_count) { /* This should only be called at start of write. */ - STS_ASSERT(this->offset == 0); + AMS_ASSERT(this->offset == 0); ArchiveHeader header = ArchiveHeader::Make(entry_count); R_ASSERT(this->Write(&header, sizeof(header))); @@ -155,7 +155,7 @@ namespace sts::kvdb { void ArchiveWriter::WriteEntry(const void *key, size_t key_size, const void *value, size_t value_size) { /* This should only be called after writing header. */ - STS_ASSERT(this->offset != 0); + AMS_ASSERT(this->offset != 0); ArchiveEntryHeader header = ArchiveEntryHeader::Make(key_size, value_size); R_ASSERT(this->Write(&header, sizeof(header))); diff --git a/stratosphere/libstratosphere/source/kvdb/kvdb_file_key_value_store.cpp b/stratosphere/libstratosphere/source/kvdb/kvdb_file_key_value_store.cpp index d4ec971cb..7b23e4c38 100644 --- a/stratosphere/libstratosphere/source/kvdb/kvdb_file_key_value_store.cpp +++ b/stratosphere/libstratosphere/source/kvdb/kvdb_file_key_value_store.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::kvdb { +namespace ams::kvdb { /* Cache implementation. */ void *FileKeyValueStore::Cache::Allocate(size_t size) { @@ -57,7 +57,7 @@ namespace sts::kvdb { this->backing_buffer_free_offset = 0; this->count = 0; this->entries = static_castentries)>(this->Allocate(sizeof(*this->entries) * this->capacity)); - STS_ASSERT(this->entries != nullptr); + AMS_ASSERT(this->entries != nullptr); } std::optional FileKeyValueStore::Cache::TryGet(void *out_value, size_t max_out_size, const void *key, size_t key_size) { @@ -104,7 +104,7 @@ namespace sts::kvdb { } /* Ensure key size is small enough. */ - STS_ASSERT(key_size <= MaxKeySize); + AMS_ASSERT(key_size <= MaxKeySize); /* If we're at capacity, invalidate the cache. */ if (this->count == this->capacity) { diff --git a/stratosphere/libstratosphere/source/ldr/ldr_pm_api.cpp b/stratosphere/libstratosphere/source/ldr/ldr_pm_api.cpp index 4f4e5e0f4..6e213438a 100644 --- a/stratosphere/libstratosphere/source/ldr/ldr_pm_api.cpp +++ b/stratosphere/libstratosphere/source/ldr/ldr_pm_api.cpp @@ -21,7 +21,7 @@ #include "ldr_ams.h" -namespace sts::ldr::pm { +namespace ams::ldr::pm { /* Information API. */ Result CreateProcess(Handle *out, PinId pin_id, u32 flags, Handle reslimit) { diff --git a/stratosphere/libstratosphere/source/map/map_api.cpp b/stratosphere/libstratosphere/source/map/map_api.cpp index 11fb68426..d3e5ef333 100644 --- a/stratosphere/libstratosphere/source/map/map_api.cpp +++ b/stratosphere/libstratosphere/source/map/map_api.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::map { +namespace ams::map { namespace { @@ -106,7 +106,7 @@ namespace sts::map { R_TRY(GetProcessAddressSpaceInfo(&address_space, process_handle)); if (size > address_space.aslr_size) { - return ro::ResultInsufficientAddressSpace(); + return ro::ResultOutOfAddressSpace(); } uintptr_t try_address; @@ -129,7 +129,7 @@ namespace sts::map { return ResultSuccess(); } - return ro::ResultInsufficientAddressSpace();; + return ro::ResultOutOfAddressSpace(); } Result MapCodeMemoryInProcessModern(MappedCodeMemory &out_mcm, Handle process_handle, uintptr_t base_address, size_t size) { @@ -137,7 +137,7 @@ namespace sts::map { R_TRY(GetProcessAddressSpaceInfo(&address_space, process_handle)); if (size > address_space.aslr_size) { - return ro::ResultInsufficientAddressSpace();; + return ro::ResultOutOfAddressSpace(); } uintptr_t try_address; @@ -169,7 +169,7 @@ namespace sts::map { return ResultSuccess(); } - return ro::ResultInsufficientAddressSpace();; + return ro::ResultOutOfAddressSpace(); } } diff --git a/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.cpp b/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.cpp index a96a13166..d6a5b31c9 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.cpp +++ b/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.cpp @@ -16,7 +16,7 @@ #include #include "os_inter_process_event.hpp" -namespace sts::os::impl { +namespace ams::os::impl { namespace { @@ -40,7 +40,7 @@ namespace sts::os::impl { } Result InterProcessEvent::Initialize(bool autoclear) { - STS_ASSERT(!this->is_initialized); + AMS_ASSERT(!this->is_initialized); Handle rh, wh; R_TRY(CreateEventHandles(&rh, &wh)); this->Initialize(rh, true, wh, true, autoclear); @@ -48,8 +48,8 @@ namespace sts::os::impl { } void InterProcessEvent::Initialize(Handle read_handle, bool manage_read_handle, Handle write_handle, bool manage_write_handle, bool autoclear) { - STS_ASSERT(!this->is_initialized); - STS_ASSERT(read_handle != INVALID_HANDLE || write_handle != INVALID_HANDLE); + AMS_ASSERT(!this->is_initialized); + AMS_ASSERT(read_handle != INVALID_HANDLE || write_handle != INVALID_HANDLE); this->read_handle = read_handle; this->manage_read_handle = manage_read_handle; this->write_handle = write_handle; @@ -59,30 +59,30 @@ namespace sts::os::impl { } Handle InterProcessEvent::DetachReadableHandle() { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); const Handle handle = this->read_handle; - STS_ASSERT(handle != INVALID_HANDLE); + AMS_ASSERT(handle != INVALID_HANDLE); this->read_handle = INVALID_HANDLE; this->manage_read_handle = false; return handle; } Handle InterProcessEvent::DetachWritableHandle() { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); const Handle handle = this->write_handle; - STS_ASSERT(handle != INVALID_HANDLE); + AMS_ASSERT(handle != INVALID_HANDLE); this->write_handle = INVALID_HANDLE; this->manage_write_handle = false; return handle; } Handle InterProcessEvent::GetReadableHandle() const { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); return this->read_handle; } Handle InterProcessEvent::GetWritableHandle() const { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); return this->write_handle; } diff --git a/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.hpp b/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.hpp index 98f5d9748..ad3d56e87 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_inter_process_event.hpp @@ -17,7 +17,7 @@ #pragma once #include -namespace sts::os::impl { +namespace ams::os::impl { class WaitableHolderOfInterProcessEvent; diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_base.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_base.hpp index dbe229bda..d0fd901b5 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_base.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_base.hpp @@ -16,7 +16,7 @@ #pragma once #include -namespace sts::os::impl { +namespace ams::os::impl { class WaitableObjectList; class WaitableManagerImpl; diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_impl.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_impl.hpp index 59fe202b9..ccd7a335f 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_impl.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_impl.hpp @@ -21,7 +21,7 @@ #include "os_waitable_holder_of_thread.hpp" #include "os_waitable_holder_of_message_queue.hpp" -namespace sts::os::impl { +namespace ams::os::impl { struct WaitableHolderImpl { union { @@ -36,7 +36,7 @@ namespace sts::os::impl { }; #define CHECK_HOLDER(T) \ - static_assert(std::is_base_of<::sts::os::impl::WaitableHolderBase, T>::value && std::is_trivially_destructible::value, #T) + static_assert(std::is_base_of<::ams::os::impl::WaitableHolderBase, T>::value && std::is_trivially_destructible::value, #T) CHECK_HOLDER(WaitableHolderOfHandle); CHECK_HOLDER(WaitableHolderOfEvent); diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_event.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_event.hpp index fc440fac7..cafb4c5af 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_event.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_event.hpp @@ -17,7 +17,7 @@ #include "os_waitable_holder_base.hpp" #include "os_waitable_object_list.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableHolderOfEvent : public WaitableHolderOfUserObject { private: diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_handle.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_handle.hpp index f11acf704..67843c6d9 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_handle.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_handle.hpp @@ -16,7 +16,7 @@ #pragma once #include "os_waitable_holder_base.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableHolderOfHandle : public WaitableHolderOfKernelObject { private: diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_inter_process_event.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_inter_process_event.hpp index 8439a7b67..6ff58989b 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_inter_process_event.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_inter_process_event.hpp @@ -17,7 +17,7 @@ #include "os_waitable_holder_base.hpp" #include "os_inter_process_event.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableHolderOfInterProcessEvent : public WaitableHolderOfKernelObject { private: @@ -31,7 +31,7 @@ namespace sts::os::impl { } virtual Handle GetHandle() const override { - STS_ASSERT(this->event->is_initialized); + AMS_ASSERT(this->event->is_initialized); return this->event->GetReadableHandle(); } }; diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_interrupt_event.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_interrupt_event.hpp index f54952c37..43706c273 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_interrupt_event.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_interrupt_event.hpp @@ -16,7 +16,7 @@ #pragma once #include "os_waitable_holder_base.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableHolderOfInterruptEvent : public WaitableHolderOfKernelObject { private: @@ -30,7 +30,7 @@ namespace sts::os::impl { } virtual Handle GetHandle() const override { - STS_ASSERT(this->event->is_initialized); + AMS_ASSERT(this->event->is_initialized); return this->event->handle.Get(); } }; diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_message_queue.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_message_queue.hpp index d85c6123e..ff5aefa62 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_message_queue.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_message_queue.hpp @@ -17,7 +17,7 @@ #include "os_waitable_holder_base.hpp" #include "os_waitable_object_list.hpp" -namespace sts::os::impl { +namespace ams::os::impl { template class WaitableHolderOfMessageQueue : public WaitableHolderOfUserObject { diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_thread.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_thread.hpp index 844eaf8b4..6e489556f 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_thread.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_holder_of_thread.hpp @@ -16,7 +16,7 @@ #pragma once #include "os_waitable_holder_base.hpp" -namespace sts::os::impl { +namespace ams::os::impl { /* Nintendo implements this as a user wait object, operating on Thread state. */ /* Libnx doesn't have an equivalent, so we'll use the thread's handle for kernel semantics. */ diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp index a30f36bc5..d448b95ba 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.cpp @@ -16,7 +16,7 @@ #include "os_waitable_manager_impl.hpp" #include "os_waitable_object_list.hpp" -namespace sts::os::impl{ +namespace ams::os::impl{ WaitableHolderBase *WaitableManagerImpl::WaitAnyImpl(bool infinite, u64 timeout) { /* Set processing thread handle while in scope. */ @@ -64,7 +64,7 @@ namespace sts::os::impl{ index = WaitTimedOut; } else { index = this->WaitSynchronization(object_handles, count, min_timeout); - STS_ASSERT(index != WaitInvalid); + AMS_ASSERT(index != WaitInvalid); } switch (index) { @@ -115,7 +115,7 @@ namespace sts::os::impl{ for (WaitableHolderBase &holder_base : this->waitable_list) { if (Handle handle = holder_base.GetHandle(); handle != INVALID_HANDLE) { - STS_ASSERT(count < MaximumHandleCount); + AMS_ASSERT(count < MaximumHandleCount); out_handles[count] = handle; out_objects[count] = &holder_base; diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp index bea1a0f29..af889c6b1 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_manager_impl.hpp @@ -16,7 +16,7 @@ #pragma once #include "os_waitable_holder_base.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableManagerImpl { public: diff --git a/stratosphere/libstratosphere/source/os/impl/os_waitable_object_list.hpp b/stratosphere/libstratosphere/source/os/impl/os_waitable_object_list.hpp index 7129b6613..71660ad33 100644 --- a/stratosphere/libstratosphere/source/os/impl/os_waitable_object_list.hpp +++ b/stratosphere/libstratosphere/source/os/impl/os_waitable_object_list.hpp @@ -17,7 +17,7 @@ #include "os_waitable_holder_base.hpp" #include "os_waitable_manager_impl.hpp" -namespace sts::os::impl { +namespace ams::os::impl { class WaitableObjectList { public: diff --git a/stratosphere/libstratosphere/source/os/os_event.cpp b/stratosphere/libstratosphere/source/os/os_event.cpp index 51b5ebe10..0aa4d3485 100644 --- a/stratosphere/libstratosphere/source/os/os_event.cpp +++ b/stratosphere/libstratosphere/source/os/os_event.cpp @@ -16,7 +16,7 @@ #include #include "impl/os_waitable_object_list.hpp" -namespace sts::os { +namespace ams::os { Event::Event(bool a, bool s) : auto_clear(a), signaled(s) { new (GetPointer(this->waitable_object_list_storage)) impl::WaitableObjectList(); diff --git a/stratosphere/libstratosphere/source/os/os_interrupt_event.cpp b/stratosphere/libstratosphere/source/os/os_interrupt_event.cpp index 624e14a99..4fdeba40b 100644 --- a/stratosphere/libstratosphere/source/os/os_interrupt_event.cpp +++ b/stratosphere/libstratosphere/source/os/os_interrupt_event.cpp @@ -16,10 +16,10 @@ #include #include "impl/os_waitable_object_list.hpp" -namespace sts::os { +namespace ams::os { Result InterruptEvent::Initialize(u32 interrupt_id, bool autoclear) { - STS_ASSERT(!this->is_initialized); + AMS_ASSERT(!this->is_initialized); this->auto_clear = autoclear; const auto type = this->auto_clear ? svc::InterruptType_Edge : svc::InterruptType_Level; @@ -30,7 +30,7 @@ namespace sts::os { } void InterruptEvent::Finalize() { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); R_ASSERT(svcCloseHandle(this->handle.Move())); this->auto_clear = true; this->is_initialized = false; @@ -46,7 +46,7 @@ namespace sts::os { } void InterruptEvent::Wait() { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); while (true) { /* Continuously wait, until success. */ @@ -66,7 +66,7 @@ namespace sts::os { } bool InterruptEvent::TryWait() { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); if (this->auto_clear) { /* Auto-clear. Just try to reset. */ @@ -87,7 +87,7 @@ namespace sts::os { } bool InterruptEvent::TimedWait(u64 ns) { - STS_ASSERT(this->is_initialized); + AMS_ASSERT(this->is_initialized); TimeoutHelper timeout_helper(ns); while (true) { diff --git a/stratosphere/libstratosphere/source/os/os_message_queue.cpp b/stratosphere/libstratosphere/source/os/os_message_queue.cpp index 26b1ae6d4..6d0a547a3 100644 --- a/stratosphere/libstratosphere/source/os/os_message_queue.cpp +++ b/stratosphere/libstratosphere/source/os/os_message_queue.cpp @@ -16,7 +16,7 @@ #include #include "impl/os_waitable_object_list.hpp" -namespace sts::os { +namespace ams::os { MessageQueue::MessageQueue(std::unique_ptr buf, size_t c): buffer(std::move(buf)), capacity(c) { new (GetPointer(this->waitable_object_list_storage)) impl::WaitableObjectList(); @@ -28,7 +28,7 @@ namespace sts::os { void MessageQueue::SendInternal(uintptr_t data) { /* Ensure we don't corrupt the queue, but this should never happen. */ - STS_ASSERT(this->count < this->capacity); + AMS_ASSERT(this->count < this->capacity); /* Write data to tail of queue. */ this->buffer[(this->count++ + this->offset) % this->capacity] = data; @@ -36,7 +36,7 @@ namespace sts::os { void MessageQueue::SendNextInternal(uintptr_t data) { /* Ensure we don't corrupt the queue, but this should never happen. */ - STS_ASSERT(this->count < this->capacity); + AMS_ASSERT(this->count < this->capacity); /* Write data to head of queue. */ this->offset = (this->offset + this->capacity - 1) % this->capacity; @@ -46,7 +46,7 @@ namespace sts::os { uintptr_t MessageQueue::ReceiveInternal() { /* Ensure we don't corrupt the queue, but this should never happen. */ - STS_ASSERT(this->count > 0); + AMS_ASSERT(this->count > 0); uintptr_t data = this->buffer[this->offset]; this->offset = (this->offset + 1) % this->capacity; @@ -56,7 +56,7 @@ namespace sts::os { uintptr_t MessageQueue::PeekInternal() { /* Ensure we don't corrupt the queue, but this should never happen. */ - STS_ASSERT(this->count > 0); + AMS_ASSERT(this->count > 0); return this->buffer[this->offset]; } diff --git a/stratosphere/libstratosphere/source/os/os_system_event.cpp b/stratosphere/libstratosphere/source/os/os_system_event.cpp index 2ef82542e..3933e8b54 100644 --- a/stratosphere/libstratosphere/source/os/os_system_event.cpp +++ b/stratosphere/libstratosphere/source/os/os_system_event.cpp @@ -16,7 +16,7 @@ #include #include "impl/os_waitable_holder_impl.hpp" -namespace sts::os { +namespace ams::os { SystemEvent::SystemEvent(bool inter_process, bool autoclear) : state(SystemEventState::Uninitialized) { if (inter_process) { @@ -35,34 +35,34 @@ namespace sts::os { } Event &SystemEvent::GetEvent() { - STS_ASSERT(this->state == SystemEventState::Event); + AMS_ASSERT(this->state == SystemEventState::Event); return GetReference(this->storage_for_event); } const Event &SystemEvent::GetEvent() const { - STS_ASSERT(this->state == SystemEventState::Event); + AMS_ASSERT(this->state == SystemEventState::Event); return GetReference(this->storage_for_event); } impl::InterProcessEvent &SystemEvent::GetInterProcessEvent() { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return GetReference(this->storage_for_inter_process_event); } const impl::InterProcessEvent &SystemEvent::GetInterProcessEvent() const { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return GetReference(this->storage_for_inter_process_event); } Result SystemEvent::InitializeAsEvent(bool autoclear) { - STS_ASSERT(this->state == SystemEventState::Uninitialized); + AMS_ASSERT(this->state == SystemEventState::Uninitialized); new (GetPointer(this->storage_for_event)) Event(autoclear); this->state = SystemEventState::Event; return ResultSuccess(); } Result SystemEvent::InitializeAsInterProcessEvent(bool autoclear) { - STS_ASSERT(this->state == SystemEventState::Uninitialized); + AMS_ASSERT(this->state == SystemEventState::Uninitialized); new (GetPointer(this->storage_for_inter_process_event)) impl::InterProcessEvent(); this->state = SystemEventState::InterProcessEvent; @@ -77,7 +77,7 @@ namespace sts::os { } void SystemEvent::AttachHandles(Handle read_handle, bool manage_read_handle, Handle write_handle, bool manage_write_handle, bool autoclear) { - STS_ASSERT(this->state == SystemEventState::Uninitialized); + AMS_ASSERT(this->state == SystemEventState::Uninitialized); new (GetPointer(this->storage_for_inter_process_event)) impl::InterProcessEvent(); this->state = SystemEventState::InterProcessEvent; this->GetInterProcessEvent().Initialize(read_handle, manage_read_handle, write_handle, manage_write_handle, autoclear); @@ -92,22 +92,22 @@ namespace sts::os { } Handle SystemEvent::DetachReadableHandle() { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return this->GetInterProcessEvent().DetachReadableHandle(); } Handle SystemEvent::DetachWritableHandle() { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return this->GetInterProcessEvent().DetachWritableHandle(); } Handle SystemEvent::GetReadableHandle() const { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return this->GetInterProcessEvent().GetReadableHandle(); } Handle SystemEvent::GetWritableHandle() const { - STS_ASSERT(this->state == SystemEventState::InterProcessEvent); + AMS_ASSERT(this->state == SystemEventState::InterProcessEvent); return this->GetInterProcessEvent().GetWritableHandle(); } @@ -121,7 +121,7 @@ namespace sts::os { case SystemEventState::InterProcessEvent: this->GetInterProcessEvent().~InterProcessEvent(); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } this->state = SystemEventState::Uninitialized; } @@ -135,7 +135,7 @@ namespace sts::os { this->GetInterProcessEvent().Signal(); break; case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -148,7 +148,7 @@ namespace sts::os { this->GetInterProcessEvent().Reset(); break; case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } void SystemEvent::Wait() { @@ -160,7 +160,7 @@ namespace sts::os { this->GetInterProcessEvent().Wait(); break; case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -171,7 +171,7 @@ namespace sts::os { case SystemEventState::InterProcessEvent: return this->GetInterProcessEvent().TryWait(); case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -182,7 +182,7 @@ namespace sts::os { case SystemEventState::InterProcessEvent: return this->GetInterProcessEvent().TimedWait(ns); case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } } diff --git a/stratosphere/libstratosphere/source/os/os_waitable_holder.cpp b/stratosphere/libstratosphere/source/os/os_waitable_holder.cpp index b908f3d07..e0f03b52f 100644 --- a/stratosphere/libstratosphere/source/os/os_waitable_holder.cpp +++ b/stratosphere/libstratosphere/source/os/os_waitable_holder.cpp @@ -17,11 +17,11 @@ #include "impl/os_waitable_holder_impl.hpp" #include "impl/os_waitable_manager_impl.hpp" -namespace sts::os { +namespace ams::os { WaitableHolder::WaitableHolder(Handle handle) { /* Don't allow invalid handles. */ - STS_ASSERT(handle != INVALID_HANDLE); + AMS_ASSERT(handle != INVALID_HANDLE); /* Initialize appropriate holder. */ new (GetPointer(this->impl_storage)) impl::WaitableHolderOfHandle(handle); @@ -48,7 +48,7 @@ namespace sts::os { new (GetPointer(this->impl_storage)) impl::WaitableHolderOfInterProcessEvent(&event->GetInterProcessEvent()); break; case SystemEventState::Uninitialized: - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } /* Set user-data. */ @@ -80,7 +80,7 @@ namespace sts::os { case MessageQueueWaitKind::ForNotEmpty: new (GetPointer(this->impl_storage)) impl::WaitableHolderOfMessageQueueForNotEmpty(message_queue); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } /* Set user-data. */ @@ -91,7 +91,7 @@ namespace sts::os { auto holder_base = reinterpret_cast(GetPointer(this->impl_storage)); /* Don't allow destruction of a linked waitable holder. */ - STS_ASSERT(!holder_base->IsLinkedToManager()); + AMS_ASSERT(!holder_base->IsLinkedToManager()); holder_base->~WaitableHolderBase(); } @@ -100,7 +100,7 @@ namespace sts::os { auto holder_base = reinterpret_cast(GetPointer(this->impl_storage)); /* Don't allow unlinking of an unlinked holder. */ - STS_ASSERT(holder_base->IsLinkedToManager()); + AMS_ASSERT(holder_base->IsLinkedToManager()); holder_base->GetManager()->UnlinkWaitableHolder(*holder_base); holder_base->SetManager(nullptr); diff --git a/stratosphere/libstratosphere/source/os/os_waitable_manager.cpp b/stratosphere/libstratosphere/source/os/os_waitable_manager.cpp index bfec7eda7..434ddfbd6 100644 --- a/stratosphere/libstratosphere/source/os/os_waitable_manager.cpp +++ b/stratosphere/libstratosphere/source/os/os_waitable_manager.cpp @@ -17,7 +17,7 @@ #include "impl/os_waitable_holder_impl.hpp" #include "impl/os_waitable_manager_impl.hpp" -namespace sts::os { +namespace ams::os { WaitableManager::WaitableManager() { /* Initialize storage. */ @@ -28,7 +28,7 @@ namespace sts::os { auto &impl = GetReference(this->impl_storage); /* Don't allow destruction of a non-empty waitable holder. */ - STS_ASSERT(impl.IsEmpty()); + AMS_ASSERT(impl.IsEmpty()); impl.~WaitableManagerImpl(); } @@ -39,7 +39,7 @@ namespace sts::os { auto &impl = GetReference(this->impl_storage); /* Don't allow waiting on empty list. */ - STS_ASSERT(!impl.IsEmpty()); + AMS_ASSERT(!impl.IsEmpty()); return reinterpret_cast(impl.WaitAny()); } @@ -48,7 +48,7 @@ namespace sts::os { auto &impl = GetReference(this->impl_storage); /* Don't allow waiting on empty list. */ - STS_ASSERT(!impl.IsEmpty()); + AMS_ASSERT(!impl.IsEmpty()); return reinterpret_cast(impl.TryWaitAny()); } @@ -57,7 +57,7 @@ namespace sts::os { auto &impl = GetReference(this->impl_storage); /* Don't allow waiting on empty list. */ - STS_ASSERT(!impl.IsEmpty()); + AMS_ASSERT(!impl.IsEmpty()); return reinterpret_cast(impl.TimedWaitAny(timeout)); } @@ -68,7 +68,7 @@ namespace sts::os { auto holder_base = reinterpret_cast(GetPointer(holder->impl_storage)); /* Don't allow double-linking a holder. */ - STS_ASSERT(!holder_base->IsLinkedToManager()); + AMS_ASSERT(!holder_base->IsLinkedToManager()); impl.LinkWaitableHolder(*holder_base); holder_base->SetManager(&impl); diff --git a/stratosphere/libstratosphere/source/patcher/patcher_api.cpp b/stratosphere/libstratosphere/source/patcher/patcher_api.cpp index 63257d7a9..8fbe4a43a 100644 --- a/stratosphere/libstratosphere/source/patcher/patcher_api.cpp +++ b/stratosphere/libstratosphere/source/patcher/patcher_api.cpp @@ -27,7 +27,7 @@ /* IPS Patching adapted from Luma3DS (https://github.com/AuroraWright/Luma3DS/blob/master/sysmodules/loader/source/patcher.c) */ -namespace sts::patcher { +namespace ams::patcher { namespace { @@ -101,11 +101,11 @@ namespace sts::patcher { void ApplyIpsPatch(u8 *mapped_module, size_t mapped_size, size_t protected_size, size_t offset, bool is_ips32, FILE *f_ips) { /* Validate offset/protected size. */ - STS_ASSERT(offset <= protected_size); + AMS_ASSERT(offset <= protected_size); u8 buffer[sizeof(Ips32TailMagic)]; while (true) { - STS_ASSERT(fread(buffer, is_ips32 ? sizeof(Ips32TailMagic) : sizeof(IpsTailMagic), 1, f_ips) == 1); + AMS_ASSERT(fread(buffer, is_ips32 ? sizeof(Ips32TailMagic) : sizeof(IpsTailMagic), 1, f_ips) == 1); if (IsIpsTail(is_ips32, buffer)) { break; @@ -115,18 +115,18 @@ namespace sts::patcher { u32 patch_offset = GetIpsPatchOffset(is_ips32, buffer); /* Size of patch. */ - STS_ASSERT(fread(buffer, 2, 1, f_ips) == 1); + AMS_ASSERT(fread(buffer, 2, 1, f_ips) == 1); u32 patch_size = GetIpsPatchSize(is_ips32, buffer); /* Check for RLE encoding. */ if (patch_size == 0) { /* Size of RLE. */ - STS_ASSERT(fread(buffer, 2, 1, f_ips) == 1); + AMS_ASSERT(fread(buffer, 2, 1, f_ips) == 1); u32 rle_size = (buffer[0] << 8) | (buffer[1]); /* Value for RLE. */ - STS_ASSERT(fread(buffer, 1, 1, f_ips) == 1); + AMS_ASSERT(fread(buffer, 1, 1, f_ips) == 1); /* Ensure we don't write to protected region. */ if (patch_offset < protected_size) { @@ -169,7 +169,7 @@ namespace sts::patcher { if (patch_offset + read_size > mapped_size) { read_size = mapped_size - patch_offset; } - STS_ASSERT(fread(mapped_module + patch_offset, read_size, 1, f_ips) == 1); + AMS_ASSERT(fread(mapped_module + patch_offset, read_size, 1, f_ips) == 1); if (patch_size > read_size) { fseek(f_ips, patch_size - read_size, SEEK_CUR); } diff --git a/stratosphere/libstratosphere/source/pm/pm_boot_mode_api.cpp b/stratosphere/libstratosphere/source/pm/pm_boot_mode_api.cpp index c207b7e7c..5e4e86144 100644 --- a/stratosphere/libstratosphere/source/pm/pm_boot_mode_api.cpp +++ b/stratosphere/libstratosphere/source/pm/pm_boot_mode_api.cpp @@ -17,10 +17,10 @@ #include #include -namespace sts::pm::bm { +namespace ams::pm::bm { /* Boot Mode API. */ - /* Both functions should be weakly linked, so that they can be overridden by sts::boot2 as needed. */ + /* Both functions should be weakly linked, so that they can be overridden by ams::boot2 as needed. */ BootMode WEAK GetBootMode() { PmBootMode boot_mode = PmBootMode_Normal; R_ASSERT(pmbmGetBootMode(&boot_mode)); diff --git a/stratosphere/libstratosphere/source/pm/pm_dmnt_api.cpp b/stratosphere/libstratosphere/source/pm/pm_dmnt_api.cpp index 89ff37495..725346371 100644 --- a/stratosphere/libstratosphere/source/pm/pm_dmnt_api.cpp +++ b/stratosphere/libstratosphere/source/pm/pm_dmnt_api.cpp @@ -20,7 +20,7 @@ #include "pm_ams.h" -namespace sts::pm::dmnt { +namespace ams::pm::dmnt { /* Debug Monitor API. */ Result StartProcess(os::ProcessId process_id) { diff --git a/stratosphere/libstratosphere/source/pm/pm_info_api.cpp b/stratosphere/libstratosphere/source/pm/pm_info_api.cpp index 88e913c11..5685208a9 100644 --- a/stratosphere/libstratosphere/source/pm/pm_info_api.cpp +++ b/stratosphere/libstratosphere/source/pm/pm_info_api.cpp @@ -20,7 +20,7 @@ #include "pm_ams.h" -namespace sts::pm::info { +namespace ams::pm::info { namespace { diff --git a/stratosphere/libstratosphere/source/pm/pm_shell_api.cpp b/stratosphere/libstratosphere/source/pm/pm_shell_api.cpp index f85eb1a33..d7c4dbc97 100644 --- a/stratosphere/libstratosphere/source/pm/pm_shell_api.cpp +++ b/stratosphere/libstratosphere/source/pm/pm_shell_api.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::pm::shell { +namespace ams::pm::shell { /* Shell API. */ Result WEAK LaunchTitle(os::ProcessId *out_process_id, const ncm::TitleLocation &loc, u32 launch_flags) { diff --git a/stratosphere/libstratosphere/source/result/result_on_assertion.cpp b/stratosphere/libstratosphere/source/result/result_on_assertion.cpp index cef621392..160b220fb 100644 --- a/stratosphere/libstratosphere/source/result/result_on_assertion.cpp +++ b/stratosphere/libstratosphere/source/result/result_on_assertion.cpp @@ -16,21 +16,21 @@ #include -namespace sts::result { +namespace ams::result { extern bool CallFatalOnResultAssertion; } -namespace sts::result::impl { +namespace ams::result::impl { NORETURN WEAK void OnResultAssertion(Result result) { /* Assert that we should call fatal on result assertion. */ /* If we shouldn't fatal, this will std::abort(); */ /* If we should, we'll continue onwards. */ - STS_ASSERT((sts::result::CallFatalOnResultAssertion)); + AMS_ASSERT((ams::result::CallFatalOnResultAssertion)); - /* TODO: sts::fatal:: */ + /* TODO: ams::fatal:: */ fatalSimple(result.GetValue()); while (true) { /* ... */ } } diff --git a/stratosphere/libstratosphere/source/rnd/rnd_api.cpp b/stratosphere/libstratosphere/source/rnd/rnd_api.cpp index c9c83bb89..c8cc07dfe 100644 --- a/stratosphere/libstratosphere/source/rnd/rnd_api.cpp +++ b/stratosphere/libstratosphere/source/rnd/rnd_api.cpp @@ -19,7 +19,7 @@ #include #include -namespace sts::rnd { +namespace ams::rnd { namespace { diff --git a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_manager.cpp b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_manager.cpp index 537f451f0..6be09d7cd 100644 --- a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_manager.cpp +++ b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_manager.cpp @@ -15,14 +15,14 @@ */ #include -namespace sts::sf::cmif { +namespace ams::sf::cmif { ServerDomainManager::Domain::~Domain() { while (!this->entries.empty()) { Entry *entry = &this->entries.front(); { std::scoped_lock lk(this->manager->entry_owner_lock); - STS_ASSERT(entry->owner == this); + AMS_ASSERT(entry->owner == this); entry->owner = nullptr; } entry->object.Reset(); @@ -35,7 +35,7 @@ namespace sts::sf::cmif { for (size_t i = 0; i < count; i++) { Entry *entry = this->manager->entry_manager.AllocateEntry(); R_UNLESS(entry != nullptr, sf::cmif::ResultOutOfDomainEntries()); - STS_ASSERT(entry->owner == nullptr); + AMS_ASSERT(entry->owner == nullptr); out_ids[i] = this->manager->entry_manager.GetId(entry); } return ResultSuccess(); @@ -48,18 +48,18 @@ namespace sts::sf::cmif { void ServerDomainManager::Domain::UnreserveIds(const DomainObjectId *ids, size_t count) { for (size_t i = 0; i < count; i++) { Entry *entry = this->manager->entry_manager.GetEntry(ids[i]); - STS_ASSERT(entry != nullptr); - STS_ASSERT(entry->owner == nullptr); + AMS_ASSERT(entry != nullptr); + AMS_ASSERT(entry->owner == nullptr); this->manager->entry_manager.FreeEntry(entry); } } void ServerDomainManager::Domain::RegisterObject(DomainObjectId id, ServiceObjectHolder &&obj) { Entry *entry = this->manager->entry_manager.GetEntry(id); - STS_ASSERT(entry != nullptr); + AMS_ASSERT(entry != nullptr); { std::scoped_lock lk(this->manager->entry_owner_lock); - STS_ASSERT(entry->owner == nullptr); + AMS_ASSERT(entry->owner == nullptr); entry->owner = this; this->entries.push_back(*entry); } @@ -129,8 +129,8 @@ namespace sts::sf::cmif { void ServerDomainManager::EntryManager::FreeEntry(Entry *entry) { std::scoped_lock lk(this->lock); - STS_ASSERT(entry->owner == nullptr); - STS_ASSERT(!entry->object); + AMS_ASSERT(entry->owner == nullptr); + AMS_ASSERT(!entry->object); this->free_list.push_front(*entry); } @@ -142,8 +142,8 @@ namespace sts::sf::cmif { const auto id = ids[i]; Entry *entry = this->GetEntry(id); if (id != InvalidDomainObjectId) { - STS_ASSERT(entry != nullptr); - STS_ASSERT(entry->owner == nullptr); + AMS_ASSERT(entry != nullptr); + AMS_ASSERT(entry->owner == nullptr); this->free_list.erase(this->free_list.iterator_to(*entry)); } } diff --git a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp index 8bdaf0831..57c53bb91 100644 --- a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp +++ b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_domain_service_object.cpp @@ -16,7 +16,7 @@ #include #include -namespace sts::sf::cmif { +namespace ams::sf::cmif { Result DomainServiceObjectDispatchTable::ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const { return this->ProcessMessageImpl(ctx, static_cast(ctx.srv_obj)->GetServerDomain(), in_raw_data); @@ -133,7 +133,7 @@ namespace sts::sf::cmif { /* Write out header. */ constexpr size_t out_header_size = sizeof(CmifDomainOutHeader); const size_t impl_out_data_total_size = this->GetImplOutDataTotalSize(); - STS_ASSERT(out_header_size + impl_out_data_total_size + sizeof(DomainObjectId) * this->GetOutObjectCount() <= raw_data.GetSize()); + AMS_ASSERT(out_header_size + impl_out_data_total_size + sizeof(DomainObjectId) * this->GetOutObjectCount() <= raw_data.GetSize()); *reinterpret_cast(raw_data.GetPointer()) = CmifDomainOutHeader{ .num_out_objects = static_cast(this->GetOutObjectCount()), }; /* Set output raw data. */ @@ -151,7 +151,7 @@ namespace sts::sf::cmif { /* Write out header. */ constexpr size_t out_header_size = sizeof(CmifDomainOutHeader); const size_t impl_out_data_total_size = this->GetImplOutDataTotalSize(); - STS_ASSERT(out_header_size + impl_out_data_total_size <= raw_data.GetSize()); + AMS_ASSERT(out_header_size + impl_out_data_total_size <= raw_data.GetSize()); *reinterpret_cast(raw_data.GetPointer()) = CmifDomainOutHeader{ .num_out_objects = 0, }; /* Set output raw data. */ diff --git a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_dispatch.cpp b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_dispatch.cpp index 4d27bffe2..41e61f37a 100644 --- a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_dispatch.cpp +++ b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_dispatch.cpp @@ -15,7 +15,7 @@ */ #include -namespace sts::sf::cmif { +namespace ams::sf::cmif { Result impl::ServiceDispatchTableBase::ProcessMessageImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const { /* Get versioning info. */ @@ -46,7 +46,7 @@ namespace sts::sf::cmif { /* Forward forwardable results, otherwise ensure we can send result to user. */ R_TRY_CATCH(command_result) { R_CATCH(sf::impl::ResultRequestContextChanged) { return R_CURRENT_RESULT; } - R_CATCH_ALL() { STS_ASSERT(out_header != nullptr); } + R_CATCH_ALL() { AMS_ASSERT(out_header != nullptr); } } R_END_TRY_CATCH; /* Write output header to raw data. */ @@ -89,11 +89,11 @@ namespace sts::sf::cmif { /* Forward forwardable results, otherwise ensure we can send result to user. */ R_TRY_CATCH(command_result) { - R_CATCH(ams::mitm::ResultShouldForwardToSession) { + R_CATCH(sm::mitm::ResultShouldForwardToSession) { return ctx.session->ForwardRequest(ctx); } R_CATCH(sf::impl::ResultRequestContextChanged) { return R_CURRENT_RESULT; } - R_CATCH_ALL() { STS_ASSERT(out_header != nullptr); } + R_CATCH_ALL() { AMS_ASSERT(out_header != nullptr); } } R_END_TRY_CATCH; /* Write output header to raw data. */ diff --git a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_object_holder.cpp b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_object_holder.cpp index 8f03a576e..7bdcc4a10 100644 --- a/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_object_holder.cpp +++ b/stratosphere/libstratosphere/source/sf/cmif/sf_cmif_service_object_holder.cpp @@ -16,7 +16,7 @@ #include #include -namespace sts::sf::cmif { +namespace ams::sf::cmif { Result ServiceObjectHolder::ProcessMessage(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data) const { const auto ProcessHandler = this->dispatch_meta->ProcessHandler; diff --git a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_api.cpp b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_api.cpp index a0994b442..246373ab0 100644 --- a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_api.cpp +++ b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_api.cpp @@ -15,14 +15,14 @@ */ #include -namespace sts::sf::hipc { +namespace ams::sf::hipc { namespace { NX_INLINE Result ReceiveImpl(Handle session_handle, void *message_buf, size_t message_buf_size) { s32 unused_index; if (message_buf == armGetTls()) { - /* Consider: STS_ASSERT(message_buf_size == TlsMessageBufferSize); */ + /* Consider: AMS_ASSERT(message_buf_size == TlsMessageBufferSize); */ return svcReplyAndReceive(&unused_index, &session_handle, 1, INVALID_HANDLE, U64_MAX); } else { return svcReplyAndReceiveWithUserBuffer(&unused_index, message_buf, message_buf_size, &session_handle, 1, INVALID_HANDLE, U64_MAX); @@ -32,7 +32,7 @@ namespace sts::sf::hipc { NX_INLINE Result ReplyImpl(Handle session_handle, void *message_buf, size_t message_buf_size) { s32 unused_index; if (message_buf == armGetTls()) { - /* Consider: STS_ASSERT(message_buf_size == TlsMessageBufferSize); */ + /* Consider: AMS_ASSERT(message_buf_size == TlsMessageBufferSize); */ return svcReplyAndReceive(&unused_index, &session_handle, 0, session_handle, 0); } else { return svcReplyAndReceiveWithUserBuffer(&unused_index, message_buf, message_buf_size, &session_handle, 0, session_handle, 0); @@ -73,7 +73,7 @@ namespace sts::sf::hipc { R_CONVERT(svc::ResultSessionClosed, ResultSuccess()) } R_END_TRY_CATCH; /* ReplyImpl should *always* return an error. */ - STS_ASSERT(false); + AMS_ASSERT(false); } Result CreateSession(Handle *out_server_handle, Handle *out_client_handle) { diff --git a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp index f096d6942..85c4aa419 100644 --- a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp +++ b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_domain_session_manager.cpp @@ -15,7 +15,7 @@ */ #include -namespace sts::sf::hipc { +namespace ams::sf::hipc { namespace impl { @@ -71,7 +71,7 @@ namespace sts::sf::hipc { if (this->is_mitm_session) { /* If we're a mitm session, we need to convert the remote session to domain. */ - STS_ASSERT(session->forward_service->own_handle); + AMS_ASSERT(session->forward_service->own_handle); R_TRY(serviceConvertToDomain(session->forward_service.get())); /* The object ID reservation cannot fail here, as that would cause desynchronization from target domain. */ @@ -94,8 +94,8 @@ namespace sts::sf::hipc { }))); } - STS_ASSERT(object_id != cmif::InvalidDomainObjectId); - STS_ASSERT(static_cast(new_holder)); + AMS_ASSERT(object_id != cmif::InvalidDomainObjectId); + AMS_ASSERT(static_cast(new_holder)); /* We succeeded! */ domain_guard.Cancel(); diff --git a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp index 51726ae4e..563ea2807 100644 --- a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp +++ b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_manager.cpp @@ -15,7 +15,7 @@ */ #include -namespace sts::sf::hipc { +namespace ams::sf::hipc { ServerManagerBase::ServerBase::~ServerBase() { /* Pure virtual destructor, to prevent linker errors. */ } @@ -65,14 +65,14 @@ namespace sts::sf::hipc { void ServerManagerBase::AddUserWaitableHolder(os::WaitableHolder *waitable) { const auto user_data_tag = static_cast(waitable->GetUserData()); - STS_ASSERT(user_data_tag != UserDataTag::Server); - STS_ASSERT(user_data_tag != UserDataTag::MitmServer); - STS_ASSERT(user_data_tag != UserDataTag::Session); + AMS_ASSERT(user_data_tag != UserDataTag::Server); + AMS_ASSERT(user_data_tag != UserDataTag::MitmServer); + AMS_ASSERT(user_data_tag != UserDataTag::Session); this->RegisterToWaitList(waitable); } Result ServerManagerBase::ProcessForServer(os::WaitableHolder *holder) { - STS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::Server); + AMS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::Server); ServerBase *server = static_cast(holder); ON_SCOPE_EXIT { this->RegisterToWaitList(server); }; @@ -83,14 +83,14 @@ namespace sts::sf::hipc { server->CreateSessionObjectHolder(&obj, &fsrv); /* Not a mitm server, so we must have no forward service. */ - STS_ASSERT(fsrv == nullptr); + AMS_ASSERT(fsrv == nullptr); /* Try to accept. */ return this->AcceptSession(server->port_handle, std::move(obj)); } Result ServerManagerBase::ProcessForMitmServer(os::WaitableHolder *holder) { - STS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::MitmServer); + AMS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::MitmServer); ServerBase *server = static_cast(holder); ON_SCOPE_EXIT { this->RegisterToWaitList(server); }; @@ -101,20 +101,20 @@ namespace sts::sf::hipc { server->CreateSessionObjectHolder(&obj, &fsrv); /* Mitm server, so we must have forward service. */ - STS_ASSERT(fsrv != nullptr); + AMS_ASSERT(fsrv != nullptr); /* Try to accept. */ return this->AcceptMitmSession(server->port_handle, std::move(obj), std::move(fsrv)); } Result ServerManagerBase::ProcessForSession(os::WaitableHolder *holder) { - STS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::Session); + AMS_ASSERT(static_cast(holder->GetUserData()) == UserDataTag::Session); ServerSession *session = static_cast(holder); cmif::PointerAndSize tls_message(armGetTls(), hipc::TlsMessageBufferSize); const cmif::PointerAndSize &saved_message = session->saved_message; - STS_ASSERT(tls_message.GetSize() == saved_message.GetSize()); + AMS_ASSERT(tls_message.GetSize() == saved_message.GetSize()); if (!session->has_received) { R_TRY(this->ReceiveRequest(session, tls_message)); session->has_received = true; @@ -180,7 +180,7 @@ namespace sts::sf::hipc { this->ProcessDeferredSessions(); return ResultSuccess(); break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp index 9447445f4..85be7985a 100644 --- a/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp +++ b/stratosphere/libstratosphere/source/sf/hipc/sf_hipc_server_session_manager.cpp @@ -15,7 +15,7 @@ */ #include -namespace sts::sf::hipc { +namespace ams::sf::hipc { namespace { @@ -40,10 +40,10 @@ namespace sts::sf::hipc { } Result ServerSession::ForwardRequest(const cmif::ServiceDispatchContext &ctx) const { - STS_ASSERT(this->IsMitmSession()); + AMS_ASSERT(this->IsMitmSession()); /* TODO: Support non-TLS messages? */ - STS_ASSERT(this->saved_message.GetPointer() != nullptr); - STS_ASSERT(this->saved_message.GetSize() == TlsMessageBufferSize); + AMS_ASSERT(this->saved_message.GetPointer() != nullptr); + AMS_ASSERT(this->saved_message.GetSize() == TlsMessageBufferSize); /* Copy saved TLS in. */ std::memcpy(armGetTls(), this->saved_message.GetPointer(), this->saved_message.GetSize()); @@ -115,7 +115,7 @@ namespace sts::sf::hipc { session_memory->pointer_buffer = this->GetSessionPointerBuffer(session_memory); session_memory->saved_message = this->GetSessionSavedMessageBuffer(session_memory); /* Validate session pointer buffer. */ - STS_ASSERT(session_memory->pointer_buffer.GetSize() >= session_memory->forward_service->pointer_buffer_size); + AMS_ASSERT(session_memory->pointer_buffer.GetSize() >= session_memory->forward_service->pointer_buffer_size); session_memory->pointer_buffer = cmif::PointerAndSize(session_memory->pointer_buffer.GetAddress(), session_memory->forward_service->pointer_buffer_size); /* Register to wait list. */ this->RegisterSessionToWaitList(session_memory); @@ -188,7 +188,7 @@ namespace sts::sf::hipc { return ResultSuccess(); case hipc::ReceiveResult::NeedsRetry: continue; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } } diff --git a/stratosphere/libstratosphere/source/sm/sm_api.cpp b/stratosphere/libstratosphere/source/sm/sm_api.cpp index 11047c6bd..7fa6666ad 100644 --- a/stratosphere/libstratosphere/source/sm/sm_api.cpp +++ b/stratosphere/libstratosphere/source/sm/sm_api.cpp @@ -21,7 +21,7 @@ #include "sm_ams.h" #include "sm_utils.hpp" -namespace sts::sm { +namespace ams::sm { /* Ordinary SM API. */ Result GetService(Service *out, ServiceName name) { diff --git a/stratosphere/libstratosphere/source/sm/sm_manager_api.cpp b/stratosphere/libstratosphere/source/sm/sm_manager_api.cpp index 8318d794c..e00977f28 100644 --- a/stratosphere/libstratosphere/source/sm/sm_manager_api.cpp +++ b/stratosphere/libstratosphere/source/sm/sm_manager_api.cpp @@ -22,7 +22,7 @@ #include "smm_ams.h" #include "sm_utils.hpp" -namespace sts::sm::manager { +namespace ams::sm::manager { /* Manager API. */ Result RegisterProcess(os::ProcessId process_id, ncm::TitleId title_id, const void *acid, size_t acid_size, const void *aci, size_t aci_size) { diff --git a/stratosphere/libstratosphere/source/sm/sm_mitm_api.cpp b/stratosphere/libstratosphere/source/sm/sm_mitm_api.cpp index 09b97ae2d..0f475b85e 100644 --- a/stratosphere/libstratosphere/source/sm/sm_mitm_api.cpp +++ b/stratosphere/libstratosphere/source/sm/sm_mitm_api.cpp @@ -21,7 +21,7 @@ #include "sm_ams.h" #include "sm_utils.hpp" -namespace sts::sm::mitm { +namespace ams::sm::mitm { /* Mitm API. */ Result InstallMitm(Handle *out_port, Handle *out_query, ServiceName name) { diff --git a/stratosphere/libstratosphere/source/sm/sm_utils.cpp b/stratosphere/libstratosphere/source/sm/sm_utils.cpp index 460fce338..4f553faad 100644 --- a/stratosphere/libstratosphere/source/sm/sm_utils.cpp +++ b/stratosphere/libstratosphere/source/sm/sm_utils.cpp @@ -16,7 +16,7 @@ #include "sm_utils.hpp" -namespace sts::sm::impl { +namespace ams::sm::impl { namespace { diff --git a/stratosphere/libstratosphere/source/sm/sm_utils.hpp b/stratosphere/libstratosphere/source/sm/sm_utils.hpp index c1cd9ed78..5a15bf6c7 100644 --- a/stratosphere/libstratosphere/source/sm/sm_utils.hpp +++ b/stratosphere/libstratosphere/source/sm/sm_utils.hpp @@ -22,7 +22,7 @@ #include "sm_ams.h" -namespace sts::sm::impl { +namespace ams::sm::impl { /* Utilities. */ os::RecursiveMutex &GetUserSessionMutex(); diff --git a/stratosphere/libstratosphere/source/spl/smc/spl_smc.cpp b/stratosphere/libstratosphere/source/spl/smc/spl_smc.cpp index 8b3c97339..b8692755c 100644 --- a/stratosphere/libstratosphere/source/spl/smc/spl_smc.cpp +++ b/stratosphere/libstratosphere/source/spl/smc/spl_smc.cpp @@ -18,7 +18,7 @@ #include #include -namespace sts::spl::smc { +namespace ams::spl::smc { Result SetConfig(SplConfigItem which, const u64 *value, size_t num_qwords) { SecmonArgs args; @@ -352,7 +352,7 @@ namespace sts::spl::smc { } Result AtmosphereWriteAddress(void *dst, const void *src, size_t size) { - STS_ASSERT(size <= sizeof(u64)); + AMS_ASSERT(size <= sizeof(u64)); SecmonArgs args; args.X[0] = static_cast(FunctionId::AtmosphereWriteAddress); diff --git a/stratosphere/libstratosphere/source/spl/spl_api.cpp b/stratosphere/libstratosphere/source/spl/spl_api.cpp index 23c3eb2ba..a9bc8f1f5 100644 --- a/stratosphere/libstratosphere/source/spl/spl_api.cpp +++ b/stratosphere/libstratosphere/source/spl/spl_api.cpp @@ -17,7 +17,7 @@ #include #include -namespace sts::spl { +namespace ams::spl { HardwareType GetHardwareType() { u64 out_val = 0; @@ -70,7 +70,7 @@ namespace sts::spl { case HardwareType::Hoag: case HardwareType::Iowa: return true; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/libstratosphere/source/updater/updater_api.cpp b/stratosphere/libstratosphere/source/updater/updater_api.cpp index a573d83d6..362424106 100644 --- a/stratosphere/libstratosphere/source/updater/updater_api.cpp +++ b/stratosphere/libstratosphere/source/updater/updater_api.cpp @@ -22,7 +22,7 @@ #include "updater_files.hpp" #include "updater_paths.hpp" -namespace sts::updater { +namespace ams::updater { namespace { @@ -72,7 +72,7 @@ namespace sts::updater { return true; case BootImageUpdateType::Mariko: return false; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -82,7 +82,7 @@ namespace sts::updater { return true; case BootImageUpdateType::Mariko: return false; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -92,7 +92,7 @@ namespace sts::updater { return NcmContentMetaType_BootImagePackage; case BootModeType::Safe: return NcmContentMetaType_BootImagePackageSafe; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -139,7 +139,7 @@ namespace sts::updater { Result GetBootImagePackageDataId(u64 *out_data_id, BootModeType mode, void *work_buffer, size_t work_buffer_size) { /* Ensure we can read content metas. */ constexpr size_t MaxContentMetas = 0x40; - STS_ASSERT(work_buffer_size >= sizeof(NcmContentMetaKey) * MaxContentMetas); + AMS_ASSERT(work_buffer_size >= sizeof(NcmContentMetaKey) * MaxContentMetas); /* Open NAND System meta database, list contents. */ NcmContentMetaDatabase meta_db; @@ -156,7 +156,7 @@ namespace sts::updater { return ResultBootImagePackageNotFound(); } - STS_ASSERT(total_entries == written_entries); + AMS_ASSERT(total_entries == written_entries); /* Output is sorted, return the lowest valid exfat entry. */ if (total_entries > 1) { @@ -182,7 +182,7 @@ namespace sts::updater { return VerifyBootImagesNormal(data_id, work_buffer, work_buffer_size, boot_image_update_type); case BootModeType::Safe: return VerifyBootImagesSafe(data_id, work_buffer, work_buffer_size, boot_image_update_type); - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -303,7 +303,7 @@ namespace sts::updater { return UpdateBootImagesNormal(data_id, work_buffer, work_buffer_size, boot_image_update_type); case BootModeType::Safe: return UpdateBootImagesSafe(data_id, work_buffer, work_buffer_size, boot_image_update_type); - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -340,7 +340,7 @@ namespace sts::updater { } /* Only preserve autorcm if on a unit with unpatched rcm bug. */ - if (HasAutoRcmPreserve(boot_image_update_type) && !ams::IsRcmBugPatched()) { + if (HasAutoRcmPreserve(boot_image_update_type) && !exosphere::IsRcmBugPatched()) { R_TRY(boot0_accessor.PreserveAutoRcm(bct, work, Boot0Partition::BctNormalSub)); R_TRY(boot0_accessor.Write(bct, BctSize, Boot0Partition::BctNormalSub)); R_TRY(boot0_accessor.PreserveAutoRcm(bct, work, Boot0Partition::BctNormalMain)); @@ -399,7 +399,7 @@ namespace sts::updater { R_TRY(boot0_accessor.UpdateEks(bct, work)); } /* Only preserve autorcm if on a unit with unpatched rcm bug. */ - if (HasAutoRcmPreserve(boot_image_update_type) && !ams::IsRcmBugPatched()) { + if (HasAutoRcmPreserve(boot_image_update_type) && !exosphere::IsRcmBugPatched()) { R_TRY(boot0_accessor.PreserveAutoRcm(bct, work, Boot0Partition::BctSafeSub)); R_TRY(boot0_accessor.Write(bct, BctSize, Boot0Partition::BctSafeSub)); R_TRY(boot0_accessor.PreserveAutoRcm(bct, work, Boot0Partition::BctSafeMain)); @@ -492,7 +492,7 @@ namespace sts::updater { case spl::HardwareType::Hoag: case spl::HardwareType::Iowa: return BootImageUpdateType::Mariko; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/libstratosphere/source/updater/updater_bis_management.cpp b/stratosphere/libstratosphere/source/updater/updater_bis_management.cpp index d90421f61..879810d90 100644 --- a/stratosphere/libstratosphere/source/updater/updater_bis_management.cpp +++ b/stratosphere/libstratosphere/source/updater/updater_bis_management.cpp @@ -19,7 +19,7 @@ #include "updater_bis_management.hpp" -namespace sts::updater { +namespace ams::updater { Result BisAccessor::Initialize() { R_TRY(fsOpenBisStorage(&this->storage, this->partition_id)); @@ -35,18 +35,18 @@ namespace sts::updater { } Result BisAccessor::Read(void *dst, size_t size, u64 offset) { - STS_ASSERT((offset % SectorAlignment) == 0); + AMS_ASSERT((offset % SectorAlignment) == 0); return fsStorageRead(&this->storage, offset, dst, size); } Result BisAccessor::Write(u64 offset, const void *src, size_t size) { - STS_ASSERT((offset % SectorAlignment) == 0); + AMS_ASSERT((offset % SectorAlignment) == 0); return fsStorageWrite(&this->storage, offset, src, size); } Result BisAccessor::Write(u64 offset, size_t size, const char *bip_path, void *work_buffer, size_t work_buffer_size) { - STS_ASSERT((offset % SectorAlignment) == 0); - STS_ASSERT((work_buffer_size % SectorAlignment) == 0); + AMS_ASSERT((offset % SectorAlignment) == 0); + AMS_ASSERT((work_buffer_size % SectorAlignment) == 0); FILE *bip_fp = fopen(bip_path, "rb"); if (bip_fp == NULL) { @@ -63,7 +63,7 @@ namespace sts::updater { return fsdevGetLastResult(); } } - STS_ASSERT(written + read_size <= size); + AMS_ASSERT(written + read_size <= size); size_t aligned_size = ((read_size + SectorAlignment - 1) / SectorAlignment) * SectorAlignment; R_TRY(this->Write(offset + written, work_buffer, aligned_size)); @@ -77,8 +77,8 @@ namespace sts::updater { } Result BisAccessor::Clear(u64 offset, u64 size, void *work_buffer, size_t work_buffer_size) { - STS_ASSERT((offset % SectorAlignment) == 0); - STS_ASSERT((work_buffer_size % SectorAlignment) == 0); + AMS_ASSERT((offset % SectorAlignment) == 0); + AMS_ASSERT((work_buffer_size % SectorAlignment) == 0); std::memset(work_buffer, 0, work_buffer_size); @@ -92,8 +92,8 @@ namespace sts::updater { } Result BisAccessor::GetHash(void *dst, u64 offset, u64 size, u64 hash_size, void *work_buffer, size_t work_buffer_size) { - STS_ASSERT((offset % SectorAlignment) == 0); - STS_ASSERT((work_buffer_size % SectorAlignment) == 0); + AMS_ASSERT((offset % SectorAlignment) == 0); + AMS_ASSERT((work_buffer_size % SectorAlignment) == 0); Sha256Context sha_ctx; sha256ContextCreate(&sha_ctx); @@ -113,12 +113,12 @@ namespace sts::updater { size_t Boot0Accessor::GetBootloaderVersion(void *bct) { u32 version = *reinterpret_cast(reinterpret_cast(bct) + BctVersionOffset); - STS_ASSERT(version <= BctVersionMax); + AMS_ASSERT(version <= BctVersionMax); return static_cast(version); } size_t Boot0Accessor::GetEksIndex(size_t bootloader_version) { - STS_ASSERT(bootloader_version <= BctVersionMax); + AMS_ASSERT(bootloader_version <= BctVersionMax); return (bootloader_version > 0) ? bootloader_version - 1 : 0; } diff --git a/stratosphere/libstratosphere/source/updater/updater_bis_management.hpp b/stratosphere/libstratosphere/source/updater/updater_bis_management.hpp index 597ebd4d2..df7c1a85a 100644 --- a/stratosphere/libstratosphere/source/updater/updater_bis_management.hpp +++ b/stratosphere/libstratosphere/source/updater/updater_bis_management.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::updater { +namespace ams::updater { class BisAccessor { public: @@ -138,13 +138,13 @@ namespace sts::updater { } } - STS_ASSERT(entry != nullptr); + AMS_ASSERT(entry != nullptr); return entry; } public: Result Read(size_t *out_size, void *dst, size_t size, EnumType which) { const auto entry = FindEntry(which); - STS_ASSERT(size >= entry->size); + AMS_ASSERT(size >= entry->size); R_TRY(BisAccessor::Read(dst, entry->size, entry->offset)); @@ -154,8 +154,8 @@ namespace sts::updater { Result Write(const void *src, size_t size, EnumType which) { const auto entry = FindEntry(which); - STS_ASSERT(size <= entry->size); - STS_ASSERT((size % BisAccessor::SectorAlignment) == 0); + AMS_ASSERT(size <= entry->size); + AMS_ASSERT((size % BisAccessor::SectorAlignment) == 0); return BisAccessor::Write(entry->offset, src, size); } @@ -198,7 +198,7 @@ namespace sts::updater { return FsBisStorageId_BootConfigAndPackage2RepairMain; case Package2Type::RepairSub: return FsBisStorageId_BootConfigAndPackage2RepairSub; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/libstratosphere/source/updater/updater_bis_save.cpp b/stratosphere/libstratosphere/source/updater/updater_bis_save.cpp index 6ec4fd149..6b0c1133f 100644 --- a/stratosphere/libstratosphere/source/updater/updater_bis_save.cpp +++ b/stratosphere/libstratosphere/source/updater/updater_bis_save.cpp @@ -19,7 +19,7 @@ #include "updater_bis_save.hpp" -namespace sts::updater { +namespace ams::updater { size_t BisSave::GetVerificationFlagOffset(BootModeType mode) { switch (mode) { @@ -33,9 +33,9 @@ namespace sts::updater { } Result BisSave::Initialize(void *work_buffer, size_t work_buffer_size) { - STS_ASSERT(work_buffer_size >= SaveSize); - STS_ASSERT(util::IsAligned(reinterpret_cast(work_buffer), 0x1000)); - STS_ASSERT(util::IsAligned(work_buffer_size, 0x200)); + AMS_ASSERT(work_buffer_size >= SaveSize); + AMS_ASSERT(util::IsAligned(reinterpret_cast(work_buffer), 0x1000)); + AMS_ASSERT(util::IsAligned(work_buffer_size, 0x200)); R_TRY(this->accessor.Initialize()); this->save_buffer = work_buffer; diff --git a/stratosphere/libstratosphere/source/updater/updater_bis_save.hpp b/stratosphere/libstratosphere/source/updater/updater_bis_save.hpp index 23dde4baa..a3b0ecbc1 100644 --- a/stratosphere/libstratosphere/source/updater/updater_bis_save.hpp +++ b/stratosphere/libstratosphere/source/updater/updater_bis_save.hpp @@ -21,7 +21,7 @@ #include "updater_bis_management.hpp" -namespace sts::updater { +namespace ams::updater { class BisSave { public: diff --git a/stratosphere/libstratosphere/source/updater/updater_files.cpp b/stratosphere/libstratosphere/source/updater/updater_files.cpp index feda0b701..0c172d2c1 100644 --- a/stratosphere/libstratosphere/source/updater/updater_files.cpp +++ b/stratosphere/libstratosphere/source/updater/updater_files.cpp @@ -19,7 +19,7 @@ #include "updater_files.hpp" -namespace sts::updater { +namespace ams::updater { Result ReadFile(size_t *out_size, void *dst, size_t dst_size, const char *path) { FILE *fp = fopen(path, "rb"); diff --git a/stratosphere/libstratosphere/source/updater/updater_files.hpp b/stratosphere/libstratosphere/source/updater/updater_files.hpp index 9b2db3016..369d4c095 100644 --- a/stratosphere/libstratosphere/source/updater/updater_files.hpp +++ b/stratosphere/libstratosphere/source/updater/updater_files.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::updater { +namespace ams::updater { /* File helpers. */ Result ReadFile(size_t *out_size, void *dst, size_t dst_size, const char *path); diff --git a/stratosphere/libstratosphere/source/updater/updater_paths.cpp b/stratosphere/libstratosphere/source/updater/updater_paths.cpp index 01c90612e..355708c8d 100644 --- a/stratosphere/libstratosphere/source/updater/updater_paths.cpp +++ b/stratosphere/libstratosphere/source/updater/updater_paths.cpp @@ -20,7 +20,7 @@ #include "updater_paths.hpp" -namespace sts::updater { +namespace ams::updater { namespace { @@ -34,7 +34,7 @@ namespace sts::updater { constexpr const char *Package2PathA = "bip:/a/package2"; const char *ChooseCandidatePath(const char * const *candidates, size_t num_candidates) { - STS_ASSERT(num_candidates > 0); + AMS_ASSERT(num_candidates > 0); for (size_t i = 0; i < num_candidates; i++) { struct stat buf; @@ -72,7 +72,7 @@ namespace sts::updater { constexpr const char *candidates[] = {BctPathA, BctPathNx}; return ChooseCandidatePath(candidates, util::size(candidates)); } - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -88,7 +88,7 @@ namespace sts::updater { constexpr const char *candidates[] = {Package1PathA, Package1PathNx}; return ChooseCandidatePath(candidates, util::size(candidates)); } - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -104,7 +104,7 @@ namespace sts::updater { constexpr const char *candidates[] = {Package2PathA, Package2PathNx}; return ChooseCandidatePath(candidates, util::size(candidates)); } - STS_UNREACHABLE_DEFAULT_CASE();; + AMS_UNREACHABLE_DEFAULT_CASE(); } } diff --git a/stratosphere/libstratosphere/source/updater/updater_paths.hpp b/stratosphere/libstratosphere/source/updater/updater_paths.hpp index d09ae867f..8a5739218 100644 --- a/stratosphere/libstratosphere/source/updater/updater_paths.hpp +++ b/stratosphere/libstratosphere/source/updater/updater_paths.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::updater { +namespace ams::updater { /* Path functionality. */ const char *GetBootImagePackageMountPath(); diff --git a/stratosphere/libstratosphere/source/util/util_compression.cpp b/stratosphere/libstratosphere/source/util/util_compression.cpp index ba33163b8..54199f276 100644 --- a/stratosphere/libstratosphere/source/util/util_compression.cpp +++ b/stratosphere/libstratosphere/source/util/util_compression.cpp @@ -20,13 +20,13 @@ #include "lz4.h" -namespace sts::util { +namespace ams::util { /* Compression utilities. */ int CompressLZ4(void *dst, size_t dst_size, const void *src, size_t src_size) { /* Size checks. */ - STS_ASSERT(dst_size <= std::numeric_limits::max()); - STS_ASSERT(src_size <= std::numeric_limits::max()); + AMS_ASSERT(dst_size <= std::numeric_limits::max()); + AMS_ASSERT(src_size <= std::numeric_limits::max()); /* This is just a thin wrapper around LZ4. */ return LZ4_compress_default(reinterpret_cast(src), reinterpret_cast(dst), static_cast(src_size), static_cast(dst_size)); @@ -35,8 +35,8 @@ namespace sts::util { /* Decompression utilities. */ int DecompressLZ4(void *dst, size_t dst_size, const void *src, size_t src_size) { /* Size checks. */ - STS_ASSERT(dst_size <= std::numeric_limits::max()); - STS_ASSERT(src_size <= std::numeric_limits::max()); + AMS_ASSERT(dst_size <= std::numeric_limits::max()); + AMS_ASSERT(src_size <= std::numeric_limits::max()); /* This is just a thin wrapper around LZ4. */ return LZ4_decompress_safe(reinterpret_cast(src), reinterpret_cast(dst), static_cast(src_size), static_cast(dst_size)); diff --git a/stratosphere/libstratosphere/source/util/util_ini.cpp b/stratosphere/libstratosphere/source/util/util_ini.cpp index ffaf7bd5b..006405404 100644 --- a/stratosphere/libstratosphere/source/util/util_ini.cpp +++ b/stratosphere/libstratosphere/source/util/util_ini.cpp @@ -20,7 +20,7 @@ #include "ini.h" -namespace sts::util::ini { +namespace ams::util::ini { /* Ensure that types are the same for Handler vs ini_handler. */ static_assert(std::is_same::value, "Bad ini::Handler definition!"); @@ -50,7 +50,7 @@ namespace sts::util::ini { size_t try_read = std::min(size_t(num - 1), ctx->num_left); size_t actually_read; R_ASSERT(fsFileRead(ctx->f, ctx->offset, str, try_read, FsReadOption_None, &actually_read)); - STS_ASSERT(actually_read == try_read); + AMS_ASSERT(actually_read == try_read); /* Only "read" up to the first \n. */ size_t offset = actually_read; diff --git a/stratosphere/loader/source/ldr_arguments.cpp b/stratosphere/loader/source/ldr_arguments.cpp index fbc934333..c23e60cd2 100644 --- a/stratosphere/loader/source/ldr_arguments.cpp +++ b/stratosphere/loader/source/ldr_arguments.cpp @@ -16,7 +16,7 @@ #include "ldr_arguments.hpp" -namespace sts::ldr::args { +namespace ams::ldr::args { namespace { diff --git a/stratosphere/loader/source/ldr_arguments.hpp b/stratosphere/loader/source/ldr_arguments.hpp index 41f93bef2..66abdda07 100644 --- a/stratosphere/loader/source/ldr_arguments.hpp +++ b/stratosphere/loader/source/ldr_arguments.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr::args { +namespace ams::ldr::args { constexpr size_t ArgumentSizeMax = 0x8000; diff --git a/stratosphere/loader/source/ldr_capabilities.cpp b/stratosphere/loader/source/ldr_capabilities.cpp index d1075c9d1..01ce1b90e 100644 --- a/stratosphere/loader/source/ldr_capabilities.cpp +++ b/stratosphere/loader/source/ldr_capabilities.cpp @@ -16,7 +16,7 @@ #include "ldr_capabilities.hpp" -namespace sts::ldr::caps { +namespace ams::ldr::caps { namespace { diff --git a/stratosphere/loader/source/ldr_capabilities.hpp b/stratosphere/loader/source/ldr_capabilities.hpp index 8806968a7..e98a5a56e 100644 --- a/stratosphere/loader/source/ldr_capabilities.hpp +++ b/stratosphere/loader/source/ldr_capabilities.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr::caps { +namespace ams::ldr::caps { /* Capabilities API. */ Result ValidateCapabilities(const void *acid_kac, size_t acid_kac_size, const void *aci_kac, size_t aci_kac_size); diff --git a/stratosphere/loader/source/ldr_content_management.cpp b/stratosphere/loader/source/ldr_content_management.cpp index 380d729b7..4c3ddaa20 100644 --- a/stratosphere/loader/source/ldr_content_management.cpp +++ b/stratosphere/loader/source/ldr_content_management.cpp @@ -19,7 +19,7 @@ #include "ldr_content_management.hpp" #include "ldr_ecs.hpp" -namespace sts::ldr { +namespace ams::ldr { namespace { @@ -83,7 +83,7 @@ namespace sts::ldr { Result MountNspFileSystem(const char *device_name, const char *path) { FsFileSystem fs; R_TRY(fsOpenFileSystemWithId(&fs, 0, FsFileSystemType_ApplicationPackage, path)); - STS_ASSERT(fsdevMountDevice(device_name, fs) >= 0); + AMS_ASSERT(fsdevMountDevice(device_name, fs) >= 0); return ResultSuccess(); } @@ -176,7 +176,7 @@ namespace sts::ldr { /* Try to mount the content path. */ FsFileSystem fs; R_TRY(fsldrOpenCodeFileSystem(static_cast(loc.title_id), path, &fs)); - STS_ASSERT(fsdevMountDevice(CodeFileSystemDeviceName, fs) != -1); + AMS_ASSERT(fsdevMountDevice(CodeFileSystemDeviceName, fs) != -1); /* Note that we mounted code. */ this->is_code_mounted = true; diff --git a/stratosphere/loader/source/ldr_content_management.hpp b/stratosphere/loader/source/ldr_content_management.hpp index 232eb963e..b6a789ec7 100644 --- a/stratosphere/loader/source/ldr_content_management.hpp +++ b/stratosphere/loader/source/ldr_content_management.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr { +namespace ams::ldr { /* Utility reference to make code mounting automatic. */ class ScopedCodeMount { diff --git a/stratosphere/loader/source/ldr_ecs.cpp b/stratosphere/loader/source/ldr_ecs.cpp index 25435e4ae..c96928151 100644 --- a/stratosphere/loader/source/ldr_ecs.cpp +++ b/stratosphere/loader/source/ldr_ecs.cpp @@ -17,7 +17,7 @@ #include #include "ldr_ecs.hpp" -namespace sts::ldr::ecs { +namespace ams::ldr::ecs { namespace { diff --git a/stratosphere/loader/source/ldr_ecs.hpp b/stratosphere/loader/source/ldr_ecs.hpp index 34044caa3..481125b09 100644 --- a/stratosphere/loader/source/ldr_ecs.hpp +++ b/stratosphere/loader/source/ldr_ecs.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr::ecs { +namespace ams::ldr::ecs { /* External Content Source API. */ const char *Get(ncm::TitleId title_id); diff --git a/stratosphere/loader/source/ldr_launch_record.cpp b/stratosphere/loader/source/ldr_launch_record.cpp index 2879d06f3..314f25411 100644 --- a/stratosphere/loader/source/ldr_launch_record.cpp +++ b/stratosphere/loader/source/ldr_launch_record.cpp @@ -19,7 +19,7 @@ #include "ldr_launch_record.hpp" -namespace sts::ldr { +namespace ams::ldr { namespace { @@ -41,7 +41,7 @@ namespace sts::ldr { /* Loader wants to override this libstratosphere function, which is weakly linked. */ /* This is necessary to prevent circular dependencies. */ -namespace sts::pm::info { +namespace ams::pm::info { Result HasLaunchedTitle(bool *out, ncm::TitleId title_id) { *out = ldr::HasLaunchedTitle(title_id); diff --git a/stratosphere/loader/source/ldr_launch_record.hpp b/stratosphere/loader/source/ldr_launch_record.hpp index 9c4c3806e..9fac03a10 100644 --- a/stratosphere/loader/source/ldr_launch_record.hpp +++ b/stratosphere/loader/source/ldr_launch_record.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr { +namespace ams::ldr { /* Launch Record API. */ bool HasLaunchedTitle(ncm::TitleId title_id); diff --git a/stratosphere/loader/source/ldr_loader_service.cpp b/stratosphere/loader/source/ldr_loader_service.cpp index e50306550..5481e9411 100644 --- a/stratosphere/loader/source/ldr_loader_service.cpp +++ b/stratosphere/loader/source/ldr_loader_service.cpp @@ -23,7 +23,7 @@ #include "ldr_loader_service.hpp" #include "ldr_ro_manager.hpp" -namespace sts::ldr { +namespace ams::ldr { /* Official commands. */ Result LoaderService::CreateProcess(sf::OutMoveHandle proc_h, PinId id, u32 flags, sf::CopyHandle reslimit_h) { diff --git a/stratosphere/loader/source/ldr_loader_service.hpp b/stratosphere/loader/source/ldr_loader_service.hpp index 18989a2d4..e150cf9d3 100644 --- a/stratosphere/loader/source/ldr_loader_service.hpp +++ b/stratosphere/loader/source/ldr_loader_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr { +namespace ams::ldr { class LoaderService : public sf::IServiceObject { protected: diff --git a/stratosphere/loader/source/ldr_main.cpp b/stratosphere/loader/source/ldr_main.cpp index 0bbd7847f..8bf6fa5ac 100644 --- a/stratosphere/loader/source/ldr_main.cpp +++ b/stratosphere/loader/source/ldr_main.cpp @@ -48,19 +48,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Loader; + ncm::TitleId CurrentTitleId = ncm::TitleId::Loader; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/loader/source/ldr_meta.cpp b/stratosphere/loader/source/ldr_meta.cpp index 13d42f1d5..bef672d0d 100644 --- a/stratosphere/loader/source/ldr_meta.cpp +++ b/stratosphere/loader/source/ldr_meta.cpp @@ -19,7 +19,7 @@ #include "ldr_content_management.hpp" #include "ldr_meta.hpp" -namespace sts::ldr { +namespace ams::ldr { namespace { diff --git a/stratosphere/loader/source/ldr_meta.hpp b/stratosphere/loader/source/ldr_meta.hpp index ecb978fdc..66a3dea9d 100644 --- a/stratosphere/loader/source/ldr_meta.hpp +++ b/stratosphere/loader/source/ldr_meta.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr { +namespace ams::ldr { struct Meta { Npdm *npdm; diff --git a/stratosphere/loader/source/ldr_patcher.cpp b/stratosphere/loader/source/ldr_patcher.cpp index 0582bd7a6..38b6c2489 100644 --- a/stratosphere/loader/source/ldr_patcher.cpp +++ b/stratosphere/loader/source/ldr_patcher.cpp @@ -20,7 +20,7 @@ #include "ldr_patcher.hpp" -namespace sts::ldr { +namespace ams::ldr { namespace { @@ -37,7 +37,7 @@ namespace sts::ldr { void LocateAndApplyIpsPatchesToModule(const u8 *build_id, uintptr_t mapped_nso, size_t mapped_size) { ro::ModuleId module_id; std::memcpy(&module_id.build_id, build_id, sizeof(module_id.build_id)); - sts::patcher::LocateAndApplyIpsPatchesToModule(NsoPatchesDirectory, NsoPatchesProtectedSize, NsoPatchesProtectedOffset, &module_id, reinterpret_cast(mapped_nso), mapped_size); + ams::patcher::LocateAndApplyIpsPatchesToModule(NsoPatchesDirectory, NsoPatchesProtectedSize, NsoPatchesProtectedOffset, &module_id, reinterpret_cast(mapped_nso), mapped_size); } } \ No newline at end of file diff --git a/stratosphere/loader/source/ldr_patcher.hpp b/stratosphere/loader/source/ldr_patcher.hpp index a5b611f11..3f1c6b30e 100644 --- a/stratosphere/loader/source/ldr_patcher.hpp +++ b/stratosphere/loader/source/ldr_patcher.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::ldr { +namespace ams::ldr { /* Apply IPS patches. */ void LocateAndApplyIpsPatchesToModule(const u8 *build_id, uintptr_t mapped_nso, size_t mapped_size); diff --git a/stratosphere/loader/source/ldr_process_creation.cpp b/stratosphere/loader/source/ldr_process_creation.cpp index ae142c9ee..8b5c0d2cb 100644 --- a/stratosphere/loader/source/ldr_process_creation.cpp +++ b/stratosphere/loader/source/ldr_process_creation.cpp @@ -28,7 +28,7 @@ #include "ldr_process_creation.hpp" #include "ldr_ro_manager.hpp" -namespace sts::ldr { +namespace ams::ldr { namespace { @@ -56,7 +56,7 @@ namespace sts::ldr { }; constexpr const char *GetNsoName(size_t idx) { - STS_ASSERT(idx < Nso_Count); + AMS_ASSERT(idx < Nso_Count); constexpr const char *NsoNames[Nso_Count] = { "rtld", @@ -491,7 +491,7 @@ namespace sts::ldr { aslr_start = map::AslrBase64Bit; aslr_size = map::AslrSize64Bit; break; - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } else { /* On 1.0.0, only 2 address space types existed. */ @@ -509,7 +509,7 @@ namespace sts::ldr { uintptr_t aslr_slide = 0; uintptr_t unused_size = (aslr_size - total_size); if (out_cpi->flags & svc::CreateProcessFlag_EnableAslr) { - aslr_slide = sts::rnd::GenerateRandomU64(unused_size / BaseAddressAlignment) * BaseAddressAlignment; + aslr_slide = ams::rnd::GenerateRandomU64(unused_size / BaseAddressAlignment) * BaseAddressAlignment; } /* Set out. */ diff --git a/stratosphere/loader/source/ldr_process_creation.hpp b/stratosphere/loader/source/ldr_process_creation.hpp index f7fde6d55..1d1704d52 100644 --- a/stratosphere/loader/source/ldr_process_creation.hpp +++ b/stratosphere/loader/source/ldr_process_creation.hpp @@ -21,7 +21,7 @@ #include "ldr_arguments.hpp" -namespace sts::ldr { +namespace ams::ldr { /* Process Creation API. */ Result CreateProcess(Handle *out, PinId pin_id, const ncm::TitleLocation &loc, const char *path, u32 flags, Handle reslimit_h); diff --git a/stratosphere/loader/source/ldr_ro_manager.cpp b/stratosphere/loader/source/ldr_ro_manager.cpp index b53d03272..eaca6c34e 100644 --- a/stratosphere/loader/source/ldr_ro_manager.cpp +++ b/stratosphere/loader/source/ldr_ro_manager.cpp @@ -17,7 +17,7 @@ #include #include "ldr_ro_manager.hpp" -namespace sts::ldr::ro { +namespace ams::ldr::ro { namespace { diff --git a/stratosphere/loader/source/ldr_ro_manager.hpp b/stratosphere/loader/source/ldr_ro_manager.hpp index 9902312e1..4b1c929f8 100644 --- a/stratosphere/loader/source/ldr_ro_manager.hpp +++ b/stratosphere/loader/source/ldr_ro_manager.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ldr::ro { +namespace ams::ldr::ro { /* RO Manager API. */ Result PinTitle(PinId *out, const ncm::TitleLocation &loc); diff --git a/stratosphere/pm/source/impl/pm_process_info.cpp b/stratosphere/pm/source/impl/pm_process_info.cpp index 73864bf2c..f38962eb3 100644 --- a/stratosphere/pm/source/impl/pm_process_info.cpp +++ b/stratosphere/pm/source/impl/pm_process_info.cpp @@ -19,7 +19,7 @@ #include "pm_process_info.hpp" -namespace sts::pm::impl { +namespace ams::pm::impl { ProcessInfo::ProcessInfo(Handle h, os::ProcessId pid, ldr::PinId pin, const ncm::TitleLocation &l) : process_id(pid), pin_id(pin), loc(l), handle(h), state(ProcessState_Created), flags(0), waitable_holder(h) { this->waitable_holder.SetUserData(reinterpret_cast(this)); diff --git a/stratosphere/pm/source/impl/pm_process_info.hpp b/stratosphere/pm/source/impl/pm_process_info.hpp index aef076465..514b65fad 100644 --- a/stratosphere/pm/source/impl/pm_process_info.hpp +++ b/stratosphere/pm/source/impl/pm_process_info.hpp @@ -22,7 +22,7 @@ #include "pm_process_manager.hpp" -namespace sts::pm::impl { +namespace ams::pm::impl { class ProcessList; diff --git a/stratosphere/pm/source/impl/pm_process_manager.cpp b/stratosphere/pm/source/impl/pm_process_manager.cpp index 3ac504399..14bb7d8c1 100644 --- a/stratosphere/pm/source/impl/pm_process_manager.cpp +++ b/stratosphere/pm/source/impl/pm_process_manager.cpp @@ -25,7 +25,7 @@ #include "pm_process_info.hpp" -namespace sts::pm::impl { +namespace ams::pm::impl { namespace { @@ -133,7 +133,7 @@ namespace sts::pm::impl { return static_cast(ProcessEventDeprecated::DebugRunning); case ProcessEvent::DebugSuspended: return static_cast(ProcessEventDeprecated::DebugSuspended); - STS_UNREACHABLE_DEFAULT_CASE(); + AMS_UNREACHABLE_DEFAULT_CASE(); } } @@ -172,8 +172,8 @@ namespace sts::pm::impl { std::scoped_lock lk(this->lock); const size_t index = this->GetProcessInfoIndex(process_info); - STS_ASSERT(index < MaxProcessInfos); - STS_ASSERT(this->process_info_allocated[index]); + AMS_ASSERT(index < MaxProcessInfos); + AMS_ASSERT(this->process_info_allocated[index]); process_info->~ProcessInfo(); this->process_info_allocated[index] = false; @@ -315,7 +315,7 @@ namespace sts::pm::impl { /* Make new process info. */ void *process_info_storage = g_process_info_allocator.AllocateProcessInfoStorage(); - STS_ASSERT(process_info_storage != nullptr); + AMS_ASSERT(process_info_storage != nullptr); ProcessInfo *process_info = new (process_info_storage) ProcessInfo(process_handle, process_id, pin_id, location); /* Link new process info. */ @@ -716,7 +716,7 @@ namespace sts::pm::impl { /* In 8.0.0, Nintendo added this command, which signals that the boot sysmodule has finished. */ /* Nintendo only signals it in safe mode FIRM, and this function aborts on normal FIRM. */ /* We will signal it always, but only allow this function to succeed on safe mode. */ - STS_ASSERT(spl::IsRecoveryBoot()); + AMS_ASSERT(spl::IsRecoveryBoot()); *out = g_boot_finished_event.GetReadableHandle(); return ResultSuccess(); } diff --git a/stratosphere/pm/source/impl/pm_process_manager.hpp b/stratosphere/pm/source/impl/pm_process_manager.hpp index 88d596105..4fe734044 100644 --- a/stratosphere/pm/source/impl/pm_process_manager.hpp +++ b/stratosphere/pm/source/impl/pm_process_manager.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::pm::impl { +namespace ams::pm::impl { /* Initialization. */ Result InitializeProcessManager(); diff --git a/stratosphere/pm/source/impl/pm_resource_manager.cpp b/stratosphere/pm/source/impl/pm_resource_manager.cpp index e2bf072f8..d9f840d3a 100644 --- a/stratosphere/pm/source/impl/pm_resource_manager.cpp +++ b/stratosphere/pm/source/impl/pm_resource_manager.cpp @@ -19,7 +19,7 @@ #include "pm_resource_manager.hpp" -namespace sts::pm::resource { +namespace ams::pm::resource { namespace { @@ -223,7 +223,7 @@ namespace sts::pm::resource { g_resource_limits[ResourceLimitGroup_Applet][LimitableResource_Threads]; /* Ensure we don't over-commit threads. */ - STS_ASSERT(total_threads_allocated <= total_threads_available); + AMS_ASSERT(total_threads_allocated <= total_threads_available); /* Set number of extra threads. */ g_extra_application_threads_available = total_threads_available - total_threads_allocated; @@ -247,7 +247,7 @@ namespace sts::pm::resource { const u64 reserved_non_system_size = (application_size + applet_size + ReservedMemorySize600); /* Ensure there's enough memory for the system region. */ - STS_ASSERT(reserved_non_system_size < total_memory); + AMS_ASSERT(reserved_non_system_size < total_memory); g_memory_resource_limits[spl::MemoryArrangement_Dynamic][ResourceLimitGroup_System] = total_memory - reserved_non_system_size; } else { @@ -343,8 +343,8 @@ namespace sts::pm::resource { Result GetResourceLimitValues(u64 *out_cur, u64 *out_lim, ResourceLimitGroup group, LimitableResource resource) { /* Do not allow out of bounds access. */ - STS_ASSERT(group < ResourceLimitGroup_Count); - STS_ASSERT(resource < LimitableResource_Count); + AMS_ASSERT(group < ResourceLimitGroup_Count); + AMS_ASSERT(resource < LimitableResource_Count); const Handle reslimit_hnd = GetResourceLimitHandle(group); R_TRY(svcGetResourceLimitCurrentValue(out_cur, reslimit_hnd, resource)); diff --git a/stratosphere/pm/source/impl/pm_resource_manager.hpp b/stratosphere/pm/source/impl/pm_resource_manager.hpp index 667d03e74..53e515e72 100644 --- a/stratosphere/pm/source/impl/pm_resource_manager.hpp +++ b/stratosphere/pm/source/impl/pm_resource_manager.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::pm::resource { +namespace ams::pm::resource { /* Resource API. */ Result InitializeResourceManager(); diff --git a/stratosphere/pm/source/pm_boot_mode_service.cpp b/stratosphere/pm/source/pm_boot_mode_service.cpp index fd2731343..66c080177 100644 --- a/stratosphere/pm/source/pm_boot_mode_service.cpp +++ b/stratosphere/pm/source/pm_boot_mode_service.cpp @@ -16,7 +16,7 @@ #include "pm_boot_mode_service.hpp" -namespace sts::pm::bm { +namespace ams::pm::bm { namespace { diff --git a/stratosphere/pm/source/pm_boot_mode_service.hpp b/stratosphere/pm/source/pm_boot_mode_service.hpp index ecbe88f21..44890fa2a 100644 --- a/stratosphere/pm/source/pm_boot_mode_service.hpp +++ b/stratosphere/pm/source/pm_boot_mode_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::pm::bm { +namespace ams::pm::bm { class BootModeService final : public sf::IServiceObject { private: diff --git a/stratosphere/pm/source/pm_debug_monitor_service.cpp b/stratosphere/pm/source/pm_debug_monitor_service.cpp index 30df43437..bf4780dbd 100644 --- a/stratosphere/pm/source/pm_debug_monitor_service.cpp +++ b/stratosphere/pm/source/pm_debug_monitor_service.cpp @@ -18,7 +18,7 @@ #include "pm_debug_monitor_service.hpp" #include "impl/pm_process_manager.hpp" -namespace sts::pm::dmnt { +namespace ams::pm::dmnt { /* Actual command implementations. */ Result DebugMonitorServiceBase::GetModuleIdList(sf::Out out_count, const sf::OutBuffer &out_buf, u64 unused) { diff --git a/stratosphere/pm/source/pm_debug_monitor_service.hpp b/stratosphere/pm/source/pm_debug_monitor_service.hpp index 9ebce6375..c610d0f91 100644 --- a/stratosphere/pm/source/pm_debug_monitor_service.hpp +++ b/stratosphere/pm/source/pm_debug_monitor_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::pm::dmnt { +namespace ams::pm::dmnt { class DebugMonitorServiceBase : public sf::IServiceObject { protected: diff --git a/stratosphere/pm/source/pm_info_service.cpp b/stratosphere/pm/source/pm_info_service.cpp index f21428aaa..c7ada3d6e 100644 --- a/stratosphere/pm/source/pm_info_service.cpp +++ b/stratosphere/pm/source/pm_info_service.cpp @@ -20,7 +20,7 @@ #include "pm_info_service.hpp" #include "impl/pm_process_manager.hpp" -namespace sts::pm::info { +namespace ams::pm::info { /* Overrides for libstratosphere pm::info commands. */ Result HasLaunchedTitle(bool *out, ncm::TitleId title_id) { diff --git a/stratosphere/pm/source/pm_info_service.hpp b/stratosphere/pm/source/pm_info_service.hpp index 0133e785f..47b778a8e 100644 --- a/stratosphere/pm/source/pm_info_service.hpp +++ b/stratosphere/pm/source/pm_info_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::pm::info { +namespace ams::pm::info { class InformationService final : public sf::IServiceObject { private: diff --git a/stratosphere/pm/source/pm_main.cpp b/stratosphere/pm/source/pm_main.cpp index 04b45a514..6040a051a 100644 --- a/stratosphere/pm/source/pm_main.cpp +++ b/stratosphere/pm/source/pm_main.cpp @@ -50,19 +50,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Pm; + ncm::TitleId CurrentTitleId = ncm::TitleId::Pm; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); @@ -93,7 +93,7 @@ namespace { /* Doing this here works around a bug fixed in 6.0.0. */ /* Not doing so will cause svcDebugActiveProcess to deadlock on lower firmwares if called for it's own process. */ if (process_id == os::GetCurrentProcessId()) { - return ams::StratosphereTitleId; + return ams::CurrentTitleId; } /* Get a debug handle. */ diff --git a/stratosphere/pm/source/pm_shell_service.cpp b/stratosphere/pm/source/pm_shell_service.cpp index 7f48309ec..8f159c906 100644 --- a/stratosphere/pm/source/pm_shell_service.cpp +++ b/stratosphere/pm/source/pm_shell_service.cpp @@ -17,7 +17,7 @@ #include "pm_shell_service.hpp" #include "impl/pm_process_manager.hpp" -namespace sts::pm::shell { +namespace ams::pm::shell { /* Overrides for libstratosphere pm::shell commands. */ Result LaunchTitle(os::ProcessId *out_process_id, const ncm::TitleLocation &loc, u32 launch_flags) { diff --git a/stratosphere/pm/source/pm_shell_service.hpp b/stratosphere/pm/source/pm_shell_service.hpp index 2a6010090..ac6ee39b8 100644 --- a/stratosphere/pm/source/pm_shell_service.hpp +++ b/stratosphere/pm/source/pm_shell_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::pm::shell { +namespace ams::pm::shell { class ShellServiceBase : public sf::IServiceObject { protected: diff --git a/stratosphere/ro/source/impl/ro_nro_utils.cpp b/stratosphere/ro/source/impl/ro_nro_utils.cpp index 68826bfde..6606e823f 100644 --- a/stratosphere/ro/source/impl/ro_nro_utils.cpp +++ b/stratosphere/ro/source/impl/ro_nro_utils.cpp @@ -18,7 +18,7 @@ #include "ro_nro_utils.hpp" -namespace sts::ro::impl { +namespace ams::ro::impl { namespace { diff --git a/stratosphere/ro/source/impl/ro_nro_utils.hpp b/stratosphere/ro/source/impl/ro_nro_utils.hpp index d0087a25e..84d20ee4d 100644 --- a/stratosphere/ro/source/impl/ro_nro_utils.hpp +++ b/stratosphere/ro/source/impl/ro_nro_utils.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ro::impl { +namespace ams::ro::impl { /* Utilities for working with NROs. */ Result MapNro(u64 *out_base_address, Handle process_handle, u64 nro_heap_address, u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size); diff --git a/stratosphere/ro/source/impl/ro_nrr_utils.cpp b/stratosphere/ro/source/impl/ro_nrr_utils.cpp index 78cb7fd13..0b7a9a743 100644 --- a/stratosphere/ro/source/impl/ro_nrr_utils.cpp +++ b/stratosphere/ro/source/impl/ro_nrr_utils.cpp @@ -19,7 +19,7 @@ #include "ro_nrr_utils.hpp" #include "ro_service_impl.hpp" -namespace sts::ro::impl { +namespace ams::ro::impl { namespace { diff --git a/stratosphere/ro/source/impl/ro_nrr_utils.hpp b/stratosphere/ro/source/impl/ro_nrr_utils.hpp index eca3f42a0..351a93681 100644 --- a/stratosphere/ro/source/impl/ro_nrr_utils.hpp +++ b/stratosphere/ro/source/impl/ro_nrr_utils.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ro::impl { +namespace ams::ro::impl { /* Utilities for working with NRRs. */ Result MapAndValidateNrr(NrrHeader **out_header, u64 *out_mapped_code_address, Handle process_handle, ncm::TitleId title_id, u64 nrr_heap_address, u64 nrr_heap_size, ModuleType expected_type, bool enforce_type); diff --git a/stratosphere/ro/source/impl/ro_patcher.cpp b/stratosphere/ro/source/impl/ro_patcher.cpp index ce4db30d4..e4f5318aa 100644 --- a/stratosphere/ro/source/impl/ro_patcher.cpp +++ b/stratosphere/ro/source/impl/ro_patcher.cpp @@ -18,7 +18,7 @@ #include "ro_patcher.hpp" -namespace sts::ro::impl { +namespace ams::ro::impl { namespace { @@ -33,7 +33,7 @@ namespace sts::ro::impl { /* Apply IPS patches. */ void LocateAndApplyIpsPatchesToModule(const ModuleId *module_id, u8 *mapped_nro, size_t mapped_size) { - sts::patcher::LocateAndApplyIpsPatchesToModule(NroPatchesDirectory, NroPatchesProtectedSize, NroPatchesProtectedOffset, module_id, mapped_nro, mapped_size); + ams::patcher::LocateAndApplyIpsPatchesToModule(NroPatchesDirectory, NroPatchesProtectedSize, NroPatchesProtectedOffset, module_id, mapped_nro, mapped_size); } } \ No newline at end of file diff --git a/stratosphere/ro/source/impl/ro_patcher.hpp b/stratosphere/ro/source/impl/ro_patcher.hpp index 041023b45..2a9239097 100644 --- a/stratosphere/ro/source/impl/ro_patcher.hpp +++ b/stratosphere/ro/source/impl/ro_patcher.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::ro::impl { +namespace ams::ro::impl { /* Apply IPS patches. */ void LocateAndApplyIpsPatchesToModule(const ModuleId *module_id, u8 *mapped_nro, size_t mapped_size); diff --git a/stratosphere/ro/source/impl/ro_service_impl.cpp b/stratosphere/ro/source/impl/ro_service_impl.cpp index 6665c5083..2f957b109 100644 --- a/stratosphere/ro/source/impl/ro_service_impl.cpp +++ b/stratosphere/ro/source/impl/ro_service_impl.cpp @@ -25,7 +25,7 @@ #include "ro_patcher.hpp" #include "ro_service_impl.hpp" -namespace sts::ro::impl { +namespace ams::ro::impl { namespace { @@ -248,7 +248,7 @@ namespace sts::ro::impl { return nullptr; } - STS_ASSERT(context_id < MaxSessions); + AMS_ASSERT(context_id < MaxSessions); return &g_process_contexts[context_id]; } @@ -275,7 +275,7 @@ namespace sts::ro::impl { } } /* Failure to find a free context is actually an abort condition. */ - STS_ASSERT(false); + AMS_ASSERT(false); } void FreeContext(size_t context_id) { @@ -369,7 +369,7 @@ namespace sts::ro::impl { Result LoadNrr(size_t context_id, Handle process_h, u64 nrr_address, u64 nrr_size, ModuleType expected_type, bool enforce_type) { /* Get context. */ ProcessContext *context = GetContextById(context_id); - STS_ASSERT(context != nullptr); + AMS_ASSERT(context != nullptr); /* Get title id. */ const ncm::TitleId title_id = context->GetTitleId(process_h); @@ -399,7 +399,7 @@ namespace sts::ro::impl { Result UnloadNrr(size_t context_id, u64 nrr_address) { /* Get context. */ ProcessContext *context = GetContextById(context_id); - STS_ASSERT(context != nullptr); + AMS_ASSERT(context != nullptr); /* Validate address. */ R_UNLESS(util::IsAligned(nrr_address, 0x1000), ResultInvalidAddress()); @@ -421,7 +421,7 @@ namespace sts::ro::impl { Result LoadNro(u64 *out_address, size_t context_id, u64 nro_address, u64 nro_size, u64 bss_address, u64 bss_size) { /* Get context. */ ProcessContext *context = GetContextById(context_id); - STS_ASSERT(context != nullptr); + AMS_ASSERT(context != nullptr); /* Validate address/size. */ R_TRY(ValidateAddressAndSize(nro_address, nro_size)); @@ -467,7 +467,7 @@ namespace sts::ro::impl { Result UnloadNro(size_t context_id, u64 nro_address) { /* Get context. */ ProcessContext *context = GetContextById(context_id); - STS_ASSERT(context != nullptr); + AMS_ASSERT(context != nullptr); /* Validate address. */ R_UNLESS(util::IsAligned(nro_address, 0x1000), ResultInvalidAddress()); diff --git a/stratosphere/ro/source/impl/ro_service_impl.hpp b/stratosphere/ro/source/impl/ro_service_impl.hpp index 9221a2e65..4bc646e85 100644 --- a/stratosphere/ro/source/impl/ro_service_impl.hpp +++ b/stratosphere/ro/source/impl/ro_service_impl.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::ro::impl { +namespace ams::ro::impl { /* Definitions. */ constexpr size_t InvalidContextId = static_cast(-1); diff --git a/stratosphere/ro/source/ro_debug_monitor.cpp b/stratosphere/ro/source/ro_debug_monitor.cpp index 7504c3eb8..f648d9155 100644 --- a/stratosphere/ro/source/ro_debug_monitor.cpp +++ b/stratosphere/ro/source/ro_debug_monitor.cpp @@ -21,7 +21,7 @@ #include "ro_debug_monitor.hpp" #include "impl/ro_service_impl.hpp" -namespace sts::ro { +namespace ams::ro { Result DebugMonitorService::GetProcessModuleInfo(sf::Out out_count, const sf::OutArray &out_infos, os::ProcessId process_id) { R_UNLESS(out_infos.GetSize() <= std::numeric_limits::max(), ResultInvalidSize()); diff --git a/stratosphere/ro/source/ro_debug_monitor.hpp b/stratosphere/ro/source/ro_debug_monitor.hpp index a8a60f51c..0cbced5ee 100644 --- a/stratosphere/ro/source/ro_debug_monitor.hpp +++ b/stratosphere/ro/source/ro_debug_monitor.hpp @@ -18,7 +18,7 @@ #include #include -namespace sts::ro { +namespace ams::ro { class DebugMonitorService final : public sf::IServiceObject { protected: diff --git a/stratosphere/ro/source/ro_main.cpp b/stratosphere/ro/source/ro_main.cpp index e5f63cf30..e60cf5194 100644 --- a/stratosphere/ro/source/ro_main.cpp +++ b/stratosphere/ro/source/ro_main.cpp @@ -44,19 +44,19 @@ extern "C" { void __appExit(void); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Ro; + ncm::TitleId CurrentTitleId = ncm::TitleId::Ro; + + namespace result { + + bool CallFatalOnResultAssertion = true; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = true; - -} - -using namespace sts; +using namespace ams; void __libnx_initheap(void) { void* addr = nx_inner_heap; diff --git a/stratosphere/ro/source/ro_service.cpp b/stratosphere/ro/source/ro_service.cpp index 68e597ee4..9de7d0a29 100644 --- a/stratosphere/ro/source/ro_service.cpp +++ b/stratosphere/ro/source/ro_service.cpp @@ -22,7 +22,7 @@ #include "ro_service.hpp" #include "impl/ro_service_impl.hpp" -namespace sts::ro { +namespace ams::ro { void SetDevelopmentHardware(bool is_development_hardware) { impl::SetDevelopmentHardware(is_development_hardware); diff --git a/stratosphere/ro/source/ro_service.hpp b/stratosphere/ro/source/ro_service.hpp index 5e24c6894..ddbb3b9fa 100644 --- a/stratosphere/ro/source/ro_service.hpp +++ b/stratosphere/ro/source/ro_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::ro { +namespace ams::ro { /* Access utilities. */ void SetDevelopmentHardware(bool is_development_hardware); diff --git a/stratosphere/sm/source/impl/sm_service_manager.cpp b/stratosphere/sm/source/impl/sm_service_manager.cpp index 218c9b65f..1a4150cf5 100644 --- a/stratosphere/sm/source/impl/sm_service_manager.cpp +++ b/stratosphere/sm/source/impl/sm_service_manager.cpp @@ -22,7 +22,7 @@ #include "sm_service_manager.hpp" -namespace sts::sm::impl { +namespace ams::sm::impl { /* Anonymous namespace for implementation details. */ namespace { @@ -167,11 +167,11 @@ namespace sts::sm::impl { cfg::GetInitialProcessRange(&this->min, &this->max); /* Ensure range is sane. */ - STS_ASSERT(this->min <= this->max); + AMS_ASSERT(this->min <= this->max); } bool IsInitialProcess(os::ProcessId pid) const { - STS_ASSERT(pid != os::InvalidProcessId); + AMS_ASSERT(pid != os::InvalidProcessId); return this->min <= pid && pid <= this->max; } }; @@ -234,7 +234,7 @@ namespace sts::sm::impl { ncm::TitleId GetTitleIdForMitm(os::ProcessId pid) { /* Anything that can request a mitm session must have a process info. */ const auto process_info = GetProcessInfo(pid); - STS_ASSERT(process_info != nullptr); + AMS_ASSERT(process_info != nullptr); return process_info->tid; } diff --git a/stratosphere/sm/source/impl/sm_service_manager.hpp b/stratosphere/sm/source/impl/sm_service_manager.hpp index 66a1d7b5e..155e93ae1 100644 --- a/stratosphere/sm/source/impl/sm_service_manager.hpp +++ b/stratosphere/sm/source/impl/sm_service_manager.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::sm::impl { +namespace ams::sm::impl { /* Process management. */ Result RegisterProcess(os::ProcessId pid, ncm::TitleId tid, const void *acid_sac, size_t acid_sac_size, const void *aci_sac, size_t aci_sac_size); diff --git a/stratosphere/sm/source/sm_dmnt_service.cpp b/stratosphere/sm/source/sm_dmnt_service.cpp index 72122dbe0..f56a824e5 100644 --- a/stratosphere/sm/source/sm_dmnt_service.cpp +++ b/stratosphere/sm/source/sm_dmnt_service.cpp @@ -20,7 +20,7 @@ #include "sm_dmnt_service.hpp" #include "impl/sm_service_manager.hpp" -namespace sts::sm { +namespace ams::sm { Result DmntService::AtmosphereGetRecord(sf::Out record, ServiceName service) { return impl::GetServiceRecord(record.GetPointer(), service); diff --git a/stratosphere/sm/source/sm_dmnt_service.hpp b/stratosphere/sm/source/sm_dmnt_service.hpp index f9b60c227..bbf7c6e74 100644 --- a/stratosphere/sm/source/sm_dmnt_service.hpp +++ b/stratosphere/sm/source/sm_dmnt_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::sm { +namespace ams::sm { /* Service definition. */ class DmntService final : public sf::IServiceObject { diff --git a/stratosphere/sm/source/sm_main.cpp b/stratosphere/sm/source/sm_main.cpp index 76e1fc661..e35d1522e 100644 --- a/stratosphere/sm/source/sm_main.cpp +++ b/stratosphere/sm/source/sm_main.cpp @@ -48,19 +48,19 @@ extern "C" { } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Sm; + ncm::TitleId CurrentTitleId = ncm::TitleId::Sm; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/sm/source/sm_manager_service.cpp b/stratosphere/sm/source/sm_manager_service.cpp index 544ead0e9..2438b83fa 100644 --- a/stratosphere/sm/source/sm_manager_service.cpp +++ b/stratosphere/sm/source/sm_manager_service.cpp @@ -20,7 +20,7 @@ #include "sm_manager_service.hpp" #include "impl/sm_service_manager.hpp" -namespace sts::sm { +namespace ams::sm { Result ManagerService::RegisterProcess(os::ProcessId process_id, const sf::InBuffer &acid_sac, const sf::InBuffer &aci_sac) { return impl::RegisterProcess(process_id, ncm::TitleId::Invalid, acid_sac.GetPointer(), acid_sac.GetSize(), aci_sac.GetPointer(), aci_sac.GetSize()); diff --git a/stratosphere/sm/source/sm_manager_service.hpp b/stratosphere/sm/source/sm_manager_service.hpp index af838bf71..6292a67ca 100644 --- a/stratosphere/sm/source/sm_manager_service.hpp +++ b/stratosphere/sm/source/sm_manager_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::sm { +namespace ams::sm { /* Service definition. */ class ManagerService final : public sf::IServiceObject { diff --git a/stratosphere/sm/source/sm_user_service.cpp b/stratosphere/sm/source/sm_user_service.cpp index 3ae49f62c..ad8ff8b9f 100644 --- a/stratosphere/sm/source/sm_user_service.cpp +++ b/stratosphere/sm/source/sm_user_service.cpp @@ -20,7 +20,7 @@ #include "sm_user_service.hpp" #include "impl/sm_service_manager.hpp" -namespace sts::sm { +namespace ams::sm { Result UserService::Initialize(const sf::ClientProcessId &client_process_id) { this->process_id = client_process_id.GetValue(); diff --git a/stratosphere/sm/source/sm_user_service.hpp b/stratosphere/sm/source/sm_user_service.hpp index 99534b530..1b3d42739 100644 --- a/stratosphere/sm/source/sm_user_service.hpp +++ b/stratosphere/sm/source/sm_user_service.hpp @@ -20,7 +20,7 @@ #include #include -namespace sts::sm { +namespace ams::sm { /* Service definition. */ class UserService final : public sf::IServiceObject { diff --git a/stratosphere/spl/source/spl_api_impl.cpp b/stratosphere/spl/source/spl_api_impl.cpp index aac848bd4..2451125a3 100644 --- a/stratosphere/spl/source/spl_api_impl.cpp +++ b/stratosphere/spl/source/spl_api_impl.cpp @@ -22,7 +22,7 @@ #include "spl_ctr_drbg.hpp" -namespace sts::spl::impl { +namespace ams::spl::impl { namespace { @@ -127,14 +127,14 @@ namespace sts::spl::impl { /* Initialization functionality. */ void InitializeCtrDrbg() { u8 seed[CtrDrbg::SeedSize]; - STS_ASSERT(smc::GenerateRandomBytes(seed, sizeof(seed)) == smc::Result::Success); + AMS_ASSERT(smc::GenerateRandomBytes(seed, sizeof(seed)) == smc::Result::Success); g_drbg.Initialize(seed); } void InitializeSeEvents() { u64 irq_num; - STS_ASSERT(smc::GetConfig(&irq_num, 1, SplConfigItem_SecurityEngineIrqNumber) == smc::Result::Success); + AMS_ASSERT(smc::GetConfig(&irq_num, 1, SplConfigItem_SecurityEngineIrqNumber) == smc::Result::Success); R_ASSERT(g_se_event.Initialize(irq_num)); R_ASSERT(g_se_keyslot_available_event.InitializeAsInterProcessEvent()); diff --git a/stratosphere/spl/source/spl_api_impl.hpp b/stratosphere/spl/source/spl_api_impl.hpp index 8ef033fb8..03c3573db 100644 --- a/stratosphere/spl/source/spl_api_impl.hpp +++ b/stratosphere/spl/source/spl_api_impl.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::spl::impl { +namespace ams::spl::impl { /* Initialization. */ void Initialize(); diff --git a/stratosphere/spl/source/spl_crypto_service.cpp b/stratosphere/spl/source/spl_crypto_service.cpp index 322e25414..600ab49d1 100644 --- a/stratosphere/spl/source/spl_crypto_service.cpp +++ b/stratosphere/spl/source/spl_crypto_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_crypto_service.hpp" -namespace sts::spl { +namespace ams::spl { CryptoService::~CryptoService() { /* Free any keyslots this service is using. */ diff --git a/stratosphere/spl/source/spl_crypto_service.hpp b/stratosphere/spl/source/spl_crypto_service.hpp index 361959922..36f75c62a 100644 --- a/stratosphere/spl/source/spl_crypto_service.hpp +++ b/stratosphere/spl/source/spl_crypto_service.hpp @@ -21,7 +21,7 @@ #include "spl_general_service.hpp" -namespace sts::spl { +namespace ams::spl { class CryptoService : public GeneralService { public: diff --git a/stratosphere/spl/source/spl_ctr_drbg.cpp b/stratosphere/spl/source/spl_ctr_drbg.cpp index 72ad9f7d2..2dd90b11b 100644 --- a/stratosphere/spl/source/spl_ctr_drbg.cpp +++ b/stratosphere/spl/source/spl_ctr_drbg.cpp @@ -20,7 +20,7 @@ #include "spl_ctr_drbg.hpp" -namespace sts::spl { +namespace ams::spl { void CtrDrbg::Update(const void *data) { aes128ContextCreate(&this->aes_ctx, this->key, true); diff --git a/stratosphere/spl/source/spl_ctr_drbg.hpp b/stratosphere/spl/source/spl_ctr_drbg.hpp index 2bbff9d1a..53c21da4c 100644 --- a/stratosphere/spl/source/spl_ctr_drbg.hpp +++ b/stratosphere/spl/source/spl_ctr_drbg.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::spl { +namespace ams::spl { /* Nintendo implements CTR_DRBG for their csrng. We will do the same. */ class CtrDrbg { diff --git a/stratosphere/spl/source/spl_deprecated_service.cpp b/stratosphere/spl/source/spl_deprecated_service.cpp index 674e2120c..c8b33b975 100644 --- a/stratosphere/spl/source/spl_deprecated_service.cpp +++ b/stratosphere/spl/source/spl_deprecated_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_deprecated_service.hpp" -namespace sts::spl { +namespace ams::spl { Result DeprecatedService::GetConfig(sf::Out out, u32 which) { return impl::GetConfig(out.GetPointer(), static_cast(which)); diff --git a/stratosphere/spl/source/spl_deprecated_service.hpp b/stratosphere/spl/source/spl_deprecated_service.hpp index 577bfd23d..9f0978b1a 100644 --- a/stratosphere/spl/source/spl_deprecated_service.hpp +++ b/stratosphere/spl/source/spl_deprecated_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::spl { +namespace ams::spl { class DeprecatedService : public sf::IServiceObject { protected: diff --git a/stratosphere/spl/source/spl_es_service.cpp b/stratosphere/spl/source/spl_es_service.cpp index 1b6bdec2c..e27fa4c25 100644 --- a/stratosphere/spl/source/spl_es_service.cpp +++ b/stratosphere/spl/source/spl_es_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_es_service.hpp" -namespace sts::spl { +namespace ams::spl { Result EsService::ImportEsKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) { return impl::ImportEsKey(src.GetPointer(), src.GetSize(), access_key, key_source, option); diff --git a/stratosphere/spl/source/spl_es_service.hpp b/stratosphere/spl/source/spl_es_service.hpp index 3d6660802..e827d006e 100644 --- a/stratosphere/spl/source/spl_es_service.hpp +++ b/stratosphere/spl/source/spl_es_service.hpp @@ -21,7 +21,7 @@ #include "spl_rsa_service.hpp" -namespace sts::spl { +namespace ams::spl { class EsService : public RsaService { public: diff --git a/stratosphere/spl/source/spl_fs_service.cpp b/stratosphere/spl/source/spl_fs_service.cpp index fb6dc2779..e191ae05f 100644 --- a/stratosphere/spl/source/spl_fs_service.cpp +++ b/stratosphere/spl/source/spl_fs_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_fs_service.hpp" -namespace sts::spl { +namespace ams::spl { Result FsService::ImportLotusKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) { return impl::ImportLotusKey(src.GetPointer(), src.GetSize(), access_key, key_source, option); diff --git a/stratosphere/spl/source/spl_fs_service.hpp b/stratosphere/spl/source/spl_fs_service.hpp index e326dacc4..6f5ab9b4d 100644 --- a/stratosphere/spl/source/spl_fs_service.hpp +++ b/stratosphere/spl/source/spl_fs_service.hpp @@ -21,7 +21,7 @@ #include "spl_crypto_service.hpp" -namespace sts::spl { +namespace ams::spl { class FsService : public CryptoService { public: diff --git a/stratosphere/spl/source/spl_general_service.cpp b/stratosphere/spl/source/spl_general_service.cpp index 517f5bedd..f655be8b5 100644 --- a/stratosphere/spl/source/spl_general_service.cpp +++ b/stratosphere/spl/source/spl_general_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_general_service.hpp" -namespace sts::spl { +namespace ams::spl { Result GeneralService::GetConfig(sf::Out out, u32 which) { return impl::GetConfig(out.GetPointer(), static_cast(which)); diff --git a/stratosphere/spl/source/spl_general_service.hpp b/stratosphere/spl/source/spl_general_service.hpp index 872b078f1..9bd35d1e4 100644 --- a/stratosphere/spl/source/spl_general_service.hpp +++ b/stratosphere/spl/source/spl_general_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::spl { +namespace ams::spl { class GeneralService : public sf::IServiceObject { protected: diff --git a/stratosphere/spl/source/spl_main.cpp b/stratosphere/spl/source/spl_main.cpp index febf25182..d4eaa5717 100644 --- a/stratosphere/spl/source/spl_main.cpp +++ b/stratosphere/spl/source/spl_main.cpp @@ -53,19 +53,19 @@ extern "C" { void __libnx_exception_handler(ThreadExceptionDump *ctx); } -namespace sts::ams { +namespace ams { - ncm::TitleId StratosphereTitleId = ncm::TitleId::Spl; + ncm::TitleId CurrentTitleId = ncm::TitleId::Spl; + + namespace result { + + bool CallFatalOnResultAssertion = false; + + } } -namespace sts::result { - - bool CallFatalOnResultAssertion = false; - -} - -using namespace sts; +using namespace ams; void __libnx_exception_handler(ThreadExceptionDump *ctx) { ams::CrashHandler(ctx); diff --git a/stratosphere/spl/source/spl_manu_service.cpp b/stratosphere/spl/source/spl_manu_service.cpp index aaa26a2e7..458e649d7 100644 --- a/stratosphere/spl/source/spl_manu_service.cpp +++ b/stratosphere/spl/source/spl_manu_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_manu_service.hpp" -namespace sts::spl { +namespace ams::spl { Result ManuService::ReEncryptRsaPrivateKey(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &src, AccessKey access_key_dec, KeySource source_dec, AccessKey access_key_enc, KeySource source_enc, u32 option) { return impl::ReEncryptRsaPrivateKey(out.GetPointer(), out.GetSize(), src.GetPointer(), src.GetSize(), access_key_dec, source_dec, access_key_enc, source_enc, option); diff --git a/stratosphere/spl/source/spl_manu_service.hpp b/stratosphere/spl/source/spl_manu_service.hpp index 328573a13..371d48a56 100644 --- a/stratosphere/spl/source/spl_manu_service.hpp +++ b/stratosphere/spl/source/spl_manu_service.hpp @@ -21,7 +21,7 @@ #include "spl_rsa_service.hpp" -namespace sts::spl { +namespace ams::spl { class ManuService : public RsaService { public: diff --git a/stratosphere/spl/source/spl_random_service.cpp b/stratosphere/spl/source/spl_random_service.cpp index 6e980a16a..f307900ef 100644 --- a/stratosphere/spl/source/spl_random_service.cpp +++ b/stratosphere/spl/source/spl_random_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_random_service.hpp" -namespace sts::spl { +namespace ams::spl { Result RandomService::GenerateRandomBytes(const sf::OutBuffer &out) { return impl::GenerateRandomBytes(out.GetPointer(), out.GetSize()); diff --git a/stratosphere/spl/source/spl_random_service.hpp b/stratosphere/spl/source/spl_random_service.hpp index be014f66d..408144c83 100644 --- a/stratosphere/spl/source/spl_random_service.hpp +++ b/stratosphere/spl/source/spl_random_service.hpp @@ -19,7 +19,7 @@ #include #include -namespace sts::spl { +namespace ams::spl { class RandomService final : public sf::IServiceObject { protected: diff --git a/stratosphere/spl/source/spl_rsa_service.cpp b/stratosphere/spl/source/spl_rsa_service.cpp index dd5d3668f..17ebd27d0 100644 --- a/stratosphere/spl/source/spl_rsa_service.cpp +++ b/stratosphere/spl/source/spl_rsa_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_rsa_service.hpp" -namespace sts::spl { +namespace ams::spl { Result RsaService::DecryptRsaPrivateKeyDeprecated(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) { return impl::DecryptRsaPrivateKey(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option); diff --git a/stratosphere/spl/source/spl_rsa_service.hpp b/stratosphere/spl/source/spl_rsa_service.hpp index 385224082..a428eb063 100644 --- a/stratosphere/spl/source/spl_rsa_service.hpp +++ b/stratosphere/spl/source/spl_rsa_service.hpp @@ -21,7 +21,7 @@ #include "spl_crypto_service.hpp" -namespace sts::spl { +namespace ams::spl { class RsaService : public CryptoService { public: diff --git a/stratosphere/spl/source/spl_ssl_service.cpp b/stratosphere/spl/source/spl_ssl_service.cpp index 15117c808..12b2d4687 100644 --- a/stratosphere/spl/source/spl_ssl_service.cpp +++ b/stratosphere/spl/source/spl_ssl_service.cpp @@ -20,7 +20,7 @@ #include "spl_api_impl.hpp" #include "spl_ssl_service.hpp" -namespace sts::spl { +namespace ams::spl { Result SslService::ImportSslKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) { return impl::ImportSslKey(src.GetPointer(), src.GetSize(), access_key, key_source); diff --git a/stratosphere/spl/source/spl_ssl_service.hpp b/stratosphere/spl/source/spl_ssl_service.hpp index 1d2ce2d6d..845097cb7 100644 --- a/stratosphere/spl/source/spl_ssl_service.hpp +++ b/stratosphere/spl/source/spl_ssl_service.hpp @@ -21,7 +21,7 @@ #include "spl_rsa_service.hpp" -namespace sts::spl { +namespace ams::spl { class SslService : public RsaService { public: