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
This commit is contained in:
@ -38,13 +38,19 @@
|
|||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
DebugLib
|
DebugLib
|
||||||
|
PcdLib
|
||||||
|
|
||||||
|
[FeaturePcd]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollationSupport
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiUnicodeCollationProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiUnicodeCollationProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
|
gEfiUnicodeCollation2ProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
|
|
||||||
|
@ -60,9 +60,12 @@ CHAR8 mOtherChars[] = {
|
|||||||
'\0'
|
'\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,
|
EngStriColl,
|
||||||
EngMetaiMatch,
|
EngMetaiMatch,
|
||||||
EngStrLwr,
|
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
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
InitializeUnicodeCollationEng (
|
InitializeUnicodeCollationEng (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
@ -99,6 +116,7 @@ Returns:
|
|||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN Index2;
|
UINTN Index2;
|
||||||
|
|
||||||
@ -125,15 +143,47 @@ Returns:
|
|||||||
Index2 = mOtherChars[Index];
|
Index2 = mOtherChars[Index];
|
||||||
mEngInfoMap[Index2] |= CHAR_FAT_VALID;
|
mEngInfoMap[Index2] |= CHAR_FAT_VALID;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Create a handle for the device
|
if (FeaturePcdGet (PcdUnicodeCollation2Support)) {
|
||||||
//
|
if (FeaturePcdGet (PcdUnicodeCollationSupport)) {
|
||||||
return gBS->InstallProtocolInterface (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&mHandle,
|
&mHandle,
|
||||||
&gEfiUnicodeCollationProtocolGuid,
|
&gEfiUnicodeCollationProtocolGuid,
|
||||||
EFI_NATIVE_INTERFACE,
|
&UnicodeEng,
|
||||||
&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
|
INTN
|
||||||
|
@ -34,6 +34,7 @@ Revision History
|
|||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Defines
|
// Defines
|
||||||
|
Reference in New Issue
Block a user