/* This routine enables a PEIM to register itself for shadow when the PEI Foundation discovers permanent memory. */
EFI_STATUS EFIAPI PeiRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
/* This routine enables a PEIM to register itself for shadow when the PEI Foundation discovers permanent memory. */
EFI_STATUS EFIAPI PeiRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
{
  PEI_CORE_INSTANCE  *Private;
  Private = PEI_CORE_INSTANCE_FROM_PS_THIS (GetPeiServicesTablePointer ());
  if (Private->CurrentFileHandle != FileHandle) {
    return EFI_NOT_FOUND;
  }
  if (Private->Fv[Private->CurrentPeimFvCount].PeimState[Private->CurrentPeimCount] >= PEIM_STATE_REGISTER_FOR_SHADOW) {
    return EFI_ALREADY_STARTED;
  }
  Private->Fv[Private->CurrentPeimFvCount].PeimState[Private->CurrentPeimCount] = PEIM_STATE_REGISTER_FOR_SHADOW;
  return EFI_SUCCESS;
}