summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
index 4c071f2dbe..a8145cd28a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
@@ -23,7 +23,9 @@ Abstract:
#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
STATIC EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
+#endif
EFI_STATUS
EfiLibReportStatusCode (
@@ -56,37 +58,34 @@ Returns:
--*/
{
EFI_STATUS Status;
-
- Status = EFI_UNSUPPORTED;
- if (gRT->Hdr.Revision >= 0x00020000) {
- if (gStatusCode == NULL) {
- if (gBS == NULL) {
- return EFI_UNSUPPORTED;
- }
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
- return EFI_UNSUPPORTED;
- }
- }
- Status = gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);
- } else {
- if (gRT == NULL) {
- return EFI_UNSUPPORTED;
- }
- //
- // Check whether EFI_RUNTIME_SERVICES has Tiano Extension
- //
- Status = EFI_UNSUPPORTED;
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
- if (gRT->Hdr.Revision == EFI_SPECIFICATION_VERSION &&
- gRT->Hdr.HeaderSize == sizeof (EFI_RUNTIME_SERVICES) &&
- gRT->ReportStatusCode != NULL) {
- Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);
-#endif
- }
- }
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ if (gStatusCode == NULL) {
+ if (gBS == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+ Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
+ if (EFI_ERROR (Status) || gStatusCode == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+ }
+ Status = gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);
return Status;
+#else
+ if (gRT == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+ //
+ // Check whether EFI_RUNTIME_SERVICES has Tiano Extension
+ //
+ Status = EFI_UNSUPPORTED;
+ if (gRT->Hdr.Revision == EFI_SPECIFICATION_VERSION &&
+ gRT->Hdr.HeaderSize == sizeof (EFI_RUNTIME_SERVICES) &&
+ gRT->ReportStatusCode != NULL) {
+ Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);
+ }
+ return Status;
+#endif
}
EFI_STATUS