\r
#include "UefiLibInternal.h"\r
\r
-/**\r
- An empty function to pass error checking of CreateEventEx ().\r
-\r
- This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error\r
- checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.\r
- \r
- @param Event Event whose notification function is being invoked.\r
- @param Context The pointer to the notification function's context,\r
- which is implementation-dependent.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalEmptyFuntion (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-{\r
- return;\r
-}\r
-\r
/**\r
Creates an EFI event in the Legacy Boot Event Group.\r
\r
{\r
return EfiCreateEventLegacyBootEx (\r
TPL_CALLBACK,\r
- InternalEmptyFuntion,\r
+ InternalEmptyFunction,\r
NULL,\r
LegacyBootEvent\r
);\r
OUT EFI_EVENT *LegacyBootEvent\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
+ EFI_EVENT_NOTIFY WorkerNotifyFunction;\r
\r
ASSERT (LegacyBootEvent != NULL);\r
\r
//\r
// For UEFI 2.0 and the future use an Event Group\r
//\r
+ if (NotifyFunction == NULL) {\r
+ //\r
+ // CreateEventEx will check NotifyFunction is NULL or not and return error.\r
+ // Use dummy routine for the case NotifyFunction is NULL.\r
+ //\r
+ WorkerNotifyFunction = InternalEmptyFunction;\r
+ } else {\r
+ WorkerNotifyFunction = NotifyFunction;\r
+ }\r
Status = gBS->CreateEventEx (\r
EVT_NOTIFY_SIGNAL,\r
NotifyTpl,\r
- NotifyFunction,\r
+ WorkerNotifyFunction,\r
NotifyContext,\r
&gEfiEventLegacyBootGuid,\r
LegacyBootEvent\r
{\r
return EfiCreateEventReadyToBootEx (\r
TPL_CALLBACK,\r
- InternalEmptyFuntion,\r
+ InternalEmptyFunction,\r
NULL,\r
ReadyToBootEvent\r
);\r
OUT EFI_EVENT *ReadyToBootEvent\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
+ EFI_EVENT_NOTIFY WorkerNotifyFunction;\r
\r
ASSERT (ReadyToBootEvent != NULL);\r
\r
//\r
// For UEFI 2.0 and the future use an Event Group\r
//\r
+ if (NotifyFunction == NULL) {\r
+ //\r
+ // CreateEventEx will check NotifyFunction is NULL or not and return error.\r
+ // Use dummy routine for the case NotifyFunction is NULL.\r
+ //\r
+ WorkerNotifyFunction = InternalEmptyFunction;\r
+ } else {\r
+ WorkerNotifyFunction = NotifyFunction;\r
+ }\r
Status = gBS->CreateEventEx (\r
EVT_NOTIFY_SIGNAL,\r
NotifyTpl,\r
- NotifyFunction,\r
+ WorkerNotifyFunction,\r
NotifyContext,\r
&gEfiEventReadyToBootGuid,\r
ReadyToBootEvent\r