[NTOS:KE] Don't hardcode pool tag and TSS flag values (#6051)

Co-authored-by: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
This commit is contained in:
Hermès Bélusca-Maïto 2023-11-20 21:35:57 +01:00
parent 6e449d47e8
commit 2f0a5e546f
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -48,7 +48,7 @@ KeStartAllProcessors(VOID)
DPCStack = NULL;
// Allocate structures for a new CPU.
APInfo = ExAllocatePoolZero(NonPagedPool, sizeof(APINFO), ' eK');
APInfo = ExAllocatePoolZero(NonPagedPool, sizeof(*APInfo), TAG_KERNEL);
if (!APInfo)
break;
ASSERT(ALIGN_DOWN_POINTER_BY(APInfo, PAGE_SIZE) == APInfo);
@ -83,7 +83,7 @@ KeStartAllProcessors(VOID)
KiSetGdtDescriptorBase(KiGetGdtEntry(&APInfo->Gdt, KGDT_TSS), (ULONG_PTR)&APInfo->Tss);
// Clear TSS Busy flag (aka set the type to "TSS (Available)")
KiGetGdtEntry(&APInfo->Gdt, KGDT_TSS)->HighWord.Bits.Type = 0b1001;
KiGetGdtEntry(&APInfo->Gdt, KGDT_TSS)->HighWord.Bits.Type = I386_TSS;
APInfo->TssDoubleFault.Esp0 = (ULONG_PTR)&APInfo->NMIStackData;
APInfo->TssDoubleFault.Esp = (ULONG_PTR)&APInfo->NMIStackData;
@ -146,11 +146,11 @@ KeStartAllProcessors(VOID)
ProcessorCount--;
if (APInfo)
ExFreePoolWithTag(APInfo, ' eK');
ExFreePoolWithTag(APInfo, TAG_KERNEL);
if (KernelStack)
MmDeleteKernelStack(KernelStack, FALSE);
if (DPCStack)
MmDeleteKernelStack(DPCStack, FALSE);
DPRINT1("KeStartAllProcessors: Sucessful AP startup count is %u\n", ProcessorCount);
DPRINT1("KeStartAllProcessors: Successful AP startup count is %u\n", ProcessorCount);
}