]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg DXE Core: Add Idle event during BootServices WaitForEvent
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Jun 2011 23:28:02 +0000 (23:28 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Jun 2011 23:28:02 +0000 (23:28 +0000)
Signal an Idle event during BootServices WaitForEvent.

Signed-off-by: jljusten
Reviewed-by: mdkinney
Reviewed-by: rsun3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11841 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Dxe/DxeMain.h
MdeModulePkg/Core/Dxe/DxeMain.inf
MdeModulePkg/Core/Dxe/Event/Event.c
MdeModulePkg/Include/Guid/IdleLoopEvent.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

index 79b895bcfa68bb065044601c7284dbab264caf13..09c7093518723b8a1b587c34f6bd2e0c76fb00a9 100644 (file)
@@ -26,7 +26,7 @@
   Depex - Dependency Expresion.\r
   SOR   - Schedule On Request - Don't schedule if this bit is set.\r
 \r
-Copyright (c) 2006 - 2010, 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
@@ -402,7 +402,7 @@ CoreTrust (
 **/\r
 VOID\r
 EFIAPI\r
-EmptyFuntion (\r
+CoreEmptyCallbackFunction (\r
   IN EFI_EVENT                Event,\r
   IN VOID                     *Context\r
   )\r
@@ -450,7 +450,7 @@ CoreDispatcher (
   Status = CoreCreateEventEx (\r
              EVT_NOTIFY_SIGNAL,\r
              TPL_NOTIFY,\r
-             EmptyFuntion,\r
+             CoreEmptyCallbackFunction,\r
              NULL,\r
              &gEfiEventDxeDispatchGuid,\r
              &DxeDispatchEvent\r
index f5651026fa9c1cd3e1f1b95803854d9e7c06e615..dfd4980eac03971bf51977269e6b49db85b7980e 100644 (file)
@@ -63,6 +63,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/EventLegacyBios.h>\r
 #include <Guid/EventGroup.h>\r
 #include <Guid/LoadModuleAtFixedAddress.h>\r
+#include <Guid/IdleLoopEvent.h>\r
 \r
 #include <Library/DxeCoreEntryPoint.h>\r
 #include <Library/DebugLib.h>\r
@@ -2459,4 +2460,20 @@ CoreReleaseLock (
   IN EFI_LOCK  *Lock\r
   );\r
 \r
+\r
+/**\r
+  An empty function to pass error checking of CreateEventEx ().\r
+\r
+  @param  Event                 Event whose notification function is being invoked.\r
+  @param  Context               Pointer to the notification function's context,\r
+                                which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CoreEmptyCallbackFunction (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  );\r
+\r
 #endif\r
index e00ee8d28416573a9efd54cf07ef556320773cd9..3170e37be8e6c9f08730509cbc55e27f53433b7a 100644 (file)
   gEfiMemoryTypeInformationGuid                 ## CONSUMES ## GUID\r
   gEfiEventDxeDispatchGuid                      ## CONSUMES ## GUID\r
   gLoadFixedAddressConfigurationTableGuid       ## SOMETIMES_CONSUMES\r
-  \r
+  gIdleLoopEventGuid                            ## CONSUMES ## GUID\r
 \r
 [Protocols]\r
   gEfiStatusCodeRuntimeProtocolGuid             ## SOMETIMES_CONSUMES\r
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
diff --git a/MdeModulePkg/Include/Guid/IdleLoopEvent.h b/MdeModulePkg/Include/Guid/IdleLoopEvent.h
new file mode 100644 (file)
index 0000000..3673207
--- /dev/null
@@ -0,0 +1,24 @@
+/** @file\r
+  GUID is the name of events used with CreateEventEx in order to be notified\r
+  when the DXE Core is idle.\r
+\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
+  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
+**/\r
+\r
+#ifndef __IDLE_LOOP_EVENT_GUID_H__\r
+#define __IDLE_LOOP_EVENT_GUID_H__\r
+\r
+#define IDLE_LOOP_EVENT_GUID \\r
+   { 0x3c8d294c, 0x5fc3, 0x4451, { 0xbb, 0x31, 0xc4, 0xc0, 0x32, 0x29, 0x5e, 0x6c } }\r
+\r
+extern EFI_GUID gIdleLoopEventGuid;\r
+\r
+#endif\r
index e2b17fe5599cf1105993a76002dc86ca7a54ab46..f2dbb7155621ac884b54e605f8a010199fafe63b 100644 (file)
   # Include/Guid/DebugMask.h  \r
   gEfiGenericVariableGuid = { 0x59d1c24f, 0x50f1, 0x401a, {0xb1, 0x01, 0xf3, 0x3e, 0x0d, 0xae, 0xd4, 0x43} }\r
   \r
+  ##  Event for the DXE Core to signal idle events\r
+  #  Include/Guid/EventIdle.h\r
+  gIdleLoopEventGuid  = { 0x3c8d294c, 0x5fc3, 0x4451, { 0xbb, 0x31, 0xc4, 0xc0, 0x32, 0x29, 0x5e, 0x6c } }\r
+\r
 [Protocols]\r
   ## Load File protocol provides capability to load and unload EFI image into memory and execute it.\r
   #  Include/Protocol/LoadPe32Image.h\r