X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FLibrary%2FDxeReportStatusCodeLibFramework%2FReportStatusCodeLib.c;h=9e35cdda9083f5e6094099352758d35473437f03;hp=f29831563c083fd62d919a46896e87646ef4900d;hb=15cd6a822c3b96cc3d5e12d4ec271b686e7d0bd8;hpb=1d0cab2ec2f57a31832799473a5174a422ce2ed0 diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c index f29831563c..9e35cdda90 100644 --- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c +++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c @@ -48,22 +48,28 @@ InternalReportStatusCode ( IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) { - // - // If gStatusCode is NULL, then see if a Status Code Protocol instance is present - // in the handle database. - // - if (mReportStatusCode == NULL) { - mReportStatusCode = InternalGetReportStatusCode (); + if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) || + (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) || + (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) { + // + // If gStatusCode is NULL, then see if a Status Code Protocol instance is present + // in the handle database. + // if (mReportStatusCode == NULL) { - return EFI_UNSUPPORTED; + mReportStatusCode = InternalGetReportStatusCode (); + if (mReportStatusCode == NULL) { + return EFI_UNSUPPORTED; + } } + + // + // A Status Code Protocol is present in the handle database, so pass in all the + // parameters to the ReportStatusCode() service of the Status Code Protocol + // + return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data); } - - // - // A Status Code Protocol is present in the handle database, so pass in all the - // parameters to the ReportStatusCode() service of the Status Code Protocol - // - return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data); + + return EFI_UNSUPPORTED; }