coreinit: Rework thread creation

New implementation is much closer to console behavior. For example we didn't align the stack which would cause crashes in the Miiverse applet
This commit is contained in:
Exzap 2024-05-04 07:05:59 +02:00
parent 041f29a914
commit a16c37f0c5
10 changed files with 297 additions and 117 deletions

View file

@ -155,7 +155,7 @@ void ExceptionHandler_LogGeneralInfo()
const char* threadName = "NULL";
if (!threadItrBE->threadName.IsNull())
threadName = threadItrBE->threadName.GetPtr();
sprintf(dumpLine, "%08x Ent %08x IP %08x LR %08x %-9s Aff %d%d%d Pri %2d Name %s", threadItrMPTR, _swapEndianU32(threadItrBE->entrypoint), threadItrBE->context.srr0, _swapEndianU32(threadItrBE->context.lr), threadStateStr, (affinity >> 0) & 1, (affinity >> 1) & 1, (affinity >> 2) & 1, effectivePriority, threadName);
sprintf(dumpLine, "%08x Ent %08x IP %08x LR %08x %-9s Aff %d%d%d Pri %2d Name %s", threadItrMPTR, threadItrBE->entrypoint.GetMPTR(), threadItrBE->context.srr0, _swapEndianU32(threadItrBE->context.lr), threadStateStr, (affinity >> 0) & 1, (affinity >> 1) & 1, (affinity >> 2) & 1, effectivePriority, threadName);
// write line to log
CrashLog_WriteLine(dumpLine);
}