From a537f1483c1312f9a937b7ec854396170006ff8d Mon Sep 17 00:00:00 2001 From: ajfish Date: Wed, 19 Jul 2006 12:24:11 +0000 Subject: [PATCH] Fixed some naming issues and update to the EDK II name. I also fixed an issue with the UEFI library forcing UEFI.h to include Tinao protocols. I make the UEFI library a DXE library so it would get the correct includes. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1048 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c | 11 ++++ .../Core/Dxe/DxeMain/DxeProtocolNotify.c | 17 +++++- EdkModulePkg/Include/EdkDxe.h | 2 +- MdePkg/Include/Dxe.h | 4 +- MdePkg/Include/DxeCore.h | 4 +- MdePkg/Include/Library/UefiLib.h | 8 +-- MdePkg/Include/Uefi.h | 12 +--- MdePkg/Include/Uefi/UefiSpec.h | 12 ++-- MdePkg/Library/UefiLib/UefiLib.msa | 19 ++----- MdePkg/Library/UefiLib/UefiNotTiano.c | 57 ++++++++++++------- 10 files changed, 83 insertions(+), 63 deletions(-) diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c index 9b8402b561..24568ea334 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -307,9 +307,16 @@ EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = { (EFI_GET_NEXT_HIGH_MONO_COUNT) CoreEfiNotAvailableYetArg1, // GetNextHighMonotonicCount (EFI_RESET_SYSTEM) CoreEfiNotAvailableYetArg4 // ResetSystem #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + // + // This Tiano extension was removed when UEFI 2.0 support was added. + // It's now just a protocol. + // , (EFI_REPORT_STATUS_CODE) CoreEfiNotAvailableYetArg5 // ReportStatusCode #elif (EFI_SPECIFICATION_VERSION >= 0x00020000) + // + // New runtime services added by UEFI 2.0 + // , (EFI_UPDATE_CAPSULE) CoreEfiNotAvailableYetArg3, // UpdateCapsule (EFI_QUERY_CAPSULE_CAPABILITIES) CoreEfiNotAvailableYetArg4, // QueryCapsuleCapabilities @@ -452,6 +459,10 @@ Returns: // CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode); #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + // + // This Tiano extension was removed when UEFI 2.0 support was added. + // It's now just a protocol. + // gRT->ReportStatusCode = gStatusCode->ReportStatusCode; #endif diff --git a/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c b/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c index 7c22a03f7f..53f3b3be9b 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c +++ b/EdkModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c @@ -43,12 +43,23 @@ ARCHITECTURAL_PROTOCOL_ENTRY mArchProtocols[] = { { &gEfiRuntimeArchProtocolGuid, (VOID **)&gRuntime, NULL, NULL, FALSE }, { &gEfiVariableArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }, { &gEfiVariableWriteArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }, - #if (EFI_SPECIFICATION_VERSION >= 0x00020000) +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + // + // UEFI 2.0 added support for Capsule services. DXE CIS ??? Added support for this AP + // { &gEfiCapsuleArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE}, - #endif +#endif { &gEfiMonotonicCounterArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }, { &gEfiResetArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }, -// { &gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode, NULL, NULL, FALSE }, +#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + // + // The ReportStatusCode Runtime service is in conflict with the UEFI 2.0 specificaiton + // Thus gEfiStatusCodeRuntimeProtocolGuid becomes a normal protocol in UEFI 2.0 systems + // It is only included if the EFI 1.10 with Tiano extensions is enabled for backward + // compatability + // + { &gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode, NULL, NULL, FALSE }, +#endif { &gEfiRealTimeClockArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE }, { NULL, (VOID **)NULL, NULL, NULL, FALSE } }; diff --git a/EdkModulePkg/Include/EdkDxe.h b/EdkModulePkg/Include/EdkDxe.h index 83833e5918..d78893242e 100644 --- a/EdkModulePkg/Include/EdkDxe.h +++ b/EdkModulePkg/Include/EdkDxe.h @@ -86,7 +86,7 @@ Abstract: #if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) // -// Tiano8.5 Module use ScsiPassThru protocol together with the original ScsiIo protocol +// Old EDK modules use Module use ScsiPassThru protocol together with the original ScsiIo protocol // In UEFI2.0, Module use ScsiPassThruExt Protocol with new UEFI2.0 ScsiIo protocol // #include diff --git a/MdePkg/Include/Dxe.h b/MdePkg/Include/Dxe.h index d97209d1a4..42168297b9 100644 --- a/MdePkg/Include/Dxe.h +++ b/MdePkg/Include/Dxe.h @@ -5,8 +5,8 @@ DXE modules follow the public Framework specifications and the UEFI specifiations. The build infrastructure must set EFI_SPECIFICATION_VERSION before including this file. To support - R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To support - R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. + EDK II/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To support + EDK/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. EDK_RELEASE_VERSION must be set to a non zero value. EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically by the build infrastructure for every module. diff --git a/MdePkg/Include/DxeCore.h b/MdePkg/Include/DxeCore.h index 9554fb8c23..4a4f6376fd 100644 --- a/MdePkg/Include/DxeCore.h +++ b/MdePkg/Include/DxeCore.h @@ -5,8 +5,8 @@ The DXE Core has its own module type since its entry point definition is unique. This module type should only be used by the DXE core. The build infrastructure must set EFI_SPECIFICATION_VERSION before including this - file. To support R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To - support R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. + file. To support EDK II/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To + support EDK/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. EDK_RELEASE_VERSION must be set to a non zero value. EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically by the build infrastructure for every module. diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 428235cbf2..dd27078396 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -400,7 +400,7 @@ EfiSignalEventLegacyBoot ( 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 declaring a GUID for the legacy boot event class. This library supports - the R8.5/EFI 1.10 form and R9/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). @@ -450,7 +450,7 @@ EfiCreateEventLegacyBootEx ( 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 the ready to boot event class defined in UEFI 2.0. This library supports - the R8.5/EFI 1.10 form and R9/UEFI 2.0 form and allows common code to + the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to work both ways. @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex). @@ -499,7 +499,7 @@ EfiCreateEventReadyToBootEx ( 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 + 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. @@ -520,7 +520,7 @@ EfiInitializeFwVolDevicepathNode ( 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 + 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 diff --git a/MdePkg/Include/Uefi.h b/MdePkg/Include/Uefi.h index 34fcdf6c0e..7c9c7480cc 100644 --- a/MdePkg/Include/Uefi.h +++ b/MdePkg/Include/Uefi.h @@ -5,8 +5,8 @@ UEFI modules follow the public EFI 1.10 or UEFI 2.0 specifications and also contains the infrastructure required to build modules. The build infrastructure must set EFI_SPECIFICATION_VERSION before including this - file. To support R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To - support R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. + file. To support EDK II/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To + support EDK/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. Seting EDK_RELEASE_VERSION to zero implies no Tiano extensions and a non zero value implies Tiano extensions are availible. EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically @@ -49,14 +49,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -// -// Need due to R8.5 Tiano contamination of UEFI enumes. -// There is a UEFI library that does things the new way and the old way -// This is why these definitions are need in Uefi.h -// -#include -#include - // // All module types types have access to PCD for build support diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index 3410ad2821..1f2862776c 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -2137,22 +2137,22 @@ typedef struct { typedef struct { EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID PiwgSpecificDevicePath; + EFI_GUID TianoSpecificDevicePath; UINT32 Type; -} PIWG_DEVICE_PATH; +} TIANO_DEVICE_PATH; -#define PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE 0x01 +#define TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE 0x01 typedef struct { - PIWG_DEVICE_PATH Piwg; + TIANO_DEVICE_PATH Tiano; EFI_GUID NameGuid; } MEDIA_FW_VOL_FILEPATH_DEVICE_PATH; // // Place holder for a future extension // -#define PIWG_MEDIAFW_VOL_DEVICE_PATH_TYPE 0x02 +#define TIANO_MEDIAFW_VOL_DEVICE_PATH_TYPE 0x02 typedef struct { - PIWG_DEVICE_PATH Piwg; + TIANO_DEVICE_PATH Tiano; EFI_GUID VolumeGuid; } MEDIA_FW_VOL_DEVICE_PATH; diff --git a/MdePkg/Library/UefiLib/UefiLib.msa b/MdePkg/Library/UefiLib/UefiLib.msa index c02d365d24..b5b62bb3d5 100644 --- a/MdePkg/Library/UefiLib/UefiLib.msa +++ b/MdePkg/Library/UefiLib/UefiLib.msa @@ -1,22 +1,15 @@ - - + UefiLib - UEFI_DRIVER + DXE_DRIVER 3a004ba5-efe0-4a61-9f1a-267a46ae5ba9 1.0 Component description file for the entry point to a EFIDXE Drivers - Library to abstract Framework extensions that conflict with UEFI 2.0 Specification + Library to abstract Framework extensions that conflict with UEFI 2.0 Specification + + 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 it contains DXE enum extensions for EFI event services. Copyright (c) 2006, 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 diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index 770d76df7e..5faa08de76 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -3,7 +3,8 @@ 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 - (R8.5/EFI 1.10) and new (R9/UEFI 2.0) way. + (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
All rights reserved. This program and the accompanying materials @@ -16,6 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ + /** An empty function to pass error checking of CreateEventEx (). @@ -24,6 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ 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 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 R8.5/EFI 1.10 form and R9/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). @@ -94,7 +97,7 @@ EfiCreateEventLegacyBootEx ( ASSERT (LegacyBootEvent != NULL); -#if (EFI_SPECIFICATION_VERSION < 0x00020000) +#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) // // prior to UEFI 2.0 use Tiano extension to EFI // @@ -105,7 +108,7 @@ EfiCreateEventLegacyBootEx ( NotifyContext, LegacyBootEvent ); -#else +#elif (EFI_SPECIFICATION_VERSION >= 0x00020000) // // For UEFI 2.0 and the future use an Event Group // @@ -117,6 +120,11 @@ EfiCreateEventLegacyBootEx ( &gEfiEventLegacyBootGuid, LegacyBootEvent ); +#else + // + // For EFI 1.10 with no Tiano extensions return unsupported + // + Status = EFI_UNSUPORTED; #endif return Status; @@ -129,7 +137,7 @@ EfiCreateEventLegacyBootEx ( 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 the ready to boot event class defined in UEFI 2.0. This library supports - the R8.5/EFI 1.10 form and R9/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). @@ -184,7 +192,7 @@ EfiCreateEventReadyToBootEx ( ASSERT (ReadyToBootEvent != NULL); -#if (EFI_SPECIFICATION_VERSION < 0x00020000) +#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) // // prior to UEFI 2.0 use Tiano extension to EFI // @@ -195,7 +203,7 @@ EfiCreateEventReadyToBootEx ( NotifyContext, ReadyToBootEvent ); -#else +#elif (EFI_SPECIFICATION_VERSION >= 0x00020000) // // For UEFI 2.0 and the future use an Event Group // @@ -207,6 +215,11 @@ EfiCreateEventReadyToBootEx ( &gEfiEventReadyToBootGuid, ReadyToBootEvent ); +#else + // + // For EFI 1.10 with no Tiano extensions return unsupported + // + Status = EFI_UNSUPORTED; #endif return Status; @@ -266,7 +279,7 @@ EfiSignalEventLegacyBoot ( 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 + 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 @@ -286,7 +299,7 @@ EfiGetNameGuidFromFwVolDevicePathNode ( { ASSERT (FvDevicePathNode != NULL); -#if (EFI_SPECIFICATION_VERSION < 0x00020000) +#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) // // Use old Device Path that conflicts with UEFI // @@ -295,14 +308,14 @@ EfiGetNameGuidFromFwVolDevicePathNode ( return (EFI_GUID *) &FvDevicePathNode->NameGuid; } -#else +#elif ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION >= 0x00020000)) // // Use the new Device path that does not conflict with the UEFI // - if (FvDevicePathNode->Piwg.Header.Type == MEDIA_DEVICE_PATH || - FvDevicePathNode->Piwg.Header.SubType == MEDIA_VENDOR_DP) { - if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Piwg.PiwgSpecificDevicePath)) { - if (FvDevicePathNode->Piwg.Type == PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) { + if (FvDevicePathNode->Tiano.Header.Type == MEDIA_DEVICE_PATH || + FvDevicePathNode->Tiano.Header.SubType == MEDIA_VENDOR_DP) { + if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Tiano.TianoSpecificDevicePath)) { + if (FvDevicePathNode->Tiano.Type == TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) { return (EFI_GUID *) &FvDevicePathNode->NameGuid; } } @@ -318,7 +331,7 @@ EfiGetNameGuidFromFwVolDevicePathNode ( 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 + 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. @@ -348,19 +361,19 @@ EfiInitializeFwVolDevicepathNode ( // // Use the new Device path that does not conflict with the UEFI // - FvDevicePathNode->Piwg.Header.Type = MEDIA_DEVICE_PATH; - FvDevicePathNode->Piwg.Header.SubType = MEDIA_VENDOR_DP; - SetDevicePathNodeLength (&FvDevicePathNode->Piwg.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH)); + FvDevicePathNode->Tiano.Header.Type = MEDIA_DEVICE_PATH; + FvDevicePathNode->Tiano.Header.SubType = MEDIA_VENDOR_DP; + SetDevicePathNodeLength (&FvDevicePathNode->Tiano.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH)); // - // Add the GUID for generic PIWG device paths + // Add the GUID for generic Tiano device paths // - CopyGuid (&FvDevicePathNode->Piwg.PiwgSpecificDevicePath, &gEfiFrameworkDevicePathGuid); + CopyGuid (&FvDevicePathNode->Tiano.TianoSpecificDevicePath, &gEfiFrameworkDevicePathGuid); // - // Add in the FW Vol File Path PIWG defined inforation + // Add in the FW Vol File Path Tiano defined information // - FvDevicePathNode->Piwg.Type = PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE; + FvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE; #endif -- 2.39.2