update AP bootstrap code

This commit is contained in:
2024-08-14 13:03:05 +02:00
parent d7a1b01b63
commit 5670398077
2 changed files with 63 additions and 1 deletions

View File

@@ -79,6 +79,8 @@ HlStartProcessor(IN ULONG CpuId,
return STATUS_SUCCESS;
}
extern ULONG_PTR ArBootstrapPageMap;
XTAPI
XTSTATUS
HlStartAllProcessors(VOID)
@@ -95,6 +97,9 @@ HlStartAllProcessors(VOID)
/* Check if at least one AP is present */
if(HlpSystemInfo.CpuCount > 1)
{
/* Save page map address in the bootstrap code */
ArBootstrapPageMap = ArReadControlRegister(3);
/* Allocate 5 pages for AP bootstrap code and ensure it is low memory */
Status = MmAllocateHardwareMemory(AP_SPINUP_PAGE_COUNT, FALSE, &ApPhysicalAddress);
if(Status != STATUS_SUCCESS || ApPhysicalAddress.QuadPart > (0x100000 - AP_SPINUP_PAGE_COUNT * MM_PAGE_SIZE))