1 /** @file 2 This Library uses Framework RecoveryModule PPI to do system recovery. 3 4 This library instance is no longer used and module using this library 5 class should update to directly locate EFI_PEI_RECOVERY_MODULE_PPI defined 6 in PI 1.2 specification. 7 8 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> 9 This program and the accompanying materials 10 are licensed and made available under the terms and conditions of the BSD License 11 which accompanies this distribution. The full text of the license may be found at 12 http://opensource.org/licenses/bsd-license.php 13 14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 16 17 **/ 18 #include <PiPei.h> 19 #include <Library/PeiServicesLib.h> 20 #include <Library/PeiServicesTablePointerLib.h> 21 #include <Library/DebugLib.h> 22 23 #include <Ppi/RecoveryModule.h> 24 25 /** 26 Calling this function causes the system do recovery. 27 28 @retval EFI_SUCESS Sucess to do recovery. 29 @retval Others Fail to do recovery. 30 **/ 31 EFI_STATUS 32 EFIAPI 33 PeiRecoverFirmware ( 34 VOID 35 ) 36 { 37 EFI_STATUS Status; 38 EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery; 39 40 Status = PeiServicesLocatePpi ( 41 &gEfiPeiRecoveryModulePpiGuid, 42 0, 43 NULL, 44 (VOID **)&PeiRecovery 45 ); 46 ASSERT_EFI_ERROR (Status); 47 48 return PeiRecovery->LoadRecoveryCapsule ((EFI_PEI_SERVICES **) GetPeiServicesTablePointer(), PeiRecovery); 49 } 50 51