diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-09-26 09:35:36 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-09-26 09:35:36 +0000 |
commit | 4fb31c2c5828aa51a8bfed98778d1be919981d2b (patch) | |
tree | f66ac100b5d772c8c9b0f6823415e4ce8541a686 /IntelFrameworkModulePkg | |
parent | ba7c1a5056a6d4d621c9cb30ad99d741e0fd4dcd (diff) | |
download | edk2-4fb31c2c5828aa51a8bfed98778d1be919981d2b.zip edk2-4fb31c2c5828aa51a8bfed98778d1be919981d2b.tar.gz edk2-4fb31c2c5828aa51a8bfed98778d1be919981d2b.tar.bz2 |
1) Add library classes of S3Lib and RecoveryLib in MdeModulePkg
2) Add NULL instance for above library classes in MdeModulePkg
3) Add Framework implement library instance for above two library classes in IntelFrameworkModulePkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3930 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
5 files changed, 200 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc index a94f836..ebe0bce 100644 --- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc @@ -52,7 +52,9 @@ UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
OemHookStatusCodeLib|IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
SerialPortLib|MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf
-
+ S3Lib|IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf
+ RecoveryLib|IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf
+
[LibraryClasses.common.PEIM]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
@@ -169,6 +171,10 @@ IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf
IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf
+
+ IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf
+ IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf
+
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
diff --git a/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c b/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c new file mode 100644 index 0000000..0538312 --- /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);
+}
+
diff --git a/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf b/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf new file mode 100644 index 0000000..90fcbac --- /dev/null +++ b/IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf @@ -0,0 +1,50 @@ +#/** @file
+# Recovery Library for PEIM
+#
+# 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.
+#
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiRecoveryLib
+ FILE_GUID = C0227547-0811-4cbb-ABEA-DECD22829122
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = RecoveryLib|PEIM
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x00020000
+
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ PeiRecoveryLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+
+[LibraryClasses]
+ BaseLib
+ PeiServicesTablePointerLib
+ DebugLib
+
+[Ppis]
+ gEfiPeiRecoveryModulePpiGuid # PPI ALWAYS_CONSUMED
+
+
\ No newline at end of file diff --git a/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.c b/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.c new file mode 100644 index 0000000..875e116 --- /dev/null +++ b/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.c @@ -0,0 +1,46 @@ +/**@file
+ S3 Library. This library class defines a set of methods related do S3 mode
+
+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/S3Resume.h>
+
+/**
+ Calling this function causes the system restore config from S3.
+
+ @retval EFI_SUCESS Sucess to restore config from S3.
+ @retval Others Fail to restore config from S3.
+**/
+EFI_STATUS
+EFIAPI
+S3RestoreConfig (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ EFI_PEI_S3_RESUME_PPI *S3Resume;
+
+ Status = PeiServicesLocatePpi (
+ &gEfiPeiS3ResumePpiGuid,
+ 0,
+ NULL,
+ (VOID **)&S3Resume
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ return S3Resume->S3RestoreConfig (GetPeiServicesTablePointer());
+}
+
diff --git a/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf b/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf new file mode 100644 index 0000000..929e230 --- /dev/null +++ b/IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf @@ -0,0 +1,51 @@ +#/** @file
+# Graphics Library for UEFI drivers
+#
+# This library provides supports for basic graphic functions.
+# 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.
+#
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiS3Lib
+ FILE_GUID = EFB7D3A8-DEB9-4bed-B6D6-3B09BEEB835A
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = S3Lib|PEIM
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x00020000
+
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ PeiS3Lib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+
+[LibraryClasses]
+ BaseLib
+ PeiServicesTablePointerLib
+ DebugLib
+
+[Ppis]
+ gEfiPeiS3ResumePpiGuid # PPI ALWAYS_CONSUMED
+
+
|