/* This function is the entry point of this Status Code Router PEIM. It produces Report Stataus Code Handler PPI and Status Code PPI. */
EFI_STATUS EFIAPI GenericStatusCodePeiEntry(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
/* This function is the entry point of this Status Code Router PEIM. It produces Report Stataus Code Handler PPI and Status Code PPI. */
EFI_STATUS EFIAPI GenericStatusCodePeiEntry(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
{
  EFI_STATUS                 Status;
  EFI_PEI_PPI_DESCRIPTOR     *OldDescriptor;
  EFI_PEI_PROGRESS_CODE_PPI  *OldStatusCodePpi;
  CreateRscHandlerCallbackPacket ();
  Status = PeiServicesInstallPpi (mRscHandlerPpiList);
  ASSERT_EFI_ERROR (Status);
  Status = PeiServicesLocatePpi (
             &gEfiPeiStatusCodePpiGuid,
             0,
             &OldDescriptor,
             (VOID **)&OldStatusCodePpi
             );
  if (!EFI_ERROR (Status)) {
    Status = PeiServicesReInstallPpi (OldDescriptor, mStatusCodePpiList);
  } else {
    Status = PeiServicesInstallPpi (mStatusCodePpiList);
  }
  ASSERT_EFI_ERROR (Status);
  return EFI_SUCCESS;
}