UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
OemHookStatusCodeLib|IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
SerialPortLib|MdePkg/Library/SerialPortLibNull/SerialPortLibNull.inf\r
-\r
+ S3Lib|IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf\r
+ RecoveryLib|IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf\r
+ \r
[LibraryClasses.common.PEIM]\r
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf\r
IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf\r
IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
+\r
+ IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf\r
+ IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf\r
+ \r
IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf\r
IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf\r
--- /dev/null
+/**@file\r
+ Recovery Library. This library class defines a set of methods related do recovery.\r
+\r
+Copyright (c) 2006 - 2007 Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#include <FrameworkPei.h>\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+#include <Ppi/RecoveryModule.h>\r
+\r
+/**\r
+ Calling this function causes the system do recovery.\r
+ \r
+ @retval EFI_SUCESS Sucess to do recovery.\r
+ @retval Others Fail to do recovery.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Recovery (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;\r
+ \r
+ Status = PeiServicesLocatePpi (\r
+ &gEfiPeiRecoveryModulePpiGuid,\r
+ 0,\r
+ NULL,\r
+ (VOID **)&PeiRecovery\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return PeiRecovery->LoadRecoveryCapsule (GetPeiServicesTablePointer(), PeiRecovery);\r
+}\r
+\r
--- /dev/null
+#/** @file\r
+# Recovery Library for PEIM\r
+#\r
+# Copyright (c) 2006 - 2007, Intel Corporation.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiRecoveryLib\r
+ FILE_GUID = C0227547-0811-4cbb-ABEA-DECD22829122\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = RecoveryLib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+ PeiRecoveryLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+ IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+ PeiServicesTablePointerLib\r
+ DebugLib\r
+\r
+[Ppis]\r
+ gEfiPeiRecoveryModulePpiGuid # PPI ALWAYS_CONSUMED\r
+ \r
+
\ No newline at end of file
--- /dev/null
+/**@file\r
+ S3 Library. This library class defines a set of methods related do S3 mode\r
+\r
+Copyright (c) 2006 - 2007 Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#include <FrameworkPei.h>\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+#include <Ppi/S3Resume.h>\r
+\r
+/**\r
+ Calling this function causes the system restore config from S3.\r
+ \r
+ @retval EFI_SUCESS Sucess to restore config from S3.\r
+ @retval Others Fail to restore config from S3.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+S3RestoreConfig (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_PEI_S3_RESUME_PPI *S3Resume;\r
+ \r
+ Status = PeiServicesLocatePpi (\r
+ &gEfiPeiS3ResumePpiGuid,\r
+ 0,\r
+ NULL,\r
+ (VOID **)&S3Resume\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ return S3Resume->S3RestoreConfig (GetPeiServicesTablePointer()); \r
+}\r
+\r
--- /dev/null
+#/** @file\r
+# Graphics Library for UEFI drivers\r
+#\r
+# This library provides supports for basic graphic functions.\r
+# Copyright (c) 2006 - 2007, Intel Corporation.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiS3Lib\r
+ FILE_GUID = EFB7D3A8-DEB9-4bed-B6D6-3B09BEEB835A\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = S3Lib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+ PeiS3Lib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+ IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+ PeiServicesTablePointerLib\r
+ DebugLib\r
+\r
+[Ppis]\r
+ gEfiPeiS3ResumePpiGuid # PPI ALWAYS_CONSUMED\r
+\r
+\r
\r
#include <PiPei.h>\r
#include <Ppi/DxeIpl.h>\r
-#include <Ppi/S3Resume.h>\r
#include <Protocol/EdkDecompress.h>\r
#include <Ppi/EndOfPeiPhase.h>\r
#include <Protocol/CustomizedDecompress.h>\r
#include <Ppi/Security.h>\r
#include <Ppi/SectionExtraction.h>\r
#include <Ppi/FvLoadFile.h>\r
-#include <Ppi/RecoveryModule.h>\r
#include <Ppi/MemoryDiscovered.h>\r
#include <Ppi/Decompress.h>\r
#include <Ppi/FirmwareVolumeInfo.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/PeCoffLib.h>\r
-\r
+#include <Library/S3Lib.h>\r
+#include <Library/RecoveryLib.h>\r
\r
#define STACK_SIZE 0x20000\r
#define BSP_STORE_SIZE 0x4000\r
BaseLib\r
PeimEntryPoint\r
DebugLib\r
-\r
+ S3Lib\r
+ RecoveryLib\r
\r
[Protocols]\r
gEfiCustomizedDecompressProtocolGuid # PROTOCOL SOMETIMES_PRODUCED\r
EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint;\r
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;\r
EFI_BOOT_MODE BootMode;\r
- EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;\r
- EFI_PEI_S3_RESUME_PPI *S3Resume;\r
EFI_PEI_FV_HANDLE VolumeHandle;\r
EFI_PEI_FILE_HANDLE FileHandle;\r
UINTN Instance;\r
ASSERT_EFI_ERROR(Status);\r
\r
if (BootMode == BOOT_ON_S3_RESUME) {\r
- Status = PeiServicesLocatePpi (\r
- &gEfiPeiS3ResumePpiGuid,\r
- 0,\r
- NULL,\r
- (VOID **)&S3Resume\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- Status = S3Resume->S3RestoreConfig (PeiServices);\r
+ Status = S3RestoreConfig();\r
ASSERT_EFI_ERROR (Status);\r
} else if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
-\r
- Status = PeiServicesLocatePpi (\r
- &gEfiPeiRecoveryModulePpiGuid,\r
- 0,\r
- NULL,\r
- (VOID **)&PeiRecovery\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery);\r
+ Status = Recovery ();\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "Load Recovery Capsule Failed.(Status = %r)\n", Status));\r
CpuDeadLoop ();\r
--- /dev/null
+/** @file\r
+ Recovery Library. This library class defines a set of methods related recovery mode.\r
+\r
+ Copyright (c) 2005 - 2007, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __RECOVERY_LIB_H__\r
+#define __RECOVERY_LIB_H__\r
+\r
+/**\r
+ Calling this function causes the system do recovery.\r
+ \r
+ @retval EFI_SUCESS Sucess to do recovery.\r
+ @retval Others Fail to do recovery.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Recovery (\r
+ VOID\r
+ )\r
+;\r
+\r
+#endif\r
+\r
+\r
--- /dev/null
+/** @file\r
+ S3 Library. This library class defines a set of methods related do S3 mode.\r
+\r
+ Copyright (c) 2005 - 2007, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __S3_LIB_H__\r
+#define __S3_LIB_H__\r
+\r
+/**\r
+ Calling this function causes the system restore config from S3.\r
+ \r
+ @retval EFI_SUCESS Sucess to restore config from S3.\r
+ @retval Others Fail to restore config from S3.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+S3RestoreConfig (\r
+ VOID\r
+ )\r
+;\r
+\r
+#endif\r
+\r
--- /dev/null
+/**@file\r
+ Recovery Library. This library class defines a set of methods related do recovery.\r
+\r
+Copyright (c) 2006 - 2007 Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#include <PiPei.h>\r
+\r
+/**\r
+ Calling this function causes the system do recovery.\r
+ \r
+ @retval EFI_SUCESS Sucess to do recovery.\r
+ @retval Others Fail to do recovery.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Recovery (\r
+ VOID\r
+ )\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
--- /dev/null
+#/** @file\r
+# Recovery for PEIM\r
+#\r
+# Copyright (c) 2006 - 2007, Intel Corporation.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiRecoveryLibNull\r
+ FILE_GUID = 41789FB9-02AC-4484-BD40-A3147D7EDA25\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = RecoveryLib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+ PeiRecoveryLibNull.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+\r
+ \r
+
\ No newline at end of file
--- /dev/null
+/**@file\r
+ S3 Library. This library class defines a set of methods related do S3 mode\r
+\r
+Copyright (c) 2006 - 2007 Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+#include <PiPei.h>\r
+\r
+/**\r
+ Calling this function causes the system restore config from S3.\r
+ \r
+ @retval EFI_SUCESS Sucess to restore config from S3.\r
+ @retval Others Fail to restore config from S3.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+S3RestoreConfig (\r
+ VOID\r
+ )\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
+\r
--- /dev/null
+#/** @file\r
+# Graphics Library for UEFI drivers\r
+#\r
+# This library provides supports for basic graphic functions.\r
+# Copyright (c) 2006 - 2007, Intel Corporation.\r
+#\r
+# All rights reserved. This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = PeiS3LibNull\r
+ FILE_GUID = EFB7D3A8-DEB9-4bed-B6D6-3B09BEEB835A\r
+ MODULE_TYPE = PEIM\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = S3Lib|PEIM\r
+ EDK_RELEASE_VERSION = 0x00020000\r
+ EFI_SPECIFICATION_VERSION = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+ PeiS3LibNull.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ BaseLib\r
+\r
PeCoffLoaderLib|Include/Library/PeCoffLoaderLib.h \r
ResetSystemLib|Include/Library/ResetSystemLib.h \r
UdpIoLib|Include/Library/UdpIoLib.h\r
-\r
+ S3Lib|Include/Library/S3Lib.h\r
+ RecoveryLib|Include/Library/RecoveryLib.h\r
+ \r
[Guids.common]\r
\r
gPcdDataBaseHobGuid = { 0xEA296D92, 0x0B69, 0x423C, { 0x8C, 0x28, 0x33, 0xB4, 0xE0, 0xA9, 0x12, 0x68 }}\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf\r
CustomDecompressLib|MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf\r
+ S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
+ RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
\r
[LibraryClasses.IA32]\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf\r
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf\r
MdeModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.inf\r
-\r
+ \r
MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf\r
\r
+ MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
+ MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
+\r
MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
CustomDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+ S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
+ RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
\r
[LibraryClasses.common.BASE]\r
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r