summaryrefslogtreecommitdiff
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-26 07:00:30 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-26 07:00:30 +0000
commitc0b162a2c0b5c60386230e00764d6820bd4c8f74 (patch)
tree3c0b7e675d0601fb13153b8ccb9d7b5049f13af7 /MdePkg/Library
parent3b660b0c8b70cb12b7406467a8dbc6ab9d2cee0f (diff)
downloadedk2-platforms-c0b162a2c0b5c60386230e00764d6820bd4c8f74.tar.xz
1. Removed definition for EFI_1_1 from module ConSplitter
2. Removed old Intel Framework specification extension for Media Firmware file path from Uefi/UefiSpec.h and UefiLib/UefiNotTiano.c 3. Added EFI revision check in UefiLib/UefiNotTiano.c and removed one EFI_SPECIFICATION_VERSION wrapper in Uefi/UefiSpec.h. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2505 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/UefiLib/UefiNotTiano.c210
1 files changed, 94 insertions, 116 deletions
diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c
index ce59eaf417..33a14522a9 100644
--- a/MdePkg/Library/UefiLib/UefiNotTiano.c
+++ b/MdePkg/Library/UefiLib/UefiNotTiano.c
@@ -2,11 +2,11 @@
Library functions that abstract areas of conflict between Tiano an UEFI 2.0.
Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the
- oldconflicts with library functions and supporting implementations of the old
- (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as
+ oldconflicts with library functions and supporting implementations of the old
+ (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as
it contains DXE enum extensions for EFI event services.
-Copyright (c) 2006, Intel Corporation<BR>
+Copyright (c) 2006 - 2007, Intel Corporation<BR>
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
@@ -19,11 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
- An empty function to pass error checking of CreateEventEx ().
-
+ An empty function to pass error checking of CreateEventEx ().
+
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.
-
+
**/
STATIC
VOID
@@ -37,13 +37,13 @@ InternalEmptyFuntion (
}
/**
- Create a Legacy Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
+ Create a Legacy Boot Event.
+
+ Tiano extended the CreateEvent Type enum to add a legacy boot event type.
This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
+ added and now it's possible to not voilate the UEFI specification by
declaring a GUID for the legacy boot event class. This library supports
- the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
+ the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
work both ways.
@param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
@@ -68,8 +68,8 @@ EfiCreateEventLegacyBoot (
/**
Create an EFI event in the Legacy Boot Event Group and allows
- the caller to specify a notification function.
-
+ the caller to specify a notification function.
+
This function abstracts the creation of the Legacy Boot Event.
The Framework moved from a proprietary to UEFI 2.0 based mechanism.
This library abstracts the caller from how this event is created to prevent
@@ -98,47 +98,47 @@ EfiCreateEventLegacyBootEx (
ASSERT (LegacyBootEvent != NULL);
-#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- LegacyBootEvent
- );
-#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &gEfiEventLegacyBootGuid,
- LegacyBootEvent
- );
-#else
- //
- // For EFI 1.10 with no Tiano extensions return unsupported
- //
- Status = EFI_UNSUPORTED;
-#endif
+ if (gST->Hdr.Revision < 0x00020000) {
+ //
+ // prior to UEFI 2.0 use Tiano extension to EFI
+ //
+ Status = gBS->CreateEvent (
+ EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
+ NotifyTpl,
+ NotifyFunction,
+ NotifyContext,
+ LegacyBootEvent
+ );
+ } else if (gST->Hdr.Revision >= 0x00020000 ) {
+ //
+ // For UEFI 2.0 and the future use an Event Group
+ //
+ Status = gBS->CreateEventEx (
+ EVENT_NOTIFY_SIGNAL,
+ NotifyTpl,
+ NotifyFunction,
+ NotifyContext,
+ &gEfiEventLegacyBootGuid,
+ LegacyBootEvent
+ );
+ } else {
+ //
+ // For EFI 1.10 with no Tiano extensions return unsupported
+ //
+ Status = EFI_UNSUPPORTED;
+ }
return Status;
}
/**
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
+ Create a Read to Boot Event.
+
+ Tiano extended the CreateEvent Type enum to add a ready to boot event type.
This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
+ added and now it's possible to not voilate the UEFI specification and use
the ready to boot event class defined in UEFI 2.0. This library supports
- the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
+ the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
work both ways.
@param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
@@ -163,8 +163,8 @@ EfiCreateEventReadyToBoot (
/**
Create an EFI event in the Ready To Boot Event Group and allows
- the caller to specify a notification function.
-
+ the caller to specify a notification function.
+
This function abstracts the creation of the Ready to Boot Event.
The Framework moved from a proprietary to UEFI 2.0 based mechanism.
This library abstracts the caller from how this event is created to prevent
@@ -193,45 +193,45 @@ EfiCreateEventReadyToBootEx (
ASSERT (ReadyToBootEvent != NULL);
-#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- ReadyToBootEvent
- );
-#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &gEfiEventReadyToBootGuid,
- ReadyToBootEvent
- );
-#else
- //
- // For EFI 1.10 with no Tiano extensions return unsupported
- //
- Status = EFI_UNSUPORTED;
-#endif
+ if (gST->Hdr.Revision < 0x00020000) {
+ //
+ // prior to UEFI 2.0 use Tiano extension to EFI
+ //
+ Status = gBS->CreateEvent (
+ EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
+ NotifyTpl,
+ NotifyFunction,
+ NotifyContext,
+ ReadyToBootEvent
+ );
+ } else if (gST->Hdr.Revision >= 0x00020000) {
+ //
+ // For UEFI 2.0 and the future use an Event Group
+ //
+ Status = gBS->CreateEventEx (
+ EVENT_NOTIFY_SIGNAL,
+ NotifyTpl,
+ NotifyFunction,
+ NotifyContext,
+ &gEfiEventReadyToBootGuid,
+ ReadyToBootEvent
+ );
+ } else {
+ //
+ // For EFI 1.10 with no Tiano extensions return unsupported
+ //
+ Status = EFI_UNSUPPORTED;
+ }
return Status;
}
/**
- Signal a Ready to Boot Event.
-
- Create a Ready to Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
+ Signal a Ready to Boot Event.
+
+ Create a Ready to Boot Event. Signal it and close it. This causes other
+ events of the same event group to be signaled in other modules.
**/
VOID
@@ -251,10 +251,10 @@ EfiSignalEventReadyToBoot (
}
/**
- Signal a Legacy Boot Event.
-
- Create a legacy Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
+ Signal a Legacy Boot Event.
+
+ Create a legacy Boot Event. Signal it and close it. This causes other
+ events of the same event group to be signaled in other modules.
**/
VOID
@@ -275,12 +275,12 @@ EfiSignalEventLegacyBoot (
/**
- Check to see if the Firmware Volume (FV) Media Device Path is valid
-
+ 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 Tiano extensions of device path. If the code
+ the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
+ device path is defined for Tiano 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
@@ -300,16 +300,6 @@ EfiGetNameGuidFromFwVolDevicePathNode (
{
ASSERT (FvDevicePathNode != NULL);
-#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
- //
- // Use old Device Path that conflicts with UEFI
- //
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH ||
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
- return (EFI_GUID *) &FvDevicePathNode->NameGuid;
- }
-
-#elif ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION >= 0x00020000))
//
// Use the new Device path that does not conflict with the UEFI
//
@@ -321,18 +311,18 @@ EfiGetNameGuidFromFwVolDevicePathNode (
}
}
}
-#endif
+
return NULL;
}
/**
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 Tiano extensions of device path. If the code
+ the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
+ device path is defined for Tiano 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.
@@ -350,15 +340,6 @@ EfiInitializeFwVolDevicepathNode (
ASSERT (FvDevicePathNode != NULL);
ASSERT (NameGuid != NULL);
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
- //
- // Use old Device Path that conflicts with UEFI
- //
- FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
- FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
- SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
-
-#else
//
// Use the new Device path that does not conflict with the UEFI
//
@@ -376,9 +357,6 @@ EfiInitializeFwVolDevicepathNode (
//
FvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;
-#endif
-
CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);
-
}