/* PcdCpuApStackSize must be configured with value taking the Guard page into account. */
VOID EFIAPI GetStackBase(IN OUT VOID *Buffer)
/* PcdCpuApStackSize must be configured with value taking the Guard page into account. */
VOID EFIAPI GetStackBase(IN OUT VOID *Buffer)
{
  EFI_PHYSICAL_ADDRESS  StackBase;
  UINTN                 Index;
  MpInitLibWhoAmI (&Index);
  StackBase  = (EFI_PHYSICAL_ADDRESS)(UINTN)&StackBase;
  StackBase += BASE_4KB;
  StackBase &= ~((EFI_PHYSICAL_ADDRESS)BASE_4KB - 1);
  StackBase -= PcdGet32 (PcdCpuApStackSize);
  *((EFI_PHYSICAL_ADDRESS *)Buffer + Index) = StackBase;
}