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