]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiLib/UefiNotTiano.c
MdePkg/ProcessorBind: add defines for page allocation granularity
[mirror_edk2.git] / MdePkg / Library / UefiLib / UefiNotTiano.c
index c40914ae5bac2a3ab0d661b0594107b84a0e0dcd..fc3a6ea74a0e44e6b5015b08e5e23391fac12894 100644 (file)
@@ -6,8 +6,8 @@
   (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as\r
   it contains DXE enum extensions for EFI event services.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -21,27 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "UefiLibInternal.h"\r
 \r
-/**\r
-  An empty function to pass error checking of CreateEventEx ().\r
-\r
-  This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error\r
-  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.\r
\r
-  @param  Event                 Event whose notification function is being invoked.\r
-  @param  Context               Pointer to the notification function's context,\r
-                                which is implementation-dependent.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InternalEmptyFuntion (\r
-  IN EFI_EVENT                Event,\r
-  IN VOID                     *Context\r
-  )\r
-{\r
-  return;\r
-}\r
-\r
 /**\r
   Creates an EFI event in the Legacy Boot Event Group.\r
 \r
@@ -67,7 +46,7 @@ EfiCreateEventLegacyBoot (
 {\r
   return EfiCreateEventLegacyBootEx (\r
            TPL_CALLBACK,\r
-           InternalEmptyFuntion,\r
+           EfiEventEmptyFunction,\r
            NULL,\r
            LegacyBootEvent\r
            );\r
@@ -101,7 +80,8 @@ EfiCreateEventLegacyBootEx (
   OUT EFI_EVENT         *LegacyBootEvent\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
+  EFI_STATUS        Status;\r
+  EFI_EVENT_NOTIFY  WorkerNotifyFunction;\r
 \r
   ASSERT (LegacyBootEvent != NULL);\r
 \r
@@ -114,10 +94,19 @@ EfiCreateEventLegacyBootEx (
     //\r
     // For UEFI 2.0 and the future use an Event Group\r
     //\r
+    if (NotifyFunction == NULL) {\r
+      //\r
+      // CreateEventEx will check NotifyFunction is NULL or not and return error.\r
+      // Use dummy routine for the case NotifyFunction is NULL.\r
+      //\r
+      WorkerNotifyFunction = EfiEventEmptyFunction;\r
+    } else {\r
+      WorkerNotifyFunction = NotifyFunction;\r
+    }\r
     Status = gBS->CreateEventEx (\r
                     EVT_NOTIFY_SIGNAL,\r
                     NotifyTpl,\r
-                    NotifyFunction,\r
+                    WorkerNotifyFunction,\r
                     NotifyContext,\r
                     &gEfiEventLegacyBootGuid,\r
                     LegacyBootEvent\r
@@ -138,7 +127,7 @@ EfiCreateEventLegacyBootEx (
   change with the version of the specification supported.\r
   If ReadyToBootEvent is NULL, then ASSERT().\r
 \r
-  @param  ReadyToBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+  @param  ReadyToBootEvent  Returns the EFI event returned from gBS->CreateEvent(Ex).\r
 \r
   @retval EFI_SUCCESS       Event was created.\r
   @retval Other             Event was not created.\r
@@ -152,7 +141,7 @@ EfiCreateEventReadyToBoot (
 {\r
   return EfiCreateEventReadyToBootEx (\r
            TPL_CALLBACK,\r
-           InternalEmptyFuntion,\r
+           EfiEventEmptyFunction,\r
            NULL,\r
            ReadyToBootEvent\r
            );\r
@@ -186,7 +175,8 @@ EfiCreateEventReadyToBootEx (
   OUT EFI_EVENT         *ReadyToBootEvent\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
+  EFI_STATUS        Status;\r
+  EFI_EVENT_NOTIFY  WorkerNotifyFunction;\r
 \r
   ASSERT (ReadyToBootEvent != NULL);\r
 \r
@@ -199,10 +189,19 @@ EfiCreateEventReadyToBootEx (
     //\r
     // For UEFI 2.0 and the future use an Event Group\r
     //\r
+    if (NotifyFunction == NULL) {\r
+      //\r
+      // CreateEventEx will check NotifyFunction is NULL or not and return error.\r
+      // Use dummy routine for the case NotifyFunction is NULL.\r
+      //\r
+      WorkerNotifyFunction = EfiEventEmptyFunction;\r
+    } else {\r
+      WorkerNotifyFunction = NotifyFunction;\r
+    }\r
     Status = gBS->CreateEventEx (\r
                     EVT_NOTIFY_SIGNAL,\r
                     NotifyTpl,\r
-                    NotifyFunction,\r
+                    WorkerNotifyFunction,\r
                     NotifyContext,\r
                     &gEfiEventReadyToBootGuid,\r
                     ReadyToBootEvent\r
@@ -276,23 +275,23 @@ EfiSignalEventLegacyBoot (
   the differences from the caller.\r
   If FvDevicePathNode is NULL, then ASSERT().\r
 \r
-  @param  FvDevicePathNode  Pointer to FV device path to check.\r
+  @param  FvDevicePathNode  The pointer to FV device path to check.\r
 \r
   @retval NULL              FvDevicePathNode is not valid.\r
   @retval Other             FvDevicePathNode is valid and pointer to NameGuid was returned.\r
 \r
 **/\r
-EFI_GUID*\r
+EFI_GUID *\r
 EFIAPI\r
 EfiGetNameGuidFromFwVolDevicePathNode (\r
-  IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvFileDevicePathNode\r
+  IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
   )\r
 {\r
-  ASSERT (FvFileDevicePathNode != NULL);\r
+  ASSERT (FvDevicePathNode != NULL);\r
 \r
-  if (DevicePathType (&FvFileDevicePathNode->Header) == MEDIA_DEVICE_PATH &&\r
-      DevicePathSubType (&FvFileDevicePathNode->Header) == MEDIA_PIWG_FW_FILE_DP) {\r
-    return (EFI_GUID *) &FvFileDevicePathNode->FvFileName;\r
+  if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&\r
+      DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_PIWG_FW_FILE_DP) {\r
+    return (EFI_GUID *) &FvDevicePathNode->FvFileName;\r
   }\r
 \r
   return NULL;\r
@@ -311,27 +310,27 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   If FvDevicePathNode is NULL, then ASSERT().\r
   If NameGuid is NULL, then ASSERT().\r
   \r
-  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
+  @param  FvDevicePathNode  The pointer to a FV device path node to initialize\r
   @param  NameGuid          FV file name to use in FvDevicePathNode\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 EfiInitializeFwVolDevicepathNode (\r
-  IN OUT    MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFileDevicePathNode,\r
-  IN CONST  EFI_GUID                          *NameGuid\r
+  IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode,\r
+  IN CONST EFI_GUID                         *NameGuid\r
   )\r
 {\r
-  ASSERT (FvFileDevicePathNode  != NULL);\r
+  ASSERT (FvDevicePathNode != NULL);\r
   ASSERT (NameGuid          != NULL);\r
 \r
   //\r
   // Use the new Device path that does not conflict with the UEFI\r
   //\r
-  FvFileDevicePathNode->Header.Type     = MEDIA_DEVICE_PATH;\r
-  FvFileDevicePathNode->Header.SubType  = MEDIA_PIWG_FW_FILE_DP;\r
-  SetDevicePathNodeLength (&FvFileDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
+  FvDevicePathNode->Header.Type     = MEDIA_DEVICE_PATH;\r
+  FvDevicePathNode->Header.SubType  = MEDIA_PIWG_FW_FILE_DP;\r
+  SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
 \r
-  CopyGuid (&FvFileDevicePathNode->FvFileName, NameGuid);\r
+  CopyGuid (&FvDevicePathNode->FvFileName, NameGuid);\r
 }\r
 \r