summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Disk
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-09 03:11:08 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-09 03:11:08 +0000
commit2d9a7522a34940a4fe9fefab6508055e0f1f1db9 (patch)
tree6357fe594f8307c676974a27a9dd1ad1e49d5489 /MdeModulePkg/Universal/Disk
parentd24236bfd9840864d229f9fccceabdcbd8049974 (diff)
downloadedk2-platforms-2d9a7522a34940a4fe9fefab6508055e0f1f1db9.tar.xz
Update English Module to selectively install Unicode Collation and Unicode Collation 2 protocol.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4049 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Disk')
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf6
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c72
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h1
3 files changed, 68 insertions, 11 deletions
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
index 845822557c..8f33c3b47d 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
@@ -38,13 +38,19 @@
[Packages]
MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiBootServicesTableLib
UefiDriverEntryPoint
DebugLib
+ PcdLib
+[FeaturePcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport
+ gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support
[Protocols]
gEfiUnicodeCollationProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+ gEfiUnicodeCollation2ProtocolGuid # PROTOCOL ALWAYS_PRODUCED
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
index 5b543e939e..555ad90016 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
@@ -60,9 +60,12 @@ CHAR8 mOtherChars[] = {
'\0'
};
-EFI_HANDLE mHandle = NULL;
+STATIC EFI_HANDLE mHandle = NULL;
-EFI_UNICODE_COLLATION_PROTOCOL UnicodeEng = {
+//
+// EFI Unicode Collation Protocol supporting ISO 639-2 language code
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_COLLATION_PROTOCOL UnicodeEng = {
EngStriColl,
EngMetaiMatch,
EngStrLwr,
@@ -73,9 +76,23 @@ EFI_UNICODE_COLLATION_PROTOCOL UnicodeEng = {
};
//
+// EFI Unicode Collation2 Protocol supporting RFC 3066 language code
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_COLLATION_PROTOCOL Unicode2Eng = {
+ EngStriColl,
+ EngMetaiMatch,
+ EngStrLwr,
+ EngStrUpr,
+ EngFatToStr,
+ EngStrToFat,
+ "en"
+};
+
//
+// Driver entry point.
//
EFI_STATUS
+EFIAPI
InitializeUnicodeCollationEng (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -99,6 +116,7 @@ Returns:
--*/
{
+ EFI_STATUS Status;
UINTN Index;
UINTN Index2;
@@ -125,15 +143,47 @@ Returns:
Index2 = mOtherChars[Index];
mEngInfoMap[Index2] |= CHAR_FAT_VALID;
}
- //
- // Create a handle for the device
- //
- return gBS->InstallProtocolInterface (
- &mHandle,
- &gEfiUnicodeCollationProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &UnicodeEng
- );
+
+ if (FeaturePcdGet (PcdUnicodeCollation2Support)) {
+ if (FeaturePcdGet (PcdUnicodeCollationSupport)) {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mHandle,
+ &gEfiUnicodeCollationProtocolGuid,
+ &UnicodeEng,
+ &gEfiUnicodeCollation2ProtocolGuid,
+ &Unicode2Eng,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ } else {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mHandle,
+ &gEfiUnicodeCollation2ProtocolGuid,
+ &Unicode2Eng,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
+ } else {
+ if (FeaturePcdGet (PcdUnicodeCollationSupport)) {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mHandle,
+ &gEfiUnicodeCollationProtocolGuid,
+ &UnicodeEng,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+ } else {
+ //
+ // This module must support to produce at least one of Unicode Collation Protocol
+ // and Unicode Collation 2 Protocol.
+ //
+ ASSERT (FALSE);
+ Status = EFI_UNSUPPORTED;
+ }
+ }
+
+ return Status;
}
INTN
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
index cdab4090c7..668652871a 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
@@ -34,6 +34,7 @@ Revision History
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/PcdLib.h>
//
// Defines