From ff8ff1391d20bd7846a972652c25b7631a9bef8e Mon Sep 17 00:00:00 2001 From: yshang1 Date: Sun, 3 Feb 2008 03:53:58 +0000 Subject: 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/ReportStatusCodeLib.c | 45 ++++++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c') 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; } -- cgit v1.2.3