]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/Dxe/Event/event.c
1. Removed #ifdef EDK_RELEASE_VERSION from all c files for all modules
[mirror_edk2.git] / EdkModulePkg / Core / Dxe / Event / event.c
index 3749657276e4de51d9df0ab247fee73a5886e8e6..8f2934e71118a487191e6036399b3125e03702f8 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
@@ -16,7 +16,7 @@ Module Name:
 Abstract:\r
 \r
     EFI Event support\r
\r
+\r
 --*/\r
 \r
 \r
@@ -37,17 +37,17 @@ UINT32 mEventTable[] = {
   //\r
   EFI_EVENT_TIMER,\r
   //\r
-  // 0x00000100       Generic event with a notification function that \r
+  // 0x00000100       Generic event with a notification function that\r
   // can be waited on with CheckEvent() or WaitForEvent()\r
   //\r
   EFI_EVENT_NOTIFY_WAIT,\r
   //\r
-  // 0x00000200       Generic event with a notification function that \r
+  // 0x00000200       Generic event with a notification function that\r
   // is queue when the event is signaled with SignalEvent()\r
   //\r
   EFI_EVENT_NOTIFY_SIGNAL,\r
   //\r
-  // 0x00000201       ExitBootServicesEvent.  \r
+  // 0x00000201       ExitBootServicesEvent.\r
   //\r
   EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
   //\r
@@ -55,33 +55,14 @@ UINT32 mEventTable[] = {
   //\r
   EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // 0x00000203       ReadyToBootEvent.\r
-  //\r
-  EFI_EVENT_SIGNAL_READY_TO_BOOT,\r
-  //\r
-  // 0x00000204       LegacyBootEvent.\r
-  //\r
-  EFI_EVENT_SIGNAL_LEGACY_BOOT,\r
-  //\r
-  // 0x00000603       Signal all ReadyToBootEvents.\r
-  //\r
-  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_READY_TO_BOOT,\r
-  //\r
-  // 0x00000604       Signal all LegacyBootEvents.\r
-  //\r
-  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_LEGACY_BOOT,\r
-#endif\r
-\r
   //\r
-  // 0x00000000       Generic event without a notification function. \r
-  // It can be signaled with SignalEvent() and checked with CheckEvent() \r
+  // 0x00000000       Generic event without a notification function.\r
+  // It can be signaled with SignalEvent() and checked with CheckEvent()\r
   // or WaitForEvent().\r
   //\r
   0x00000000,\r
   //\r
-  // 0x80000100       Timer event with a notification function that can be \r
+  // 0x80000100       Timer event with a notification function that can be\r
   // waited on with CheckEvent() or WaitForEvent()\r
   //\r
   EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_WAIT,\r
@@ -149,7 +130,7 @@ Routine Description:
 Arguments:\r
 \r
   None\r
-    \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS - Always return success\r
@@ -163,7 +144,7 @@ Returns:
   }\r
 \r
   CoreInitializeTimer ();\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -176,12 +157,12 @@ CoreDispatchEventNotifies (
 \r
 Routine Description:\r
 \r
-  Dispatches all pending events. \r
+  Dispatches all pending events.\r
 \r
 Arguments:\r
 \r
   Priority - The task priority level of event notifications to dispatch\r
-    \r
+\r
 Returns:\r
 \r
   None\r
@@ -190,7 +171,7 @@ Returns:
 {\r
   IEVENT          *Event;\r
   LIST_ENTRY      *Head;\r
-  \r
+\r
   CoreAcquireEventLock ();\r
   ASSERT (gEventQueueLock.OwnerTpl == Priority);\r
   Head = &gEventQueue[Priority];\r
@@ -199,7 +180,7 @@ Returns:
   // Dispatch all the pending notifications\r
   //\r
   while (!IsListEmpty (Head)) {\r
-      \r
+\r
     Event = CR (Head->ForwardLink, IEVENT, NotifyLink, EVENT_SIGNATURE);\r
     RemoveEntryList (&Event->NotifyLink);\r
 \r
@@ -214,7 +195,7 @@ Returns:
     }\r
 \r
     CoreReleaseEventLock ();\r
-      \r
+\r
     //\r
     // Notify this event\r
     //\r
@@ -246,7 +227,7 @@ Routine Description:
 Arguments:\r
 \r
   Event       - The Event to notify\r
-    \r
+\r
 Returns:\r
 \r
   None\r
@@ -268,7 +249,7 @@ Returns:
     Event->NotifyLink.ForwardLink = NULL;\r
   }\r
 \r
-  // \r
+  //\r
   // Queue the event to the pending notification list\r
   //\r
 \r
@@ -289,7 +270,7 @@ Routine Description:
 \r
 Arguments:\r
   EventGroup - The list to signal\r
-    \r
+\r
 Returns:\r
 \r
   None\r
@@ -313,33 +294,6 @@ Returns:
   CoreReleaseEventLock ();\r
 }\r
 \r
-\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-\r
-static\r
-VOID\r
-EFIAPI\r
-EventNotifySignalAllNullEvent (\r
-  IN EFI_EVENT                Event,\r
-  IN VOID                     *Context\r
-  )\r
-{\r
-  //\r
-  // This null event is a size efficent way to enusre that \r
-  // EFI_EVENT_NOTIFY_SIGNAL_ALL is error checked correctly.\r
-  // EFI_EVENT_NOTIFY_SIGNAL_ALL is now mapped into \r
-  // CreateEventEx() and this function is used to make the\r
-  // old error checking in CreateEvent() for Tiano extensions\r
-  // function.\r
-  //\r
-  return;\r
-}\r
-\r
-#endif\r
-\r
-\r
-\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 CoreCreateEvent (\r
@@ -368,42 +322,22 @@ Returns:
   EFI_OUT_OF_RESOURCES  - The event could not be allocated\r
 \r
 --*/\r
-{ \r
+{\r
   EFI_GUID            *GuidPtr;\r
   EFI_EVENT_NOTIFY    Function;\r
-  \r
+\r
   GuidPtr = NULL;\r
   Function = NotifyFunction;\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // Clear EFI_EVENT_NOFITY_SIGNAL_ALL (Tiano extension) as all events in the \r
-  //  EventGroup now have this property. So we need to filter it out.\r
-  //\r
-  if (Type & EFI_EVENT_NOTIFY_SIGNAL_ALL) {\r
-    Type &= ~EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
-    Function = EventNotifySignalAllNullEvent;\r
-  }\r
-\r
-  //\r
-  // Map the Tiano extensions Events to CreateEventEx form\r
-  //\r
-  if (Type == EFI_EVENT_SIGNAL_READY_TO_BOOT) {\r
-    GuidPtr = &gEfiEventReadyToBootGuid;\r
-  } else if (Type == EFI_EVENT_SIGNAL_LEGACY_BOOT) {\r
-    GuidPtr = &gEfiEventLegacyBootGuid\r
-  }\r
-#endif\r
-\r
   //\r
   // Convert EFI 1.10 Events to thier UEFI 2.0 CreateEventEx mapping\r
-  // \r
+  //\r
   if (Type == EVENT_SIGNAL_EXIT_BOOT_SERVICES) {\r
     GuidPtr = &gEfiEventExitBootServicesGuid;\r
   } else if (Type == EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {\r
     GuidPtr = &gEfiEventVirtualAddressChangeGuid;\r
   }\r
-  \r
+\r
   return CoreCreateEventEx (Type, NotifyTpl, Function, NotifyContext, GuidPtr, Event);\r
 }\r
 \r
@@ -469,8 +403,8 @@ Returns:
     //\r
     // Check for an invalid NotifyFunction or NotifyTpl\r
     //\r
-    if ((NotifyFunction == NULL) || \r
-        (NotifyTpl < EFI_TPL_APPLICATION) || \r
+    if ((NotifyFunction == NULL) ||\r
+        (NotifyTpl < EFI_TPL_APPLICATION) ||\r
        (NotifyTpl >= EFI_TPL_HIGH_LEVEL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
@@ -488,7 +422,7 @@ Returns:
   // Allcoate and initialize a new event structure.\r
   //\r
   Status = CoreAllocatePool (\r
-             (Type & EFI_EVENT_RUNTIME) ? EfiRuntimeServicesData: EfiBootServicesData, \r
+             (Type & EFI_EVENT_RUNTIME) ? EfiRuntimeServicesData: EfiBootServicesData,\r
              sizeof (IEVENT),\r
              (VOID **)&IEvent\r
              );\r
@@ -500,7 +434,7 @@ Returns:
 \r
   IEvent->Signature = EVENT_SIGNATURE;\r
   IEvent->Type = Type;\r
-  \r
+\r
   IEvent->NotifyTpl      = NotifyTpl;\r
   IEvent->NotifyFunction = NotifyFunction;\r
   IEvent->NotifyContext  = (VOID *)NotifyContext;\r
@@ -524,16 +458,16 @@ Returns:
   }\r
 \r
   CoreAcquireEventLock ();\r
-  \r
+\r
   if ((Type & EFI_EVENT_NOTIFY_SIGNAL) != 0x00000000) {\r
     //\r
     // The Event's NotifyFunction must be queued whenever the event is signaled\r
     //\r
     InsertHeadList (&gEventSignalQueue, &IEvent->SignalLink);\r
   }\r
-  \r
+\r
   CoreReleaseEventLock ();\r
-  \r
+\r
   //\r
   // Done\r
   //\r
@@ -552,15 +486,15 @@ CoreSignalEvent (
 Routine Description:\r
 \r
   Signals the event.  Queues the event to be notified if needed\r
-    \r
+\r
 Arguments:\r
 \r
   UserEvent - The event to signal\r
-    \r
+\r
 Returns:\r
 \r
   EFI_INVALID_PARAMETER - Parameters are not valid.\r
-  \r
+\r
   EFI_SUCCESS - The event was signaled.\r
 \r
 --*/\r
@@ -592,8 +526,8 @@ Returns:
     if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {\r
       if (Event->ExFlag) {\r
         //\r
-        // The CreateEventEx() style requires all members of the Event Group \r
-        //  to be signaled. \r
+        // The CreateEventEx() style requires all members of the Event Group\r
+        //  to be signaled.\r
         //\r
         CoreReleaseEventLock ();\r
         CoreNotifySignalList (&Event->EventGroup);\r
@@ -619,11 +553,11 @@ CoreCheckEvent (
 Routine Description:\r
 \r
   Check the status of an event\r
-    \r
+\r
 Arguments:\r
 \r
   UserEvent - The event to check\r
-    \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS           - The event is in the signaled state\r
@@ -697,17 +631,17 @@ CoreWaitForEvent (
 Routine Description:\r
 \r
   Stops execution until an event is signaled.\r
-    \r
+\r
 Arguments:\r
 \r
   NumberOfEvents  - The number of events in the UserEvents array\r
   UserEvents      - An array of EFI_EVENT\r
   UserIndex       - Pointer to the index of the event which satisfied the wait condition\r
-    \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS           - The event indicated by Index was signaled.\r
-  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or \r
+  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or\r
                           Event was not a valid type\r
   EFI_UNSUPPORTED       - The current TPL is not TPL_APPLICATION\r
 \r
@@ -725,7 +659,7 @@ Returns:
   }\r
 \r
   for(;;) {\r
-      \r
+\r
     for(Index = 0; Index < NumberOfEvents; Index++) {\r
 \r
       Status = CoreCheckEvent (UserEvents[Index]);\r
@@ -742,7 +676,7 @@ Returns:
     //\r
     // This was the location of the Idle loop callback in EFI 1.x reference\r
     // code. We don't have that concept in this base at this point.\r
-    // \r
+    //\r
   }\r
 }\r
 \r
@@ -757,15 +691,15 @@ CoreCloseEvent (
 Routine Description:\r
 \r
   Closes an event and frees the event structure.\r
-    \r
+\r
 Arguments:\r
 \r
   UserEvent - Event to close\r
-    \r
+\r
 Returns:\r
 \r
   EFI_INVALID_PARAMETER - Parameters are not valid.\r
-  \r
+\r
   EFI_SUCCESS - The event has been closed\r
 \r
 --*/\r
@@ -796,11 +730,11 @@ Returns:
   //\r
   // If the event is queued somewhere, remove it\r
   //\r
-  \r
+\r
   if (Event->RuntimeData.Link.ForwardLink != NULL) {\r
     RemoveEntryList (&Event->RuntimeData.Link);\r
   }\r
-  \r
+\r
   if (Event->NotifyLink.ForwardLink != NULL) {\r
     RemoveEntryList (&Event->NotifyLink);\r
   }\r