diff options
author | Mars Lin <Mars_Lin@phoenix.com> | 2013-09-05 06:12:04 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-05 06:12:04 +0000 |
commit | e8326a006ac55997001e46a73f3aa14bf4c4a999 (patch) | |
tree | d2b9e7deaf73aeb956bf0a9e7eec3c2f1a2318a8 /MdePkg/Library/UefiLib | |
parent | 10516d293f5734504adce90c6136440beb4dab6f (diff) | |
download | edk2-platforms-e8326a006ac55997001e46a73f3aa14bf4c4a999.tar.xz |
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 <Mars_Lin@phoenix.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14631 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/UefiLib')
-rw-r--r-- | MdePkg/Library/UefiLib/UefiNotTiano.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index 1869c066c7..9b95be65fd 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -34,7 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
VOID
EFIAPI
-InternalEmptyFuntion (
+InternalEmptyFunction (
IN EFI_EVENT Event,
IN VOID *Context
)
@@ -67,7 +67,7 @@ EfiCreateEventLegacyBoot ( {
return EfiCreateEventLegacyBootEx (
TPL_CALLBACK,
- InternalEmptyFuntion,
+ InternalEmptyFunction,
NULL,
LegacyBootEvent
);
@@ -101,7 +101,8 @@ EfiCreateEventLegacyBootEx ( OUT EFI_EVENT *LegacyBootEvent
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ EFI_EVENT_NOTIFY WorkerNotifyFunction;
ASSERT (LegacyBootEvent != NULL);
@@ -114,10 +115,19 @@ EfiCreateEventLegacyBootEx ( //
// 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 @@ EfiCreateEventReadyToBoot ( {
return EfiCreateEventReadyToBootEx (
TPL_CALLBACK,
- InternalEmptyFuntion,
+ InternalEmptyFunction,
NULL,
ReadyToBootEvent
);
@@ -186,7 +196,8 @@ EfiCreateEventReadyToBootEx ( OUT EFI_EVENT *ReadyToBootEvent
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ EFI_EVENT_NOTIFY WorkerNotifyFunction;
ASSERT (ReadyToBootEvent != NULL);
@@ -199,10 +210,19 @@ EfiCreateEventReadyToBootEx ( //
// 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
|