Simplify thread frame setup using pointer arithmetic
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 29s
Builds / ExectOS (i686, release) (push) Successful in 30s
Builds / ExectOS (amd64, debug) (push) Successful in 46s
Builds / ExectOS (i686, debug) (push) Successful in 43s

This commit is contained in:
2026-05-22 18:42:41 +02:00
parent 6eb0b4d982
commit 102b357a75

View File

@@ -43,7 +43,7 @@ KE::KThread::InitializeThreadContext(IN PKTHREAD Thread,
PFX_SAVE_FORMAT FxSaveFormat; PFX_SAVE_FORMAT FxSaveFormat;
/* Set initial thread frame */ /* Set initial thread frame */
ThreadFrame = (PKTHREAD_INIT_FRAME)((ULONG_PTR)Thread->InitialStack - sizeof(KTHREAD_INIT_FRAME)); ThreadFrame = ((PKTHREAD_INIT_FRAME)Thread->InitialStack) - 1;
/* Fill floating point save area with zeroes */ /* Fill floating point save area with zeroes */
RTL::Memory::ZeroMemory(&ThreadFrame->NpxFrame, sizeof(FX_SAVE_AREA)); RTL::Memory::ZeroMemory(&ThreadFrame->NpxFrame, sizeof(FX_SAVE_AREA));