summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c')
-rw-r--r--IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c b/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
new file mode 100644
index 0000000000..053831235b
--- /dev/null
+++ b/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
@@ -0,0 +1,46 @@
+/**@file
+ Recovery Library. This library class defines a set of methods related do recovery.
+
+Copyright (c) 2006 - 2007 Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#include <FrameworkPei.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PeiServicesTablePointerLib.h>
+#include <Library/DebugLib.h>
+
+#include <Ppi/RecoveryModule.h>
+
+/**
+ Calling this function causes the system do recovery.
+
+ @retval EFI_SUCESS Sucess to do recovery.
+ @retval Others Fail to do recovery.
+**/
+EFI_STATUS
+EFIAPI
+Recovery (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;
+
+ Status = PeiServicesLocatePpi (
+ &gEfiPeiRecoveryModulePpiGuid,
+ 0,
+ NULL,
+ (VOID **)&PeiRecovery
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ return PeiRecovery->LoadRecoveryCapsule (GetPeiServicesTablePointer(), PeiRecovery);
+}
+