]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
Base on PI spec, GetPeiServicesTablePointer is updated to return CONST EFI_PEI_SERVIC...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / PeiRecoveryLib / PeiRecoveryLib.c
CommitLineData
4fb31c2c 1/**@file\r
2 Recovery Library. This library class defines a set of methods related do recovery.\r
3\r
1b641bb8 4Copyright (c) 2006 - 2008 Intel Corporation\r
4fb31c2c 5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14#include <FrameworkPei.h>\r
15#include <Library/PeiServicesLib.h>\r
16#include <Library/PeiServicesTablePointerLib.h>\r
17#include <Library/DebugLib.h>\r
18\r
19#include <Ppi/RecoveryModule.h>\r
20\r
21/**\r
22 Calling this function causes the system do recovery.\r
23 \r
24 @retval EFI_SUCESS Sucess to do recovery.\r
25 @retval Others Fail to do recovery.\r
26**/\r
27EFI_STATUS\r
28EFIAPI\r
e8da1266 29PeiRecoverFirmware (\r
4fb31c2c 30 VOID\r
31 )\r
32{\r
33 EFI_STATUS Status;\r
34 EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;\r
35 \r
36 Status = PeiServicesLocatePpi (\r
37 &gEfiPeiRecoveryModulePpiGuid,\r
38 0,\r
39 NULL,\r
40 (VOID **)&PeiRecovery\r
41 );\r
42 ASSERT_EFI_ERROR (Status);\r
43\r
1b641bb8 44 return PeiRecovery->LoadRecoveryCapsule ((EFI_PEI_SERVICES **) GetPeiServicesTablePointer(), PeiRecovery);\r
4fb31c2c 45}\r
46\r