From 03a425a5796e7ce634a9a2ecd9d7b8383d884531 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 10 May 2019 03:28:18 -0700 Subject: [PATCH] stratosphere: TODO: panic -> std::abort() --- stratosphere/ams_mitm/source/utils.cpp | 2 +- stratosphere/libstratosphere | 2 +- stratosphere/loader/source/ldr_map.hpp | 2 +- stratosphere/loader/source/ldr_nso.cpp | 3 +-- stratosphere/loader/source/ldr_nso.hpp | 3 +-- stratosphere/pm/source/pm_boot2.cpp | 2 +- stratosphere/sm/source/sm_main.cpp | 6 ++---- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/stratosphere/ams_mitm/source/utils.cpp b/stratosphere/ams_mitm/source/utils.cpp index 7c406495a..70f1a011e 100644 --- a/stratosphere/ams_mitm/source/utils.cpp +++ b/stratosphere/ams_mitm/source/utils.cpp @@ -83,7 +83,7 @@ void Utils::InitializeThreadFunc(void *args) { static const char * const required_active_services[] = {"pcv", "gpio", "pinmux", "psc:c"}; for (unsigned int i = 0; i < sizeof(required_active_services) / sizeof(required_active_services[0]); i++) { if (R_FAILED(smGetServiceOriginal(&tmp_hnd, smEncodeName(required_active_services[i])))) { - /* TODO: Panic */ + std::abort(); } else { svcCloseHandle(tmp_hnd); } diff --git a/stratosphere/libstratosphere b/stratosphere/libstratosphere index e8707a658..8ec43f0d6 160000 --- a/stratosphere/libstratosphere +++ b/stratosphere/libstratosphere @@ -1 +1 @@ -Subproject commit e8707a6581ecf33a8e35601c8f2e11018bbdc7ec +Subproject commit 8ec43f0d69463784c00ddb19c5f3b043e713548e diff --git a/stratosphere/loader/source/ldr_map.hpp b/stratosphere/loader/source/ldr_map.hpp index c9a83b608..c4556ee9d 100644 --- a/stratosphere/loader/source/ldr_map.hpp +++ b/stratosphere/loader/source/ldr_map.hpp @@ -73,7 +73,7 @@ class AutoCloseMap { void Close() { if (this->mapped_address) { if (R_FAILED(svcUnmapProcessMemory(this->mapped_address, this->process_handle, this->base_address, this->size))) { - /* TODO: panic(). */ + std::abort(); } this->mapped_address = NULL; } diff --git a/stratosphere/loader/source/ldr_nso.cpp b/stratosphere/loader/source/ldr_nso.cpp index 08cef21ce..eb7ff616a 100644 --- a/stratosphere/loader/source/ldr_nso.cpp +++ b/stratosphere/loader/source/ldr_nso.cpp @@ -207,8 +207,7 @@ Result NsoUtils::CalculateNsoLoadExtents(u32 addspace_type, u32 args_size, NsoLo addspace_size = 0x7FF8000000ULL; break; default: - /* TODO: Panic. */ - return ResultKernelOutOfMemory; + std::abort(); } } else { if (addspace_type & 2) { diff --git a/stratosphere/loader/source/ldr_nso.hpp b/stratosphere/loader/source/ldr_nso.hpp index 69eeff2a3..558bbd728 100644 --- a/stratosphere/loader/source/ldr_nso.hpp +++ b/stratosphere/loader/source/ldr_nso.hpp @@ -94,8 +94,7 @@ class NsoUtils { case 12: return "sdk"; default: - /* TODO: Panic. */ - return "?"; + std::abort(); } } diff --git a/stratosphere/pm/source/pm_boot2.cpp b/stratosphere/pm/source/pm_boot2.cpp index 3fc033db7..9511f168c 100644 --- a/stratosphere/pm/source/pm_boot2.cpp +++ b/stratosphere/pm/source/pm_boot2.cpp @@ -180,7 +180,7 @@ static void MountSdCard() { static const char * const required_active_services[] = {"pcv", "gpio", "pinmux", "psc:c"}; for (unsigned int i = 0; i < sizeof(required_active_services) / sizeof(required_active_services[0]); i++) { if (R_FAILED(smGetServiceOriginal(&tmp_hnd, smEncodeName(required_active_services[i])))) { - /* TODO: Panic */ + std::abort(); } else { svcCloseHandle(tmp_hnd); } diff --git a/stratosphere/sm/source/sm_main.cpp b/stratosphere/sm/source/sm_main.cpp index be0d8815e..882f51731 100644 --- a/stratosphere/sm/source/sm_main.cpp +++ b/stratosphere/sm/source/sm_main.cpp @@ -91,8 +91,7 @@ int main(int argc, char **argv) /* Create sm:m manually. */ Handle smm_h; if (R_FAILED(Registration::RegisterServiceForSelf(smEncodeName("sm:m"), 1, false, &smm_h))) { - /* TODO: Panic. */ - while (1) { } + std::abort(); } server_manager->AddWaitable(new ExistingPortServer(smm_h, 1)); @@ -101,8 +100,7 @@ int main(int argc, char **argv) /* Create sm:dmnt manually. */ Handle smdmnt_h; if (R_FAILED(Registration::RegisterServiceForSelf(smEncodeName("sm:dmnt"), 1, false, &smdmnt_h))) { - /* TODO: Panic. */ - while (1) { } + std::abort(); } server_manager->AddWaitable(new ExistingPortServer(smm_h, 1));;