Wire thread startup frame to return to user-mode switch or system thread exit handler
Some checks failed
Builds / ExectOS (amd64, debug) (push) Successful in 25s
Builds / ExectOS (i686, debug) (push) Failing after 28s
Builds / ExectOS (amd64, release) (push) Successful in 39s
Builds / ExectOS (i686, release) (push) Failing after 36s

This commit is contained in:
2026-06-14 01:34:24 +02:00
parent e035666f7a
commit 89681897d7
4 changed files with 40 additions and 0 deletions

View File

@@ -105,6 +105,9 @@ KE::KThread::InitializeThreadContext(IN PKTHREAD Thread,
ThreadFrame->ExceptionFrame.P2Home = (ULONGLONG)StartRoutine;
ThreadFrame->ExceptionFrame.P3Home = (ULONGLONG)SystemRoutine;
ThreadFrame->ExceptionFrame.P4Home = (ULONGLONG)SystemRoutine;
/* Set the routine that will handle the thread finishing its initialization and transition it to UserMode */
ThreadFrame->StartFrame.Return = (ULONG64)SwitchToUserMode;
}
else
{
@@ -113,6 +116,9 @@ KE::KThread::InitializeThreadContext(IN PKTHREAD Thread,
/* Disable floating point state */
Thread->NpxState = NPX_STATE_UNUSED;
/* Set the routine that will handle a system thread that unexpectedly finished its execution */
ThreadFrame->StartFrame.Return = (ULONG64)HandleSystemThreadExit;
}
/* Initialize thread startup information */