mirror of https://github.com/acidanthera/audk.git
Fix a conformance issue in gBS->CreateEvent() & gBS->CreateEventEx():
1. gBS->CreateEventEx() with EventGroup = NULL should behavior like gBS->CreateEvent() 2. EVT_SIGNAL_EXIT_BOOT_SERVICES & EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE are invalid parameters for gBS->CreateEventEx() if the EventGroup is not NULL. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4692 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
5127b4716b
commit
bb8ffffd1c
|
@ -323,22 +323,7 @@ Returns:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_GUID *GuidPtr;
|
return CoreCreateEventEx (Type, NotifyTpl, NotifyFunction, NotifyContext, NULL, Event);
|
||||||
EFI_EVENT_NOTIFY Function;
|
|
||||||
|
|
||||||
GuidPtr = NULL;
|
|
||||||
Function = NotifyFunction;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Convert EFI 1.10 Events to their UEFI 2.0 CreateEventEx mapping
|
|
||||||
//
|
|
||||||
if (Type == EVT_SIGNAL_EXIT_BOOT_SERVICES) {
|
|
||||||
GuidPtr = &gEfiEventExitBootServicesGuid;
|
|
||||||
} else if (Type == EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {
|
|
||||||
GuidPtr = &gEfiEventVirtualAddressChangeGuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CoreCreateEventEx (Type, NotifyTpl, Function, NotifyContext, GuidPtr, Event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,7 +348,7 @@ Arguments:
|
||||||
NotifyFunction - Pointer to the events notification function
|
NotifyFunction - Pointer to the events notification function
|
||||||
NotifyContext - Pointer to the notification functions context; corresponds to
|
NotifyContext - Pointer to the notification functions context; corresponds to
|
||||||
parameter "Context" in the notification function
|
parameter "Context" in the notification function
|
||||||
EventGrout - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
|
EventGroup - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
|
||||||
Event - Pointer to the newly created event if the call succeeds; undefined otherwise
|
Event - Pointer to the newly created event if the call succeeds; undefined otherwise
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
@ -396,6 +381,33 @@ Returns:
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Convert Event type for pre-defined Event groups
|
||||||
|
//
|
||||||
|
if (EventGroup != NULL) {
|
||||||
|
//
|
||||||
|
// For event group, type EVT_SIGNAL_EXIT_BOOT_SERVICES and EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
|
||||||
|
// are not valid
|
||||||
|
//
|
||||||
|
if ((Type == EVT_SIGNAL_EXIT_BOOT_SERVICES) || (Type == EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
if (CompareGuid (EventGroup, &gEfiEventExitBootServicesGuid)) {
|
||||||
|
Type = EVT_SIGNAL_EXIT_BOOT_SERVICES;
|
||||||
|
} else if (CompareGuid (EventGroup, &gEfiEventVirtualAddressChangeGuid)) {
|
||||||
|
Type = EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//
|
||||||
|
// Convert EFI 1.10 Events to their UEFI 2.0 CreateEventEx mapping
|
||||||
|
//
|
||||||
|
if (Type == EVT_SIGNAL_EXIT_BOOT_SERVICES) {
|
||||||
|
EventGroup = &gEfiEventExitBootServicesGuid;
|
||||||
|
} else if (Type == EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {
|
||||||
|
EventGroup = &gEfiEventVirtualAddressChangeGuid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If it's a notify type of event, check its parameters
|
// If it's a notify type of event, check its parameters
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue