diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-23 07:16:03 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-23 07:16:03 +0000 |
commit | bdabfae78d16baed7c0f3247c8be30e9092de227 (patch) | |
tree | 06a58abc1e92d0d62499340e091df3df4b833ada /EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib | |
parent | 90d6d599d90330b279d7f3c0cb5d853e663e5145 (diff) | |
download | edk2-platforms-bdabfae78d16baed7c0f3247c8be30e9092de227.tar.xz |
Update EfiLibReportStatusCode in ECP EfiDriverLib and EfiRuntimeLib libraries to check uefi version in runtime not in build time.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5947 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib')
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c index a8145cd28a..4c071f2dbe 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c +++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c @@ -23,9 +23,7 @@ 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 (
@@ -58,34 +56,37 @@ Returns: --*/
{
EFI_STATUS Status;
-
-#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;
+
+ 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
+ }
+ }
+ return Status;
}
EFI_STATUS
|