/* Get the mem size need to be consumed and reserved in PEI phase. */
UINT64 GetPeiMemSize(IN EFI_PEI_SERVICES **PeiServices, IN UINT32 BootMode)
/* Get the mem size need to be consumed and reserved in PEI phase. */
UINT64 GetPeiMemSize(IN EFI_PEI_SERVICES **PeiServices, IN UINT32 BootMode)
{
  UINT64  Size;
  UINT64  MinSize;
  if (BootMode == BOOT_IN_RECOVERY_MODE) {
    return PcdGet32 (PcdPeiRecoveryMinMemSize);
  }
  Size = GetMemorySizeInMemoryTypeInformation (PeiServices);
  if (BootMode == BOOT_ON_FLASH_UPDATE) {
    MinSize = PcdGet32 (PcdPeiMinMemSize);
  } else {
    MinSize = PcdGet32 (PcdPeiMinMemSize);
  }
  return MinSize + Size + PEI_ADDITIONAL_MEMORY_SIZE;
}