From ff8ff1391d20bd7846a972652c25b7631a9bef8e Mon Sep 17 00:00:00 2001 From: yshang1 Date: Sun, 3 Feb 2008 03:53:58 +0000 Subject: [PATCH] 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 --- .../PeiReportStatusCodeLib.inf | 3 ++ .../ReportStatusCodeLib.c | 45 +++++++++++++++---- Nt32Pkg/Nt32Pkg.dsc | 1 + 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf index a860c7a137..aeee6c182e 100644 --- a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf +++ b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf @@ -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] diff --git a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c index 2d08ccdeb4..c79d93e643 100644 --- a/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c +++ b/IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c @@ -22,6 +22,7 @@ #include #include #include +#include< Library/OemHookStatusCodeLib.h> #include #include @@ -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; } diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index 98e0520fa8..d8f5cd76cd 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -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 -- 2.39.2