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
This commit is contained in:
klu2 2007-09-26 09:35:36 +00:00
parent ba7c1a5056
commit 4fb31c2c58
17 changed files with 429 additions and 28 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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());
}

View File

@ -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

View File

@ -22,7 +22,6 @@ Abstract:
#include <PiPei.h>
#include <Ppi/DxeIpl.h>
#include <Ppi/S3Resume.h>
#include <Protocol/EdkDecompress.h>
#include <Ppi/EndOfPeiPhase.h>
#include <Protocol/CustomizedDecompress.h>
@ -30,7 +29,6 @@ Abstract:
#include <Ppi/Security.h>
#include <Ppi/SectionExtraction.h>
#include <Ppi/FvLoadFile.h>
#include <Ppi/RecoveryModule.h>
#include <Ppi/MemoryDiscovered.h>
#include <Ppi/Decompress.h>
#include <Ppi/FirmwareVolumeInfo.h>
@ -52,7 +50,8 @@ Abstract:
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/PeCoffLib.h>
#include <Library/S3Lib.h>
#include <Library/RecoveryLib.h>
#define STACK_SIZE 0x20000
#define BSP_STORE_SIZE 0x4000

View File

@ -75,7 +75,8 @@
BaseLib
PeimEntryPoint
DebugLib
S3Lib
RecoveryLib
[Protocols]
gEfiCustomizedDecompressProtocolGuid # PROTOCOL SOMETIMES_PRODUCED

View File

@ -185,8 +185,6 @@ DxeLoadCore (
EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint;
EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader;
EFI_BOOT_MODE BootMode;
EFI_PEI_RECOVERY_MODULE_PPI *PeiRecovery;
EFI_PEI_S3_RESUME_PPI *S3Resume;
EFI_PEI_FV_HANDLE VolumeHandle;
EFI_PEI_FILE_HANDLE FileHandle;
UINTN Instance;
@ -198,27 +196,10 @@ DxeLoadCore (
ASSERT_EFI_ERROR(Status);
if (BootMode == BOOT_ON_S3_RESUME) {
Status = PeiServicesLocatePpi (
&gEfiPeiS3ResumePpiGuid,
0,
NULL,
(VOID **)&S3Resume
);
ASSERT_EFI_ERROR (Status);
Status = S3Resume->S3RestoreConfig (PeiServices);
Status = S3RestoreConfig();
ASSERT_EFI_ERROR (Status);
} else if (BootMode == BOOT_IN_RECOVERY_MODE) {
Status = PeiServicesLocatePpi (
&gEfiPeiRecoveryModulePpiGuid,
0,
NULL,
(VOID **)&PeiRecovery
);
ASSERT_EFI_ERROR (Status);
Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery);
Status = Recovery ();
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Load Recovery Capsule Failed.(Status = %r)\n", Status));
CpuDeadLoop ();

View File

@ -0,0 +1,33 @@
/** @file
Recovery Library. This library class defines a set of methods related recovery mode.
Copyright (c) 2005 - 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.
**/
#ifndef __RECOVERY_LIB_H__
#define __RECOVERY_LIB_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
)
;
#endif

View File

@ -0,0 +1,32 @@
/** @file
S3 Library. This library class defines a set of methods related do S3 mode.
Copyright (c) 2005 - 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.
**/
#ifndef __S3_LIB_H__
#define __S3_LIB_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
)
;
#endif

View File

@ -0,0 +1,30 @@
/**@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 <PiPei.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
)
{
return EFI_UNSUPPORTED;
}

View File

@ -0,0 +1,44 @@
#/** @file
# Recovery 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 = PeiRecoveryLibNull
FILE_GUID = 41789FB9-02AC-4484-BD40-A3147D7EDA25
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]
PeiRecoveryLibNull.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
BaseLib

View File

@ -0,0 +1,30 @@
/**@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 <PiPei.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
)
{
return EFI_UNSUPPORTED;
}

View File

@ -0,0 +1,43 @@
#/** @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 = PeiS3LibNull
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]
PeiS3LibNull.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
BaseLib

View File

@ -32,7 +32,9 @@
PeCoffLoaderLib|Include/Library/PeCoffLoaderLib.h
ResetSystemLib|Include/Library/ResetSystemLib.h
UdpIoLib|Include/Library/UdpIoLib.h
S3Lib|Include/Library/S3Lib.h
RecoveryLib|Include/Library/RecoveryLib.h
[Guids.common]
gPcdDataBaseHobGuid = { 0xEA296D92, 0x0B69, 0x423C, { 0x8C, 0x28, 0x33, 0xB4, 0xE0, 0xA9, 0x12, 0x68 }}

View File

@ -43,6 +43,8 @@
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
PeCoffLoaderLib|MdeModulePkg/Library/PeiDxePeCoffLoaderLib/PeCoffLoaderLib.inf
CustomDecompressLib|MdePkg/Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.inf
S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
[LibraryClasses.IA32]
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
@ -376,11 +378,14 @@
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
MdeModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.inf
MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf

View File

@ -77,6 +77,8 @@
CustomDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf
S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf
RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
[LibraryClasses.common.BASE]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf