Revision: 14631
          http://sourceforge.net/p/edk2/code/14631
Author:   lgao4
Date:     2013-09-05 06:12:04 +0000 (Thu, 05 Sep 2013)
Log Message:
-----------
This patch uses dummy routine as NotifyFunction to make sure those 2 APIs 
provided from library can create event as expected when the caller does not 
feed in a NotifyFunction. Also, typo is corrected.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mars Lin <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdePkg/Library/UefiLib/UefiNotTiano.c

Modified: trunk/edk2/MdePkg/Library/UefiLib/UefiNotTiano.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiLib/UefiNotTiano.c    2013-09-05 05:39:57 UTC 
(rev 14630)
+++ trunk/edk2/MdePkg/Library/UefiLib/UefiNotTiano.c    2013-09-05 06:12:04 UTC 
(rev 14631)
@@ -34,7 +34,7 @@
 **/
 VOID
 EFIAPI
-InternalEmptyFuntion (
+InternalEmptyFunction (
   IN EFI_EVENT                Event,
   IN VOID                     *Context
   )
@@ -67,7 +67,7 @@
 {
   return EfiCreateEventLegacyBootEx (
            TPL_CALLBACK,
-           InternalEmptyFuntion,
+           InternalEmptyFunction,
            NULL,
            LegacyBootEvent
            );
@@ -101,7 +101,8 @@
   OUT EFI_EVENT         *LegacyBootEvent
   )
 {
-  EFI_STATUS    Status;
+  EFI_STATUS        Status;
+  EFI_EVENT_NOTIFY  WorkerNotifyFunction;
 
   ASSERT (LegacyBootEvent != NULL);
 
@@ -114,10 +115,19 @@
     //
     // For UEFI 2.0 and the future use an Event Group
     //
+    if (NotifyFunction == NULL) {
+      //
+      // CreateEventEx will check NotifyFunction is NULL or not and return 
error.
+      // Use dummy routine for the case NotifyFunction is NULL.
+      //
+      WorkerNotifyFunction = InternalEmptyFunction;
+    } else {
+      WorkerNotifyFunction = NotifyFunction;
+    }
     Status = gBS->CreateEventEx (
                     EVT_NOTIFY_SIGNAL,
                     NotifyTpl,
-                    NotifyFunction,
+                    WorkerNotifyFunction,
                     NotifyContext,
                     &gEfiEventLegacyBootGuid,
                     LegacyBootEvent
@@ -152,7 +162,7 @@
 {
   return EfiCreateEventReadyToBootEx (
            TPL_CALLBACK,
-           InternalEmptyFuntion,
+           InternalEmptyFunction,
            NULL,
            ReadyToBootEvent
            );
@@ -186,7 +196,8 @@
   OUT EFI_EVENT         *ReadyToBootEvent
   )
 {
-  EFI_STATUS    Status;
+  EFI_STATUS        Status;
+  EFI_EVENT_NOTIFY  WorkerNotifyFunction;
 
   ASSERT (ReadyToBootEvent != NULL);
 
@@ -199,10 +210,19 @@
     //
     // For UEFI 2.0 and the future use an Event Group
     //
+    if (NotifyFunction == NULL) {
+      //
+      // CreateEventEx will check NotifyFunction is NULL or not and return 
error.
+      // Use dummy routine for the case NotifyFunction is NULL.
+      //
+      WorkerNotifyFunction = InternalEmptyFunction;
+    } else {
+      WorkerNotifyFunction = NotifyFunction;
+    }
     Status = gBS->CreateEventEx (
                     EVT_NOTIFY_SIGNAL,
                     NotifyTpl,
-                    NotifyFunction,
+                    WorkerNotifyFunction,
                     NotifyContext,
                     &gEfiEventReadyToBootGuid,
                     ReadyToBootEvent

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to