]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiLib/UefiNotTiano.c
Added an extra GDT entry to the GDT used by thunk code. SS register will always be...
[mirror_edk2.git] / MdePkg / Library / UefiLib / UefiNotTiano.c
index 770d76df7eda02ab579752d6ec2e4e649f8ea77a..7797608b13023de5494599b66bb856ff1fc0e4ca 100644 (file)
@@ -3,7 +3,8 @@
 \r
   Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the\r
   oldconflicts with library functions and supporting implementations of the old \r
-  (R8.5/EFI 1.10) and new (R9/UEFI 2.0) way.\r
+  (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, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -16,14 +17,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
+\r
 /**\r
   An empty function to pass error checking of CreateEventEx (). \r
   \r
-  This empty function enusres that EFI_EVENT_NOTIFY_SIGNAL_ALL is error
+  This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error
   checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.
   \r
 **/\r
 VOID
+EFIAPI
 InternalEmptyFuntion (
   IN EFI_EVENT                Event,
   IN VOID                     *Context
@@ -39,7 +42,7 @@ InternalEmptyFuntion (
   This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
   added and now it's possible to not voilate the UEFI specification by \r
   declaring a GUID for the legacy boot event class. This library supports\r
-  the R8.5/EFI 1.10 form and R9/UEFI 2.0 form and allows common code to \r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to \r
   work both ways.\r
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
@@ -94,7 +97,7 @@ EfiCreateEventLegacyBootEx (
 \r
   ASSERT (LegacyBootEvent != NULL);\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000) \r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
   //\r
   // prior to UEFI 2.0 use Tiano extension to EFI\r
   //\r
@@ -105,7 +108,7 @@ EfiCreateEventLegacyBootEx (
                   NotifyContext,\r
                   LegacyBootEvent\r
                   );\r
-#else\r
+#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   //\r
   // For UEFI 2.0 and the future use an Event Group\r
   //\r
@@ -117,6 +120,11 @@ EfiCreateEventLegacyBootEx (
                   &gEfiEventLegacyBootGuid,\r
                   LegacyBootEvent\r
                   );\r
+#else\r
+  //\r
+  // For EFI 1.10 with no Tiano extensions return unsupported\r
+  //\r
+  Status = EFI_UNSUPORTED;\r
 #endif\r
 \r
   return Status;\r
@@ -129,7 +137,7 @@ EfiCreateEventLegacyBootEx (
   This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
   added and now it's possible to not voilate the UEFI specification and use \r
   the ready to boot event class defined in UEFI 2.0. This library supports\r
-  the R8.5/EFI 1.10 form and R9/UEFI 2.0 form and allows common code to \r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to \r
   work both ways.\r
 \r
   @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
@@ -184,7 +192,7 @@ EfiCreateEventReadyToBootEx (
 \r
   ASSERT (ReadyToBootEvent != NULL);\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000) \r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
   //\r
   // prior to UEFI 2.0 use Tiano extension to EFI\r
   //\r
@@ -195,7 +203,7 @@ EfiCreateEventReadyToBootEx (
                   NotifyContext,\r
                   ReadyToBootEvent\r
                   );\r
-#else\r
+#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   //\r
   // For UEFI 2.0 and the future use an Event Group\r
   //\r
@@ -207,6 +215,11 @@ EfiCreateEventReadyToBootEx (
                   &gEfiEventReadyToBootGuid,\r
                   ReadyToBootEvent\r
                   );\r
+#else\r
+  //\r
+  // For EFI 1.10 with no Tiano extensions return unsupported\r
+  //\r
+  Status = EFI_UNSUPORTED;\r
 #endif\r
 \r
   return Status;\r
@@ -266,7 +279,7 @@ EfiSignalEventLegacyBoot (
   Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
   so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
   the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
+  device path is defined for Tiano extensions of device path. If the code \r
   is compiled to conform with the UEFI 2.0 specification use the new device path\r
   else use the old form for backwards compatability. The return value to this\r
   function points to a location in FvDevicePathNode and it does not allocate\r
@@ -286,7 +299,7 @@ EfiGetNameGuidFromFwVolDevicePathNode (
 {\r
   ASSERT (FvDevicePathNode != NULL);\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000) \r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
   //\r
   // Use old Device Path that conflicts with UEFI\r
   //\r
@@ -295,14 +308,14 @@ EfiGetNameGuidFromFwVolDevicePathNode (
     return (EFI_GUID *) &FvDevicePathNode->NameGuid;\r
   }\r
 \r
-#else\r
+#elif ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION >= 0x00020000))\r
   //\r
   // Use the new Device path that does not conflict with the UEFI\r
   //\r
-  if (FvDevicePathNode->Piwg.Header.Type == MEDIA_DEVICE_PATH ||\r
-      FvDevicePathNode->Piwg.Header.SubType == MEDIA_VENDOR_DP) {\r
-    if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Piwg.PiwgSpecificDevicePath)) {\r
-      if (FvDevicePathNode->Piwg.Type == PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) {\r
+  if (FvDevicePathNode->Tiano.Header.Type == MEDIA_DEVICE_PATH ||\r
+      FvDevicePathNode->Tiano.Header.SubType == MEDIA_VENDOR_DP) {\r
+    if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Tiano.TianoSpecificDevicePath)) {\r
+      if (FvDevicePathNode->Tiano.Type == TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) {\r
         return (EFI_GUID *) &FvDevicePathNode->NameGuid;\r
       }\r
     }\r
@@ -318,7 +331,7 @@ EfiGetNameGuidFromFwVolDevicePathNode (
   Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
   so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
   the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
+  device path is defined for Tiano extensions of device path. If the code \r
   is compiled to conform with the UEFI 2.0 specification use the new device path\r
   else use the old form for backwards compatability.\r
 \r
@@ -348,19 +361,19 @@ EfiInitializeFwVolDevicepathNode (
   //\r
   // Use the new Device path that does not conflict with the UEFI\r
   //\r
-  FvDevicePathNode->Piwg.Header.Type     = MEDIA_DEVICE_PATH;\r
-  FvDevicePathNode->Piwg.Header.SubType  = MEDIA_VENDOR_DP;\r
-  SetDevicePathNodeLength (&FvDevicePathNode->Piwg.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
+  FvDevicePathNode->Tiano.Header.Type     = MEDIA_DEVICE_PATH;\r
+  FvDevicePathNode->Tiano.Header.SubType  = MEDIA_VENDOR_DP;\r
+  SetDevicePathNodeLength (&FvDevicePathNode->Tiano.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
 \r
   //\r
-  // Add the GUID for generic PIWG device paths\r
+  // Add the GUID for generic Tiano device paths\r
   //\r
-  CopyGuid (&FvDevicePathNode->Piwg.PiwgSpecificDevicePath, &gEfiFrameworkDevicePathGuid);\r
+  CopyGuid (&FvDevicePathNode->Tiano.TianoSpecificDevicePath, &gEfiFrameworkDevicePathGuid);\r
 \r
   //\r
-  // Add in the FW Vol File Path PIWG defined inforation\r
+  // Add in the FW Vol File Path Tiano defined information\r
   //\r
-  FvDevicePathNode->Piwg.Type = PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;\r
+  FvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;\r
 \r
 #endif\r
 \r