mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-06 16:18:51 +00:00
Merge branch 'master' of https://github.com/Atmosphere-NX/Atmosphere into logmanager
This commit is contained in:
commit
e0d66bcd4a
19 changed files with 6 additions and 122 deletions
|
@ -43,7 +43,6 @@ namespace ams::kern {
|
||||||
|
|
||||||
if (owner_thread->IsSuspended()) {
|
if (owner_thread->IsSuspended()) {
|
||||||
owner_thread->ContinueIfHasKernelWaiters();
|
owner_thread->ContinueIfHasKernelWaiters();
|
||||||
KScheduler::SetSchedulerUpdateNeeded();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +52,7 @@ namespace ams::kern {
|
||||||
KThread *owner_thread = cur_thread->GetLockOwner();
|
KThread *owner_thread = cur_thread->GetLockOwner();
|
||||||
if (AMS_UNLIKELY(owner_thread)) {
|
if (AMS_UNLIKELY(owner_thread)) {
|
||||||
owner_thread->RemoveWaiter(cur_thread);
|
owner_thread->RemoveWaiter(cur_thread);
|
||||||
|
KScheduler::SetSchedulerUpdateNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -899,7 +899,7 @@ namespace ams::fssystem::save {
|
||||||
const s64 cur_offset_end = offset + *size;
|
const s64 cur_offset_end = offset + *size;
|
||||||
size_t cur_size = 0;
|
size_t cur_size = 0;
|
||||||
|
|
||||||
if (!util::IsAligned(offset, this->block_size)) {
|
if (!util::IsAligned(cur_offset_end, this->block_size)) {
|
||||||
const s64 aligned_size = cur_offset_end - util::AlignDown(cur_offset_end, this->block_size);
|
const s64 aligned_size = cur_offset_end - util::AlignDown(cur_offset_end, this->block_size);
|
||||||
cur_size = std::min(aligned_size, static_cast<s64>(*size));
|
cur_size = std::min(aligned_size, static_cast<s64>(*size));
|
||||||
} else if (*size < this->block_size) {
|
} else if (*size < this->block_size) {
|
||||||
|
|
|
@ -15,25 +15,12 @@
|
||||||
*/
|
*/
|
||||||
#include <stratosphere.hpp>
|
#include <stratosphere.hpp>
|
||||||
|
|
||||||
namespace ams::result {
|
|
||||||
|
|
||||||
extern bool CallFatalOnResultAssertion;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ams::result::impl {
|
namespace ams::result::impl {
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAbort(const char *file, int line, const char *func, const char *expr, Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAbort(const char *file, int line, const char *func, const char *expr, Result result) {
|
||||||
/* Assert that we should call fatal on result assertion. */
|
::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription());
|
||||||
/* If we shouldn't fatal, this will abort(); */
|
|
||||||
/* If we should, we'll continue onwards. */
|
|
||||||
if (!ams::result::CallFatalOnResultAssertion) {
|
|
||||||
::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: ams::fatal:: */
|
|
||||||
fatalThrow(result.GetValue());
|
|
||||||
AMS_INFINITE_LOOP();
|
AMS_INFINITE_LOOP();
|
||||||
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAbort(Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAbort(Result result) {
|
||||||
|
@ -41,16 +28,9 @@ namespace ams::result::impl {
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAssertion(const char *file, int line, const char *func, const char *expr, Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAssertion(const char *file, int line, const char *func, const char *expr, Result result) {
|
||||||
/* Assert that we should call fatal on result assertion. */
|
::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription());
|
||||||
/* If we shouldn't fatal, this will assert(); */
|
|
||||||
/* If we should, we'll continue onwards. */
|
|
||||||
if (!ams::result::CallFatalOnResultAssertion) {
|
|
||||||
::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: ams::fatal:: */
|
|
||||||
fatalThrow(result.GetValue());
|
|
||||||
AMS_INFINITE_LOOP();
|
AMS_INFINITE_LOOP();
|
||||||
|
__builtin_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN WEAK_SYMBOL void OnResultAssertion(Result result) {
|
NORETURN WEAK_SYMBOL void OnResultAssertion(Result result) {
|
||||||
|
|
|
@ -47,12 +47,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::AtmosphereProgramId::Mitm;
|
ncm::ProgramId CurrentProgramId = ncm::AtmosphereProgramId::Mitm;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Override. */
|
/* Override. */
|
||||||
void ExceptionHandler(FatalErrorContext *ctx) {
|
void ExceptionHandler(FatalErrorContext *ctx) {
|
||||||
/* We're bpc-mitm (or ams_mitm, anyway), so manually reboot to fatal error. */
|
/* We're bpc-mitm (or ams_mitm, anyway), so manually reboot to fatal error. */
|
||||||
|
|
|
@ -63,12 +63,6 @@ namespace ams {
|
||||||
boot::RebootForFatalError(ctx);
|
boot::RebootForFatalError(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -43,12 +43,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Boot2;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Boot2;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -46,12 +46,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Creport;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Creport;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -41,12 +41,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Dmnt;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Dmnt;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -38,12 +38,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Eclct;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Eclct;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -43,12 +43,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Erpt;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Erpt;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -50,12 +50,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Fatal;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Fatal;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -39,12 +39,6 @@ extern "C" {
|
||||||
namespace ams {
|
namespace ams {
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::JpegDec;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::JpegDec;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -45,12 +45,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Loader;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Loader;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -43,12 +43,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ncm;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ncm;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -43,12 +43,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pgl;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pgl;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -48,12 +48,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pm;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pm;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -40,12 +40,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ro;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ro;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -47,12 +47,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Sm;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Sm;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
|
@ -53,12 +53,6 @@ namespace ams {
|
||||||
|
|
||||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Spl;
|
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Spl;
|
||||||
|
|
||||||
namespace result {
|
|
||||||
|
|
||||||
bool CallFatalOnResultAssertion = false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace ams;
|
using namespace ams;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue