Reserve initial thread frame space in AP startup stack

This commit is contained in:
2026-05-22 18:59:43 +02:00
parent 102b357a75
commit 9ac64605d3
7 changed files with 7 additions and 2 deletions

View File

@@ -463,7 +463,7 @@ ApEnterLongMode:
movl %edi, %edi
/* Load dedicated Stack for AP */
movq PROCESSOR_START_BLOCK_Stack(%rdi), %rsp
movq PROCESSOR_START_BLOCK_InitialStack(%rdi), %rsp
/* Save the pointer to PROCESSOR_START_BLOCK */
movq %rdi, %rcx

View File

@@ -311,7 +311,7 @@ ApEnterProtectedMode:
movl %eax, %cr0
/* Load dedicated Stack for AP */
movl PROCESSOR_START_BLOCK_Stack(%edi), %esp
movl PROCESSOR_START_BLOCK_InitialStack(%edi), %esp
/* Save the pointer to PROCESSOR_START_BLOCK */
movl %edi, %ecx

View File

@@ -174,6 +174,7 @@ HL::Cpu::StartAllProcessors(VOID)
StartBlock->Cr3 = AR::CpuFunctions::ReadControlRegister(3);
StartBlock->Cr4 = AR::CpuFunctions::ReadControlRegister(4);
StartBlock->EntryPoint = (PVOID)&KE::KernelInit::BootstrapApplicationProcessor;
StartBlock->InitialStack = (PVOID)((ULONG_PTR)StartBlock->Stack - KTHREAD_STACK_INITIAL_RESERVE);
StartBlock->ProcessorStructures = CpuStructures;
StartBlock->Started = FALSE;