From c7d265a94a3ee2517430e4f19f5b24482e5e7132 Mon Sep 17 00:00:00 2001 From: yshang1 Date: Fri, 22 Jun 2007 16:22:26 +0000 Subject: Checked in part of MDE library instances following PI and UEFI. It includes: 1) UefiLib adds features of RFC 3066/Iso639 language string and driver model protocols installation. 2) PeiCoreEntryPoint following PI. 3) UefiDriverEntryPoint following UEFI/EFI. 4) PeiServicesTablePointerLib following PI for IPF and x86. 5) Remove many CommonHeader.h. If there is only one C file in module, we should add the common headers in C file instead of creating a new CommonHeader.h. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2723 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/UefiLib/CommonHeader.h | 2 ++ MdePkg/Library/UefiLib/UefiLib.inf | 5 +++++ MdePkg/Library/UefiLib/UefiLib.msa | 21 ++++++++++++++++++ MdePkg/Library/UefiLib/UefiNotTiano.c | 42 ++++++++++++++++++++++++----------- 4 files changed, 57 insertions(+), 13 deletions(-) (limited to 'MdePkg/Library/UefiLib') diff --git a/MdePkg/Library/UefiLib/CommonHeader.h b/MdePkg/Library/UefiLib/CommonHeader.h index 9a52f266e0..ad028a769a 100644 --- a/MdePkg/Library/UefiLib/CommonHeader.h +++ b/MdePkg/Library/UefiLib/CommonHeader.h @@ -25,8 +25,10 @@ // #include #include +#include #include #include +#include #include diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf index 1b218a42cb..1801b17bdf 100644 --- a/MdePkg/Library/UefiLib/UefiLib.inf +++ b/MdePkg/Library/UefiLib/UefiLib.inf @@ -48,6 +48,7 @@ [Sources.common] UefiLibPrint.c UefiNotTiano.c + UefiDriverModel.c Console.c UefiLib.c CommonHeader.h @@ -116,6 +117,10 @@ [PcdsFixedAtBuild.common] PcdUefiLibMaxPrintBufferSize|gEfiMdePkgTokenSpaceGuid + +[PcdsFeatureFlag.common] PcdDriverDiagnosticsDisable|gEfiMdePkgTokenSpaceGuid PcdComponentNameDisable|gEfiMdePkgTokenSpaceGuid + PcdDriverDiagnostics2Disable|gEfiMdePkgTokenSpaceGuid + PcdComponentName2Disable|gEfiMdePkgTokenSpaceGuid diff --git a/MdePkg/Library/UefiLib/UefiLib.msa b/MdePkg/Library/UefiLib/UefiLib.msa index b6693d4854..a5616ab1c6 100644 --- a/MdePkg/Library/UefiLib/UefiLib.msa +++ b/MdePkg/Library/UefiLib/UefiLib.msa @@ -55,6 +55,7 @@ Console.c UefiNotTiano.c UefiLibPrint.c + UefiDriverModel.c @@ -77,5 +78,25 @@ gEfiMdePkgTokenSpaceGuid This PCD is used by UefiLib APIs, which are Print, ErrorPrint, AsciiPrint, AsciiErrorPrint. If the length of the formatted Unicode or ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first (PcdUefiLibMaxPrintBufferSize / Sizeof(CHAR16)) Unicode characters or PcdUefiLibMaxPrintBufferSize Ascii characters are sent to the respective console. + + PcdDriverDiagnosticsDisable + gEfiMdePkgTokenSpaceGuid + If this value is set TRUE, autogen will replace Driver Diagnostics Protocol instance with NULL. + + + PcdDriverDiagnostics2Disable + gEfiMdePkgTokenSpaceGuid + If this value is set TRUE, autogen will replace Driver Diagnostics2 Protocol instance with NULL. + + + PcdComponentNameDisable + gEfiMdePkgTokenSpaceGuid + If this value is set TRUE, autogen will replace Component Name Protocol instance with NULL. + + + PcdComponentName2Disable + gEfiMdePkgTokenSpaceGuid + If this value is set TRUE, autogen will replace Component Name2 Protocol instance with NULL. + \ No newline at end of file diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index b00cc22d82..9eba9ddf48 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -103,7 +103,10 @@ EfiCreateEventLegacyBootEx ( ASSERT (LegacyBootEvent != NULL); - if (gST->Hdr.Revision < 0x00020000) { + if (gST->Hdr.Revision < EFI_2_00_SYSTEM_TABLE_REVISION) { + DEBUG ((EFI_D_ERROR, "EFI1.1 can't support LegacyBootEvent!")); + ASSERT (FALSE); + return EFI_UNSUPPORTED; } else { // @@ -145,7 +148,7 @@ EfiCreateEventReadyToBoot ( ) { return EfiCreateEventReadyToBootEx ( - TPL_CALLBACK , + TPL_CALLBACK, InternalEmptyFuntion, NULL, ReadyToBootEvent @@ -184,7 +187,10 @@ EfiCreateEventReadyToBootEx ( ASSERT (ReadyToBootEvent != NULL); - if (gST->Hdr.Revision < 0x00020000) { + if (gST->Hdr.Revision < EFI_2_00_SYSTEM_TABLE_REVISION) { + DEBUG ((EFI_D_ERROR, "EFI1.1 can't support ReadyToBootEvent!")); + ASSERT (FALSE); + return EFI_UNSUPPORTED; } else { // @@ -269,16 +275,20 @@ EfiSignalEventLegacyBoot ( @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned. **/ -EFI_GUID * +EFI_GUID* EFIAPI EfiGetNameGuidFromFwVolDevicePathNode ( - IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode + IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFileDevicePathNode ) { - ASSERT (FvDevicePathNode != NULL); - // - // bugbug:Need to implement ... - // + ASSERT (FvFileDevicePathNode != NULL); + + if (FvFileDevicePathNode->Header.Type == MEDIA_DEVICE_PATH && + FvFileDevicePathNode->Header.SubType == MEDIA_PIWG_FW_FILE_DP + ) { + return (EFI_GUID *) &FvFileDevicePathNode->FvFileName; + } + return NULL; } @@ -300,14 +310,20 @@ EfiGetNameGuidFromFwVolDevicePathNode ( VOID EFIAPI EfiInitializeFwVolDevicepathNode ( - IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode, - IN CONST EFI_GUID *NameGuid + IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFileDevicePathNode, + IN CONST EFI_GUID *NameGuid ) { - ASSERT (FvDevicePathNode != NULL); + ASSERT (FvFileDevicePathNode != NULL); ASSERT (NameGuid != NULL); + // - // bugbug:Need to implement ... + // Use the new Device path that does not conflict with the UEFI // + FvFileDevicePathNode->Header.Type = MEDIA_DEVICE_PATH; + FvFileDevicePathNode->Header.SubType = MEDIA_PIWG_FW_FILE_DP; + SetDevicePathNodeLength (&FvFileDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH)); + + CopyGuid (&FvFileDevicePathNode->FvFileName, NameGuid); } -- cgit v1.2.3