Update PeiReportStatusCodeLib instance, which will support report data prior to installed the REPORT STATUSCODE PPI.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4665 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1 2008-02-03 03:53:58 +00:00
parent 2a5726b9bf
commit ff8ff1391d
3 changed files with 41 additions and 8 deletions

View File

@ -24,6 +24,8 @@
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
CONSTRUCTOR = PeiReportStatusCodeLibConstructor
#
# The following information is for reference only and not required by the build tools.
@ -46,6 +48,7 @@
BaseMemoryLib
BaseLib
DebugLib
OemHookStatusCodeLib
[Guids]

View File

@ -22,6 +22,7 @@
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include< Library/OemHookStatusCodeLib.h>
#include <Library/PcdLib.h>
#include <DebugInfo.h>
@ -31,6 +32,29 @@
//
#define MAX_EXTENDED_DATA_SIZE 0x200
/**
The constructor function initializes the OEM hooked status
code device.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
@return Status of initialization of OEM hook status code
device.
**/
EFI_STATUS
EFIAPI
PeiReportStatusCodeLibConstructor (
IN EFI_PEI_FILE_HANDLE FileHandle,
IN EFI_PEI_SERVICES **PeiServices
)
{
return OemHookStatusCodeInitialize ();
}
/**
Internal worker function that reports a status code through the Status Code Protocol
@ -65,16 +89,21 @@ InternalReportStatusCode (
)
{
CONST EFI_PEI_SERVICES **PeiServices;
EFI_STATUS Status;
PeiServices = (CONST EFI_PEI_SERVICES **) GetPeiServicesTablePointer ();
return (*PeiServices)->ReportStatusCode (
PeiServices,
Type,
Value,
Instance,
(EFI_GUID *)CallerId,
Data
);
Status = (*PeiServices)->ReportStatusCode (
PeiServices,
Type,
Value,
Instance,
(EFI_GUID *)CallerId,
Data
);
if (Status == EFI_NOT_AVAILABLE_YET) {
return OemHookStatusCodeReport (Type, Value, Instance, (EFI_GUID *) CallerId, Data);
}
return Status;
}

View File

@ -147,6 +147,7 @@
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
OemHookStatusCodeLib|IntelFrameworkModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
PeCoffGetEntryPointLib|Nt32Pkg/Library/Nt32PeiPeCoffGetEntryPointLib/Nt32PeiPeCoffGetEntryPointLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf