]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Event/Event.c
MdeModulePkg DXE Core: Add Idle event during BootServices WaitForEvent
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Event / Event.c
index 3d15c0c12ba10f31c9762cff98b2dfb8f23d93e6..d9fc7586a70cfcdd8ed3ff7052b1a2d1346e52e3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Event support functions implemented in this file.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -87,6 +87,11 @@ UINT32 mEventTable[] = {
   EVT_TIMER | EVT_NOTIFY_WAIT,\r
 };\r
 \r
+///\r
+/// gIdleLoopEvent - Event which is signalled when the core is idle\r
+///\r
+EFI_EVENT       gIdleLoopEvent = NULL;\r
+\r
 \r
 /**\r
   Enter critical section by acquiring the lock on gEventQueueLock.\r
@@ -134,6 +139,15 @@ CoreInitializeEventServices (
 \r
   CoreInitializeTimer ();\r
 \r
+  CoreCreateEventEx (\r
+    EVT_NOTIFY_SIGNAL,\r
+    TPL_NOTIFY,\r
+    CoreEmptyCallbackFunction,\r
+    NULL,\r
+    &gIdleLoopEventGuid,\r
+    &gIdleLoopEvent\r
+    );\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -630,9 +644,9 @@ CoreWaitForEvent (
     }\r
 \r
     //\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
+    // Signal the Idle event\r
     //\r
+    CoreSignalEvent (gIdleLoopEvent);\r
   }\r
 }\r
 \r
@@ -702,3 +716,4 @@ CoreCloseEvent (
 \r
   return Status;\r
 }\r
+\r