Add conditional check before output status code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7603 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -48,22 +48,28 @@ InternalReportStatusCode (
|
|||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
|
||||||
// If gStatusCode is NULL, then see if a Status Code Protocol instance is present
|
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||
|
||||||
// in the handle database.
|
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {
|
||||||
//
|
//
|
||||||
if (mReportStatusCode == NULL) {
|
// If gStatusCode is NULL, then see if a Status Code Protocol instance is present
|
||||||
mReportStatusCode = InternalGetReportStatusCode ();
|
// in the handle database.
|
||||||
|
//
|
||||||
if (mReportStatusCode == NULL) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,22 +67,28 @@ InternalReportStatusCode (
|
|||||||
CONST EFI_PEI_SERVICES **PeiServices;
|
CONST EFI_PEI_SERVICES **PeiServices;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
PeiServices = GetPeiServicesTablePointer ();
|
if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
|
||||||
Status = (*PeiServices)->ReportStatusCode (
|
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||
|
||||||
PeiServices,
|
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {
|
||||||
Type,
|
PeiServices = GetPeiServicesTablePointer ();
|
||||||
Value,
|
Status = (*PeiServices)->ReportStatusCode (
|
||||||
Instance,
|
PeiServices,
|
||||||
(EFI_GUID *)CallerId,
|
Type,
|
||||||
Data
|
Value,
|
||||||
);
|
Instance,
|
||||||
if (Status == EFI_NOT_AVAILABLE_YET) {
|
(EFI_GUID *)CallerId,
|
||||||
Status = OemHookStatusCodeInitialize ();
|
Data
|
||||||
if (!EFI_ERROR (Status)) {
|
);
|
||||||
return OemHookStatusCodeReport (Type, Value, Instance, (EFI_GUID *) CallerId, Data);
|
if (Status == EFI_NOT_AVAILABLE_YET) {
|
||||||
|
Status = OemHookStatusCodeInitialize ();
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
return OemHookStatusCodeReport (Type, Value, Instance, (EFI_GUID *) CallerId, Data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
return Status;
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user