]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Do not use statically macros of EFI_SPECIFICATION_VERSION: Use gST->Hdr.Revision...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 04:22:00 +0000 (04:22 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 04:22:00 +0000 (04:22 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6448 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c

index 3cb668e9666560dbe31bc2d07bfedf6b91e9c37d..c4fd2afbbde39ee351b8460c09b9e102c66277c2 100644 (file)
@@ -190,8 +190,6 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-\r
 static\r
 VOID\r
 EFIAPI\r
@@ -211,7 +209,7 @@ EventNotifySignalAllNullEvent (
   return;\r
 }\r
 \r
-#endif\r
+\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -245,49 +243,50 @@ Returns:
   UINT32            EventType;\r
   EFI_EVENT_NOTIFY  WorkerNotifyFunction;\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-\r
-  if (NotifyFunction == NULL) {\r
-    EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
-  } else {\r
-    EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;\r
-  }\r
-  WorkerNotifyFunction = NotifyFunction;\r
-\r
-  //\r
-  // prior to UEFI 2.0 use Tiano extension to EFI\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EventType,\r
-                  NotifyTpl,\r
-                  WorkerNotifyFunction,\r
-                  NotifyContext,\r
-                  LegacyBootEvent\r
-                  );\r
-#else\r
-\r
-  EventType = EFI_EVENT_NOTIFY_SIGNAL;\r
-  if (NotifyFunction == NULL) {\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+  \r
+    if (NotifyFunction == NULL) {\r
+      EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
+    } else {\r
+      EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;\r
+    }\r
+    WorkerNotifyFunction = NotifyFunction;\r
+  \r
     //\r
-    // CreatEventEx will check NotifyFunction is NULL or not\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
     //\r
-    WorkerNotifyFunction = EventNotifySignalAllNullEvent;\r
+    Status = gBS->CreateEvent (\r
+                    EventType,\r
+                    NotifyTpl,\r
+                    WorkerNotifyFunction,\r
+                    NotifyContext,\r
+                    LegacyBootEvent\r
+                    );\r
   } else {\r
-    WorkerNotifyFunction = NotifyFunction;\r
+  \r
+    EventType = EFI_EVENT_NOTIFY_SIGNAL;\r
+    if (NotifyFunction == NULL) {\r
+      //\r
+      // CreatEventEx will check NotifyFunction is NULL or not\r
+      //\r
+      WorkerNotifyFunction = EventNotifySignalAllNullEvent;\r
+    } else {\r
+      WorkerNotifyFunction = NotifyFunction;\r
+    }\r
+  \r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EventType,\r
+                    NotifyTpl,\r
+                    WorkerNotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventLegacyBootGuid,\r
+                    LegacyBootEvent\r
+                    );\r
   }\r
 \r
-  //\r
-  // For UEFI 2.0 and the future use an Event Group\r
-  //\r
-  Status = gBS->CreateEventEx (\r
-                  EventType,\r
-                  NotifyTpl,\r
-                  WorkerNotifyFunction,\r
-                  NotifyContext,\r
-                  &gEfiEventLegacyBootGuid,\r
-                  LegacyBootEvent\r
-                  );\r
-#endif\r
   return Status;\r
 }\r
 \r
@@ -324,48 +323,48 @@ Return:
   UINT32            EventType;\r
   EFI_EVENT_NOTIFY  WorkerNotifyFunction;\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-\r
-  if (NotifyFunction == NULL) {\r
-    EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
-  } else {\r
-    EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;\r
-  }\r
-  WorkerNotifyFunction = NotifyFunction;\r
-\r
-  //\r
-  // prior to UEFI 2.0 use Tiano extension to EFI\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EventType,\r
-                  NotifyTpl,\r
-                  WorkerNotifyFunction,\r
-                  NotifyContext,\r
-                  ReadyToBootEvent\r
-                  );\r
-#else\r
-\r
-  EventType = EFI_EVENT_NOTIFY_SIGNAL;\r
-  if (NotifyFunction == NULL) {\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+  \r
+    if (NotifyFunction == NULL) {\r
+      EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
+    } else {\r
+      EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;\r
+    }\r
+    WorkerNotifyFunction = NotifyFunction;\r
+  \r
     //\r
-    // CreatEventEx will check NotifyFunction is NULL or not\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
     //\r
-    WorkerNotifyFunction = EventNotifySignalAllNullEvent;\r
+    Status = gBS->CreateEvent (\r
+                    EventType,\r
+                    NotifyTpl,\r
+                    WorkerNotifyFunction,\r
+                    NotifyContext,\r
+                    ReadyToBootEvent\r
+                    );\r
   } else {\r
-    WorkerNotifyFunction = NotifyFunction;\r
+  \r
+    EventType = EFI_EVENT_NOTIFY_SIGNAL;\r
+    if (NotifyFunction == NULL) {\r
+      //\r
+      // CreatEventEx will check NotifyFunction is NULL or not\r
+      //\r
+      WorkerNotifyFunction = EventNotifySignalAllNullEvent;\r
+    } else {\r
+      WorkerNotifyFunction = NotifyFunction;\r
+    }\r
+  \r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EventType,\r
+                    NotifyTpl,\r
+                    WorkerNotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventReadyToBootGuid,\r
+                    ReadyToBootEvent\r
+                    );\r
   }\r
-\r
-  //\r
-  // For UEFI 2.0 and the future use an Event Group\r
-  //\r
-  Status = gBS->CreateEventEx (\r
-                  EventType,\r
-                  NotifyTpl,\r
-                  WorkerNotifyFunction,\r
-                  NotifyContext,\r
-                  &gEfiEventReadyToBootGuid,\r
-                  ReadyToBootEvent\r
-                  );\r
-#endif\r
   return Status;\r
 }\r