Fix the bug in GlueLib that we should depend on the gRT revision to use the proper report status code function.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5889 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2008-09-12 07:54:40 +00:00
parent 2206d5185c
commit 33629bba69
1 changed files with 21 additions and 23 deletions

View File

@ -22,13 +22,11 @@ Abstract:
#include "EdkIIGlueDxe.h" #include "EdkIIGlueDxe.h"
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
// //
// Global pointer to the Status Code Protocol // Global pointer to the Status Code Protocol
// //
static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL; static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
#endif
/** /**
Internal worker function that reports a status code through the Status Code Protocol Internal worker function that reports a status code through the Status Code Protocol
@ -63,10 +61,13 @@ InternalReportStatusCode (
IN EFI_STATUS_CODE_DATA *Data OPTIONAL IN EFI_STATUS_CODE_DATA *Data OPTIONAL
) )
{ {
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
EFI_STATUS Status; EFI_STATUS Status;
if (gRT == NULL) {
return EFI_UNSUPPORTED;
}
if (gRT->Hdr.Revision >= 0x00020000) {
// //
// If gStatusCode is NULL, then see if a Status Code Protocol instance is present // If gStatusCode is NULL, then see if a Status Code Protocol instance is present
// in the handle database. // in the handle database.
@ -83,12 +84,9 @@ InternalReportStatusCode (
// parameters to the ReportStatusCode() service of the Status Code Protocol // parameters to the ReportStatusCode() service of the Status Code Protocol
// //
return (gStatusCode->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data); return (gStatusCode->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
} else {
#else
return (gRT->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data); return (gRT->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
}
#endif
} }