Skip to content

Commit

Permalink
[NTOS:KE] Don't hardcode pool tag and TSS flag values.
Browse files Browse the repository at this point in the history
  • Loading branch information
HBelusca committed Nov 28, 2023
1 parent 8c3f7b1 commit 4b99350
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ntoskrnl/ke/i386/mproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

0 comments on commit 4b99350

Please sign in to comment.