/* Adjust the pool head position to make sure the Guard page is adjavent to pool tail or pool head. */
VOID* AdjustPoolHeadA(IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NoPages, IN UINTN Size)
/* Adjust the pool head position to make sure the Guard page is adjavent to pool tail or pool head. */
VOID* AdjustPoolHeadA(IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NoPages, IN UINTN Size)
{
  if ((Memory == 0) || ((PcdGet8 (PcdHeapGuardPropertyMask) & BIT7) != 0)) {
    return (VOID *)(UINTN)Memory;
  }
  Size = ALIGN_VALUE (Size, 8);
  return (VOID *)(UINTN)(Memory + EFI_PAGES_TO_SIZE (NoPages) - Size);
}