summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-12 07:54:40 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-12 07:54:40 +0000
commit33629bba69a3fc8e77b14677bbe8a00c879a3d6c (patch)
treefca9c2840564cae2aeb27986828da3a43aaf0b72
parent2206d5185ce8a7f2049c50ca9defb3fefe84e245 (diff)
downloadedk2-platforms-33629bba69a3fc8e77b14677bbe8a00c879a3d6c.tar.xz
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
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
index 2178d742e1..0526d22073 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
@@ -22,13 +22,11 @@ Abstract:
#include "EdkIIGlueDxe.h"
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
//
// Global pointer to the Status Code Protocol
//
static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
-#endif
/**
Internal worker function that reports a status code through the Status Code Protocol
@@ -63,32 +61,32 @@ InternalReportStatusCode (
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
EFI_STATUS Status;
- //
- // If gStatusCode is NULL, then see if a Status Code Protocol instance is present
- // in the handle database.
- //
- if (gStatusCode == NULL) {
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
- return EFI_UNSUPPORTED;
- }
+ if (gRT == 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 (gStatusCode->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
-
-#else
-
- return (gRT->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
+ if (gRT->Hdr.Revision >= 0x00020000) {
+ //
+ // If gStatusCode is NULL, then see if a Status Code Protocol instance is present
+ // in the handle database.
+ //
+ if (gStatusCode == NULL) {
+ Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
+ if (EFI_ERROR (Status) || gStatusCode == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+ }
-#endif
+ //
+ // 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 (gStatusCode->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
+ } else {
+ return (gRT->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
+ }
}