mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
10516d293f
commit
e8326a006a
|
@ -34,7 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InternalEmptyFuntion (
|
InternalEmptyFunction (
|
||||||
IN EFI_EVENT Event,
|
IN EFI_EVENT Event,
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
|
@ -67,7 +67,7 @@ EfiCreateEventLegacyBoot (
|
||||||
{
|
{
|
||||||
return EfiCreateEventLegacyBootEx (
|
return EfiCreateEventLegacyBootEx (
|
||||||
TPL_CALLBACK,
|
TPL_CALLBACK,
|
||||||
InternalEmptyFuntion,
|
InternalEmptyFunction,
|
||||||
NULL,
|
NULL,
|
||||||
LegacyBootEvent
|
LegacyBootEvent
|
||||||
);
|
);
|
||||||
|
@ -102,6 +102,7 @@ EfiCreateEventLegacyBootEx (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_EVENT_NOTIFY WorkerNotifyFunction;
|
||||||
|
|
||||||
ASSERT (LegacyBootEvent != NULL);
|
ASSERT (LegacyBootEvent != NULL);
|
||||||
|
|
||||||
|
@ -114,10 +115,19 @@ EfiCreateEventLegacyBootEx (
|
||||||
//
|
//
|
||||||
// For UEFI 2.0 and the future use an Event Group
|
// 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 (
|
Status = gBS->CreateEventEx (
|
||||||
EVT_NOTIFY_SIGNAL,
|
EVT_NOTIFY_SIGNAL,
|
||||||
NotifyTpl,
|
NotifyTpl,
|
||||||
NotifyFunction,
|
WorkerNotifyFunction,
|
||||||
NotifyContext,
|
NotifyContext,
|
||||||
&gEfiEventLegacyBootGuid,
|
&gEfiEventLegacyBootGuid,
|
||||||
LegacyBootEvent
|
LegacyBootEvent
|
||||||
|
@ -152,7 +162,7 @@ EfiCreateEventReadyToBoot (
|
||||||
{
|
{
|
||||||
return EfiCreateEventReadyToBootEx (
|
return EfiCreateEventReadyToBootEx (
|
||||||
TPL_CALLBACK,
|
TPL_CALLBACK,
|
||||||
InternalEmptyFuntion,
|
InternalEmptyFunction,
|
||||||
NULL,
|
NULL,
|
||||||
ReadyToBootEvent
|
ReadyToBootEvent
|
||||||
);
|
);
|
||||||
|
@ -187,6 +197,7 @@ EfiCreateEventReadyToBootEx (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_EVENT_NOTIFY WorkerNotifyFunction;
|
||||||
|
|
||||||
ASSERT (ReadyToBootEvent != NULL);
|
ASSERT (ReadyToBootEvent != NULL);
|
||||||
|
|
||||||
|
@ -199,10 +210,19 @@ EfiCreateEventReadyToBootEx (
|
||||||
//
|
//
|
||||||
// For UEFI 2.0 and the future use an Event Group
|
// 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 (
|
Status = gBS->CreateEventEx (
|
||||||
EVT_NOTIFY_SIGNAL,
|
EVT_NOTIFY_SIGNAL,
|
||||||
NotifyTpl,
|
NotifyTpl,
|
||||||
NotifyFunction,
|
WorkerNotifyFunction,
|
||||||
NotifyContext,
|
NotifyContext,
|
||||||
&gEfiEventReadyToBootGuid,
|
&gEfiEventReadyToBootGuid,
|
||||||
ReadyToBootEvent
|
ReadyToBootEvent
|
||||||
|
|
Loading…
Reference in New Issue