diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-06-22 16:22:26 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-06-22 16:22:26 +0000 |
commit | c7d265a94a3ee2517430e4f19f5b24482e5e7132 (patch) | |
tree | 6f74331af15f965bc99f56652cfa75db9794e743 /MdePkg/Library/UefiLib | |
parent | 1a5589a183b11fcfa54a0c4b5496d80f233b1ceb (diff) | |
download | edk2-platforms-c7d265a94a3ee2517430e4f19f5b24482e5e7132.tar.xz |
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
Diffstat (limited to 'MdePkg/Library/UefiLib')
-rw-r--r-- | MdePkg/Library/UefiLib/CommonHeader.h | 2 | ||||
-rw-r--r-- | MdePkg/Library/UefiLib/UefiLib.inf | 5 | ||||
-rw-r--r-- | MdePkg/Library/UefiLib/UefiLib.msa | 21 | ||||
-rw-r--r-- | MdePkg/Library/UefiLib/UefiNotTiano.c | 42 |
4 files changed, 57 insertions, 13 deletions
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 <Protocol/DriverBinding.h>
#include <Protocol/ComponentName.h>
+#include <Protocol/ComponentName2.h>
#include <Protocol/DriverConfiguration.h>
#include <Protocol/DriverDiagnostics.h>
+#include <Protocol/DriverDiagnostics2.h>
#include <Guid/EventGroup.h>
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 @@ <Filename>Console.c</Filename>
<Filename>UefiNotTiano.c</Filename>
<Filename>UefiLibPrint.c</Filename>
+ <Filename>UefiDriverModel.c</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
@@ -77,5 +78,25 @@ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
<HelpText>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.</HelpText>
</PcdEntry>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdDriverDiagnosticsDisable</C_Name>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>If this value is set TRUE, autogen will replace Driver Diagnostics Protocol instance with NULL.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdDriverDiagnostics2Disable</C_Name>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>If this value is set TRUE, autogen will replace Driver Diagnostics2 Protocol instance with NULL.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdComponentNameDisable</C_Name>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>If this value is set TRUE, autogen will replace Component Name Protocol instance with NULL.</HelpText>
+ </PcdEntry>
+ <PcdEntry PcdItemType="FEATURE_FLAG" Usage="ALWAYS_CONSUMED">
+ <C_Name>PcdComponentName2Disable</C_Name>
+ <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>
+ <HelpText>If this value is set TRUE, autogen will replace Component Name2 Protocol instance with NULL.</HelpText>
+ </PcdEntry>
</PcdCoded>
</ModuleSurfaceArea>
\ 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);
}
|