]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / PeiRecoveryLib / PeiRecoveryLib.c
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 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11 **/
12 #include <PiPei.h>
13 #include <Library/PeiServicesLib.h>
14 #include <Library/PeiServicesTablePointerLib.h>
15 #include <Library/DebugLib.h>
16
17 #include <Ppi/RecoveryModule.h>
18
19 /**
20 Calling this function causes the system do recovery.
21
22 @retval EFI_SUCESS Sucess to do recovery.
23 @retval Others Fail to do recovery.
24 **/
25 EFI_STATUS
26 EFIAPI
27 PeiRecoverFirmware (
28 VOID
29 )
30 {
31 EFI_STATUS Status;
32 EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;
33
34 Status = PeiServicesLocatePpi (
35 &gEfiPeiRecoveryModulePpiGuid,
36 0,
37 NULL,
38 (VOID **)&PeiRecovery
39 );
40 ASSERT_EFI_ERROR (Status);
41
42 return PeiRecovery->LoadRecoveryCapsule ((EFI_PEI_SERVICES **) GetPeiServicesTablePointer(), PeiRecovery);
43 }
44