summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Dxe
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 02:47:49 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 02:47:49 +0000
commitbb8ffffd1c0ff0ee697c26d377fd9767097cc02b (patch)
tree1636303e1f362613c6f04b033cfd7376afe8e7f6 /MdeModulePkg/Core/Dxe
parent5127b4716b334a68474d227567cc1ce528e1175f (diff)
downloadedk2-platforms-bb8ffffd1c0ff0ee697c26d377fd9767097cc02b.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Core/Dxe')
-rw-r--r--MdeModulePkg/Core/Dxe/Event/event.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/MdeModulePkg/Core/Dxe/Event/event.c b/MdeModulePkg/Core/Dxe/Event/event.c
index c4d6eeb553..81f0b1af10 100644
--- a/MdeModulePkg/Core/Dxe/Event/event.c
+++ b/MdeModulePkg/Core/Dxe/Event/event.c
@@ -323,22 +323,7 @@ Returns:
--*/
{
- EFI_GUID *GuidPtr;
- 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);
+ return CoreCreateEventEx (Type, NotifyTpl, NotifyFunction, NotifyContext, NULL, Event);
}
@@ -363,7 +348,7 @@ Arguments:
NotifyFunction - Pointer to the events notification function
NotifyContext - Pointer to the notification functions context; corresponds to
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
Returns:
@@ -397,6 +382,33 @@ Returns:
}
//
+ // 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 ((Type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL))) {