X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EdkCompatibilityPkg%2FFoundation%2FLibrary%2FEdkIIGlueLib%2FLibrary%2FUefiLib%2FUefiNotTiano.c;h=bccb35a44b68ad8219577cca4b3c139782c761a4;hb=3e99020dbf0a159e34b84e7ae9125f2e368d5390;hp=c995b92bc9d1cb928e535f50247ba442a27c4b5d;hpb=68bb5ce77e51cf35791e46f2202e36da97e5e6be;p=mirror_edk2.git diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c index c995b92bc9..bccb35a44b 100644 --- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c +++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -67,7 +67,7 @@ GlueEfiCreateEventLegacyBoot ( { return EfiCreateEventLegacyBootEx ( EFI_TPL_CALLBACK, - InternalEmptyFuntion, + NULL, NULL, LegacyBootEvent ); @@ -101,29 +101,50 @@ EfiCreateEventLegacyBootEx ( OUT EFI_EVENT *LegacyBootEvent ) { - EFI_STATUS Status; + EFI_STATUS Status; + UINT32 EventType; + EFI_EVENT_NOTIFY WorkerNotifyFunction; ASSERT (LegacyBootEvent != NULL); #if (EFI_SPECIFICATION_VERSION < 0x00020000) + + if (NotifyFunction == NULL) { + EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL; + } else { + EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT; + } + WorkerNotifyFunction = NotifyFunction; + // // prior to UEFI 2.0 use Tiano extension to EFI // Status = gBS->CreateEvent ( - EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL, + EventType, NotifyTpl, - NotifyFunction, + WorkerNotifyFunction, NotifyContext, LegacyBootEvent ); #else + + EventType = EVENT_NOTIFY_SIGNAL; + if (NotifyFunction == NULL) { + // + // CreatEventEx will check NotifyFunction is NULL or not + // + WorkerNotifyFunction = InternalEmptyFuntion; + } else { + WorkerNotifyFunction = NotifyFunction; + } + // // For UEFI 2.0 and the future use an Event Group // Status = gBS->CreateEventEx ( - EVENT_NOTIFY_SIGNAL, + EventType, NotifyTpl, - NotifyFunction, + WorkerNotifyFunction, NotifyContext, &gEfiEventLegacyBootGuid, LegacyBootEvent @@ -157,7 +178,7 @@ GlueEfiCreateEventReadyToBoot ( { return EfiCreateEventReadyToBootEx ( EFI_TPL_CALLBACK, - InternalEmptyFuntion, + NULL, NULL, ReadyToBootEvent ); @@ -191,29 +212,51 @@ EfiCreateEventReadyToBootEx ( OUT EFI_EVENT *ReadyToBootEvent ) { - EFI_STATUS Status; + EFI_STATUS Status; + UINT32 EventType; + EFI_EVENT_NOTIFY WorkerNotifyFunction; ASSERT (ReadyToBootEvent != NULL); -#if (EFI_SPECIFICATION_VERSION < 0x00020000) +#if (EFI_SPECIFICATION_VERSION < 0x00020000) + + if (NotifyFunction == NULL) { + EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL; + } else { + EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT; + } + WorkerNotifyFunction = NotifyFunction; + // // prior to UEFI 2.0 use Tiano extension to EFI // Status = gBS->CreateEvent ( - EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL, + EventType, NotifyTpl, - NotifyFunction, + WorkerNotifyFunction, NotifyContext, ReadyToBootEvent ); #else + + EventType = EVENT_NOTIFY_SIGNAL; + + if (NotifyFunction == NULL) { + // + // CreatEventEx will check NotifyFunction is NULL or not + // + WorkerNotifyFunction = InternalEmptyFuntion; + } else { + WorkerNotifyFunction = NotifyFunction; + } + // // For UEFI 2.0 and the future use an Event Group // Status = gBS->CreateEventEx ( - EVENT_NOTIFY_SIGNAL, + EventType, NotifyTpl, - NotifyFunction, + WorkerNotifyFunction, NotifyContext, &gEfiEventReadyToBootGuid, ReadyToBootEvent @@ -274,15 +317,6 @@ EfiSignalEventLegacyBoot ( /** Check to see if the Firmware Volume (FV) Media Device Path is valid - Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum - so as we move to UEFI 2.0 support we must use a mechanism that conforms with - the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed - device path is defined for PIWG extensions of device path. If the code - is compiled to conform with the UEFI 2.0 specification use the new device path - else use the old form for backwards compatability. The return value to this - function points to a location in FvDevicePathNode and it does not allocate - new memory for the GUID pointer that is returned. - @param FvDevicePathNode Pointer to FV device path to check. @retval NULL FvDevicePathNode is not valid. @@ -297,11 +331,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode ( { ASSERT (FvDevicePathNode != NULL); - // - // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10. - // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with - // EFI 1.10 and UEFI 2.10. - // if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH && DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) { return (EFI_GUID *) &FvDevicePathNode->NameGuid; @@ -314,13 +343,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode ( /** Initialize a Firmware Volume (FV) Media Device Path node. - Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum - so as we move to UEFI 2.0 support we must use a mechanism that conforms with - the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed - device path is defined for PIWG extensions of device path. If the code - is compiled to conform with the UEFI 2.0 specification use the new device path - else use the old form for backwards compatability. - @param FvDevicePathNode Pointer to a FV device path node to initialize @param NameGuid FV file name to use in FvDevicePathNode @@ -335,16 +357,10 @@ GlueEfiInitializeFwVolDevicepathNode ( ASSERT (FvDevicePathNode != NULL); ASSERT (NameGuid != NULL); - // - // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10. - // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with - // EFI 1.10 and UEFI 2.10. - // FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH; FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP; SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH)); - - CopyGuid (&FvDevicePathNode->NameGuid, NameGuid); + CopyGuid (&FvDevicePathNode->NameGuid, NameGuid); }