]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update following library class/Protocol for puting 'Framework' as prefix
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 22 Oct 2007 09:36:00 +0000 (09:36 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 22 Oct 2007 09:36:00 +0000 (09:36 +0000)
FrameworkHii
FrameworkFormBrowser
FrameworkFormCallback
FrameworkIfrSupportLib

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4196 6f19259b-4bc3-4df7-8a09-765794883524

68 files changed:
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c
IntelFrameworkModulePkg/Universal/DriverSampleDxe/DriverSample.h
IntelFrameworkModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
IntelFrameworkModulePkg/Universal/HiiDataBaseDxe/HiiDatabase.h
IntelFrameworkModulePkg/Universal/HiiDataBaseDxe/HiiDatabase.inf
IntelFrameworkModulePkg/Universal/SetupBrowserDxe/Setup.h
IntelFrameworkModulePkg/Universal/SetupBrowserDxe/SetupBrowser.inf
IntelFrameworkPkg/Include/Library/FrameworkHiiLib.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Library/FrameworkIfrSupportLib.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Library/HiiLibFramework.h [deleted file]
IntelFrameworkPkg/Include/Library/IfrSupportLibFramework.h [deleted file]
IntelFrameworkPkg/Include/Protocol/FormBrowserFramework.h [deleted file]
IntelFrameworkPkg/Include/Protocol/FormCallbackFramework.h [deleted file]
IntelFrameworkPkg/Include/Protocol/FrameworkFormBrowser.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/FrameworkFormCallback.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/FrameworkHii.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/HiiFramework.h [deleted file]
IntelFrameworkPkg/IntelFrameworkPkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dsc
IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.h [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c [new file with mode: 0644]
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiNotTiano.c [new file with mode: 0644]
IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.c [deleted file]
IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf [deleted file]
IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.msa [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrCommon.c [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOnTheFly.c [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOpCodeCreation.c [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.msa [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLibInternal.h [deleted file]
IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrVariable.c [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/Console.c [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiDriverModel.c [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.inf [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.msa [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c [deleted file]
IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c [deleted file]
MdeModulePkg/MdeModulePkg.dsc
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
Nt32Pkg/CpuRuntimeDxe/CpuDriver.h
Nt32Pkg/CpuRuntimeDxe/CpuRuntimeDxe.inf
Nt32Pkg/Include/Library/EdkGenericBdsLib.h
Nt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLibInternal.h
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubClassPlatformDxe.inf
Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriver.h
Nt32Pkg/Nt32Pkg.dsc
Nt32Pkg/PlatformBdsDxe/Generic/Bds.h
Nt32Pkg/PlatformBdsDxe/PlatformBdsDxe.inf

index 7f98ec5d2fa2137cfffcdfc334cf1024932b5b3e..af1486b2c6344a5403fc8a17d9c3b0a35670af73 100644 (file)
@@ -80,8 +80,8 @@
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
-  IfrSupportLibFramework|IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
+  FrameworkIfrSupportLib|IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf\r
   PciIncompatibleDeviceSupportLib|IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   GraphicsLib|IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
   PciIncompatibleDeviceSupportLib|IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   GraphicsLib|IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
@@ -98,8 +98,8 @@
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
-  IfrSupportLibFramework|IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
+  FrameworkIfrSupportLib|IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
 \r
 ################################################################################\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
 \r
 ################################################################################\r
index 50eb1f56bc0d58f18ddbb84f6b6eb39bf97666c0..5ab779a6a3295d5e1f20a9202bddc6ef6d7f8fba 100644 (file)
@@ -25,7 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/FirmwareVolume2.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/FirmwareVolume2.h>\r
 #include <Protocol/UgaDraw.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkHii.h>\r
 \r
 #include <Guid/Bmp.h>\r
 \r
 \r
 #include <Guid/Bmp.h>\r
 \r
index e32927d7a79825dea251e0ac4cfd52cc78307f75..fbf93ece95f9e426be4ee80250a409fcca2068fd 100644 (file)
@@ -20,8 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <PiDxe.h>\r
 \r
 \r
 #include <PiDxe.h>\r
 \r
-#include <Protocol/FormCallbackFramework.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkFormCallback.h>\r
+#include <Protocol/FrameworkHii.h>\r
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
@@ -29,10 +29,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PrintLib.h>\r
-#include <Library/IfrSupportLibFramework.h>\r
+#include <Library/FrameworkIfrSupportLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 \r
 #include "NVDataStruc.h"\r
 \r
 \r
 #include "NVDataStruc.h"\r
 \r
index 2a552838b01290191db5ed27d7a4f40c3e1f3eae..aff2ae4695b1b01b742d4e5ad1c2ea86b6090e99 100644 (file)
 \r
 \r
 [LibraryClasses]\r
 \r
 \r
 [LibraryClasses]\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
   MemoryAllocationLib\r
   BaseMemoryLib\r
   MemoryAllocationLib\r
   BaseMemoryLib\r
-  IfrSupportLibFramework\r
+  FrameworkIfrSupportLib\r
   PrintLib\r
   BaseLib\r
   UefiDriverEntryPoint\r
   PrintLib\r
   BaseLib\r
   UefiDriverEntryPoint\r
index 077a0cccdcfe87f3793cb3b8d9e05ebc41b08e4a..1498f3cc9e545d9acb7eada4634738b62721f39a 100644 (file)
@@ -21,8 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <PiDxe.h>\r
 \r
 #include <Guid/GlobalVariable.h>\r
 #include <PiDxe.h>\r
 \r
 #include <Guid/GlobalVariable.h>\r
-#include <Protocol/FormCallbackFramework.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkFormCallback.h>\r
+#include <Protocol/FrameworkHii.h>\r
 \r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 \r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/IfrSupportLibFramework.h>\r
+#include <Library/FrameworkIfrSupportLib.h>\r
 \r
 //\r
 // HII Database Global data\r
 \r
 //\r
 // HII Database Global data\r
index a106feb14ef0e7c9a37e526b4f4d35f556ec6508..3e8c6d57f00678e81c21c09ae89e42a8df2cec03 100644 (file)
@@ -46,7 +46,7 @@
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
 \r
 [LibraryClasses]\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
 \r
 [LibraryClasses]\r
-  IfrSupportLibFramework\r
+  FrameworkIfrSupportLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
   BaseMemoryLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
   BaseMemoryLib\r
index bc26a5905d4b35f3c5e9e5ce212c7bc9bfc715a1..098077776f814684d825b51d87a17220e69f7f75 100644 (file)
@@ -18,9 +18,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <PiDxe.h>\r
 \r
 \r
 #include <PiDxe.h>\r
 \r
-#include <Protocol/FormCallbackFramework.h>\r
-#include <Protocol/FormBrowserFramework.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkFormCallback.h>\r
+#include <Protocol/FrameworkFormBrowser.h>\r
+#include <Protocol/FrameworkHii.h>\r
 #include <Protocol/Print.h>\r
 \r
 #include <Library/BaseLib.h>\r
 #include <Protocol/Print.h>\r
 \r
 #include <Library/BaseLib.h>\r
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PrintLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 #include <Library/GraphicsLib.h>\r
 \r
 \r
 #include <Library/GraphicsLib.h>\r
 \r
 \r
index 2b811953e1681e7dfa00233db31d348608531887..f01b83d7577e69c9c39323bc9eca3f155ab28f66 100644 (file)
@@ -54,7 +54,7 @@
 \r
 [LibraryClasses]\r
   GraphicsLib\r
 \r
 [LibraryClasses]\r
   GraphicsLib\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
   PrintLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
   PrintLib\r
diff --git a/IntelFrameworkPkg/Include/Library/FrameworkHiiLib.h b/IntelFrameworkPkg/Include/Library/FrameworkHiiLib.h
new file mode 100644 (file)
index 0000000..d2d7433
--- /dev/null
@@ -0,0 +1,46 @@
+/** @file\r
+  Public include file for the HII Library\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  HiiLib.h\r
+\r
+**/\r
+\r
+#ifndef __HII_LIB_H__\r
+#define __HII_LIB_H__\r
+\r
+#include <Protocol/FrameworkHii.h>\r
+\r
+/**\r
+  This function allocates pool for an EFI_HII_PACKAGES structure\r
+  with enough space for the variable argument list of package pointers.\r
+  The allocated structure is initialized using NumberOfPackages, Guid, \r
+  and the variable length argument list of package pointers.\r
+\r
+  @param  NumberOfPackages The number of HII packages to prepare.\r
+  @param  Guid Package GUID.\r
+\r
+  @return\r
+  The allocated and initialized packages.\r
+\r
+**/\r
+EFI_HII_PACKAGES *\r
+EFIAPI\r
+PreparePackages (\r
+  IN UINTN           NumberOfPackages,\r
+  IN CONST EFI_GUID  *Guid OPTIONAL,\r
+  ...\r
+  )\r
+;\r
+\r
+\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Library/FrameworkIfrSupportLib.h b/IntelFrameworkPkg/Include/Library/FrameworkIfrSupportLib.h
new file mode 100644 (file)
index 0000000..d2a1ff5
--- /dev/null
@@ -0,0 +1,1270 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+  IfrSupportLib.h\r
+\r
+Abstract:\r
+\r
+  The file contain all library function for Ifr Operations.\r
+\r
+--*/\r
+\r
+#ifndef _IFRSUPPORTLIBRARY_H\r
+#define _IFRSUPPORTLIBRARY_H\r
+\r
+#define DEFAULT_FORM_BUFFER_SIZE    0xFFFF\r
+#define DEFAULT_STRING_BUFFER_SIZE  0xFFFF\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  CHAR16      *OptionString;  // Passed in string to generate a token for in a truly dynamic form creation\r
+  STRING_REF  StringToken;    // This is used when creating a single op-code without generating a StringToken (have one already)\r
+  UINT16      Value;\r
+  UINT8       Flags;\r
+  UINT16      Key;\r
+} IFR_OPTION;\r
+#pragma pack()\r
+\r
+EFI_STATUS\r
+GetCurrentLanguage (\r
+  OUT     CHAR16              *Lang\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Determine what is the current language setting\r
+  \r
+Arguments:\r
+\r
+  Lang      - Pointer of system language\r
+  \r
+Returns: \r
+  \r
+  Status code\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+AddString (\r
+  IN      VOID                *StringBuffer,\r
+  IN      CHAR16              *Language,\r
+  IN      CHAR16              *String,\r
+  IN OUT  STRING_REF          *StringToken\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Add a string to the incoming buffer and return the token and offset data\r
+  \r
+Arguments:\r
+\r
+  StringBuffer      - The incoming buffer\r
+  \r
+  Language          - Currrent language\r
+  \r
+  String            - The string to be added\r
+  \r
+  StringToken       - The index where the string placed\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+  \r
+  EFI_SUCCESS             - String successfully added to the incoming buffer\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+AddOpCode (\r
+  IN      VOID                *FormBuffer,\r
+  IN OUT  VOID                *OpCodeData\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Add op-code data to the FormBuffer\r
+  \r
+Arguments:\r
+\r
+  FormBuffer      - Form buffer to be inserted to\r
+  \r
+  OpCodeData      - Op-code data to be inserted\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+  \r
+  EFI_SUCCESS             - Op-code data successfully inserted\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateFormSet (\r
+  IN      CHAR16              *FormSetTitle,\r
+  IN      EFI_GUID            *Guid,\r
+  IN      UINT8               Class,\r
+  IN      UINT8               SubClass,\r
+  IN OUT  VOID                **FormBuffer,\r
+  IN OUT  VOID                **StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a formset\r
+  \r
+Arguments:\r
+\r
+  FormSetTitle        - Title of formset\r
+  \r
+  Guid                - Guid of formset\r
+  \r
+  Class               - Class of formset\r
+  \r
+  SubClass            - Sub class of formset\r
+  \r
+  FormBuffer          - Pointer of the formset created\r
+  \r
+  StringBuffer        - Pointer of FormSetTitile string created\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+  \r
+  EFI_SUCCESS             - Formset successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateForm (\r
+  IN      CHAR16              *FormTitle,\r
+  IN      UINT16              FormId,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a form\r
+  \r
+Arguments:\r
+\r
+  FormTitle       - Title of the form\r
+  \r
+  FormId          - Id of the form\r
+  \r
+  FormBuffer          - Pointer of the form created\r
+  \r
+  StringBuffer        - Pointer of FormTitil string created\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Form successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateSubTitle (\r
+  IN      CHAR16              *SubTitle,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a SubTitle\r
+  \r
+Arguments:\r
+\r
+  SubTitle        - Sub title to be created\r
+  \r
+  FormBuffer      - Where this subtitle to add to\r
+  \r
+  StringBuffer    - String buffer created for subtitle\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Subtitle successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateText (\r
+  IN      CHAR16              *String,\r
+  IN      CHAR16              *String2,\r
+  IN      CHAR16              *String3,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a line of text\r
+  \r
+Arguments:\r
+\r
+  String          - First string of the text\r
+  \r
+  String2         - Second string of the text\r
+  \r
+  String3         - Help string of the text\r
+  \r
+  Flags           - Flag of the text\r
+  \r
+  Key             - Key of the text\r
+  \r
+  FormBuffer      - The form where this text adds to\r
+  \r
+  StringBuffer    - String buffer created for String, String2 and String3\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Text successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateGoto (\r
+  IN      UINT16              FormId,\r
+  IN      CHAR16              *Prompt,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a hyperlink\r
+  \r
+Arguments:\r
+\r
+  FormId        - Form ID of the hyperlink\r
+  \r
+  Prompt        - Prompt of the hyperlink\r
+  \r
+  FormBuffer    - The form where this hyperlink adds to\r
+  \r
+  StringBuffer  - String buffer created for Prompt\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Hyperlink successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateOneOf (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the one-of box\r
+  \r
+  DataWidth       - DataWidth of the one-of box\r
+  \r
+  Prompt          - Prompt of the one-of box\r
+  \r
+  Help            - Help of the one-of box\r
+  \r
+  OptionsList     - Each string in it is an option of the one-of box\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - The form where this one-of box adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR    - DataWidth > 2\r
+\r
+  EFI_SUCCESS         - One-Of box successfully created.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateOrderedList (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               MaxEntries,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the ordered list\r
+  \r
+  MaxEntries      - MaxEntries of the ordered list\r
+  \r
+  Prompt          - Prompt of the ordered list\r
+  \r
+  Help            - Help of the ordered list\r
+  \r
+  OptionsList     - Each string in it is an option of the ordered list\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - The form where this ordered list adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Ordered list successfully created.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateCheckBox (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT8               Flags,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a checkbox\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the check box\r
+  \r
+  DataWidth       - DataWidth of the check box\r
+  \r
+  Prompt          - Prompt of the check box\r
+  \r
+  Help            - Help of the check box\r
+  \r
+  Flags           - Flags of the check box\r
+  \r
+  FormBuffer      - The form where this check box adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR    - DataWidth > 1\r
+\r
+  EFI_SUCCESS         - Check box successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateNumeric (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT16              Minimum,\r
+  IN      UINT16              Maximum,\r
+  IN      UINT16              Step,\r
+  IN      UINT16              Default,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the numeric\r
+  \r
+  DataWidth       - DataWidth of the numeric\r
+  \r
+  Prompt          - Prompt of the numeric\r
+  \r
+  Help            - Help of the numeric\r
+  \r
+  Minimum         - Minumun boundary of the numeric\r
+  \r
+  Maximum         - Maximum boundary of the numeric\r
+  \r
+  Step            - Step of the numeric\r
+   \r
+  Default         - Default value\r
+  \r
+  Flags           - Flags of the numeric\r
+  \r
+  Key             - Key of the numeric\r
+  \r
+  FormBuffer      - The form where this numeric adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR      - DataWidth > 2\r
+  \r
+  EFI_SUCCESS           - Numeric is successfully created\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateString (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT8               MinSize,\r
+  IN      UINT8               MaxSize,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a string\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the string\r
+  \r
+  DataWidth       - DataWidth of the string\r
+  \r
+  Prompt          - Prompt of the string\r
+  \r
+  Help            - Help of the string\r
+  \r
+  MinSize         - Min size boundary of the string\r
+  \r
+  MaxSize         - Max size boundary of the string\r
+    \r
+  Flags           - Flags of the string\r
+  \r
+  Key             - Key of the string\r
+  \r
+  FormBuffer      - The form where this string adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - String successfully created.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+ExtractDataFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      HiiHandle,\r
+  IN OUT  UINT16              *ImageLength,\r
+  OUT     UINT8               *DefaultImage,\r
+  OUT     EFI_GUID            *Guid\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Extract information pertaining to the HiiHandle\r
+  \r
+Arguments:\r
+\r
+  HiiHandle       - Hii handle\r
+  \r
+  ImageLength     - For input, length of DefaultImage;\r
+                    For output, length of actually required\r
+                    \r
+  DefaultImage    - Image buffer prepared by caller\r
+  \r
+  Guid            - Guid information about the form\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+  \r
+  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
+  \r
+  EFI_SUCCESS             - Successfully extract data from Hii database.\r
+  \r
+  \r
+--*/\r
+;\r
+\r
+EFI_HII_HANDLE\r
+FindHiiHandle (\r
+  IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
+  IN     EFI_GUID            *Guid\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Finds HII handle for given pack GUID previously registered with the HII.\r
+\r
+Arguments:\r
+  HiiProtocol - pointer to pointer to HII protocol interface. \r
+                If NULL, the interface will be found but not returned.\r
+                If it points to NULL, the interface will be found and \r
+                written back to the pointer that is pointed to.\r
+  Guid        - The GUID of the pack that registered with the HII.\r
+\r
+Returns:\r
+  Handle to the HII pack previously registered by the memory driver.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateSubTitleOpCode (\r
+  IN      STRING_REF          StringToken,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a SubTitle opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  StringToken     - StringToken of the subtitle\r
+  \r
+  FormBuffer      - Output of subtitle as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Subtitle created to be a form\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateTextOpCode (\r
+  IN      STRING_REF          StringToken,\r
+  IN      STRING_REF          StringTokenTwo,\r
+  IN      STRING_REF          StringTokenThree,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a Text opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  StringToken               - First string token of the text\r
+  \r
+  StringTokenTwo            - Second string token of the text\r
+  \r
+  StringTokenThree          - Help string token of the text\r
+  \r
+  Flags                     - Flag of the text\r
+  \r
+  Key                       - Key of the text\r
+  \r
+  FormBuffer                - Output of text as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - Text created to be a form\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateGotoOpCode (\r
+  IN      UINT16              FormId,\r
+  IN      STRING_REF          StringToken,\r
+  IN      STRING_REF          StringTokenTwo,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a hyperlink opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  FormId          - Form ID of the hyperlink\r
+  \r
+  StringToken     - Prompt string token of the hyperlink\r
+  \r
+  StringTokenTwo  - Help string token of the hyperlink\r
+  \r
+  Flags           - Flags of the hyperlink\r
+  \r
+  Key             - Key of the hyperlink\r
+  \r
+  FormBuffer      - Output of hyperlink as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS   - Hyperlink created to be a form\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateOneOfOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the one-of box\r
+  \r
+  DataWidth       - DataWidth of the one-of box\r
+  \r
+  PromptToken     - Prompt string token of the one-of box\r
+  \r
+  HelpToken       - Help string token of the one-of box\r
+  \r
+  OptionsList     - Each string in it is an option of the one-of box\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - Output of One-Of box as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS         - One-Of box created to be a form\r
+  \r
+  EFI_DEVICE_ERROR    - DataWidth > 2\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateOrderedListOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               MaxEntries,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the ordered list\r
+  \r
+  MaxEntries      - MaxEntries of the ordered list\r
+  \r
+  PromptToken     - Prompt string token of the ordered list\r
+  \r
+  HelpToken       - Help string token of the ordered list\r
+  \r
+  OptionsList     - Each string in it is an option of the ordered list\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - Output of ordered list as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Ordered list created to be a form\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateCheckBoxOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a checkbox opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the check box\r
+  \r
+  DataWidth       - DataWidth of the check box\r
+  \r
+  PromptToken     - Prompt string token of the check box\r
+  \r
+  HelpToken       - Help string token of the check box\r
+  \r
+  Flags           - Flags of the check box\r
+  \r
+  Key             - Key of the check box\r
+  \r
+  FormBuffer      - Output of the check box as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - Checkbox created to be a form\r
+  \r
+  EFI_DEVICE_ERROR  - DataWidth > 1\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateNumericOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT16              Minimum,\r
+  IN      UINT16              Maximum,\r
+  IN      UINT16              Step,\r
+  IN      UINT16              Default,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the numeric\r
+  \r
+  DataWidth       - DataWidth of the numeric\r
+  \r
+  PromptToken     - Prompt string token of the numeric\r
+  \r
+  HelpToken       - Help string token of the numeric\r
+  \r
+  Minimum         - Minumun boundary of the numeric\r
+  \r
+  Maximum         - Maximum boundary of the numeric\r
+  \r
+  Step            - Step of the numeric\r
+  \r
+  Default         - Default value of the numeric\r
+  \r
+  Flags           - Flags of the numeric\r
+  \r
+  Key             - Key of the numeric\r
+  \r
+  FormBuffer      - Output of the numeric as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - The numeric created to be a form.\r
+  \r
+  EFI_DEVICE_ERROR  - DataWidth > 2\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateStringOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT8               MinSize,\r
+  IN      UINT8               MaxSize,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+\r
+  QuestionId      - Question ID of the string\r
+  \r
+  DataWidth       - DataWidth of the string\r
+  \r
+  PromptToken     - Prompt token of the string\r
+  \r
+  HelpToken       - Help token of the string\r
+  \r
+  MinSize         - Min size boundary of the string\r
+  \r
+  MaxSize         - Max size boundary of the string\r
+    \r
+  Flags           - Flags of the string\r
+  \r
+  Key             - Key of the string\r
+  \r
+  FormBuffer      - Output of the string as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - String created to be a form.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+ValidateDataFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      HiiHandle,\r
+  OUT     BOOLEAN             *Results\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Validate that the data associated with the HiiHandle in NVRAM is within\r
+  the reasonable parameters for that FormSet.  Values for strings and passwords\r
+  are not verified due to their not having the equivalent of valid range settings.\r
+  \r
+Arguments:\r
+\r
+  HiiHandle -   Handle of the HII database entry to query\r
+\r
+  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
+                TRUE  = NVRAM Data is within parameters\r
+                FALSE = NVRAM Data is NOT within parameters\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
+  \r
+  EFI_SUCCESS               - Data successfully validated\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+CreateBannerOpCode (\r
+  IN      UINT16              Title,\r
+  IN      UINT16              LineNumber,\r
+  IN      UINT8               Alignment,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
+  \r
+Arguments:\r
+\r
+  Title       - Title of the banner\r
+  \r
+  LineNumber  - LineNumber of the banner\r
+  \r
+  Alignment   - Alignment of the banner\r
+  \r
+  FormBuffer  - Output of banner as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Banner created to be a form.\r
+\r
+--*/\r
+;\r
+\r
+VOID\r
+EfiLibHiiVariablePackGetMap (\r
+  IN    EFI_HII_VARIABLE_PACK        *Pack,  \r
+  OUT   CHAR16                       **Name,  OPTIONAL\r
+  OUT   EFI_GUID                     **Guid,  OPTIONAL\r
+  OUT   UINT16                       *Id,     OPTIONAL\r
+  OUT   VOID                         **Var,   OPTIONAL\r
+  OUT   UINTN                        *Size    OPTIONAL\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Extracts a variable form a Pack.\r
+\r
+Arguments:\r
+\r
+  Pack - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns: \r
+\r
+  VOID.\r
+\r
+--*/\r
+;\r
+\r
+UINTN\r
+EfiLibHiiVariablePackListGetMapCnt (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a count of the variables/maps in the List.\r
+\r
+Arguments:\r
+\r
+  List - List of variables\r
+\r
+Returns: \r
+\r
+  Number of Map in the variable pack list.\r
+\r
+--*/\r
+;\r
+\r
+typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (\r
+  IN CHAR16                      *Name,\r
+  IN EFI_GUID                    *Guid,\r
+  IN UINT16                      Id,\r
+  IN VOID                        *Var,\r
+  IN UINTN                       Size\r
+  )  \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  type definition for the callback to be \r
+  used with EfiLibHiiVariablePackListForEachVar().\r
+\r
+Arguments:\r
+\r
+  Id   - Variable/Map ID\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns: \r
+\r
+  VOID\r
+\r
+--*/\r
+;\r
+\r
+VOID\r
+EfiLibHiiVariablePackListForEachVar (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
+  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Will iterate all variable/maps as appearing \r
+  in List and for each, it will call the Callback.\r
+\r
+Arguments:\r
+\r
+  List     - List of variables\r
+  Callback - Routine to be called for each iterated variable.\r
+\r
+Returns: \r
+\r
+  VOID\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMapByIdx (\r
+  IN    UINTN                         Idx,  \r
+  IN    EFI_HII_VARIABLE_PACK_LIST    *List,  \r
+  OUT   CHAR16                        **Name,  OPTIONAL\r
+  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
+  OUT   UINT16                        *Id,    OPTIONAL\r
+  OUT   VOID                          **Var,\r
+  OUT   UINTN                         *Size\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form List given \r
+  the order number as appears in the List.\r
+\r
+Arguments:\r
+\r
+  Idx  - The index of the variable/map to retrieve\r
+  List - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMapById (\r
+  IN    UINT16                        Id,  \r
+  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
+  OUT   CHAR16                        **Name,  OPTIONAL\r
+  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
+  OUT   VOID                          **Var,\r
+  OUT   UINTN                         *Size\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form List given the \r
+  order number as appears in the List.\r
+\r
+Arguments:\r
+\r
+  Id   - The ID of the variable/map to retrieve\r
+  List - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMap (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
+  IN    CHAR16                       *Name,\r
+  IN    EFI_GUID                     *Guid,\r
+  OUT   UINT16                       *Id,\r
+  OUT   VOID                         **Var, \r
+  OUT   UINTN                        *Size\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
+\r
+Arguments:\r
+\r
+  List - List of variables\r
+  Name - Name of the variable/map to be found\r
+  Guid - GUID of the variable/map to be found\r
+  Var  - Pointer to the variable/map found\r
+  Size - Size of the variable/map in bytes found\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableRetrieveFromNv (\r
+  IN  CHAR16                     *Name,\r
+  IN  EFI_GUID                   *Guid,\r
+  IN  UINTN                      Size,\r
+  OUT VOID                       **Var\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
+  If it does, it will retrieve it into the Var. \r
+\r
+Arguments:\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
+                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
+Returns:\r
+  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
+  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+;\r
+\r
+////\r
+//// Variable override support.\r
+////\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableOverrideIfSuffix (\r
+  IN  CHAR16                 *Suffix,\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                   *Var\r
+  )  \r
+/*++\r
+\r
+Routine Description:\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the Name ends with specified Suffix.\r
+  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
+  the Suffix matches the end of Name, so the variable will be loaded from NV\r
+  provided the variable exists and the GUID and Size matches.\r
+\r
+Arguments:\r
+  Suffix           - Suffix the Name should end with.\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into this buffer.\r
+                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+Returns:\r
+  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
+  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableOverrideBySuffix (\r
+  IN  CHAR16                 *Suffix,\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                   *Var\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
+  For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
+  the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
+  will be loaded from NV provided the variable exists and the GUID and Size matches.\r
+\r
+Arguments:\r
+  Suffix           - Suffix the variable will be appended with.\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into this buffer.\r
+                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+\r
+Returns:\r
+  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Library/HiiLibFramework.h b/IntelFrameworkPkg/Include/Library/HiiLibFramework.h
deleted file mode 100644 (file)
index 91453e9..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file\r
-  Public include file for the HII Library\r
-\r
-  Copyright (c) 2006, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-  Module Name:  HiiLib.h\r
-\r
-**/\r
-\r
-#ifndef __HII_LIB_H__\r
-#define __HII_LIB_H__\r
-\r
-#include <Protocol/HiiFramework.h>\r
-\r
-/**\r
-  This function allocates pool for an EFI_HII_PACKAGES structure\r
-  with enough space for the variable argument list of package pointers.\r
-  The allocated structure is initialized using NumberOfPackages, Guid, \r
-  and the variable length argument list of package pointers.\r
-\r
-  @param  NumberOfPackages The number of HII packages to prepare.\r
-  @param  Guid Package GUID.\r
-\r
-  @return\r
-  The allocated and initialized packages.\r
-\r
-**/\r
-EFI_HII_PACKAGES *\r
-EFIAPI\r
-PreparePackages (\r
-  IN UINTN           NumberOfPackages,\r
-  IN CONST EFI_GUID  *Guid OPTIONAL,\r
-  ...\r
-  )\r
-;\r
-\r
-\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Include/Library/IfrSupportLibFramework.h b/IntelFrameworkPkg/Include/Library/IfrSupportLibFramework.h
deleted file mode 100644 (file)
index d2a1ff5..0000000
+++ /dev/null
@@ -1,1270 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  IfrSupportLib.h\r
-\r
-Abstract:\r
-\r
-  The file contain all library function for Ifr Operations.\r
-\r
---*/\r
-\r
-#ifndef _IFRSUPPORTLIBRARY_H\r
-#define _IFRSUPPORTLIBRARY_H\r
-\r
-#define DEFAULT_FORM_BUFFER_SIZE    0xFFFF\r
-#define DEFAULT_STRING_BUFFER_SIZE  0xFFFF\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
-  CHAR16      *OptionString;  // Passed in string to generate a token for in a truly dynamic form creation\r
-  STRING_REF  StringToken;    // This is used when creating a single op-code without generating a StringToken (have one already)\r
-  UINT16      Value;\r
-  UINT8       Flags;\r
-  UINT16      Key;\r
-} IFR_OPTION;\r
-#pragma pack()\r
-\r
-EFI_STATUS\r
-GetCurrentLanguage (\r
-  OUT     CHAR16              *Lang\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Determine what is the current language setting\r
-  \r
-Arguments:\r
-\r
-  Lang      - Pointer of system language\r
-  \r
-Returns: \r
-  \r
-  Status code\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-AddString (\r
-  IN      VOID                *StringBuffer,\r
-  IN      CHAR16              *Language,\r
-  IN      CHAR16              *String,\r
-  IN OUT  STRING_REF          *StringToken\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add a string to the incoming buffer and return the token and offset data\r
-  \r
-Arguments:\r
-\r
-  StringBuffer      - The incoming buffer\r
-  \r
-  Language          - Currrent language\r
-  \r
-  String            - The string to be added\r
-  \r
-  StringToken       - The index where the string placed\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - String successfully added to the incoming buffer\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-AddOpCode (\r
-  IN      VOID                *FormBuffer,\r
-  IN OUT  VOID                *OpCodeData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add op-code data to the FormBuffer\r
-  \r
-Arguments:\r
-\r
-  FormBuffer      - Form buffer to be inserted to\r
-  \r
-  OpCodeData      - Op-code data to be inserted\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Op-code data successfully inserted\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateFormSet (\r
-  IN      CHAR16              *FormSetTitle,\r
-  IN      EFI_GUID            *Guid,\r
-  IN      UINT8               Class,\r
-  IN      UINT8               SubClass,\r
-  IN OUT  VOID                **FormBuffer,\r
-  IN OUT  VOID                **StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a formset\r
-  \r
-Arguments:\r
-\r
-  FormSetTitle        - Title of formset\r
-  \r
-  Guid                - Guid of formset\r
-  \r
-  Class               - Class of formset\r
-  \r
-  SubClass            - Sub class of formset\r
-  \r
-  FormBuffer          - Pointer of the formset created\r
-  \r
-  StringBuffer        - Pointer of FormSetTitile string created\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Formset successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateForm (\r
-  IN      CHAR16              *FormTitle,\r
-  IN      UINT16              FormId,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a form\r
-  \r
-Arguments:\r
-\r
-  FormTitle       - Title of the form\r
-  \r
-  FormId          - Id of the form\r
-  \r
-  FormBuffer          - Pointer of the form created\r
-  \r
-  StringBuffer        - Pointer of FormTitil string created\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Form successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateSubTitle (\r
-  IN      CHAR16              *SubTitle,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a SubTitle\r
-  \r
-Arguments:\r
-\r
-  SubTitle        - Sub title to be created\r
-  \r
-  FormBuffer      - Where this subtitle to add to\r
-  \r
-  StringBuffer    - String buffer created for subtitle\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateText (\r
-  IN      CHAR16              *String,\r
-  IN      CHAR16              *String2,\r
-  IN      CHAR16              *String3,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a line of text\r
-  \r
-Arguments:\r
-\r
-  String          - First string of the text\r
-  \r
-  String2         - Second string of the text\r
-  \r
-  String3         - Help string of the text\r
-  \r
-  Flags           - Flag of the text\r
-  \r
-  Key             - Key of the text\r
-  \r
-  FormBuffer      - The form where this text adds to\r
-  \r
-  StringBuffer    - String buffer created for String, String2 and String3\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Text successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateGoto (\r
-  IN      UINT16              FormId,\r
-  IN      CHAR16              *Prompt,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a hyperlink\r
-  \r
-Arguments:\r
-\r
-  FormId        - Form ID of the hyperlink\r
-  \r
-  Prompt        - Prompt of the hyperlink\r
-  \r
-  FormBuffer    - The form where this hyperlink adds to\r
-  \r
-  StringBuffer  - String buffer created for Prompt\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Hyperlink successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOneOf (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  Prompt          - Prompt of the one-of box\r
-  \r
-  Help            - Help of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this one-of box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
-  EFI_SUCCESS         - One-Of box successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOrderedList (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  Prompt          - Prompt of the ordered list\r
-  \r
-  Help            - Help of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this ordered list adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateCheckBox (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               Flags,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a checkbox\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  Prompt          - Prompt of the check box\r
-  \r
-  Help            - Help of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  FormBuffer      - The form where this check box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 1\r
-\r
-  EFI_SUCCESS         - Check box successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateNumeric (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  Prompt          - Prompt of the numeric\r
-  \r
-  Help            - Help of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-   \r
-  Default         - Default value\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - The form where this numeric adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR      - DataWidth > 2\r
-  \r
-  EFI_SUCCESS           - Numeric is successfully created\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateString (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a string\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  Prompt          - Prompt of the string\r
-  \r
-  Help            - Help of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - The form where this string adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - String successfully created.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-ExtractDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  IN OUT  UINT16              *ImageLength,\r
-  OUT     UINT8               *DefaultImage,\r
-  OUT     EFI_GUID            *Guid\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extract information pertaining to the HiiHandle\r
-  \r
-Arguments:\r
-\r
-  HiiHandle       - Hii handle\r
-  \r
-  ImageLength     - For input, length of DefaultImage;\r
-                    For output, length of actually required\r
-                    \r
-  DefaultImage    - Image buffer prepared by caller\r
-  \r
-  Guid            - Guid information about the form\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
-  \r
-  EFI_SUCCESS             - Successfully extract data from Hii database.\r
-  \r
-  \r
---*/\r
-;\r
-\r
-EFI_HII_HANDLE\r
-FindHiiHandle (\r
-  IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
-  IN     EFI_GUID            *Guid\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds HII handle for given pack GUID previously registered with the HII.\r
-\r
-Arguments:\r
-  HiiProtocol - pointer to pointer to HII protocol interface. \r
-                If NULL, the interface will be found but not returned.\r
-                If it points to NULL, the interface will be found and \r
-                written back to the pointer that is pointed to.\r
-  Guid        - The GUID of the pack that registered with the HII.\r
-\r
-Returns:\r
-  Handle to the HII pack previously registered by the memory driver.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateSubTitleOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a SubTitle opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  StringToken     - StringToken of the subtitle\r
-  \r
-  FormBuffer      - Output of subtitle as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateTextOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      STRING_REF          StringTokenThree,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a Text opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  StringToken               - First string token of the text\r
-  \r
-  StringTokenTwo            - Second string token of the text\r
-  \r
-  StringTokenThree          - Help string token of the text\r
-  \r
-  Flags                     - Flag of the text\r
-  \r
-  Key                       - Key of the text\r
-  \r
-  FormBuffer                - Output of text as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Text created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateGotoOpCode (\r
-  IN      UINT16              FormId,\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a hyperlink opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  FormId          - Form ID of the hyperlink\r
-  \r
-  StringToken     - Prompt string token of the hyperlink\r
-  \r
-  StringTokenTwo  - Help string token of the hyperlink\r
-  \r
-  Flags           - Flags of the hyperlink\r
-  \r
-  Key             - Key of the hyperlink\r
-  \r
-  FormBuffer      - Output of hyperlink as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS   - Hyperlink created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOneOfOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  PromptToken     - Prompt string token of the one-of box\r
-  \r
-  HelpToken       - Help string token of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of One-Of box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS         - One-Of box created to be a form\r
-  \r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateOrderedListOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  PromptToken     - Prompt string token of the ordered list\r
-  \r
-  HelpToken       - Help string token of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of ordered list as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list created to be a form\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateCheckBoxOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a checkbox opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  PromptToken     - Prompt string token of the check box\r
-  \r
-  HelpToken       - Help string token of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  Key             - Key of the check box\r
-  \r
-  FormBuffer      - Output of the check box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Checkbox created to be a form\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 1\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateNumericOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  PromptToken     - Prompt string token of the numeric\r
-  \r
-  HelpToken       - Help string token of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value of the numeric\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - Output of the numeric as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - The numeric created to be a form.\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 2\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateStringOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-\r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  PromptToken     - Prompt token of the string\r
-  \r
-  HelpToken       - Help token of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - Output of the string as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - String created to be a form.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-ValidateDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  OUT     BOOLEAN             *Results\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Validate that the data associated with the HiiHandle in NVRAM is within\r
-  the reasonable parameters for that FormSet.  Values for strings and passwords\r
-  are not verified due to their not having the equivalent of valid range settings.\r
-  \r
-Arguments:\r
-\r
-  HiiHandle -   Handle of the HII database entry to query\r
-\r
-  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
-                TRUE  = NVRAM Data is within parameters\r
-                FALSE = NVRAM Data is NOT within parameters\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS               - Data successfully validated\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CreateBannerOpCode (\r
-  IN      UINT16              Title,\r
-  IN      UINT16              LineNumber,\r
-  IN      UINT8               Alignment,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
-  \r
-Arguments:\r
-\r
-  Title       - Title of the banner\r
-  \r
-  LineNumber  - LineNumber of the banner\r
-  \r
-  Alignment   - Alignment of the banner\r
-  \r
-  FormBuffer  - Output of banner as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Banner created to be a form.\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiLibHiiVariablePackGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK        *Pack,  \r
-  OUT   CHAR16                       **Name,  OPTIONAL\r
-  OUT   EFI_GUID                     **Guid,  OPTIONAL\r
-  OUT   UINT16                       *Id,     OPTIONAL\r
-  OUT   VOID                         **Var,   OPTIONAL\r
-  OUT   UINTN                        *Size    OPTIONAL\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extracts a variable form a Pack.\r
-\r
-Arguments:\r
-\r
-  Pack - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID.\r
-\r
---*/\r
-;\r
-\r
-UINTN\r
-EfiLibHiiVariablePackListGetMapCnt (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a count of the variables/maps in the List.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-\r
-Returns: \r
-\r
-  Number of Map in the variable pack list.\r
-\r
---*/\r
-;\r
-\r
-typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (\r
-  IN CHAR16                      *Name,\r
-  IN EFI_GUID                    *Guid,\r
-  IN UINT16                      Id,\r
-  IN VOID                        *Var,\r
-  IN UINTN                       Size\r
-  )  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  type definition for the callback to be \r
-  used with EfiLibHiiVariablePackListForEachVar().\r
-\r
-Arguments:\r
-\r
-  Id   - Variable/Map ID\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID\r
-\r
---*/\r
-;\r
-\r
-VOID\r
-EfiLibHiiVariablePackListForEachVar (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
-  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Will iterate all variable/maps as appearing \r
-  in List and for each, it will call the Callback.\r
-\r
-Arguments:\r
-\r
-  List     - List of variables\r
-  Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
-  VOID\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapByIdx (\r
-  IN    UINTN                         Idx,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,  \r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   UINT16                        *Id,    OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given \r
-  the order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Idx  - The index of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapById (\r
-  IN    UINT16                        Id,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given the \r
-  order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Id   - The ID of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
-  IN    CHAR16                       *Name,\r
-  IN    EFI_GUID                     *Guid,\r
-  OUT   UINT16                       *Id,\r
-  OUT   VOID                         **Var, \r
-  OUT   UINTN                        *Size\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-  Name - Name of the variable/map to be found\r
-  Guid - GUID of the variable/map to be found\r
-  Var  - Pointer to the variable/map found\r
-  Size - Size of the variable/map in bytes found\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableRetrieveFromNv (\r
-  IN  CHAR16                     *Name,\r
-  IN  EFI_GUID                   *Guid,\r
-  IN  UINTN                      Size,\r
-  OUT VOID                       **Var\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
-  If it does, it will retrieve it into the Var. \r
-\r
-Arguments:\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
-                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-Returns:\r
-  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-////\r
-//// Variable override support.\r
-////\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideIfSuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  )  \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the Name ends with specified Suffix.\r
-  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
-  the Suffix matches the end of Name, so the variable will be loaded from NV\r
-  provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
-  Suffix           - Suffix the Name should end with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-Returns:\r
-  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
-  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideBySuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
-  For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
-  the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
-  will be loaded from NV provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
-  Suffix           - Suffix the variable will be appended with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-\r
-Returns:\r
-  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-;\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FormBrowserFramework.h b/IntelFrameworkPkg/Include/Protocol/FormBrowserFramework.h
deleted file mode 100644 (file)
index 74b9b4b..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/** @file\r
-  The EFI_FORM_BROWSER_PROTOCOL is the interface to the EFI\r
-  Configuration Driver.  This will allow the caller to direct the\r
-  configuration driver to use either the HII database or use the passed\r
-  in packet of data.  This will also allow the caller to post messages\r
-  into the configuration drivers internal mailbox.\r
-\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  FrameworkFormBrowser.h\r
-\r
-  @par Revision Reference:\r
-  This protocol is defined in HII spec 0.92.\r
-\r
-**/\r
-\r
-#ifndef __FRAMEWORK_FORM_BROWSER_H__\r
-#define __FRAMEWORK_FORM_BROWSER_H__\r
-\r
-#include <Protocol/HiiFramework.h>\r
-\r
-\r
-#define EFI_FORM_BROWSER_PROTOCOL_GUID \\r
-  { \\r
-    0xe5a1333e, 0xe1b4, 0x4d55, {0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } \\r
-  }\r
-\r
-typedef struct _EFI_FORM_BROWSER_PROTOCOL EFI_FORM_BROWSER_PROTOCOL;\r
-\r
-typedef struct {\r
-  UINT32  Length;\r
-  UINT16  Type;\r
-  UINT8   Data[1];\r
-} EFI_HII_PACKET;\r
-\r
-typedef struct {\r
-  EFI_HII_IFR_PACK    *IfrData;\r
-  EFI_HII_STRING_PACK *StringData;\r
-} EFI_IFR_PACKET;\r
-\r
-typedef struct {\r
-  UINTN LeftColumn;\r
-  UINTN RightColumn;\r
-  UINTN TopRow;\r
-  UINTN BottomRow;\r
-} EFI_SCREEN_DESCRIPTOR;\r
-\r
-/**\r
-  Provides direction to the configuration driver whether to use the HII\r
-  database or a passed-in set of data. This function also establishes a\r
-  pointer to the calling driver's callback interface.\r
-\r
-  @param  This                  A pointer to the EFI_FORM_BROWSER_PROTOCOL instance.\r
-  @param  UseDatabase           Determines whether the HII database is to be\r
-                                used to gather information. If the value is FALSE, the configuration\r
-                                driver will get the information provided in the passed-in Packet parameters.\r
-  @param  Handle                A pointer to an array of HII handles to display. This value\r
-                                should correspond to the value of the HII form package that is required to\r
-                                be displayed.\r
-  @param  HandleCount           The number of handles in the array specified by Handle.\r
-  @param  Packet                A pointer to a set of data containing pointers to IFR\r
-                                and/or string data.\r
-  @param  CallbackHandle        The handle to the driver's callback interface.\r
-                                This parameter is used only when the UseDatabase parameter is FALSE\r
-                                and an application wants to register a callback with the browser\r
-  @param  NvMapOverride         This buffer is used only when there is no NV variable\r
-                                to define the current settings and the caller needs to provide to the browser\r
-                                the current settings for the "fake" NV variable.\r
-  @param  ScreenDimensions      Allows the browser to be called so that it occupies\r
-                                a portion of the physical screen instead of dynamically determining the\r
-                                screen dimensions.\r
-  @param  ResetRequired         This BOOLEAN value will tell the caller if a reset\r
-                                is required based on the data that might have been changed. The ResetRequired\r
-                                parameter is primarily applicable for configuration applications, and is an\r
-                                optional parameter.\r
-\r
-  @retval EFI_SUCCESS           The function completed successfully\r
-  @retval EFI_NOT_FOUND         The variable was not found.\r
-  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result.\r
-                                DataSize has been updated with the size needed to complete the request.\r
-  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
-  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_SEND_FORM) (\r
-  IN  EFI_FORM_BROWSER_PROTOCOL       *This,\r
-  IN  BOOLEAN                         UseDatabase,\r
-  IN  EFI_HII_HANDLE                  *Handle,\r
-  IN  UINTN                           HandleCount,\r
-  IN  EFI_IFR_PACKET                  *Packet, OPTIONAL\r
-  IN  EFI_HANDLE                      CallbackHandle, OPTIONAL\r
-  IN  UINT8                           *NvMapOverride, OPTIONAL\r
-  IN EFI_SCREEN_DESCRIPTOR            *ScreenDimensions, OPTIONAL\r
-  OUT BOOLEAN                         *ResetRequired OPTIONAL\r
-  );\r
-\r
-/**\r
-  Routine used to abstract a generic dialog interface and return the selected\r
-  key or string.\r
-\r
-  @param  NumberOfLines         The number of lines for the dialog box.\r
-  @param  HotKey                Defines whether a single character is parsed (TRUE)\r
-                                and returned in KeyValue or if a string is returned in StringBuffer.\r
-  @param  MaximumStringSize     The maximum size in bytes of a typed-in string.\r
-                                Because each character is a CHAR16, the minimum string returned is two bytes.\r
-  @param  StringBuffer          The passed-in pointer to the buffer that will hold\r
-                                the typed in string if HotKey is FALSE.\r
-  @param  KeyValue              The EFI_INPUT_KEY value returned if HotKey is TRUE.\r
-  @param  String                The pointer to the first string in the list of strings\r
-                                that comprise the dialog box.\r
-  @param  ...                   A series of NumberOfLines text strings that will be used\r
-                                to construct the dialog box.\r
-\r
-  @retval EFI_SUCCESS           The dialog was displayed and user interaction was received.\r
-  @retval EFI_DEVICE_ERROR      The user typed in an ESC character to exit the routine.\r
-  @retval EFI_INVALID_PARAMETER One of the parameters was invalid\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_CREATE_POP_UP) (\r
-  IN  UINTN                           NumberOfLines,\r
-  IN  BOOLEAN                         HotKey,\r
-  IN  UINTN                           MaximumStringSize,\r
-  OUT CHAR16                          *StringBuffer,\r
-  OUT EFI_INPUT_KEY                   *KeyValue,\r
-  IN  CHAR16                          *String,\r
-  ...\r
-  );\r
-\r
-/**\r
-  @par Protocol Description:\r
-  The EFI_FORM_BROWSER_PROTOCOL is the interface to call for drivers to\r
-  leverage the EFI configuration driver interface.\r
-\r
-  @param SendForm\r
-  Provides direction to the configuration driver whether to use the HII\r
-  database or to use a passed-in set of data. This functions also establishes\r
-  a pointer to the calling driver's callback interface.\r
-\r
-  @param CreatePopUp\r
-  Routine used to abstract a generic dialog interface and return the\r
-  selected key or string.\r
-\r
-**/\r
-struct _EFI_FORM_BROWSER_PROTOCOL {\r
-  EFI_SEND_FORM     SendForm;\r
-  EFI_CREATE_POP_UP CreatePopUp;\r
-};\r
-\r
-extern EFI_GUID gEfiFormBrowserProtocolGuid;\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FormCallbackFramework.h b/IntelFrameworkPkg/Include/Protocol/FormCallbackFramework.h
deleted file mode 100644 (file)
index 708eabc..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/** @file\r
-  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom\r
-  NV storage devices as well as communication of user selections in a more\r
-  interactive environment.  This protocol should be published by hardware\r
-  specific drivers which want to export access to custom hardware storage or\r
-  publish IFR which has a requirement to call back the original driver.\r
-\r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  FormCallbackFramework.h\r
-\r
-  @par Revision Reference:\r
-  This protocol is defined in HII spec 0.92.\r
-\r
-**/\r
-\r
-#ifndef __FORM_CALLBACK_H__\r
-#define __FORM_CALLBACK_H__\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Protocol/HiiFramework.h>\r
-#include <Protocol/FormBrowserFramework.h>\r
-\r
-#define EFI_FORM_CALLBACK_PROTOCOL_GUID \\r
-  { \\r
-    0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 } \\r
-  }\r
-\r
-//\r
-// Forward reference for pure ANSI compatability\r
-//\r
-typedef struct _EFI_FORM_CALLBACK_PROTOCOL  EFI_FORM_CALLBACK_PROTOCOL;\r
-\r
-\r
-#define RESET_REQUIRED  1 // Flags setting to signify that the callback operation resulted in an eventual\r
-// reset to be done upon exit of the browser\r
-//\r
-#define EXIT_REQUIRED   2   // Flags setting to signify that after the processing of the callback results - exit the browser\r
-#define SAVE_REQUIRED   4   // Flags setting to signify that after the processing of the callback results - save the NV data\r
-#define NV_CHANGED      8   // Flags setting to signify that after the processing of the callback results - turn the NV flag on\r
-#define NV_NOT_CHANGED  16  // Flags setting to signify that after the processing of the callback results - turn the NV flag off\r
-#pragma pack(1)\r
-typedef struct {\r
-  UINT8   OpCode;           // Likely a string, numeric, or one-of\r
-  UINT8   Length;           // Length of the EFI_IFR_DATA_ENTRY packet\r
-  UINT16  Flags;            // Flags settings to determine what behavior is desired from the browser after the callback\r
-  VOID    *Data;            // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately\r
-  // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value\r
-  // If the OpCode is a String type - Data is a CHAR16[x] type\r
-  // If the OpCode is a Checkbox type - Data is a UINT8 value\r
-  // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure\r
-  //\r
-} EFI_IFR_DATA_ENTRY;\r
-\r
-typedef struct {\r
-  VOID                *NvRamMap;  // If the flag of the op-code specified retrieval of a copy of the NVRAM map,\r
-  // this is a pointer to a buffer copy\r
-  //\r
-  UINT32              EntryCount; // How many EFI_IFR_DATA_ENTRY entries\r
-  //\r
-  // EFI_IFR_DATA_ENTRY  Data[1];    // The in-line Data entries.\r
-  //\r
-} EFI_IFR_DATA_ARRAY;\r
-\r
-\r
-typedef union {\r
-  EFI_IFR_DATA_ARRAY  DataArray;  // Primarily used by those who call back to their drivers and use HII as a repository\r
-  EFI_IFR_PACKET      DataPacket; // Primarily used by those which do not use HII as a repository\r
-  CHAR16              *String;  // If returning an error - fill the string with null-terminated contents\r
-} EFI_HII_CALLBACK_PACKET;\r
-\r
-typedef struct {\r
-  EFI_IFR_OP_HEADER Header;\r
-  UINT16            QuestionId;   // Offset into the map\r
-  UINT8             StorageWidth; // Width of the value\r
-  //\r
-  // CHAR8             Data[1];      // The Data itself\r
-  //\r
-} EFI_IFR_NV_DATA;\r
-\r
-#pragma pack()\r
-//\r
-// The following types are currently defined:\r
-//\r
-/**\r
-  Returns the value of a variable.\r
-\r
-  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
-  @param  VariableName          A NULL-terminated Unicode string that is the\r
-                                name of the vendor's variable.\r
-  @param  VendorGuid            A unique identifier for the vendor.\r
-  @param  Attributes            If not NULL, a pointer to the memory location to\r
-                                return the attribute's bit-mask for the variable.\r
-  @param  DataSize              The size in bytes of the Buffer. A size of zero causes\r
-                                the variable to be deleted.\r
-  @param  Buffer                The buffer to return the contents of the variable.\r
-\r
-  @retval EFI_SUCCESS           The function completed successfully.\r
-  @retval EFI_NOT_FOUND         The variable was not found.\r
-  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result.\r
-                                DataSize has been updated with the size needed to complete the request.\r
-  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
-  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_NV_READ) (\r
-  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
-  IN     CHAR16                        *VariableName,\r
-  IN     EFI_GUID                      *VendorGuid,\r
-  OUT    UINT32                        *Attributes OPTIONAL,\r
-  IN OUT UINTN                         *DataSize,\r
-  OUT    VOID                          *Buffer\r
-  );\r
-\r
-/**\r
-  Sets the value of a variable.\r
-\r
-  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
-  @param  VariableName          A NULL-terminated Unicode string that is the\r
-                                name of the vendor's variable. Each VariableName is unique for each VendorGuid.\r
-  @param  VendorGuid            A unique identifier for the vendor.\r
-  @param  Attributes            Attributes bit-mask to set for the variable.\r
-  @param  DataSize              The size in bytes of the Buffer. A size of zero causes\r
-                                the variable to be deleted.\r
-  @param  Buffer                The buffer containing the contents of the variable.\r
-  @param  ResetRequired         Returns a value from the driver that abstracts\r
-                                this information and will enable a system to know if a system reset\r
-                                is required to achieve the configuration changes being enabled through\r
-                                this function.\r
-\r
-  @retval EFI_SUCCESS           The firmware has successfully stored the variable and\r
-                                its data as defined by the Attributes.\r
-  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold\r
-                                the variable and its data.\r
-  @retval EFI_INVALID_PARAMETER An invalid combination of Attributes bits\r
-                                was supplied, or the DataSize exceeds the maximum allowed.\r
-  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_NV_WRITE) (\r
-  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
-  IN     CHAR16                        *VariableName,\r
-  IN     EFI_GUID                      *VendorGuid,\r
-  IN     UINT32                        Attributes,\r
-  IN     UINTN                         DataSize,\r
-  IN     VOID                          *Buffer,\r
-  OUT    BOOLEAN                       *ResetRequired\r
-  );\r
-\r
-/**\r
-  This function is called to provide results data to the driver.\r
-\r
-  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
-  @param  KeyValue              A unique value which is sent to the original exporting\r
-                                driver so that it can identify the type of data to expect. The format of\r
-                                the data tends to vary based on the opcode that generated the callback.\r
-  @param  Data                  A pointer to the data being sent to the original exporting driver.\r
-  @param  Packet                A pointer to a packet of information which a driver passes\r
-                                back to the browser.\r
-\r
-  @return Status Code\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_FORM_CALLBACK) (\r
-  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
-  IN     UINT16                        KeyValue,\r
-  IN     EFI_IFR_DATA_ARRAY            *Data,\r
-  OUT    EFI_HII_CALLBACK_PACKET       **Packet\r
-  );\r
-\r
-/**\r
-  @par Protocol Description:\r
-  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to\r
-  custom NVS devices as well as communication of user selections in a more\r
-  interactive environment. This protocol should be published by hardware-specific\r
-  drivers that want to export access to custom hardware storage or publish IFR\r
-  that has a requirement to call back the original driver.\r
-\r
-  @param NvRead\r
-  The read operation to access the NV data serviced by a hardware-specific driver.\r
-\r
-  @param NvWrite\r
-  The write operation to access the NV data serviced by a hardware-specific driver.\r
-\r
-  @param Callback\r
-  The function that is called from the configuration browser to communicate key value pairs.\r
-\r
-**/\r
-struct _EFI_FORM_CALLBACK_PROTOCOL {\r
-  EFI_NV_READ       NvRead;\r
-  EFI_NV_WRITE      NvWrite;\r
-  EFI_FORM_CALLBACK Callback;\r
-};\r
-\r
-extern EFI_GUID gEfiFormCallbackProtocolGuid;\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FrameworkFormBrowser.h b/IntelFrameworkPkg/Include/Protocol/FrameworkFormBrowser.h
new file mode 100644 (file)
index 0000000..867a5b7
--- /dev/null
@@ -0,0 +1,162 @@
+/** @file\r
+  The EFI_FORM_BROWSER_PROTOCOL is the interface to the EFI\r
+  Configuration Driver.  This will allow the caller to direct the\r
+  configuration driver to use either the HII database or use the passed\r
+  in packet of data.  This will also allow the caller to post messages\r
+  into the configuration drivers internal mailbox.\r
+\r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkFormBrowser.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef __FRAMEWORK_FORM_BROWSER_H__\r
+#define __FRAMEWORK_FORM_BROWSER_H__\r
+\r
+#include <Protocol/FrameworkHii.h>\r
+\r
+\r
+#define EFI_FORM_BROWSER_PROTOCOL_GUID \\r
+  { \\r
+    0xe5a1333e, 0xe1b4, 0x4d55, {0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } \\r
+  }\r
+\r
+typedef struct _EFI_FORM_BROWSER_PROTOCOL EFI_FORM_BROWSER_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT32  Length;\r
+  UINT16  Type;\r
+  UINT8   Data[1];\r
+} EFI_HII_PACKET;\r
+\r
+typedef struct {\r
+  EFI_HII_IFR_PACK    *IfrData;\r
+  EFI_HII_STRING_PACK *StringData;\r
+} EFI_IFR_PACKET;\r
+\r
+typedef struct {\r
+  UINTN LeftColumn;\r
+  UINTN RightColumn;\r
+  UINTN TopRow;\r
+  UINTN BottomRow;\r
+} EFI_SCREEN_DESCRIPTOR;\r
+\r
+/**\r
+  Provides direction to the configuration driver whether to use the HII\r
+  database or a passed-in set of data. This function also establishes a\r
+  pointer to the calling driver's callback interface.\r
+\r
+  @param  This                  A pointer to the EFI_FORM_BROWSER_PROTOCOL instance.\r
+  @param  UseDatabase           Determines whether the HII database is to be\r
+                                used to gather information. If the value is FALSE, the configuration\r
+                                driver will get the information provided in the passed-in Packet parameters.\r
+  @param  Handle                A pointer to an array of HII handles to display. This value\r
+                                should correspond to the value of the HII form package that is required to\r
+                                be displayed.\r
+  @param  HandleCount           The number of handles in the array specified by Handle.\r
+  @param  Packet                A pointer to a set of data containing pointers to IFR\r
+                                and/or string data.\r
+  @param  CallbackHandle        The handle to the driver's callback interface.\r
+                                This parameter is used only when the UseDatabase parameter is FALSE\r
+                                and an application wants to register a callback with the browser\r
+  @param  NvMapOverride         This buffer is used only when there is no NV variable\r
+                                to define the current settings and the caller needs to provide to the browser\r
+                                the current settings for the "fake" NV variable.\r
+  @param  ScreenDimensions      Allows the browser to be called so that it occupies\r
+                                a portion of the physical screen instead of dynamically determining the\r
+                                screen dimensions.\r
+  @param  ResetRequired         This BOOLEAN value will tell the caller if a reset\r
+                                is required based on the data that might have been changed. The ResetRequired\r
+                                parameter is primarily applicable for configuration applications, and is an\r
+                                optional parameter.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully\r
+  @retval EFI_NOT_FOUND         The variable was not found.\r
+  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result.\r
+                                DataSize has been updated with the size needed to complete the request.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SEND_FORM) (\r
+  IN  EFI_FORM_BROWSER_PROTOCOL       *This,\r
+  IN  BOOLEAN                         UseDatabase,\r
+  IN  EFI_HII_HANDLE                  *Handle,\r
+  IN  UINTN                           HandleCount,\r
+  IN  EFI_IFR_PACKET                  *Packet, OPTIONAL\r
+  IN  EFI_HANDLE                      CallbackHandle, OPTIONAL\r
+  IN  UINT8                           *NvMapOverride, OPTIONAL\r
+  IN EFI_SCREEN_DESCRIPTOR            *ScreenDimensions, OPTIONAL\r
+  OUT BOOLEAN                         *ResetRequired OPTIONAL\r
+  );\r
+\r
+/**\r
+  Routine used to abstract a generic dialog interface and return the selected\r
+  key or string.\r
+\r
+  @param  NumberOfLines         The number of lines for the dialog box.\r
+  @param  HotKey                Defines whether a single character is parsed (TRUE)\r
+                                and returned in KeyValue or if a string is returned in StringBuffer.\r
+  @param  MaximumStringSize     The maximum size in bytes of a typed-in string.\r
+                                Because each character is a CHAR16, the minimum string returned is two bytes.\r
+  @param  StringBuffer          The passed-in pointer to the buffer that will hold\r
+                                the typed in string if HotKey is FALSE.\r
+  @param  KeyValue              The EFI_INPUT_KEY value returned if HotKey is TRUE.\r
+  @param  String                The pointer to the first string in the list of strings\r
+                                that comprise the dialog box.\r
+  @param  ...                   A series of NumberOfLines text strings that will be used\r
+                                to construct the dialog box.\r
+\r
+  @retval EFI_SUCCESS           The dialog was displayed and user interaction was received.\r
+  @retval EFI_DEVICE_ERROR      The user typed in an ESC character to exit the routine.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters was invalid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_POP_UP) (\r
+  IN  UINTN                           NumberOfLines,\r
+  IN  BOOLEAN                         HotKey,\r
+  IN  UINTN                           MaximumStringSize,\r
+  OUT CHAR16                          *StringBuffer,\r
+  OUT EFI_INPUT_KEY                   *KeyValue,\r
+  IN  CHAR16                          *String,\r
+  ...\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_FORM_BROWSER_PROTOCOL is the interface to call for drivers to\r
+  leverage the EFI configuration driver interface.\r
+\r
+  @param SendForm\r
+  Provides direction to the configuration driver whether to use the HII\r
+  database or to use a passed-in set of data. This functions also establishes\r
+  a pointer to the calling driver's callback interface.\r
+\r
+  @param CreatePopUp\r
+  Routine used to abstract a generic dialog interface and return the\r
+  selected key or string.\r
+\r
+**/\r
+struct _EFI_FORM_BROWSER_PROTOCOL {\r
+  EFI_SEND_FORM     SendForm;\r
+  EFI_CREATE_POP_UP CreatePopUp;\r
+};\r
+\r
+extern EFI_GUID gEfiFormBrowserProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FrameworkFormCallback.h b/IntelFrameworkPkg/Include/Protocol/FrameworkFormCallback.h
new file mode 100644 (file)
index 0000000..12aed7d
--- /dev/null
@@ -0,0 +1,211 @@
+/** @file\r
+  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom\r
+  NV storage devices as well as communication of user selections in a more\r
+  interactive environment.  This protocol should be published by hardware\r
+  specific drivers which want to export access to custom hardware storage or\r
+  publish IFR which has a requirement to call back the original driver.\r
+\r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkFormCallback.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef __FORM_CALLBACK_H__\r
+#define __FORM_CALLBACK_H__\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/FrameworkHii.h>\r
+#include <Protocol/FrameworkFormBrowser.h>\r
+\r
+#define EFI_FORM_CALLBACK_PROTOCOL_GUID \\r
+  { \\r
+    0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_FORM_CALLBACK_PROTOCOL  EFI_FORM_CALLBACK_PROTOCOL;\r
+\r
+\r
+#define RESET_REQUIRED  1 // Flags setting to signify that the callback operation resulted in an eventual\r
+// reset to be done upon exit of the browser\r
+//\r
+#define EXIT_REQUIRED   2   // Flags setting to signify that after the processing of the callback results - exit the browser\r
+#define SAVE_REQUIRED   4   // Flags setting to signify that after the processing of the callback results - save the NV data\r
+#define NV_CHANGED      8   // Flags setting to signify that after the processing of the callback results - turn the NV flag on\r
+#define NV_NOT_CHANGED  16  // Flags setting to signify that after the processing of the callback results - turn the NV flag off\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT8   OpCode;           // Likely a string, numeric, or one-of\r
+  UINT8   Length;           // Length of the EFI_IFR_DATA_ENTRY packet\r
+  UINT16  Flags;            // Flags settings to determine what behavior is desired from the browser after the callback\r
+  VOID    *Data;            // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately\r
+  // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value\r
+  // If the OpCode is a String type - Data is a CHAR16[x] type\r
+  // If the OpCode is a Checkbox type - Data is a UINT8 value\r
+  // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure\r
+  //\r
+} EFI_IFR_DATA_ENTRY;\r
+\r
+typedef struct {\r
+  VOID                *NvRamMap;  // If the flag of the op-code specified retrieval of a copy of the NVRAM map,\r
+  // this is a pointer to a buffer copy\r
+  //\r
+  UINT32              EntryCount; // How many EFI_IFR_DATA_ENTRY entries\r
+  //\r
+  // EFI_IFR_DATA_ENTRY  Data[1];    // The in-line Data entries.\r
+  //\r
+} EFI_IFR_DATA_ARRAY;\r
+\r
+\r
+typedef union {\r
+  EFI_IFR_DATA_ARRAY  DataArray;  // Primarily used by those who call back to their drivers and use HII as a repository\r
+  EFI_IFR_PACKET      DataPacket; // Primarily used by those which do not use HII as a repository\r
+  CHAR16              *String;  // If returning an error - fill the string with null-terminated contents\r
+} EFI_HII_CALLBACK_PACKET;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // Offset into the map\r
+  UINT8             StorageWidth; // Width of the value\r
+  //\r
+  // CHAR8             Data[1];      // The Data itself\r
+  //\r
+} EFI_IFR_NV_DATA;\r
+\r
+#pragma pack()\r
+//\r
+// The following types are currently defined:\r
+//\r
+/**\r
+  Returns the value of a variable.\r
+\r
+  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  @param  VariableName          A NULL-terminated Unicode string that is the\r
+                                name of the vendor's variable.\r
+  @param  VendorGuid            A unique identifier for the vendor.\r
+  @param  Attributes            If not NULL, a pointer to the memory location to\r
+                                return the attribute's bit-mask for the variable.\r
+  @param  DataSize              The size in bytes of the Buffer. A size of zero causes\r
+                                the variable to be deleted.\r
+  @param  Buffer                The buffer to return the contents of the variable.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_NOT_FOUND         The variable was not found.\r
+  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result.\r
+                                DataSize has been updated with the size needed to complete the request.\r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_NV_READ) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     CHAR16                        *VariableName,\r
+  IN     EFI_GUID                      *VendorGuid,\r
+  OUT    UINT32                        *Attributes OPTIONAL,\r
+  IN OUT UINTN                         *DataSize,\r
+  OUT    VOID                          *Buffer\r
+  );\r
+\r
+/**\r
+  Sets the value of a variable.\r
+\r
+  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  @param  VariableName          A NULL-terminated Unicode string that is the\r
+                                name of the vendor's variable. Each VariableName is unique for each VendorGuid.\r
+  @param  VendorGuid            A unique identifier for the vendor.\r
+  @param  Attributes            Attributes bit-mask to set for the variable.\r
+  @param  DataSize              The size in bytes of the Buffer. A size of zero causes\r
+                                the variable to be deleted.\r
+  @param  Buffer                The buffer containing the contents of the variable.\r
+  @param  ResetRequired         Returns a value from the driver that abstracts\r
+                                this information and will enable a system to know if a system reset\r
+                                is required to achieve the configuration changes being enabled through\r
+                                this function.\r
+\r
+  @retval EFI_SUCCESS           The firmware has successfully stored the variable and\r
+                                its data as defined by the Attributes.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold\r
+                                the variable and its data.\r
+  @retval EFI_INVALID_PARAMETER An invalid combination of Attributes bits\r
+                                was supplied, or the DataSize exceeds the maximum allowed.\r
+  @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_NV_WRITE) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     CHAR16                        *VariableName,\r
+  IN     EFI_GUID                      *VendorGuid,\r
+  IN     UINT32                        Attributes,\r
+  IN     UINTN                         DataSize,\r
+  IN     VOID                          *Buffer,\r
+  OUT    BOOLEAN                       *ResetRequired\r
+  );\r
+\r
+/**\r
+  This function is called to provide results data to the driver.\r
+\r
+  @param  This                  A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  @param  KeyValue              A unique value which is sent to the original exporting\r
+                                driver so that it can identify the type of data to expect. The format of\r
+                                the data tends to vary based on the opcode that generated the callback.\r
+  @param  Data                  A pointer to the data being sent to the original exporting driver.\r
+  @param  Packet                A pointer to a packet of information which a driver passes\r
+                                back to the browser.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FORM_CALLBACK) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     UINT16                        KeyValue,\r
+  IN     EFI_IFR_DATA_ARRAY            *Data,\r
+  OUT    EFI_HII_CALLBACK_PACKET       **Packet\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to\r
+  custom NVS devices as well as communication of user selections in a more\r
+  interactive environment. This protocol should be published by hardware-specific\r
+  drivers that want to export access to custom hardware storage or publish IFR\r
+  that has a requirement to call back the original driver.\r
+\r
+  @param NvRead\r
+  The read operation to access the NV data serviced by a hardware-specific driver.\r
+\r
+  @param NvWrite\r
+  The write operation to access the NV data serviced by a hardware-specific driver.\r
+\r
+  @param Callback\r
+  The function that is called from the configuration browser to communicate key value pairs.\r
+\r
+**/\r
+struct _EFI_FORM_CALLBACK_PROTOCOL {\r
+  EFI_NV_READ       NvRead;\r
+  EFI_NV_WRITE      NvWrite;\r
+  EFI_FORM_CALLBACK Callback;\r
+};\r
+\r
+extern EFI_GUID gEfiFormCallbackProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FrameworkHii.h b/IntelFrameworkPkg/Include/Protocol/FrameworkHii.h
new file mode 100644 (file)
index 0000000..32e66ed
--- /dev/null
@@ -0,0 +1,951 @@
+/** @file\r
+  This file defines the Human Interface Infrastructure protocol which will\r
+  be used by resources which want to publish IFR/Font/String data and have it\r
+  collected by the Configuration engine.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkHii.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_HII_H_\r
+#define _FRAMEWORK_HII_H_\r
+\r
+#include <PiDxe.h>\r
+\r
+//\r
+// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,\r
+// is defined in MdePkg/Protocol/GraphicsOutput.h\r
+//\r
+#include <Protocol/GraphicsOutput.h>\r
+\r
+#define EFI_HII_PROTOCOL_GUID \\r
+  { \\r
+    0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r
+  }\r
+\r
+// BugBug:\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+// If UGA goes away we need to put this some place. I'm not sure where?\r
+//\r
+//typedef struct {\r
+//  UINT8 Blue;\r
+//  UINT8 Green;\r
+//  UINT8 Red;\r
+//  UINT8 Reserved;\r
+//} EFI_UGA_PIXEL;\r
+\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+//\r
+\r
+typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;\r
+\r
+//\r
+// Global definition\r
+//\r
+#define NARROW_CHAR         0xFFF0\r
+#define WIDE_CHAR           0xFFF1\r
+#define NON_BREAKING_CHAR   0xFFF2\r
+#define GLYPH_WIDTH         8\r
+#define GLYPH_HEIGHT        19\r
+\r
+#define EFI_HII_FONT        1\r
+#define EFI_HII_STRING      2\r
+#define EFI_HII_IFR         3\r
+#define EFI_HII_KEYBOARD    4\r
+#define EFI_HII_HANDLES     5\r
+#define EFI_HII_VARIABLE    6\r
+#define EFI_HII_DEVICE_PATH 7\r
+\r
+\r
+// References to string tokens must use this macro to enable scanning for\r
+// token usages.\r
+//\r
+#define STRING_TOKEN(t) t\r
+\r
+//\r
+// The following types are currently defined:\r
+// EFI_FROM_ID has been defined in UEFI spec.\r
+//\r
+typedef UINT16  EFI_FORM_LABEL;\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT32  Length;\r
+  UINT16  Type;\r
+} EFI_HII_PACK_HEADER;\r
+\r
+//\r
+// A form list consists of a large variety of structure\r
+// possibilities so to represent the binary blob of data\r
+// associated with a package of forms, we will assume a\r
+// pointer to a self-describing data buffer.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK;\r
+\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;           // Must be filled in\r
+  EFI_HANDLE          ImageHandle;      // Must be filled in\r
+  EFI_HANDLE          DeviceHandle;     // Optional\r
+  EFI_HANDLE          ControllerHandle; // Optional\r
+  EFI_HANDLE          CallbackHandle;   // Optional\r
+  EFI_HANDLE          COBExportHandle;  // Optional\r
+} EFI_HII_HANDLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_VARIABLE_CONTENTS\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_GUID            VariableGuid;\r
+  UINT32              VariableNameLength;\r
+  UINT16              VariableId;\r
+  //\r
+  //  CHAR16                VariableName[]; //Null-terminated\r
+  //\r
+} EFI_HII_VARIABLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_DEVICE_PATH_PACK\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  //\r
+  //  EFI_DEVICE_PATH       DevicePath[];\r
+  //\r
+} EFI_HII_DEVICE_PATH_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_DATA_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_HANDLE  HiiHandle;\r
+  EFI_GUID        PackageGuid;\r
+  UINT32          DataTableSize;\r
+  UINT32          IfrDataOffset;\r
+  UINT32          StringDataOffset;\r
+  UINT32          VariableDataOffset;\r
+  UINT32          DevicePathOffset;\r
+  UINT32          NumberOfVariableData;\r
+  UINT32          NumberOfLanguages;\r
+  //\r
+  // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
+  // EFI_HII_VARIABLE_PACK VariableData[];\r
+  // EFI_HII_IFR_PACK IfrData;\r
+  // EFI_HII_STRING_PACK StringData[];\r
+  //\r
+} EFI_HII_DATA_TABLE;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_EXPORT_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  UINT32    NumberOfHiiDataTables;\r
+  EFI_GUID  Revision;\r
+  //\r
+  // EFI_HII_DATA_TABLE HiiDataTable[];\r
+  //\r
+} EFI_HII_EXPORT_TABLE;\r
+\r
+typedef struct {\r
+  BOOLEAN               FormSetUpdate;      // If TRUE, next variable is significant\r
+  EFI_PHYSICAL_ADDRESS  FormCallbackHandle; // If not 0, will update Formset with this info\r
+  BOOLEAN               FormUpdate;         // If TRUE, next variable is significant\r
+  UINT16                FormValue;          // specify which form is to be updated if FormUpdate value is TRUE.\r
+  STRING_REF            FormTitle;          // If not 0, will update Form with this info\r
+  UINT16                DataCount;          // The number of Data entries in this structure\r
+  UINT8                 *Data;              // An array of 1+ op-codes, specified by DataCount\r
+} EFI_HII_UPDATE_DATA;\r
+\r
+//\r
+// String attributes\r
+//\r
+#define LANG_RIGHT_TO_LEFT  0x00000001\r
+\r
+//\r
+// A string package is used to localize strings to a particular\r
+// language.  The package is associated with a particular driver\r
+// or set of drivers.  Tools are used to associate tokens with\r
+// string references in forms and in programs.  These tokens are\r
+// language agnostic.  When paired with a language pack (directly\r
+// or indirectly), the string token resolves into an actual\r
+// UNICODE string.  The NumStringPointers determines how many\r
+// StringPointers (offset values) there are as well as the total\r
+// number of Strings that are defined.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  RELOFST             LanguageNameString;\r
+  RELOFST             PrintableLanguageName;\r
+  UINT32              NumStringPointers;\r
+  UINT32              Attributes;\r
+  //\r
+  //  RELOFST               StringPointers[];\r
+  //  EFI_STRING            Strings[];\r
+  //\r
+} EFI_HII_STRING_PACK;\r
+\r
+//\r
+// Glyph Attributes\r
+//\r
+#define EFI_GLYPH_NON_SPACING   1\r
+#define EFI_GLYPH_WIDE          2\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+} EFI_NARROW_GLYPH;\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+  UINT8   GlyphCol2[GLYPH_HEIGHT];\r
+  UINT8   Pad[3];\r
+} EFI_WIDE_GLYPH;\r
+\r
+//\r
+// A font list consists of a font header followed by a series\r
+// of glyph structures.  Note that fonts are not language specific.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  UINT16              NumberOfNarrowGlyphs;\r
+  UINT16              NumberOfWideGlyphs;\r
+} EFI_HII_FONT_PACK;\r
+\r
+//\r
+// The IfrData in the EFI_HII_IFR_PACK structure definition\r
+// is variable length, and not really part of the header. To\r
+// simplify from code the size of the header, define an\r
+// identical structure that does not include the IfrData field.\r
+// Then use sizeof() this new structure to determine the\r
+// actual size of the header.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK_HEADER;\r
+\r
+//\r
+// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
+//\r
+typedef enum {\r
+  EfiKeyLCtrl,\r
+  EfiKeyA0,\r
+  EfiKeyLAlt,\r
+  EfiKeySpaceBar,\r
+  EfiKeyA2,\r
+  EfiKeyA3,\r
+  EfiKeyA4,\r
+  EfiKeyRCtrl,\r
+  EfiKeyLeftArrow,\r
+  EfiKeyDownArrow,\r
+  EfiKeyRightArrow,\r
+  EfiKeyZero,\r
+  EfiKeyPeriod,\r
+  EfiKeyEnter,\r
+  EfiKeyLShift,\r
+  EfiKeyB0,\r
+  EfiKeyB1,\r
+  EfiKeyB2,\r
+  EfiKeyB3,\r
+  EfiKeyB4,\r
+  EfiKeyB5,\r
+  EfiKeyB6,\r
+  EfiKeyB7,\r
+  EfiKeyB8,\r
+  EfiKeyB9,\r
+  EfiKeyB10,\r
+  EfiKeyRshift,\r
+  EfiKeyUpArrow,\r
+  EfiKeyOne,\r
+  EfiKeyTwo,\r
+  EfiKeyThree,\r
+  EfiKeyCapsLock,\r
+  EfiKeyC1,\r
+  EfiKeyC2,\r
+  EfiKeyC3,\r
+  EfiKeyC4,\r
+  EfiKeyC5,\r
+  EfiKeyC6,\r
+  EfiKeyC7,\r
+  EfiKeyC8,\r
+  EfiKeyC9,\r
+  EfiKeyC10,\r
+  EfiKeyC11,\r
+  EfiKeyC12,\r
+  EfiKeyFour,\r
+  EfiKeyFive,\r
+  EfiKeySix,\r
+  EfiKeyPlus,\r
+  EfiKeyTab,\r
+  EfiKeyD1,\r
+  EfiKeyD2,\r
+  EfiKeyD3,\r
+  EfiKeyD4,\r
+  EfiKeyD5,\r
+  EfiKeyD6,\r
+  EfiKeyD7,\r
+  EfiKeyD8,\r
+  EfiKeyD9,\r
+  EfiKeyD10,\r
+  EfiKeyD11,\r
+  EfiKeyD12,\r
+  EfiKeyD13,\r
+  EfiKeyDel,\r
+  EfiKeyEnd,\r
+  EfiKeyPgDn,\r
+  EfiKeySeven,\r
+  EfiKeyEight,\r
+  EfiKeyNine,\r
+  EfiKeyE0,\r
+  EfiKeyE1,\r
+  EfiKeyE2,\r
+  EfiKeyE3,\r
+  EfiKeyE4,\r
+  EfiKeyE5,\r
+  EfiKeyE6,\r
+  EfiKeyE7,\r
+  EfiKeyE8,\r
+  EfiKeyE9,\r
+  EfiKeyE10,\r
+  EfiKeyE11,\r
+  EfiKeyE12,\r
+  EfiKeyBackSpace,\r
+  EfiKeyIns,\r
+  EfiKeyHome,\r
+  EfiKeyPgUp,\r
+  EfiKeyNLck,\r
+  EfiKeySlash,\r
+  EfiKeyAsterisk,\r
+  EfiKeyMinus,\r
+  EfiKeyEsc,\r
+  EfiKeyF1,\r
+  EfiKeyF2,\r
+  EfiKeyF3,\r
+  EfiKeyF4,\r
+  EfiKeyF5,\r
+  EfiKeyF6,\r
+  EfiKeyF7,\r
+  EfiKeyF8,\r
+  EfiKeyF9,\r
+  EfiKeyF10,\r
+  EfiKeyF11,\r
+  EfiKeyF12,\r
+  EfiKeyPrint,\r
+  EfiKeySLck,\r
+  EfiKeyPause\r
+} EFI_KEY;\r
+\r
+typedef struct {\r
+  EFI_KEY Key;\r
+  CHAR16  Unicode;\r
+  CHAR16  ShiftedUnicode;\r
+  CHAR16  AltGrUnicode;\r
+  CHAR16  ShiftedAltGrUnicode;\r
+  UINT16  Modifier;\r
+} EFI_KEY_DESCRIPTOR;\r
+\r
+//\r
+// This structure allows a sparse set of keys to be redefined\r
+// or a complete redefinition of the keyboard layout.  Most\r
+// keyboards have a lot of commonality in their layouts, therefore\r
+// only defining those keys that need to change from the default\r
+// minimizes the passed in information.\r
+//\r
+// Additionally, when an update occurs, the active keyboard layout\r
+// will be switched to the newly updated keyboard layout.  This\r
+// allows for situations that when a keyboard layout driver is\r
+// loaded as part of system initialization, the system will default\r
+// the keyboard behavior to the new layout.\r
+//\r
+// Each call to update the keyboard mapping should contain the\r
+// complete set of key descriptors to be updated, since every\r
+// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
+// wipe the previous set of overrides.  A call to\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_KEY_DESCRIPTOR  *Descriptor;\r
+  UINT8               DescriptorCount;\r
+} EFI_HII_KEYBOARD_PACK;\r
+\r
+//\r
+// The EFI_HII_PACKAGES can contain different types of packages just\r
+// after the structure as inline data.\r
+//\r
+typedef struct {\r
+  UINTN     NumberOfPackages;\r
+  EFI_GUID  *GuidId;\r
+  //\r
+  // EFI_HII_HANDLE_PACK    *HandlePack;        // Only one pack.\r
+  // EFI_HII_IFR_PACK       *IfrPack;           // Only one pack.\r
+  // EFI_HII_FONT_PACK      *FontPack[];        // Multiple packs ok\r
+  // EFI_HII_STRING_PACK    *StringPack[];      // Multiple packs ok\r
+  // EFI_HII_KEYBOARD_PACK  *KeyboardPack[];    // Multiple packs ok\r
+  //\r
+} EFI_HII_PACKAGES;\r
+\r
+typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
+  struct _EFI_HII_VARIABLE_PACK_LIST   *NextVariablePack;\r
+  EFI_HII_VARIABLE_PACK                *VariablePack;\r
+} EFI_HII_VARIABLE_PACK_LIST;\r
+\r
+\r
+#pragma pack()\r
+\r
+/**\r
+  Registers the various packs that are passed in via the Packages parameter.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Packages              A pointer to an EFI_HII_PACKAGES package instance.\r
+  @param  Handle                A pointer to the EFI_HII_HANDLE instance.\r
+\r
+  @retval EFI_SUCCESS           Data was extracted from Packages, the database\r
+                                was updated with the data, and Handle returned successfully.\r
+  @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_PACK) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_PACKAGES    *Packages,\r
+  OUT EFI_HII_HANDLE      *Handle\r
+  );\r
+\r
+/**\r
+  Removes a package from the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle that was registered to the data that is requested\r
+                                for removal.\r
+\r
+  @retval EFI_SUCCESS           The data associated with the Handle was removed\r
+                                from the HII database.\r
+  @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_REMOVE_PACK) (\r
+  IN EFI_HII_PROTOCOL    *This,\r
+  IN EFI_HII_HANDLE      Handle\r
+  );\r
+\r
+/**\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  HandleBufferLength    On input, a pointer to the length of the handle\r
+                                buffer. On output, the length of the handle buffer that is required\r
+                                for the handles found.\r
+  @param  Handle                An array of EFI_HII_HANDLE instances returned.\r
+\r
+  @retval EFI_SUCCESS           Handle was updated successfully.\r
+  @retval EFI_BUFFER_TOO_SMALL  The HandleBufferLength parameter indicates\r
+                                that Handle is too small to support the number of handles.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_FIND_HANDLES) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN OUT UINT16           *HandleBufferLength,\r
+  OUT    EFI_HII_HANDLE   *Handle\r
+  );\r
+\r
+/**\r
+  Exports the contents of the database into a buffer.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                An EFI_HII_HANDLE that corresponds to the desired\r
+                                handle to export. If the value is 0, the entire database will be exported.\r
+                                In either case, the data will be exported in a format described by the\r
+                                structure definition of EFI_HII_EXPORT_TABLE.\r
+  @param  BufferSize\r
+  On input, a pointer to the length of the buffer. On output, the length\r
+  of the buffer that is required for the export data.\r
+  @param  Buffer                A pointer to a buffer that will contain the results of the export function.\r
+\r
+  @retval EFI_SUCCESS           The buffer was successfully filled with BufferSize amount of data.\r
+  @retval EFI_BUFFER_TOO_SMALL  The value in BufferSize was too small to contain the export data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_EXPORT) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN     EFI_HII_HANDLE   Handle,\r
+  IN OUT UINTN            *BufferSize,\r
+  OUT    VOID             *Buffer\r
+  );\r
+\r
+/**\r
+  Remove any new strings that were added after the initial string export\r
+  for this handle.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+\r
+  @retval EFI_SUCCESS           Remove strings from the handle successfully.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_RESET_STRINGS) (\r
+  IN     EFI_HII_PROTOCOL   *This,\r
+  IN     EFI_HII_HANDLE     Handle\r
+  );\r
+\r
+/**\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  StringToTest          A pointer to a Unicode string.\r
+  @param  FirstMissing          A pointer to an index into the string. On input,\r
+                                the index of the first character in the StringToTest to examine. On exit,\r
+                                the index of the first character encountered for which a glyph is unavailable.\r
+                                If all glyphs in the string are available, the index is the index of the\r
+                                terminator of the string.\r
+  @param  GlyphBufferSize       A pointer to a value. On output, if the function\r
+                                returns EFI_SUCCESS, it contains the amount of memory that is required to\r
+                                store the string's glyph equivalent.\r
+\r
+  @retval EFI_SUCCESS           All glyphs are available. Note that an empty string\r
+                                always returns this value.\r
+  @retval EFI_NOT_FOUND         A glyph was not found for a character.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_TEST_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *StringToTest,\r
+  IN OUT UINT32            *FirstMissing,\r
+  OUT    UINT32            *GlyphBufferSize\r
+  );\r
+\r
+/**\r
+  Translates a Unicode character into the corresponding font glyph.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Source                A pointer to a Unicode string.\r
+  @param  Index                 On input, the offset into the string from which to fetch\r
+                                the character.On successful completion, the index is updated to the first\r
+                                character past the character(s) making up the just extracted glyph.\r
+  @param  GlyphBuffer           Pointer to an array where the glyphs corresponding\r
+                                to the characters in the source may be stored. GlyphBuffer is assumed\r
+                                to be wide enough to accept a wide glyph character.\r
+  @param  BitWidth              If EFI_SUCCESS was returned, the UINT16 pointed to by\r
+                                this value is filled with the length of the glyph in pixels. It is unchanged\r
+                                if the call was unsuccessful.\r
+  @param  InternalStatus        The cell pointed to by this parameter must be\r
+                                initialized to zero prior to invoking the call the first time for any string.\r
+\r
+  @retval EFI_SUCCESS           It worked.\r
+  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_GLYPH) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *Source,\r
+  IN OUT UINT16            *Index,\r
+  OUT    UINT8             **GlyphBuffer,\r
+  OUT    UINT16            *BitWidth,\r
+  IN OUT UINT32            *InternalStatus\r
+  );\r
+\r
+/**\r
+  Translates a glyph into the format required for input to the Universal\r
+  Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  GlyphBuffer           A pointer to the buffer that contains glyph data.\r
+  @param  Foreground            The foreground setting requested to be used for the\r
+                                generated BltBuffer data.\r
+  @param  Background            The background setting requested to be used for the\r
+                                generated BltBuffer data.\r
+  @param  Count                 The entry in the BltBuffer upon which to act.\r
+  @param  Width                 The width in bits of the glyph being converted.\r
+  @param  Height                The height in bits of the glyph being converted\r
+  @param  BltBuffer             A pointer to the buffer that contains the data that is\r
+                                ready to be used by the UGA BLT routines.\r
+\r
+  @retval EFI_SUCCESS           It worked.\r
+  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
+  IN     EFI_HII_PROTOCOL             *This,\r
+  IN     UINT8                        *GlyphBuffer,\r
+  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
+  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
+  IN     UINTN                         Count,\r
+  IN     UINTN                         Width,\r
+  IN     UINTN                         Height,\r
+  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
+  );\r
+\r
+/**\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Pointer               to a NULL-terminated string containing a single ISO 639-2\r
+                                language identifier, indicating the language in which the string is translated.\r
+  @param  Handle                The handle of the language pack to which the string is to be added.\r
+  @param  Reference             The identifier of the string to be added. If the reference\r
+                                value is zero, then the string will be assigned a new identifier on that\r
+                                handle for the language specified. Otherwise, the string will be updated\r
+                                with the NewString Value.\r
+  @param  NewString             The string to be added.\r
+\r
+  @retval EFI_SUCCESS           The string was effectively registered.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_STRING) (\r
+  IN     EFI_HII_PROTOCOL      *This,\r
+  IN     CHAR16                *Language,\r
+  IN     EFI_HII_HANDLE        Handle,\r
+  IN OUT STRING_REF            *Reference,\r
+  IN     CHAR16                *NewString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine the primary languages that are supported\r
+  on a given handle.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the strings reside.\r
+  @param  LanguageString        A string allocated by GetPrimaryLanguages() that\r
+                                contains a list of all primary languages registered on the handle.\r
+\r
+  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine which secondary languages are supported\r
+  on a given handle for a given primary language.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the strings reside.\r
+  @param  PrimaryLanguage       Pointer to a NULL-terminated string containing a single\r
+                                ISO 639-2 language identifier, indicating the primary language.\r
+  @param  LanguageString        A string allocated by GetSecondaryLanguages()\r
+                                containing a list of all secondary languages registered on the handle.\r
+\r
+  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  IN  CHAR16              *PrimaryLanguage,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Extracts a string from a package already registered with the EFI HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+  @param  Token                 The string token assigned to the string.\r
+  @param  Raw                   If TRUE, the string is returned unedited in the internal\r
+                                storage format described above. If false, the string returned is edited\r
+                                by replacing <cr> with <space> and by removing special characters such\r
+                                as the <wide> prefix.\r
+  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
+                                single ISO 639-2 language identifier, indicating the language to print.\r
+                                If the LanguageString is empty (starts with a NULL), the default system\r
+                                language will be used to determine the language.\r
+  @param  BufferLength          Length of the StringBuffer.\r
+  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
+\r
+  @retval EFI_SUCCESS           StringBuffer is filled with a NULL-terminated string.\r
+  @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough to\r
+                                allow the entire string to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN     BOOLEAN           Raw,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a part of a string of not more than a given width.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+  @param  Token                 The string token assigned to the string.\r
+  @param  Index                 On input, the offset into the string where the line is to start.\r
+                                On output, the index is updated to point to beyond the last character returned\r
+                                in the call.\r
+  @param  LineWidth             The maximum width of the line in units of narrow glyphs.\r
+  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
+                                single ISO 639-2 language identifier, indicating the language to print.\r
+  @param  BufferLength          Pointer to the length of the StringBuffer.\r
+  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
+\r
+  @retval EFI_SUCCESS           StringBuffer filled with characters that will fit on the line.\r
+  @retval EFI_NOT_FOUND         The font glyph for at least one of the characters in\r
+                                the string is not in the font database.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
+                                to allow the entire string to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_LINE) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN OUT UINT16            *Index,\r
+  IN     UINT16            LineWidth,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINT16            *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a form or form package that has previously\r
+  been registered with the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                Handle on which the form resides.\r
+  @param  FormId                The ID of the form to return. If the ID is zero,\r
+                                the entire form package is returned.\r
+  @param  BufferLength          On input, the length of the Buffer. On output,\r
+                                the length of the returned buffer,\r
+  @param  Buffer                The buffer designed to receive the form(s).\r
+\r
+  @retval EFI_SUCCESS           Buffer filled with the requested forms. BufferLength\r
+                                was updated.\r
+  @retval EFI_INVALID_PARAMETER The handle is unknown.\r
+  @retval EFI_NOT_FOUND         A form on the requested handle cannot be found with\r
+                                the requested FormId.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
+                                to allow the form to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_FORMS) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     EFI_FORM_ID       FormId,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    UINT8             *Buffer\r
+  );\r
+\r
+/**\r
+  Extracts the defaults that are associated with a given handle in the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The HII handle from which will have default data retrieved.\r
+  @param  DefaultMask           The mask used to specify some type of default override when extracting\r
+                                the default image data.\r
+  @param  VariablePackList      A indirect pointer to the first entry of a link list with\r
+                                type EFI_HII_VARIABLE_PACK_LIST.\r
+\r
+  @retval EFI_SUCCESS           The VariablePackList was populated with the appropriate\r
+                                default setting data.\r
+  @retval EFI_NOT_FOUND         The IFR does not have any explicit or default map(s).\r
+  @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r
+                                contain invalid data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
+  IN     EFI_HII_PROTOCOL           *This,\r
+  IN     EFI_HII_HANDLE             Handle,\r
+  IN     UINTN                      DefaultMask,\r
+  OUT    EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
+  );\r
+\r
+/**\r
+  Allows the caller to update a form or form package that has previously been\r
+  registered with the EFI HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                Handle of the package where the form to be updated resides.\r
+  @param  Label                 The label inside the form package where the update is to take place.\r
+  @param  AddData               If TRUE, adding data at a given Label; otherwise,\r
+                                if FALSE, removing data at a given Label.\r
+  @param  Data                  The buffer containing the new tags to insert after the Label\r
+\r
+  @retval EFI_SUCCESS           The form was updated with the new tags.\r
+  @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r
+                                contain an integral number of tags.\r
+  @retval EFI_NOT_FOUND         The Handle, Label, or FormId was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_UPDATE_FORM) (\r
+  IN EFI_HII_PROTOCOL     *This,\r
+  IN EFI_HII_HANDLE       Handle,\r
+  IN EFI_FORM_LABEL       Label,\r
+  IN BOOLEAN              AddData,\r
+  IN EFI_HII_UPDATE_DATA  *Data\r
+  );\r
+\r
+/**\r
+  Retrieves the current keyboard layout.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  DescriptorCount       A pointer to the number of Descriptor entries being\r
+                                described in the keyboard layout being retrieved.\r
+  @param  Descriptor            A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r
+                                entries. Each entry will reflect the definition of a specific physical key.\r
+\r
+  @retval EFI_SUCCESS           The keyboard layout was retrieved successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
+  IN     EFI_HII_PROTOCOL    *This,\r
+  OUT    UINT16              *DescriptorCount,\r
+  OUT    EFI_KEY_DESCRIPTOR  *Descriptor\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The HII Protocol manages the HII database, which is a repository for data\r
+  having to do with fonts, strings, forms, keyboards, and other future human\r
+  interface items.\r
+\r
+  @param NewPack\r
+  Extracts the various packs from a package list.\r
+\r
+  @param RemovePack\r
+  Removes a package from the HII database.\r
+\r
+  @param FindHandles\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param ExportDatabase\r
+  Export the entire contents of the database to a buffer.\r
+\r
+  @param TestString\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param GetGlyph\r
+  Translates a Unicode character into the corresponding font glyph.\r
+\r
+  @param GlyphToBlt\r
+  Converts a glyph value into a format that is ready for a UGA BLT command.\r
+\r
+  @param NewString\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param GetPrimaryLanguages\r
+  Allows a program to determine the primary languages that are supported\r
+  on a given handle.\r
+\r
+  @param GetSecondaryLanguages\r
+  Allows a program to determine which secondary languages are supported\r
+  on a given handle for a given primary language.\r
+\r
+  @param GetString\r
+  Extracts a string from a package that is already registered with the\r
+  EFI HII database.\r
+\r
+  @param ResetString\r
+  Remove any new strings that were added after the initial string export\r
+  for this handle.\r
+\r
+  @param GetLine\r
+  Allows a program to extract a part of a string of not more than a given width.\r
+\r
+  @param GetForms\r
+  Allows a program to extract a form or form package that has been previously registered.\r
+\r
+  @param GetDefaultImage\r
+  Allows a program to extract the nonvolatile image that represents the default storage image.\r
+\r
+  @param UpdateForm\r
+  Allows a program to update a previously registered form.\r
+\r
+  @param GetKeyboardLayout\r
+  Allows a program to extract the current keyboard layout.\r
+\r
+**/\r
+struct _EFI_HII_PROTOCOL {\r
+  EFI_HII_NEW_PACK            NewPack;\r
+  EFI_HII_REMOVE_PACK         RemovePack;\r
+  EFI_HII_FIND_HANDLES        FindHandles;\r
+  EFI_HII_EXPORT              ExportDatabase;\r
+\r
+  EFI_HII_TEST_STRING         TestString;\r
+  EFI_HII_GET_GLYPH           GetGlyph;\r
+  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;\r
+\r
+  EFI_HII_NEW_STRING          NewString;\r
+  EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;\r
+  EFI_HII_GET_SEC_LANGUAGES   GetSecondaryLanguages;\r
+  EFI_HII_GET_STRING          GetString;\r
+  EFI_HII_RESET_STRINGS       ResetStrings;\r
+  EFI_HII_GET_LINE            GetLine;\r
+  EFI_HII_GET_FORMS           GetForms;\r
+  EFI_HII_GET_DEFAULT_IMAGE   GetDefaultImage;\r
+  EFI_HII_UPDATE_FORM         UpdateForm;\r
+\r
+  EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
+};\r
+\r
+extern EFI_GUID gEfiHiiProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/HiiFramework.h b/IntelFrameworkPkg/Include/Protocol/HiiFramework.h
deleted file mode 100644 (file)
index d138ad8..0000000
+++ /dev/null
@@ -1,951 +0,0 @@
-/** @file\r
-  This file defines the Human Interface Infrastructure protocol which will\r
-  be used by resources which want to publish IFR/Font/String data and have it\r
-  collected by the Configuration engine.\r
-\r
-  Copyright (c) 2007, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  HiiFramework.h\r
-\r
-  @par Revision Reference:\r
-  This protocol is defined in HII spec 0.92.\r
-\r
-**/\r
-\r
-#ifndef _FRAMEWORK_HII_H_\r
-#define _FRAMEWORK_HII_H_\r
-\r
-#include <PiDxe.h>\r
-\r
-//\r
-// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,\r
-// is defined in MdePkg/Protocol/GraphicsOutput.h\r
-//\r
-#include <Protocol/GraphicsOutput.h>\r
-\r
-#define EFI_HII_PROTOCOL_GUID \\r
-  { \\r
-    0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r
-  }\r
-\r
-// BugBug:\r
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
-// If UGA goes away we need to put this some place. I'm not sure where?\r
-//\r
-//typedef struct {\r
-//  UINT8 Blue;\r
-//  UINT8 Green;\r
-//  UINT8 Red;\r
-//  UINT8 Reserved;\r
-//} EFI_UGA_PIXEL;\r
-\r
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
-//\r
-\r
-typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;\r
-\r
-//\r
-// Global definition\r
-//\r
-#define NARROW_CHAR         0xFFF0\r
-#define WIDE_CHAR           0xFFF1\r
-#define NON_BREAKING_CHAR   0xFFF2\r
-#define GLYPH_WIDTH         8\r
-#define GLYPH_HEIGHT        19\r
-\r
-#define EFI_HII_FONT        1\r
-#define EFI_HII_STRING      2\r
-#define EFI_HII_IFR         3\r
-#define EFI_HII_KEYBOARD    4\r
-#define EFI_HII_HANDLES     5\r
-#define EFI_HII_VARIABLE    6\r
-#define EFI_HII_DEVICE_PATH 7\r
-\r
-\r
-// References to string tokens must use this macro to enable scanning for\r
-// token usages.\r
-//\r
-#define STRING_TOKEN(t) t\r
-\r
-//\r
-// The following types are currently defined:\r
-// EFI_FROM_ID has been defined in UEFI spec.\r
-//\r
-typedef UINT16  EFI_FORM_LABEL;\r
-\r
-#pragma pack(1)\r
-\r
-typedef struct {\r
-  UINT32  Length;\r
-  UINT16  Type;\r
-} EFI_HII_PACK_HEADER;\r
-\r
-//\r
-// A form list consists of a large variety of structure\r
-// possibilities so to represent the binary blob of data\r
-// associated with a package of forms, we will assume a\r
-// pointer to a self-describing data buffer.\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-} EFI_HII_IFR_PACK;\r
-\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;           // Must be filled in\r
-  EFI_HANDLE          ImageHandle;      // Must be filled in\r
-  EFI_HANDLE          DeviceHandle;     // Optional\r
-  EFI_HANDLE          ControllerHandle; // Optional\r
-  EFI_HANDLE          CallbackHandle;   // Optional\r
-  EFI_HANDLE          COBExportHandle;  // Optional\r
-} EFI_HII_HANDLE_PACK;\r
-\r
-//\r
-// ********************************************************\r
-// EFI_VARIABLE_CONTENTS\r
-// ********************************************************\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-  EFI_GUID            VariableGuid;\r
-  UINT32              VariableNameLength;\r
-  UINT16              VariableId;\r
-  //\r
-  //  CHAR16                VariableName[]; //Null-terminated\r
-  //\r
-} EFI_HII_VARIABLE_PACK;\r
-\r
-//\r
-// ********************************************************\r
-// EFI_DEVICE_PATH_PACK\r
-// ********************************************************\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-  //\r
-  //  EFI_DEVICE_PATH       DevicePath[];\r
-  //\r
-} EFI_HII_DEVICE_PATH_PACK;\r
-\r
-//\r
-// ********************************************************\r
-// EFI_HII_DATA_TABLE\r
-// ********************************************************\r
-//\r
-typedef struct {\r
-  EFI_HII_HANDLE  HiiHandle;\r
-  EFI_GUID        PackageGuid;\r
-  UINT32          DataTableSize;\r
-  UINT32          IfrDataOffset;\r
-  UINT32          StringDataOffset;\r
-  UINT32          VariableDataOffset;\r
-  UINT32          DevicePathOffset;\r
-  UINT32          NumberOfVariableData;\r
-  UINT32          NumberOfLanguages;\r
-  //\r
-  // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
-  // EFI_HII_VARIABLE_PACK VariableData[];\r
-  // EFI_HII_IFR_PACK IfrData;\r
-  // EFI_HII_STRING_PACK StringData[];\r
-  //\r
-} EFI_HII_DATA_TABLE;\r
-\r
-//\r
-// ********************************************************\r
-// EFI_HII_EXPORT_TABLE\r
-// ********************************************************\r
-//\r
-typedef struct {\r
-  UINT32    NumberOfHiiDataTables;\r
-  EFI_GUID  Revision;\r
-  //\r
-  // EFI_HII_DATA_TABLE HiiDataTable[];\r
-  //\r
-} EFI_HII_EXPORT_TABLE;\r
-\r
-typedef struct {\r
-  BOOLEAN               FormSetUpdate;      // If TRUE, next variable is significant\r
-  EFI_PHYSICAL_ADDRESS  FormCallbackHandle; // If not 0, will update Formset with this info\r
-  BOOLEAN               FormUpdate;         // If TRUE, next variable is significant\r
-  UINT16                FormValue;          // specify which form is to be updated if FormUpdate value is TRUE.\r
-  STRING_REF            FormTitle;          // If not 0, will update Form with this info\r
-  UINT16                DataCount;          // The number of Data entries in this structure\r
-  UINT8                 *Data;              // An array of 1+ op-codes, specified by DataCount\r
-} EFI_HII_UPDATE_DATA;\r
-\r
-//\r
-// String attributes\r
-//\r
-#define LANG_RIGHT_TO_LEFT  0x00000001\r
-\r
-//\r
-// A string package is used to localize strings to a particular\r
-// language.  The package is associated with a particular driver\r
-// or set of drivers.  Tools are used to associate tokens with\r
-// string references in forms and in programs.  These tokens are\r
-// language agnostic.  When paired with a language pack (directly\r
-// or indirectly), the string token resolves into an actual\r
-// UNICODE string.  The NumStringPointers determines how many\r
-// StringPointers (offset values) there are as well as the total\r
-// number of Strings that are defined.\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-  RELOFST             LanguageNameString;\r
-  RELOFST             PrintableLanguageName;\r
-  UINT32              NumStringPointers;\r
-  UINT32              Attributes;\r
-  //\r
-  //  RELOFST               StringPointers[];\r
-  //  EFI_STRING            Strings[];\r
-  //\r
-} EFI_HII_STRING_PACK;\r
-\r
-//\r
-// Glyph Attributes\r
-//\r
-#define EFI_GLYPH_NON_SPACING   1\r
-#define EFI_GLYPH_WIDE          2\r
-\r
-typedef struct {\r
-  CHAR16  UnicodeWeight;\r
-  UINT8   Attributes;\r
-  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
-} EFI_NARROW_GLYPH;\r
-\r
-typedef struct {\r
-  CHAR16  UnicodeWeight;\r
-  UINT8   Attributes;\r
-  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
-  UINT8   GlyphCol2[GLYPH_HEIGHT];\r
-  UINT8   Pad[3];\r
-} EFI_WIDE_GLYPH;\r
-\r
-//\r
-// A font list consists of a font header followed by a series\r
-// of glyph structures.  Note that fonts are not language specific.\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-  UINT16              NumberOfNarrowGlyphs;\r
-  UINT16              NumberOfWideGlyphs;\r
-} EFI_HII_FONT_PACK;\r
-\r
-//\r
-// The IfrData in the EFI_HII_IFR_PACK structure definition\r
-// is variable length, and not really part of the header. To\r
-// simplify from code the size of the header, define an\r
-// identical structure that does not include the IfrData field.\r
-// Then use sizeof() this new structure to determine the\r
-// actual size of the header.\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-} EFI_HII_IFR_PACK_HEADER;\r
-\r
-//\r
-// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
-//\r
-typedef enum {\r
-  EfiKeyLCtrl,\r
-  EfiKeyA0,\r
-  EfiKeyLAlt,\r
-  EfiKeySpaceBar,\r
-  EfiKeyA2,\r
-  EfiKeyA3,\r
-  EfiKeyA4,\r
-  EfiKeyRCtrl,\r
-  EfiKeyLeftArrow,\r
-  EfiKeyDownArrow,\r
-  EfiKeyRightArrow,\r
-  EfiKeyZero,\r
-  EfiKeyPeriod,\r
-  EfiKeyEnter,\r
-  EfiKeyLShift,\r
-  EfiKeyB0,\r
-  EfiKeyB1,\r
-  EfiKeyB2,\r
-  EfiKeyB3,\r
-  EfiKeyB4,\r
-  EfiKeyB5,\r
-  EfiKeyB6,\r
-  EfiKeyB7,\r
-  EfiKeyB8,\r
-  EfiKeyB9,\r
-  EfiKeyB10,\r
-  EfiKeyRshift,\r
-  EfiKeyUpArrow,\r
-  EfiKeyOne,\r
-  EfiKeyTwo,\r
-  EfiKeyThree,\r
-  EfiKeyCapsLock,\r
-  EfiKeyC1,\r
-  EfiKeyC2,\r
-  EfiKeyC3,\r
-  EfiKeyC4,\r
-  EfiKeyC5,\r
-  EfiKeyC6,\r
-  EfiKeyC7,\r
-  EfiKeyC8,\r
-  EfiKeyC9,\r
-  EfiKeyC10,\r
-  EfiKeyC11,\r
-  EfiKeyC12,\r
-  EfiKeyFour,\r
-  EfiKeyFive,\r
-  EfiKeySix,\r
-  EfiKeyPlus,\r
-  EfiKeyTab,\r
-  EfiKeyD1,\r
-  EfiKeyD2,\r
-  EfiKeyD3,\r
-  EfiKeyD4,\r
-  EfiKeyD5,\r
-  EfiKeyD6,\r
-  EfiKeyD7,\r
-  EfiKeyD8,\r
-  EfiKeyD9,\r
-  EfiKeyD10,\r
-  EfiKeyD11,\r
-  EfiKeyD12,\r
-  EfiKeyD13,\r
-  EfiKeyDel,\r
-  EfiKeyEnd,\r
-  EfiKeyPgDn,\r
-  EfiKeySeven,\r
-  EfiKeyEight,\r
-  EfiKeyNine,\r
-  EfiKeyE0,\r
-  EfiKeyE1,\r
-  EfiKeyE2,\r
-  EfiKeyE3,\r
-  EfiKeyE4,\r
-  EfiKeyE5,\r
-  EfiKeyE6,\r
-  EfiKeyE7,\r
-  EfiKeyE8,\r
-  EfiKeyE9,\r
-  EfiKeyE10,\r
-  EfiKeyE11,\r
-  EfiKeyE12,\r
-  EfiKeyBackSpace,\r
-  EfiKeyIns,\r
-  EfiKeyHome,\r
-  EfiKeyPgUp,\r
-  EfiKeyNLck,\r
-  EfiKeySlash,\r
-  EfiKeyAsterisk,\r
-  EfiKeyMinus,\r
-  EfiKeyEsc,\r
-  EfiKeyF1,\r
-  EfiKeyF2,\r
-  EfiKeyF3,\r
-  EfiKeyF4,\r
-  EfiKeyF5,\r
-  EfiKeyF6,\r
-  EfiKeyF7,\r
-  EfiKeyF8,\r
-  EfiKeyF9,\r
-  EfiKeyF10,\r
-  EfiKeyF11,\r
-  EfiKeyF12,\r
-  EfiKeyPrint,\r
-  EfiKeySLck,\r
-  EfiKeyPause\r
-} EFI_KEY;\r
-\r
-typedef struct {\r
-  EFI_KEY Key;\r
-  CHAR16  Unicode;\r
-  CHAR16  ShiftedUnicode;\r
-  CHAR16  AltGrUnicode;\r
-  CHAR16  ShiftedAltGrUnicode;\r
-  UINT16  Modifier;\r
-} EFI_KEY_DESCRIPTOR;\r
-\r
-//\r
-// This structure allows a sparse set of keys to be redefined\r
-// or a complete redefinition of the keyboard layout.  Most\r
-// keyboards have a lot of commonality in their layouts, therefore\r
-// only defining those keys that need to change from the default\r
-// minimizes the passed in information.\r
-//\r
-// Additionally, when an update occurs, the active keyboard layout\r
-// will be switched to the newly updated keyboard layout.  This\r
-// allows for situations that when a keyboard layout driver is\r
-// loaded as part of system initialization, the system will default\r
-// the keyboard behavior to the new layout.\r
-//\r
-// Each call to update the keyboard mapping should contain the\r
-// complete set of key descriptors to be updated, since every\r
-// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
-// wipe the previous set of overrides.  A call to\r
-//\r
-typedef struct {\r
-  EFI_HII_PACK_HEADER Header;\r
-  EFI_KEY_DESCRIPTOR  *Descriptor;\r
-  UINT8               DescriptorCount;\r
-} EFI_HII_KEYBOARD_PACK;\r
-\r
-//\r
-// The EFI_HII_PACKAGES can contain different types of packages just\r
-// after the structure as inline data.\r
-//\r
-typedef struct {\r
-  UINTN     NumberOfPackages;\r
-  EFI_GUID  *GuidId;\r
-  //\r
-  // EFI_HII_HANDLE_PACK    *HandlePack;        // Only one pack.\r
-  // EFI_HII_IFR_PACK       *IfrPack;           // Only one pack.\r
-  // EFI_HII_FONT_PACK      *FontPack[];        // Multiple packs ok\r
-  // EFI_HII_STRING_PACK    *StringPack[];      // Multiple packs ok\r
-  // EFI_HII_KEYBOARD_PACK  *KeyboardPack[];    // Multiple packs ok\r
-  //\r
-} EFI_HII_PACKAGES;\r
-\r
-typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
-  struct _EFI_HII_VARIABLE_PACK_LIST   *NextVariablePack;\r
-  EFI_HII_VARIABLE_PACK                *VariablePack;\r
-} EFI_HII_VARIABLE_PACK_LIST;\r
-\r
-\r
-#pragma pack()\r
-\r
-/**\r
-  Registers the various packs that are passed in via the Packages parameter.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Packages              A pointer to an EFI_HII_PACKAGES package instance.\r
-  @param  Handle                A pointer to the EFI_HII_HANDLE instance.\r
-\r
-  @retval EFI_SUCCESS           Data was extracted from Packages, the database\r
-                                was updated with the data, and Handle returned successfully.\r
-  @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_NEW_PACK) (\r
-  IN  EFI_HII_PROTOCOL    *This,\r
-  IN  EFI_HII_PACKAGES    *Packages,\r
-  OUT EFI_HII_HANDLE      *Handle\r
-  );\r
-\r
-/**\r
-  Removes a package from the HII database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle that was registered to the data that is requested\r
-                                for removal.\r
-\r
-  @retval EFI_SUCCESS           The data associated with the Handle was removed\r
-                                from the HII database.\r
-  @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_REMOVE_PACK) (\r
-  IN EFI_HII_PROTOCOL    *This,\r
-  IN EFI_HII_HANDLE      Handle\r
-  );\r
-\r
-/**\r
-  Determines the handles that are currently active in the database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  HandleBufferLength    On input, a pointer to the length of the handle\r
-                                buffer. On output, the length of the handle buffer that is required\r
-                                for the handles found.\r
-  @param  Handle                An array of EFI_HII_HANDLE instances returned.\r
-\r
-  @retval EFI_SUCCESS           Handle was updated successfully.\r
-  @retval EFI_BUFFER_TOO_SMALL  The HandleBufferLength parameter indicates\r
-                                that Handle is too small to support the number of handles.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_FIND_HANDLES) (\r
-  IN     EFI_HII_PROTOCOL *This,\r
-  IN OUT UINT16           *HandleBufferLength,\r
-  OUT    EFI_HII_HANDLE   *Handle\r
-  );\r
-\r
-/**\r
-  Exports the contents of the database into a buffer.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                An EFI_HII_HANDLE that corresponds to the desired\r
-                                handle to export. If the value is 0, the entire database will be exported.\r
-                                In either case, the data will be exported in a format described by the\r
-                                structure definition of EFI_HII_EXPORT_TABLE.\r
-  @param  BufferSize\r
-  On input, a pointer to the length of the buffer. On output, the length\r
-  of the buffer that is required for the export data.\r
-  @param  Buffer                A pointer to a buffer that will contain the results of the export function.\r
-\r
-  @retval EFI_SUCCESS           The buffer was successfully filled with BufferSize amount of data.\r
-  @retval EFI_BUFFER_TOO_SMALL  The value in BufferSize was too small to contain the export data.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_EXPORT) (\r
-  IN     EFI_HII_PROTOCOL *This,\r
-  IN     EFI_HII_HANDLE   Handle,\r
-  IN OUT UINTN            *BufferSize,\r
-  OUT    VOID             *Buffer\r
-  );\r
-\r
-/**\r
-  Remove any new strings that were added after the initial string export\r
-  for this handle.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle on which the string resides.\r
-\r
-  @retval EFI_SUCCESS           Remove strings from the handle successfully.\r
-  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_RESET_STRINGS) (\r
-  IN     EFI_HII_PROTOCOL   *This,\r
-  IN     EFI_HII_HANDLE     Handle\r
-  );\r
-\r
-/**\r
-  Tests if all of the characters in a string have corresponding font characters.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  StringToTest          A pointer to a Unicode string.\r
-  @param  FirstMissing          A pointer to an index into the string. On input,\r
-                                the index of the first character in the StringToTest to examine. On exit,\r
-                                the index of the first character encountered for which a glyph is unavailable.\r
-                                If all glyphs in the string are available, the index is the index of the\r
-                                terminator of the string.\r
-  @param  GlyphBufferSize       A pointer to a value. On output, if the function\r
-                                returns EFI_SUCCESS, it contains the amount of memory that is required to\r
-                                store the string's glyph equivalent.\r
-\r
-  @retval EFI_SUCCESS           All glyphs are available. Note that an empty string\r
-                                always returns this value.\r
-  @retval EFI_NOT_FOUND         A glyph was not found for a character.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_TEST_STRING) (\r
-  IN     EFI_HII_PROTOCOL  *This,\r
-  IN     CHAR16            *StringToTest,\r
-  IN OUT UINT32            *FirstMissing,\r
-  OUT    UINT32            *GlyphBufferSize\r
-  );\r
-\r
-/**\r
-  Translates a Unicode character into the corresponding font glyph.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Source                A pointer to a Unicode string.\r
-  @param  Index                 On input, the offset into the string from which to fetch\r
-                                the character.On successful completion, the index is updated to the first\r
-                                character past the character(s) making up the just extracted glyph.\r
-  @param  GlyphBuffer           Pointer to an array where the glyphs corresponding\r
-                                to the characters in the source may be stored. GlyphBuffer is assumed\r
-                                to be wide enough to accept a wide glyph character.\r
-  @param  BitWidth              If EFI_SUCCESS was returned, the UINT16 pointed to by\r
-                                this value is filled with the length of the glyph in pixels. It is unchanged\r
-                                if the call was unsuccessful.\r
-  @param  InternalStatus        The cell pointed to by this parameter must be\r
-                                initialized to zero prior to invoking the call the first time for any string.\r
-\r
-  @retval EFI_SUCCESS           It worked.\r
-  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_GLYPH) (\r
-  IN     EFI_HII_PROTOCOL  *This,\r
-  IN     CHAR16            *Source,\r
-  IN OUT UINT16            *Index,\r
-  OUT    UINT8             **GlyphBuffer,\r
-  OUT    UINT16            *BitWidth,\r
-  IN OUT UINT32            *InternalStatus\r
-  );\r
-\r
-/**\r
-  Translates a glyph into the format required for input to the Universal\r
-  Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  GlyphBuffer           A pointer to the buffer that contains glyph data.\r
-  @param  Foreground            The foreground setting requested to be used for the\r
-                                generated BltBuffer data.\r
-  @param  Background            The background setting requested to be used for the\r
-                                generated BltBuffer data.\r
-  @param  Count                 The entry in the BltBuffer upon which to act.\r
-  @param  Width                 The width in bits of the glyph being converted.\r
-  @param  Height                The height in bits of the glyph being converted\r
-  @param  BltBuffer             A pointer to the buffer that contains the data that is\r
-                                ready to be used by the UGA BLT routines.\r
-\r
-  @retval EFI_SUCCESS           It worked.\r
-  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
-  IN     EFI_HII_PROTOCOL             *This,\r
-  IN     UINT8                        *GlyphBuffer,\r
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
-  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
-  IN     UINTN                         Count,\r
-  IN     UINTN                         Width,\r
-  IN     UINTN                         Height,\r
-  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
-  );\r
-\r
-/**\r
-  Allows a new string to be added to an already existing string package.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Pointer               to a NULL-terminated string containing a single ISO 639-2\r
-                                language identifier, indicating the language in which the string is translated.\r
-  @param  Handle                The handle of the language pack to which the string is to be added.\r
-  @param  Reference             The identifier of the string to be added. If the reference\r
-                                value is zero, then the string will be assigned a new identifier on that\r
-                                handle for the language specified. Otherwise, the string will be updated\r
-                                with the NewString Value.\r
-  @param  NewString             The string to be added.\r
-\r
-  @retval EFI_SUCCESS           The string was effectively registered.\r
-  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_NEW_STRING) (\r
-  IN     EFI_HII_PROTOCOL      *This,\r
-  IN     CHAR16                *Language,\r
-  IN     EFI_HII_HANDLE        Handle,\r
-  IN OUT STRING_REF            *Reference,\r
-  IN     CHAR16                *NewString\r
-  );\r
-\r
-/**\r
-  Allows a program to determine the primary languages that are supported\r
-  on a given handle.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle on which the strings reside.\r
-  @param  LanguageString        A string allocated by GetPrimaryLanguages() that\r
-                                contains a list of all primary languages registered on the handle.\r
-\r
-  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
-  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
-  IN  EFI_HII_PROTOCOL    *This,\r
-  IN  EFI_HII_HANDLE      Handle,\r
-  OUT EFI_STRING          *LanguageString\r
-  );\r
-\r
-/**\r
-  Allows a program to determine which secondary languages are supported\r
-  on a given handle for a given primary language.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle on which the strings reside.\r
-  @param  PrimaryLanguage       Pointer to a NULL-terminated string containing a single\r
-                                ISO 639-2 language identifier, indicating the primary language.\r
-  @param  LanguageString        A string allocated by GetSecondaryLanguages()\r
-                                containing a list of all secondary languages registered on the handle.\r
-\r
-  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
-  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
-  IN  EFI_HII_PROTOCOL    *This,\r
-  IN  EFI_HII_HANDLE      Handle,\r
-  IN  CHAR16              *PrimaryLanguage,\r
-  OUT EFI_STRING          *LanguageString\r
-  );\r
-\r
-/**\r
-  Extracts a string from a package already registered with the EFI HII database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle on which the string resides.\r
-  @param  Token                 The string token assigned to the string.\r
-  @param  Raw                   If TRUE, the string is returned unedited in the internal\r
-                                storage format described above. If false, the string returned is edited\r
-                                by replacing <cr> with <space> and by removing special characters such\r
-                                as the <wide> prefix.\r
-  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
-                                single ISO 639-2 language identifier, indicating the language to print.\r
-                                If the LanguageString is empty (starts with a NULL), the default system\r
-                                language will be used to determine the language.\r
-  @param  BufferLength          Length of the StringBuffer.\r
-  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
-\r
-  @retval EFI_SUCCESS           StringBuffer is filled with a NULL-terminated string.\r
-  @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough to\r
-                                allow the entire string to be stored.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_STRING) (\r
-  IN     EFI_HII_PROTOCOL  *This,\r
-  IN     EFI_HII_HANDLE    Handle,\r
-  IN     STRING_REF        Token,\r
-  IN     BOOLEAN           Raw,\r
-  IN     CHAR16            *LanguageString,\r
-  IN OUT UINTN             *BufferLength,\r
-  OUT    EFI_STRING        StringBuffer\r
-  );\r
-\r
-/**\r
-  Allows a program to extract a part of a string of not more than a given width.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The handle on which the string resides.\r
-  @param  Token                 The string token assigned to the string.\r
-  @param  Index                 On input, the offset into the string where the line is to start.\r
-                                On output, the index is updated to point to beyond the last character returned\r
-                                in the call.\r
-  @param  LineWidth             The maximum width of the line in units of narrow glyphs.\r
-  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
-                                single ISO 639-2 language identifier, indicating the language to print.\r
-  @param  BufferLength          Pointer to the length of the StringBuffer.\r
-  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
-\r
-  @retval EFI_SUCCESS           StringBuffer filled with characters that will fit on the line.\r
-  @retval EFI_NOT_FOUND         The font glyph for at least one of the characters in\r
-                                the string is not in the font database.\r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
-                                to allow the entire string to be stored.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_LINE) (\r
-  IN     EFI_HII_PROTOCOL  *This,\r
-  IN     EFI_HII_HANDLE    Handle,\r
-  IN     STRING_REF        Token,\r
-  IN OUT UINT16            *Index,\r
-  IN     UINT16            LineWidth,\r
-  IN     CHAR16            *LanguageString,\r
-  IN OUT UINT16            *BufferLength,\r
-  OUT    EFI_STRING        StringBuffer\r
-  );\r
-\r
-/**\r
-  Allows a program to extract a form or form package that has previously\r
-  been registered with the HII database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                Handle on which the form resides.\r
-  @param  FormId                The ID of the form to return. If the ID is zero,\r
-                                the entire form package is returned.\r
-  @param  BufferLength          On input, the length of the Buffer. On output,\r
-                                the length of the returned buffer,\r
-  @param  Buffer                The buffer designed to receive the form(s).\r
-\r
-  @retval EFI_SUCCESS           Buffer filled with the requested forms. BufferLength\r
-                                was updated.\r
-  @retval EFI_INVALID_PARAMETER The handle is unknown.\r
-  @retval EFI_NOT_FOUND         A form on the requested handle cannot be found with\r
-                                the requested FormId.\r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
-                                to allow the form to be stored.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_FORMS) (\r
-  IN     EFI_HII_PROTOCOL  *This,\r
-  IN     EFI_HII_HANDLE    Handle,\r
-  IN     EFI_FORM_ID       FormId,\r
-  IN OUT UINTN             *BufferLength,\r
-  OUT    UINT8             *Buffer\r
-  );\r
-\r
-/**\r
-  Extracts the defaults that are associated with a given handle in the HII database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                The HII handle from which will have default data retrieved.\r
-  @param  DefaultMask           The mask used to specify some type of default override when extracting\r
-                                the default image data.\r
-  @param  VariablePackList      A indirect pointer to the first entry of a link list with\r
-                                type EFI_HII_VARIABLE_PACK_LIST.\r
-\r
-  @retval EFI_SUCCESS           The VariablePackList was populated with the appropriate\r
-                                default setting data.\r
-  @retval EFI_NOT_FOUND         The IFR does not have any explicit or default map(s).\r
-  @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r
-                                contain invalid data.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
-  IN     EFI_HII_PROTOCOL           *This,\r
-  IN     EFI_HII_HANDLE             Handle,\r
-  IN     UINTN                      DefaultMask,\r
-  OUT    EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
-  );\r
-\r
-/**\r
-  Allows the caller to update a form or form package that has previously been\r
-  registered with the EFI HII database.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  Handle                Handle of the package where the form to be updated resides.\r
-  @param  Label                 The label inside the form package where the update is to take place.\r
-  @param  AddData               If TRUE, adding data at a given Label; otherwise,\r
-                                if FALSE, removing data at a given Label.\r
-  @param  Data                  The buffer containing the new tags to insert after the Label\r
-\r
-  @retval EFI_SUCCESS           The form was updated with the new tags.\r
-  @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r
-                                contain an integral number of tags.\r
-  @retval EFI_NOT_FOUND         The Handle, Label, or FormId was not found.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_UPDATE_FORM) (\r
-  IN EFI_HII_PROTOCOL     *This,\r
-  IN EFI_HII_HANDLE       Handle,\r
-  IN EFI_FORM_LABEL       Label,\r
-  IN BOOLEAN              AddData,\r
-  IN EFI_HII_UPDATE_DATA  *Data\r
-  );\r
-\r
-/**\r
-  Retrieves the current keyboard layout.\r
-\r
-  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
-  @param  DescriptorCount       A pointer to the number of Descriptor entries being\r
-                                described in the keyboard layout being retrieved.\r
-  @param  Descriptor            A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r
-                                entries. Each entry will reflect the definition of a specific physical key.\r
-\r
-  @retval EFI_SUCCESS           The keyboard layout was retrieved successfully.\r
-\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
-  IN     EFI_HII_PROTOCOL    *This,\r
-  OUT    UINT16              *DescriptorCount,\r
-  OUT    EFI_KEY_DESCRIPTOR  *Descriptor\r
-  );\r
-\r
-/**\r
-  @par Protocol Description:\r
-  The HII Protocol manages the HII database, which is a repository for data\r
-  having to do with fonts, strings, forms, keyboards, and other future human\r
-  interface items.\r
-\r
-  @param NewPack\r
-  Extracts the various packs from a package list.\r
-\r
-  @param RemovePack\r
-  Removes a package from the HII database.\r
-\r
-  @param FindHandles\r
-  Determines the handles that are currently active in the database.\r
-\r
-  @param ExportDatabase\r
-  Export the entire contents of the database to a buffer.\r
-\r
-  @param TestString\r
-  Tests if all of the characters in a string have corresponding font characters.\r
-\r
-  @param GetGlyph\r
-  Translates a Unicode character into the corresponding font glyph.\r
-\r
-  @param GlyphToBlt\r
-  Converts a glyph value into a format that is ready for a UGA BLT command.\r
-\r
-  @param NewString\r
-  Allows a new string to be added to an already existing string package.\r
-\r
-  @param GetPrimaryLanguages\r
-  Allows a program to determine the primary languages that are supported\r
-  on a given handle.\r
-\r
-  @param GetSecondaryLanguages\r
-  Allows a program to determine which secondary languages are supported\r
-  on a given handle for a given primary language.\r
-\r
-  @param GetString\r
-  Extracts a string from a package that is already registered with the\r
-  EFI HII database.\r
-\r
-  @param ResetString\r
-  Remove any new strings that were added after the initial string export\r
-  for this handle.\r
-\r
-  @param GetLine\r
-  Allows a program to extract a part of a string of not more than a given width.\r
-\r
-  @param GetForms\r
-  Allows a program to extract a form or form package that has been previously registered.\r
-\r
-  @param GetDefaultImage\r
-  Allows a program to extract the nonvolatile image that represents the default storage image.\r
-\r
-  @param UpdateForm\r
-  Allows a program to update a previously registered form.\r
-\r
-  @param GetKeyboardLayout\r
-  Allows a program to extract the current keyboard layout.\r
-\r
-**/\r
-struct _EFI_HII_PROTOCOL {\r
-  EFI_HII_NEW_PACK            NewPack;\r
-  EFI_HII_REMOVE_PACK         RemovePack;\r
-  EFI_HII_FIND_HANDLES        FindHandles;\r
-  EFI_HII_EXPORT              ExportDatabase;\r
-\r
-  EFI_HII_TEST_STRING         TestString;\r
-  EFI_HII_GET_GLYPH           GetGlyph;\r
-  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;\r
-\r
-  EFI_HII_NEW_STRING          NewString;\r
-  EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;\r
-  EFI_HII_GET_SEC_LANGUAGES   GetSecondaryLanguages;\r
-  EFI_HII_GET_STRING          GetString;\r
-  EFI_HII_RESET_STRINGS       ResetStrings;\r
-  EFI_HII_GET_LINE            GetLine;\r
-  EFI_HII_GET_FORMS           GetForms;\r
-  EFI_HII_GET_DEFAULT_IMAGE   GetDefaultImage;\r
-  EFI_HII_UPDATE_FORM         UpdateForm;\r
-\r
-  EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
-};\r
-\r
-extern EFI_GUID gEfiHiiProtocolGuid;\r
-\r
-#endif\r
index 1a3a5b207604dfdb72577ad908d572b5fd94f58b..e3e823108c44c338041a2fa3820717ce52672c46 100644 (file)
@@ -24,8 +24,8 @@
   Include                        # Root include for the package\r
 \r
 [LibraryClasses.common]\r
   Include                        # Root include for the package\r
 \r
 [LibraryClasses.common]\r
-  HiiLibFramework|Include/Library/HiiLibFramework.h\r
-  IfrSupportLibFramework|Include/Library/IfrSupportLibFramework.h\r
+  FrameworkHiiLib|Include/Library/FrameworkHiiLib.h\r
+  FrameworkIfrSupportLib|Include/Library/FrameworkIfrSupportLib.h\r
   SmmLib|Include/Library/SmmLib.h\r
 \r
 [Guids.common]\r
   SmmLib|Include/Library/SmmLib.h\r
 \r
 [Guids.common]\r
index fa20b026f022b8bcec02abf91455becd57678aee..be7a5bce1adeb9b17d12de15cd04bec88f26f39b 100644 (file)
@@ -58,8 +58,8 @@
 ################################################################################\r
 [Components.common]\r
   IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf\r
 ################################################################################\r
 [Components.common]\r
   IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf\r
-  IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.inf\r
+  IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf\r
   IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.inf\r
   IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.inf\r
-  IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
-  IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf\r
+  IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
+  IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf\r
   IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLibSmbusPpi.inf\r
   IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLibSmbusPpi.inf\r
diff --git a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.c
new file mode 100644 (file)
index 0000000..913b471
--- /dev/null
@@ -0,0 +1,70 @@
+/** @file\r
+  HII Library implementation that uses DXE protocols and services.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  HiiLib.c\r
+\r
+**/\r
+\r
+\r
+#include <FrameworkDxe.h>\r
+\r
+\r
+#include <Library/FrameworkHiiLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+/**\r
+  This function allocates pool for an EFI_HII_PACKAGES structure\r
+  with enough space for the variable argument list of package pointers.\r
+  The allocated structure is initialized using NumberOfPackages, Guid,\r
+  and the variable length argument list of package pointers.\r
+\r
+  @param  NumberOfPackages The number of HII packages to prepare.\r
+  @param  Guid Package GUID.\r
+\r
+  @return The allocated and initialized packages.\r
+\r
+**/\r
+EFI_HII_PACKAGES *\r
+EFIAPI\r
+PreparePackages (\r
+  IN UINTN           NumberOfPackages,\r
+  IN CONST EFI_GUID  *Guid OPTIONAL,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST           Args;\r
+  EFI_HII_PACKAGES  *HiiPackages;\r
+  VOID              **Package;\r
+  UINTN             Index;\r
+\r
+  ASSERT (NumberOfPackages > 0);\r
+\r
+  HiiPackages                   = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));\r
+  ASSERT (HiiPackages != NULL);\r
+\r
+  HiiPackages->GuidId           = (EFI_GUID *) Guid;\r
+  HiiPackages->NumberOfPackages = NumberOfPackages;\r
+  Package                       = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));\r
+\r
+  VA_START (Args, Guid);\r
+\r
+  for (Index = 0; Index < NumberOfPackages; Index++) {\r
+    *Package = VA_ARG (Args, VOID *);\r
+    Package++;\r
+  }\r
+\r
+  VA_END (Args);\r
+\r
+  return HiiPackages;\r
+\r
+}\r
diff --git a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf
new file mode 100644 (file)
index 0000000..98ee9f9
--- /dev/null
@@ -0,0 +1,44 @@
+#/** @file\r
+# Library instance for HII common routines.\r
+#\r
+# This library instance implements the common HII routines.\r
+# Copyright (c) 2006, Intel Corporation\r
+#\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = FrameworkHiiLib\r
+  FILE_GUID                      = 1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = FrameworkHiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+  HiiLib.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+\r
+[LibraryClasses]\r
+  MemoryAllocationLib\r
+  DebugLib\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.msa b/IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.msa
new file mode 100644 (file)
index 0000000..67e1f0d
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>HiiLibFramework</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Library instance for HII common routines.</Abstract>\r
+    <Description>This library instance implements the common HII routines.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>HiiLibFramework</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>HiiLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>HiiLib.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrCommon.c
new file mode 100644 (file)
index 0000000..d9894c4
--- /dev/null
@@ -0,0 +1,1005 @@
+/*++\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php                                            \r
+        \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+  IfrCommon.c\r
+\r
+Abstract:\r
+\r
+  Common Library Routines to assist in IFR creation on-the-fly\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "IfrSupportLibInternal.h"\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+IfrLibConstruct (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+GetCurrentLanguage (\r
+  OUT     CHAR16              *Lang\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Determine what is the current language setting\r
+\r
+Arguments:\r
+\r
+  Lang      - Pointer of system language\r
+\r
+Returns:\r
+\r
+  Status code\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  UINTN       Size;\r
+  UINTN       Index;\r
+  CHAR8       Language[4];\r
+\r
+  //\r
+  // Getting the system language and placing it into our Global Data\r
+  //\r
+  Size = sizeof (Language);\r
+\r
+  Status = gRT->GetVariable (\r
+                  (CHAR16 *) L"Lang",\r
+                  &gEfiGlobalVariableGuid,\r
+                  NULL,\r
+                  &Size,\r
+                  Language\r
+                  );\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    AsciiStrCpy (Language, "eng");\r
+  }\r
+\r
+  for (Index = 0; Index < 3; Index++) {\r
+    //\r
+    // Bitwise AND ascii value with 0xDF yields an uppercase value.\r
+    // Sign extend into a unicode value\r
+    //\r
+    Lang[Index] = (CHAR16) (Language[Index] & 0xDF);\r
+  }\r
+\r
+  //\r
+  // Null-terminate the value\r
+  //\r
+  Lang[3] = (CHAR16) 0;\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+AddString (\r
+  IN      VOID                *StringBuffer,\r
+  IN      CHAR16              *Language,\r
+  IN      CHAR16              *String,\r
+  IN OUT  STRING_REF          *StringToken\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Add a string to the incoming buffer and return the token and offset data\r
+\r
+Arguments:\r
+\r
+  StringBuffer      - The incoming buffer\r
+\r
+  Language          - Currrent language\r
+\r
+  String            - The string to be added\r
+\r
+  StringToken       - The index where the string placed\r
+\r
+Returns:\r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+\r
+  EFI_SUCCESS             - String successfully added to the incoming buffer\r
+\r
+--*/\r
+{\r
+  EFI_HII_STRING_PACK *StringPack;\r
+  EFI_HII_STRING_PACK *StringPackBuffer;\r
+  VOID                *NewBuffer;\r
+  RELOFST             *PackSource;\r
+  RELOFST             *PackDestination;\r
+  UINT8               *Source;\r
+  UINT8               *Destination;\r
+  UINTN               Index;\r
+  BOOLEAN             Finished;\r
+  UINTN               SizeofLanguage;\r
+  UINTN               SizeofString;\r
+\r
+  StringPack  = (EFI_HII_STRING_PACK *) StringBuffer;\r
+  Finished    = FALSE;\r
+\r
+  //\r
+  // Pre-allocate a buffer sufficient for us to work on.\r
+  // We will use it as a destination scratch pad to build data on\r
+  // and when complete shift the data back to the original buffer\r
+  //\r
+  NewBuffer = AllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);\r
+  if (NewBuffer == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  StringPackBuffer = (EFI_HII_STRING_PACK *) NewBuffer;\r
+\r
+  //\r
+  // StringPack is terminated with a length 0 entry\r
+  //\r
+  for (; StringPack->Header.Length != 0;) {\r
+    //\r
+    // If this stringpack's language is same as CurrentLanguage, use it\r
+    //\r
+    if (CompareMem ((VOID *) ((CHAR8 *) (StringPack) + StringPack->LanguageNameString), Language, 3) == 0) {\r
+      //\r
+      // We have some data in this string pack, copy the string package up to the string data\r
+      //\r
+      CopyMem (&StringPackBuffer->Header, &StringPack->Header, sizeof (StringPack));\r
+\r
+      //\r
+      // These are references in the structure to tokens, need to increase them by the space occupied by an additional StringPointer\r
+      //\r
+      StringPackBuffer->LanguageNameString = (UINT16) (StringPackBuffer->LanguageNameString + (UINT16) sizeof (RELOFST));\r
+      StringPackBuffer->PrintableLanguageName = (UINT16) (StringPackBuffer->PrintableLanguageName + (UINT16) sizeof (RELOFST));\r
+\r
+      PackSource      = (RELOFST *) (StringPack + 1);\r
+      PackDestination = (RELOFST *) (StringPackBuffer + 1);\r
+      for (Index = 0; PackSource[Index] != 0x0000; Index++) {\r
+        //\r
+        // Copy the stringpointers from old to new buffer\r
+        // remember that we are adding a string, so the string offsets will all go up by sizeof (RELOFST)\r
+        //\r
+        PackDestination[Index] = (UINT16) (PackDestination[Index] + sizeof (RELOFST));\r
+      }\r
+\r
+      //\r
+      // Add a new stringpointer in the new buffer since we are adding a string.  Null terminate it\r
+      //\r
+      PackDestination[Index] = (UINT16)(PackDestination[Index-1] +\r
+                                        StrSize((CHAR16 *)((CHAR8 *)(StringPack) + PackSource[Index-1])));\r
+      PackDestination[Index + 1] = (UINT16) 0;\r
+\r
+      //\r
+      // Index is the token value for the new string\r
+      //\r
+      *StringToken = (UINT16) Index;\r
+\r
+      //\r
+      // Source now points to the beginning of the old buffer strings\r
+      // Destination now points to the beginning of the new buffer strings\r
+      //\r
+      Source      = (UINT8 *) &PackSource[Index + 1];\r
+      Destination = (UINT8 *) &PackDestination[Index + 2];\r
+\r
+      //\r
+      // This should copy all the strings from the old buffer to the new buffer\r
+      //\r
+      for (; Index != 0; Index--) {\r
+        //\r
+        // Copy Source string to destination buffer\r
+        //\r
+        StrCpy ((CHAR16 *) Destination, (CHAR16 *) Source);\r
+\r
+        //\r
+        // Adjust the source/destination to the next string location\r
+        //\r
+        Destination = Destination + StrSize ((CHAR16 *) Source);\r
+        Source      = Source + StrSize ((CHAR16 *) Source);\r
+      }\r
+\r
+      //\r
+      // This copies the new string to the destination buffer\r
+      //\r
+      StrCpy ((CHAR16 *) Destination, (CHAR16 *) String);\r
+\r
+      //\r
+      // Adjust the size of the changed string pack by adding the size of the new string\r
+      // along with the size of the additional offset entry for the new string\r
+      //\r
+      StringPackBuffer->Header.Length = (UINT32) ((UINTN) StringPackBuffer->Header.Length + StrSize (String) + sizeof (RELOFST));\r
+\r
+      //\r
+      // Advance the buffers to point to the next spots.\r
+      //\r
+      StringPackBuffer  = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPackBuffer->Header.Length);\r
+      StringPack        = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);\r
+      Finished          = TRUE;\r
+      continue;\r
+    }\r
+    //\r
+    // This isn't the language of the stringpack we were asked to add a string to\r
+    // so we need to copy it to the new buffer.\r
+    //\r
+    CopyMem (&StringPackBuffer->Header, &StringPack->Header, StringPack->Header.Length);\r
+\r
+    //\r
+    // Advance the buffers to point to the next spots.\r
+    //\r
+    StringPackBuffer  = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPack->Header.Length);\r
+    StringPack        = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);\r
+  }\r
+\r
+  //\r
+  // If we didn't copy the new data to a stringpack yet\r
+  //\r
+  if (!Finished) {\r
+    PackDestination = (RELOFST *) (StringPackBuffer + 1);\r
+    //\r
+    // Pointing to a new string pack location\r
+    //\r
+    SizeofLanguage = StrSize (Language);\r
+    SizeofString   = StrSize (String);\r
+    StringPackBuffer->Header.Length = (UINT32)\r
+      (\r
+        sizeof (EFI_HII_STRING_PACK) -\r
+        sizeof (EFI_STRING) +\r
+        sizeof (RELOFST) +\r
+        sizeof (RELOFST) +\r
+        SizeofLanguage +\r
+        SizeofString\r
+      );\r
+    StringPackBuffer->Header.Type           = EFI_HII_STRING;\r
+    StringPackBuffer->LanguageNameString    = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
+    StringPackBuffer->PrintableLanguageName = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
+    StringPackBuffer->Attributes            = 0;\r
+    PackDestination[0]                      = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
+    PackDestination[1]                      = (UINT16) (PackDestination[0] + StrSize (Language));\r
+    PackDestination[2]                      = (UINT16) 0;\r
+\r
+    //\r
+    // The first string location will be set to destination.  The minimum number of strings\r
+    // associated with a stringpack will always be token 0 stored as the languagename (e.g. ENG, SPA, etc)\r
+    // and token 1 as the new string being added and and null entry for the stringpointers\r
+    //\r
+    Destination = (UINT8 *) &PackDestination[3];\r
+\r
+    //\r
+    // Copy the language name string to the new buffer\r
+    //\r
+    StrCpy ((CHAR16 *) Destination, Language);\r
+\r
+    //\r
+    // Advance the destination to the new empty spot\r
+    //\r
+    Destination = Destination + StrSize (Language);\r
+\r
+    //\r
+    // Copy the string to the new buffer\r
+    //\r
+    StrCpy ((CHAR16 *) Destination, String);\r
+\r
+    //\r
+    // Since we are starting with a new string pack - we know the new string is token 1\r
+    //\r
+    *StringToken = (UINT16) 1;\r
+  }\r
+\r
+  //\r
+  // Zero out the original buffer and copy the updated data in the new buffer to the old buffer\r
+  //\r
+  ZeroMem (StringBuffer, DEFAULT_STRING_BUFFER_SIZE);\r
+  CopyMem (StringBuffer, NewBuffer, DEFAULT_STRING_BUFFER_SIZE);\r
+\r
+  //\r
+  // Free the newly created buffer since we don't need it anymore\r
+  //\r
+  gBS->FreePool (NewBuffer);\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+AddOpCode (\r
+  IN      VOID                *FormBuffer,\r
+  IN OUT  VOID                *OpCodeData\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Add op-code data to the FormBuffer\r
+\r
+Arguments:\r
+\r
+  FormBuffer      - Form buffer to be inserted to\r
+\r
+  OpCodeData      - Op-code data to be inserted\r
+\r
+Returns:\r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+\r
+  EFI_SUCCESS             - Op-code data successfully inserted\r
+\r
+--*/\r
+{\r
+  EFI_HII_PACK_HEADER *NewBuffer;\r
+  UINT8               *Source;\r
+  UINT8               *Destination;\r
+\r
+  //\r
+  // Pre-allocate a buffer sufficient for us to work on.\r
+  // We will use it as a destination scratch pad to build data on\r
+  // and when complete shift the data back to the original buffer\r
+  //\r
+  NewBuffer = AllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);\r
+  if (NewBuffer == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  Source      = (UINT8 *) FormBuffer;\r
+  Destination = (UINT8 *) NewBuffer;\r
+\r
+  //\r
+  // Copy the IFR Package header to the new buffer\r
+  //\r
+  CopyMem (Destination, Source, sizeof (EFI_HII_PACK_HEADER));\r
+\r
+  //\r
+  // Advance Source and Destination to next op-code\r
+  //\r
+  Source      = Source + sizeof (EFI_HII_PACK_HEADER);\r
+  Destination = Destination + sizeof (EFI_HII_PACK_HEADER);\r
+\r
+  //\r
+  // Copy data to the new buffer until we run into the end_form\r
+  //\r
+  for (; ((EFI_IFR_OP_HEADER *) Source)->OpCode != EFI_IFR_END_FORM_OP;) {\r
+    //\r
+    // If the this opcode is an end_form_set we better be creating and endform\r
+    // Nonetheless, we will add data before the end_form_set.  This also provides\r
+    // for interesting behavior in the code we will run, but has no bad side-effects\r
+    // since we will possibly do a 0 byte copy in this particular end-case.\r
+    //\r
+    if (((EFI_IFR_OP_HEADER *) Source)->OpCode == EFI_IFR_END_FORM_SET_OP) {\r
+      break;\r
+    }\r
+\r
+    //\r
+    // Copy data to new buffer\r
+    //\r
+    CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
+\r
+    //\r
+    // Adjust Source/Destination to next op-code location\r
+    //\r
+    Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
+    Source      = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
+  }\r
+\r
+  //\r
+  // Prior to the end_form is where we insert the new op-code data\r
+  //\r
+  CopyMem (Destination, OpCodeData, ((EFI_IFR_OP_HEADER *) OpCodeData)->Length);\r
+  Destination       = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;\r
+\r
+  NewBuffer->Length = (UINT32) (NewBuffer->Length + (UINT32) (((EFI_IFR_OP_HEADER *) OpCodeData)->Length));\r
+\r
+  //\r
+  // Copy end-form data to new buffer\r
+  //\r
+  CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
+\r
+  //\r
+  // Adjust Source/Destination to next op-code location\r
+  //\r
+  Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
+  Source      = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
+\r
+  //\r
+  // Copy end-formset data to new buffer\r
+  //\r
+  CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
+\r
+  //\r
+  // Zero out the original buffer and copy the updated data in the new buffer to the old buffer\r
+  //\r
+  ZeroMem (FormBuffer, DEFAULT_FORM_BUFFER_SIZE);\r
+  CopyMem (FormBuffer, NewBuffer, DEFAULT_FORM_BUFFER_SIZE);\r
+\r
+  //\r
+  // Free the newly created buffer since we don't need it anymore\r
+  //\r
+  gBS->FreePool (NewBuffer);\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+STATIC\r
+EFI_STATUS\r
+GetHiiInterface (\r
+  OUT     EFI_HII_PROTOCOL    **Hii\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Get the HII protocol interface\r
+\r
+Arguments:\r
+\r
+  Hii     - HII protocol interface\r
+\r
+Returns:\r
+\r
+  Status code\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // There should only be one HII protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiHiiProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) Hii\r
+                  );\r
+\r
+  return Status;;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+ExtractDataFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      HiiHandle,\r
+  IN OUT  UINT16              *ImageLength,\r
+  OUT     UINT8               *DefaultImage,\r
+  OUT     EFI_GUID            *Guid\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Extract information pertaining to the HiiHandle\r
+\r
+Arguments:\r
+\r
+  HiiHandle       - Hii handle\r
+\r
+  ImageLength     - For input, length of DefaultImage;\r
+                    For output, length of actually required\r
+\r
+  DefaultImage    - Image buffer prepared by caller\r
+\r
+  Guid            - Guid information about the form\r
+\r
+Returns:\r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+\r
+  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
+\r
+  EFI_SUCCESS             - Successfully extract data from Hii database.\r
+\r
+\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+  EFI_HII_PROTOCOL  *Hii;\r
+  UINTN             DataLength;\r
+  UINT8             *RawData;\r
+  UINT8             *OldData;\r
+  UINTN             Index;\r
+  UINTN             Temp;\r
+  UINTN             SizeOfNvStore;\r
+  UINTN             CachedStart;\r
+\r
+  DataLength    = DEFAULT_FORM_BUFFER_SIZE;\r
+  SizeOfNvStore = 0;\r
+  CachedStart   = 0;\r
+\r
+  Status        = GetHiiInterface (&Hii);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Allocate space for retrieval of IFR data\r
+  //\r
+  RawData = AllocateZeroPool (DataLength);\r
+  if (RawData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Get all the forms associated with this HiiHandle\r
+  //\r
+  Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    gBS->FreePool (RawData);\r
+\r
+    //\r
+    // Allocate space for retrieval of IFR data\r
+    //\r
+    RawData = AllocateZeroPool (DataLength);\r
+    if (RawData == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+\r
+    //\r
+    // Get all the forms associated with this HiiHandle\r
+    //\r
+    Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);\r
+  }\r
+\r
+  OldData = RawData;\r
+\r
+  //\r
+  // Point RawData to the beginning of the form data\r
+  //\r
+  RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));\r
+\r
+  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
+    switch (RawData[Index]) {\r
+    case EFI_IFR_FORM_SET_OP:\r
+      //\r
+      // Copy the GUID information from this handle\r
+      //\r
+      CopyMem (Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));\r
+      break;\r
+\r
+    case EFI_IFR_ONE_OF_OP:\r
+    case EFI_IFR_CHECKBOX_OP:\r
+    case EFI_IFR_NUMERIC_OP:\r
+    case EFI_IFR_DATE_OP:\r
+    case EFI_IFR_TIME_OP:\r
+    case EFI_IFR_PASSWORD_OP:\r
+    case EFI_IFR_STRING_OP:\r
+      //\r
+      // Remember, multiple op-codes may reference the same item, so let's keep a running\r
+      // marker of what the highest QuestionId that wasn't zero length.  This will accurately\r
+      // maintain the Size of the NvStore\r
+      //\r
+      if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {\r
+        Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
+        if (SizeOfNvStore < Temp) {\r
+          SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
+        }\r
+      }\r
+    }\r
+\r
+    Index = RawData[Index + 1] + Index;\r
+  }\r
+\r
+  //\r
+  // Return an error if buffer is too small\r
+  //\r
+  if (SizeOfNvStore > *ImageLength) {\r
+    gBS->FreePool (OldData);\r
+    *ImageLength = (UINT16) SizeOfNvStore;\r
+    return EFI_BUFFER_TOO_SMALL;\r
+  }\r
+\r
+  if (DefaultImage != NULL) {\r
+    ZeroMem (DefaultImage, SizeOfNvStore);\r
+  }\r
+\r
+  //\r
+  // Copy the default image information to the user's buffer\r
+  //\r
+  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
+    switch (RawData[Index]) {\r
+    case EFI_IFR_ONE_OF_OP:\r
+      CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;\r
+      break;\r
+\r
+    case EFI_IFR_ONE_OF_OPTION_OP:\r
+      if (((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Flags & EFI_IFR_FLAG_DEFAULT) {\r
+        CopyMem (&DefaultImage[CachedStart], &((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value, 2);\r
+      }\r
+      break;\r
+\r
+    case EFI_IFR_CHECKBOX_OP:\r
+      DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId] = ((EFI_IFR_CHECKBOX *) &RawData[Index])->Flags;\r
+      break;\r
+\r
+    case EFI_IFR_NUMERIC_OP:\r
+      CopyMem (\r
+        &DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId],\r
+        &((EFI_IFR_NUMERIC *) &RawData[Index])->Default,\r
+        2\r
+        );\r
+      break;\r
+\r
+    }\r
+\r
+    Index = RawData[Index + 1] + Index;\r
+  }\r
+\r
+  *ImageLength = (UINT16) SizeOfNvStore;\r
+\r
+  //\r
+  // Free our temporary repository of form data\r
+  //\r
+  gBS->FreePool (OldData);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_HII_HANDLE\r
+FindHiiHandle (\r
+  IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
+  IN     EFI_GUID            *Guid\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Finds HII handle for given pack GUID previously registered with the HII.\r
+\r
+Arguments:\r
+  HiiProtocol - pointer to pointer to HII protocol interface.\r
+                If NULL, the interface will be found but not returned.\r
+                If it points to NULL, the interface will be found and\r
+                written back to the pointer that is pointed to.\r
+  Guid        - The GUID of the pack that registered with the HII.\r
+\r
+Returns:\r
+  Handle to the HII pack previously registered by the memory driver.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+\r
+  EFI_HII_HANDLE    *HiiHandleBuffer;\r
+  EFI_HII_HANDLE    HiiHandle;\r
+  UINT16            HiiHandleBufferLength;\r
+  UINT32            NumberOfHiiHandles;\r
+  EFI_GUID          HiiGuid;\r
+  EFI_HII_PROTOCOL  *HiiProt;\r
+  UINT32            Index;\r
+  UINT16            Length;\r
+\r
+  HiiHandle = 0;\r
+  if ((HiiProtocol != NULL) && (*HiiProtocol != NULL)) {\r
+    //\r
+    // The protocol has been passed in\r
+    //\r
+    HiiProt = *HiiProtocol;\r
+  } else {\r
+    gBS->LocateProtocol (\r
+          &gEfiHiiProtocolGuid,\r
+          NULL,\r
+          (VOID **) &HiiProt\r
+          );\r
+    if (HiiProt == NULL) {\r
+      return HiiHandle;\r
+    }\r
+\r
+    if (HiiProtocol != NULL) {\r
+      //\r
+      // Return back the HII protocol for the caller as promissed\r
+      //\r
+      *HiiProtocol = HiiProt;\r
+    }\r
+  }\r
+  //\r
+  // Allocate buffer\r
+  //\r
+  HiiHandleBufferLength = 10;\r
+  HiiHandleBuffer       = AllocatePool (HiiHandleBufferLength);\r
+  ASSERT (HiiHandleBuffer != NULL);\r
+\r
+  //\r
+  // Get the Handles of the packages that were registered with Hii\r
+  //\r
+  Status = HiiProt->FindHandles (\r
+                      HiiProt,\r
+                      &HiiHandleBufferLength,\r
+                      HiiHandleBuffer\r
+                      );\r
+\r
+  //\r
+  // Get a bigger bugffer if this one is to small, and try again\r
+  //\r
+  if (Status == EFI_BUFFER_TOO_SMALL) {\r
+\r
+    gBS->FreePool (HiiHandleBuffer);\r
+\r
+    HiiHandleBuffer = AllocatePool (HiiHandleBufferLength);\r
+    ASSERT (HiiHandleBuffer != NULL);\r
+\r
+    Status = HiiProt->FindHandles (\r
+                        HiiProt,\r
+                        &HiiHandleBufferLength,\r
+                        HiiHandleBuffer\r
+                        );\r
+  }\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    goto lbl_exit;\r
+  }\r
+\r
+  NumberOfHiiHandles = HiiHandleBufferLength / sizeof (EFI_HII_HANDLE);\r
+\r
+  //\r
+  // Iterate Hii handles and look for the one that matches our Guid\r
+  //\r
+  for (Index = 0; Index < NumberOfHiiHandles; Index++) {\r
+\r
+    Length = 0;\r
+    ExtractDataFromHiiHandle (HiiHandleBuffer[Index], &Length, NULL, &HiiGuid);\r
+\r
+    if (CompareGuid (&HiiGuid, Guid)) {\r
+\r
+      HiiHandle = HiiHandleBuffer[Index];\r
+      break;\r
+    }\r
+  }\r
+\r
+lbl_exit:\r
+  gBS->FreePool (HiiHandleBuffer);\r
+  return HiiHandle;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+ValidateDataFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      HiiHandle,\r
+  OUT     BOOLEAN             *Results\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Validate that the data associated with the HiiHandle in NVRAM is within\r
+  the reasonable parameters for that FormSet.  Values for strings and passwords\r
+  are not verified due to their not having the equivalent of valid range settings.\r
+\r
+Arguments:\r
+\r
+  HiiHandle -   Handle of the HII database entry to query\r
+\r
+  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
+                TRUE  = NVRAM Data is within parameters\r
+                FALSE = NVRAM Data is NOT within parameters\r
+\r
+Returns:\r
+\r
+  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
+\r
+  EFI_SUCCESS               - Data successfully validated\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+  EFI_HII_PROTOCOL  *Hii;\r
+  EFI_GUID          Guid;\r
+  UINT8             *RawData;\r
+  UINT8             *OldData;\r
+  UINTN             RawDataLength;\r
+  UINT8             *VariableData;\r
+  UINTN             Index;\r
+  UINTN             Temp;\r
+  UINTN             SizeOfNvStore;\r
+  UINTN             CachedStart;\r
+  BOOLEAN           GotMatch;\r
+\r
+  RawDataLength = DEFAULT_FORM_BUFFER_SIZE;\r
+  SizeOfNvStore = 0;\r
+  CachedStart   = 0;\r
+  GotMatch      = FALSE;\r
+  *Results      = TRUE;\r
+\r
+  Status        = GetHiiInterface (&Hii);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Allocate space for retrieval of IFR data\r
+  //\r
+  RawData = AllocateZeroPool (RawDataLength);\r
+  if (RawData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Get all the forms associated with this HiiHandle\r
+  //\r
+  Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    gBS->FreePool (RawData);\r
+\r
+    //\r
+    // Allocate space for retrieval of IFR data\r
+    //\r
+    RawData = AllocateZeroPool (RawDataLength);\r
+    if (RawData == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
+\r
+    //\r
+    // Get all the forms associated with this HiiHandle\r
+    //\r
+    Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);\r
+  }\r
+\r
+  OldData = RawData;\r
+\r
+  //\r
+  // Point RawData to the beginning of the form data\r
+  //\r
+  RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));\r
+\r
+  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
+    if (RawData[Index] == EFI_IFR_FORM_SET_OP) {\r
+      CopyMem (&Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));\r
+      break;\r
+    }\r
+\r
+    Index = RawData[Index + 1] + Index;\r
+  }\r
+\r
+  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
+    switch (RawData[Index]) {\r
+    case EFI_IFR_FORM_SET_OP:\r
+      break;\r
+\r
+    case EFI_IFR_ONE_OF_OP:\r
+    case EFI_IFR_CHECKBOX_OP:\r
+    case EFI_IFR_NUMERIC_OP:\r
+    case EFI_IFR_DATE_OP:\r
+    case EFI_IFR_TIME_OP:\r
+    case EFI_IFR_PASSWORD_OP:\r
+    case EFI_IFR_STRING_OP:\r
+      //\r
+      // Remember, multiple op-codes may reference the same item, so let's keep a running\r
+      // marker of what the highest QuestionId that wasn't zero length.  This will accurately\r
+      // maintain the Size of the NvStore\r
+      //\r
+      if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {\r
+        Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
+        if (SizeOfNvStore < Temp) {\r
+          SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
+        }\r
+      }\r
+    }\r
+\r
+    Index = RawData[Index + 1] + Index;\r
+  }\r
+\r
+  //\r
+  // Allocate memory for our File Form Tags\r
+  //\r
+  VariableData = AllocateZeroPool (SizeOfNvStore);\r
+  if (VariableData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  Status = gRT->GetVariable (\r
+                  (CHAR16 *) L"Setup",\r
+                  &Guid,\r
+                  NULL,\r
+                  &SizeOfNvStore,\r
+                  (VOID *) VariableData\r
+                  );\r
+\r
+  if (EFI_ERROR (Status)) {\r
+\r
+    //\r
+    // If there is a variable that exists already and it is larger than what we calculated the\r
+    // storage needs to be, we must assume the variable size from GetVariable is correct and not\r
+    // allow the truncation of the variable.  It is very possible that the user who created the IFR\r
+    // we are cracking is not referring to a variable that was in a previous map, however we cannot\r
+    // allow it's truncation.\r
+    //\r
+    if (Status == EFI_BUFFER_TOO_SMALL) {\r
+      //\r
+      // Free the buffer that was allocated that was too small\r
+      //\r
+      gBS->FreePool (VariableData);\r
+\r
+      VariableData = AllocatePool (SizeOfNvStore);\r
+      if (VariableData == NULL) {\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      Status = gRT->GetVariable (\r
+                      (CHAR16 *) L"Setup",\r
+                      &Guid,\r
+                      NULL,\r
+                      &SizeOfNvStore,\r
+                      (VOID *) VariableData\r
+                      );\r
+    }\r
+  }\r
+\r
+  //\r
+  // Walk through the form and see that the variable data it refers to is ok.\r
+  // This allows for the possibility of stale (obsoleted) data in the variable\r
+  // can be overlooked without causing an error\r
+  //\r
+  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
+    switch (RawData[Index]) {\r
+    case EFI_IFR_ONE_OF_OP:\r
+      //\r
+      // A one_of has no data, its the option that does - cache the storage Id\r
+      //\r
+      CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;\r
+      break;\r
+\r
+    case EFI_IFR_ONE_OF_OPTION_OP:\r
+      //\r
+      // A one_of_option can be any value\r
+      //\r
+      if (VariableData[CachedStart] == ((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value) {\r
+        GotMatch = TRUE;\r
+      }\r
+      break;\r
+\r
+    case EFI_IFR_END_ONE_OF_OP:\r
+      //\r
+      // At this point lets make sure that the data value in the NVRAM matches one of the options\r
+      //\r
+      if (!GotMatch) {\r
+        *Results = FALSE;\r
+        return EFI_SUCCESS;\r
+      }\r
+      break;\r
+\r
+    case EFI_IFR_CHECKBOX_OP:\r
+      //\r
+      // A checkbox is a boolean, so 0 and 1 are valid\r
+      // Remember, QuestionId corresponds to the offset location of the data in the variable\r
+      //\r
+      if (VariableData[((EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) {\r
+        *Results = FALSE;\r
+        return EFI_SUCCESS;\r
+      }\r
+      break;\r
+\r
+    case EFI_IFR_NUMERIC_OP:\r
+        if ((VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||\r
+            (VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {\r
+        *Results = FALSE;\r
+        return EFI_SUCCESS;\r
+      }\r
+      break;\r
+\r
+    }\r
+\r
+    Index = RawData[Index + 1] + Index;\r
+  }\r
+\r
+  //\r
+  // Free our temporary repository of form data\r
+  //\r
+  gBS->FreePool (OldData);\r
+  gBS->FreePool (VariableData);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOnTheFly.c
new file mode 100644 (file)
index 0000000..e9ab482
--- /dev/null
@@ -0,0 +1,977 @@
+/*++\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+  IfrOnTheFly.c\r
+\r
+Abstract:\r
+\r
+  Library Routines to create IFR on-the-fly\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "IfrSupportLibInternal.h"\r
+\r
+EFI_STATUS\r
+CreateFormSet (\r
+  IN      CHAR16              *FormSetTitle,\r
+  IN      EFI_GUID            *Guid,\r
+  IN      UINT8               Class,\r
+  IN      UINT8               SubClass,\r
+  IN OUT  VOID                **FormBuffer,\r
+  IN OUT  VOID                **StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a formset\r
+  \r
+Arguments:\r
+  \r
+  FormSetTitle        - Title of formset\r
+  \r
+  Guid                - Guid of formset\r
+  \r
+  Class               - Class of formset\r
+  \r
+  SubClass            - Sub class of formset\r
+  \r
+  FormBuffer          - Pointer of the formset created\r
+  \r
+  StringBuffer        - Pointer of FormSetTitile string created\r
+  \r
+Returns: \r
+\r
+  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
+  \r
+  EFI_SUCCESS             - Formset successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_HII_IFR_PACK      IfrPack;\r
+  EFI_IFR_FORM_SET      FormSet;\r
+  EFI_IFR_END_FORM_SET  EndFormSet;\r
+  UINT8                 *Destination;\r
+  CHAR16                CurrentLanguage[4];\r
+  STRING_REF            StringToken;\r
+\r
+  //\r
+  // Pre-allocate a buffer sufficient for us to work from.\r
+  //\r
+  FormBuffer = AllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);\r
+  if (FormBuffer == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Pre-allocate a buffer sufficient for us to work from.\r
+  //\r
+  StringBuffer = AllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);\r
+  if (StringBuffer == NULL) {\r
+    gBS->FreePool (FormBuffer);\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add the FormSetTitle to the string buffer and get the StringToken\r
+  //\r
+  Status = AddString (*StringBuffer, CurrentLanguage, FormSetTitle, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Initialize the Ifr Package header data\r
+  //\r
+  IfrPack.Header.Length = sizeof (EFI_HII_PACK_HEADER) + sizeof (EFI_IFR_FORM_SET) + sizeof (EFI_IFR_END_FORM_SET);\r
+  IfrPack.Header.Type   = EFI_HII_IFR;\r
+\r
+  //\r
+  // Initialize FormSet with the appropriate information\r
+  //\r
+  FormSet.Header.OpCode = EFI_IFR_FORM_SET_OP;\r
+  FormSet.Header.Length = sizeof (EFI_IFR_FORM_SET);\r
+  FormSet.FormSetTitle  = StringToken;\r
+  FormSet.Class         = Class;\r
+  FormSet.SubClass      = SubClass;\r
+  CopyMem (&FormSet.Guid, Guid, sizeof (EFI_GUID));\r
+\r
+  //\r
+  // Initialize the end formset data\r
+  //\r
+  EndFormSet.Header.Length  = sizeof (EFI_IFR_END_FORM_SET);\r
+  EndFormSet.Header.OpCode  = EFI_IFR_END_FORM_SET_OP;\r
+\r
+  Destination               = (UINT8 *) *FormBuffer;\r
+\r
+  //\r
+  // Copy the formset/endformset data to the form buffer\r
+  //\r
+  CopyMem (Destination, &IfrPack, sizeof (EFI_HII_PACK_HEADER));\r
+\r
+  Destination = Destination + sizeof (EFI_HII_PACK_HEADER);\r
+\r
+  CopyMem (Destination, &FormSet, sizeof (EFI_IFR_FORM_SET));\r
+\r
+  Destination = Destination + sizeof (EFI_IFR_FORM_SET);\r
+\r
+  CopyMem (Destination, &EndFormSet, sizeof (EFI_IFR_END_FORM_SET));\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateForm (\r
+  IN      CHAR16              *FormTitle,\r
+  IN      UINT16              FormId,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a form\r
+  \r
+Arguments:\r
+  \r
+  FormTitle       - Title of the form\r
+  \r
+  FormId          - Id of the form\r
+  \r
+  FormBuffer          - Pointer of the form created\r
+  \r
+  StringBuffer        - Pointer of FormTitil string created\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Form successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+  EFI_IFR_FORM      Form;\r
+  EFI_IFR_END_FORM  EndForm;\r
+  CHAR16            CurrentLanguage[4];\r
+  STRING_REF        StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  Status = AddString (StringBuffer, CurrentLanguage, FormTitle, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Form.Header.OpCode  = EFI_IFR_FORM_OP;\r
+  Form.Header.Length  = sizeof (EFI_IFR_FORM);\r
+  Form.FormId         = FormId;\r
+  Form.FormTitle      = StringToken;\r
+\r
+  Status              = AddOpCode (FormBuffer, &Form);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  EndForm.Header.OpCode = EFI_IFR_END_FORM_OP;\r
+  EndForm.Header.Length = sizeof (EFI_IFR_END_FORM);\r
+\r
+  Status                = AddOpCode (FormBuffer, &EndForm);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateSubTitle (\r
+  IN      CHAR16              *SubTitle,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a SubTitle\r
+  \r
+Arguments:\r
+  \r
+  SubTitle        - Sub title to be created\r
+  \r
+  FormBuffer      - Where this subtitle to add to\r
+  \r
+  StringBuffer    - String buffer created for subtitle\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Subtitle successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+  EFI_IFR_SUBTITLE  Subtitle;\r
+  CHAR16            CurrentLanguage[4];\r
+  STRING_REF        StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  Status = AddString (StringBuffer, CurrentLanguage, SubTitle, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Subtitle.Header.OpCode  = EFI_IFR_SUBTITLE_OP;\r
+  Subtitle.Header.Length  = sizeof (EFI_IFR_SUBTITLE);\r
+  Subtitle.SubTitle       = StringToken;\r
+\r
+  Status                  = AddOpCode (FormBuffer, &Subtitle);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateText (\r
+  IN      CHAR16              *String,\r
+  IN      CHAR16              *String2,\r
+  IN      CHAR16              *String3,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a line of text\r
+  \r
+Arguments:\r
+  \r
+  String          - First string of the text\r
+  \r
+  String2         - Second string of the text\r
+  \r
+  String3         - Help string of the text\r
+  \r
+  Flags           - Flag of the text\r
+  \r
+  Key             - Key of the text\r
+  \r
+  FormBuffer      - The form where this text adds to\r
+  \r
+  StringBuffer    - String buffer created for String, String2 and String3\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Text successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  EFI_IFR_TEXT  Text;\r
+  CHAR16        CurrentLanguage[4];\r
+  STRING_REF    StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, String, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Text.Header.OpCode  = EFI_IFR_TEXT_OP;\r
+  Text.Header.Length  = sizeof (EFI_IFR_TEXT);\r
+  Text.Text           = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, String2, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Text.TextTwo  = StringToken;\r
+\r
+  Text.Flags    = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
+  Text.Key      = Key;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, String3, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Text.Help = StringToken;\r
+\r
+  Status    = AddOpCode (FormBuffer, &Text);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateGoto (\r
+  IN      UINT16              FormId,\r
+  IN      CHAR16              *Prompt,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a hyperlink\r
+  \r
+Arguments:\r
+  \r
+  FormId        - Form ID of the hyperlink\r
+  \r
+  Prompt        - Prompt of the hyperlink\r
+  \r
+  FormBuffer    - The form where this hyperlink adds to\r
+  \r
+  StringBuffer  - String buffer created for Prompt\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Hyperlink successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_IFR_REF Hyperlink;\r
+  CHAR16      CurrentLanguage[4];\r
+  STRING_REF  StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Hyperlink.Header.OpCode = EFI_IFR_REF_OP;\r
+  Hyperlink.Header.Length = sizeof (EFI_IFR_REF);\r
+  Hyperlink.FormId        = FormId;\r
+  Hyperlink.Prompt        = StringToken;\r
+\r
+  Status                  = AddOpCode (FormBuffer, &Hyperlink);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateOneOf (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the one-of box\r
+  \r
+  DataWidth       - DataWidth of the one-of box\r
+  \r
+  Prompt          - Prompt of the one-of box\r
+  \r
+  Help            - Help of the one-of box\r
+  \r
+  OptionsList     - Each string in it is an option of the one-of box\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - The form where this one-of box adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR    - DataWidth > 2\r
+\r
+  EFI_SUCCESS         - One-Of box successfully created.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS            Status;\r
+  UINTN                 Index;\r
+  EFI_IFR_ONE_OF        OneOf;\r
+  EFI_IFR_ONE_OF_OPTION OneOfOption;\r
+  EFI_IFR_END_ONE_OF    EndOneOf;\r
+  CHAR16                CurrentLanguage[4];\r
+  STRING_REF            StringToken;\r
+\r
+  //\r
+  // We do not create op-code storage widths for one-of in excess of 16 bits for now\r
+  //\r
+  if (DataWidth > 2) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;\r
+  OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);\r
+  OneOf.QuestionId    = QuestionId;\r
+  OneOf.Width         = DataWidth;\r
+  OneOf.Prompt        = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  OneOf.Help  = StringToken;\r
+\r
+  Status      = AddOpCode (FormBuffer, &OneOf);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  for (Index = 0; Index < OptionCount; Index++) {\r
+    OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
+    OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
+\r
+    //\r
+    // Add string and get token back\r
+    //\r
+    Status              = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);\r
+\r
+    OneOfOption.Option  = StringToken;\r
+    OneOfOption.Value   = OptionsList[Index].Value;\r
+    OneOfOption.Flags   = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);\r
+    OneOfOption.Key     = OptionsList[Index].Key;\r
+\r
+    Status              = AddOpCode (FormBuffer, &OneOfOption);\r
+\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+  }\r
+\r
+  EndOneOf.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
+  EndOneOf.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
+\r
+  Status                  = AddOpCode (FormBuffer, &EndOneOf);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+CreateOrderedList (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               MaxEntries,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of question with a set of options to choose from.  The\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the ordered list\r
+  \r
+  MaxEntries      - MaxEntries of the ordered list\r
+  \r
+  Prompt          - Prompt of the ordered list\r
+  \r
+  Help            - Help of the ordered list\r
+  \r
+  OptionsList     - Each string in it is an option of the ordered list\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - The form where this ordered list adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Ordered list successfully created.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS            Status;\r
+  UINTN                 Index;\r
+  EFI_IFR_ORDERED_LIST  OrderedList;\r
+  EFI_IFR_ONE_OF_OPTION OrderedListOption;\r
+  EFI_IFR_END_ONE_OF    EndOrderedList;\r
+  CHAR16                CurrentLanguage[4];\r
+  STRING_REF            StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;\r
+  OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);\r
+  OrderedList.QuestionId    = QuestionId;\r
+  OrderedList.MaxEntries    = MaxEntries;\r
+  OrderedList.Prompt        = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  OrderedList.Help  = StringToken;\r
+\r
+  Status            = AddOpCode (FormBuffer, &OrderedList);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  for (Index = 0; Index < OptionCount; Index++) {\r
+    OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
+    OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
+\r
+    //\r
+    // Add string and get token back\r
+    //\r
+    Status                    = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);\r
+\r
+    OrderedListOption.Option  = StringToken;\r
+    OrderedListOption.Value   = OptionsList[Index].Value;\r
+    OrderedListOption.Flags   = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);\r
+    OrderedListOption.Key     = OptionsList[Index].Key;\r
+\r
+    Status                    = AddOpCode (FormBuffer, &OrderedListOption);\r
+\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+  }\r
+\r
+  EndOrderedList.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
+  EndOrderedList.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
+\r
+  Status                        = AddOpCode (FormBuffer, &EndOrderedList);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateCheckBox (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT8               Flags,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a checkbox\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the check box\r
+  \r
+  DataWidth       - DataWidth of the check box\r
+  \r
+  Prompt          - Prompt of the check box\r
+  \r
+  Help            - Help of the check box\r
+  \r
+  Flags           - Flags of the check box\r
+  \r
+  FormBuffer      - The form where this check box adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR    - DataWidth > 1\r
+\r
+  EFI_SUCCESS         - Check box successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS        Status;\r
+  EFI_IFR_CHECKBOX  CheckBox;\r
+  CHAR16            CurrentLanguage[4];\r
+  STRING_REF        StringToken;\r
+\r
+  //\r
+  // We do not create op-code storage widths for checkbox in excess of 8 bits for now\r
+  //\r
+  if (DataWidth > 1) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  CheckBox.Header.OpCode  = EFI_IFR_CHECKBOX_OP;\r
+  CheckBox.Header.Length  = sizeof (EFI_IFR_CHECKBOX);\r
+  CheckBox.QuestionId     = QuestionId;\r
+  CheckBox.Width          = DataWidth;\r
+  CheckBox.Prompt         = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  CheckBox.Help   = StringToken;\r
+  CheckBox.Flags  = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
+\r
+  Status          = AddOpCode (FormBuffer, &CheckBox);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateNumeric (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT16              Minimum,\r
+  IN      UINT16              Maximum,\r
+  IN      UINT16              Step,\r
+  IN      UINT16              Default,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the numeric\r
+  \r
+  DataWidth       - DataWidth of the numeric\r
+  \r
+  Prompt          - Prompt of the numeric\r
+  \r
+  Help            - Help of the numeric\r
+  \r
+  Minimum         - Minumun boundary of the numeric\r
+  \r
+  Maximum         - Maximum boundary of the numeric\r
+  \r
+  Step            - Step of the numeric\r
+  \r
+  Default         - Default value\r
+  \r
+  Flags           - Flags of the numeric\r
+  \r
+  Key             - Key of the numeric\r
+  \r
+  FormBuffer      - The form where this numeric adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_DEVICE_ERROR      - DataWidth > 2\r
+  \r
+  EFI_SUCCESS           - Numeric is successfully created\r
+\r
+--*/\r
+{\r
+  EFI_STATUS      Status;\r
+  EFI_IFR_NUMERIC Numeric;\r
+  CHAR16          CurrentLanguage[4];\r
+  STRING_REF      StringToken;\r
+\r
+  //\r
+  // We do not create op-code storage widths for numerics in excess of 16 bits for now\r
+  //\r
+  if (DataWidth > 2) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;\r
+  Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);\r
+  Numeric.QuestionId    = QuestionId;\r
+  Numeric.Width         = DataWidth;\r
+  Numeric.Prompt        = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Numeric.Help    = StringToken;\r
+  Numeric.Minimum = Minimum;\r
+  Numeric.Maximum = Maximum;\r
+  Numeric.Step    = Step;\r
+  Numeric.Default = Default;\r
+  Numeric.Flags   = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
+  Numeric.Key     = Key;\r
+\r
+  Status          = AddOpCode (FormBuffer, &Numeric);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateString (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      CHAR16              *Prompt,\r
+  IN      CHAR16              *Help,\r
+  IN      UINT8               MinSize,\r
+  IN      UINT8               MaxSize,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer,\r
+  IN OUT  VOID                *StringBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a string\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the string\r
+  \r
+  DataWidth       - DataWidth of the string\r
+  \r
+  Prompt          - Prompt of the string\r
+  \r
+  Help            - Help of the string\r
+  \r
+  MinSize         - Min size boundary of the string\r
+  \r
+  MaxSize         - Max size boundary of the string\r
+    \r
+  Flags           - Flags of the string\r
+  \r
+  Key             - Key of the string\r
+  \r
+  FormBuffer      - The form where this string adds to\r
+  \r
+  StringBuffer    - String buffer created for Prompt and Help.\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - String successfully created.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS      Status;\r
+  EFI_IFR_STRING  String;\r
+  CHAR16          CurrentLanguage[4];\r
+  STRING_REF      StringToken;\r
+\r
+  //\r
+  // Obtain current language value\r
+  //\r
+  GetCurrentLanguage (CurrentLanguage);\r
+\r
+  //\r
+  // Add first string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  String.Header.OpCode  = EFI_IFR_STRING_OP;\r
+  String.Header.Length  = sizeof (EFI_IFR_STRING);\r
+  String.QuestionId     = QuestionId;\r
+  String.Width          = DataWidth;\r
+  String.Prompt         = StringToken;\r
+\r
+  //\r
+  // Add second string, get first string's token\r
+  //\r
+  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  String.Help     = StringToken;\r
+  String.MinSize  = MinSize;\r
+  String.MaxSize  = MaxSize;\r
+  String.Flags    = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
+  String.Key      = Key;\r
+\r
+  Status          = AddOpCode (FormBuffer, &String);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrOpCodeCreation.c
new file mode 100644 (file)
index 0000000..05b1238
--- /dev/null
@@ -0,0 +1,618 @@
+/*++\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+  IfrOpCodeCreation.c\r
+\r
+Abstract:\r
+\r
+  Library Routines to create IFR independent of string data - assume tokens already exist\r
+  Primarily to be used for exporting op-codes at a label in pre-defined forms.\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "IfrSupportLibInternal.h"\r
+\r
+EFI_STATUS\r
+CreateSubTitleOpCode (\r
+  IN      STRING_REF          StringToken,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a SubTitle opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  StringToken     - StringToken of the subtitle\r
+  \r
+  FormBuffer      - Output of subtitle as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Subtitle created to be a form\r
+\r
+--*/\r
+{\r
+  EFI_IFR_SUBTITLE  Subtitle;\r
+\r
+  Subtitle.Header.OpCode  = EFI_IFR_SUBTITLE_OP;\r
+  Subtitle.Header.Length  = sizeof (EFI_IFR_SUBTITLE);\r
+  Subtitle.SubTitle       = StringToken;\r
+\r
+  CopyMem (FormBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateTextOpCode (\r
+  IN      STRING_REF          StringToken,\r
+  IN      STRING_REF          StringTokenTwo,\r
+  IN      STRING_REF          StringTokenThree,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a Text opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  StringToken               - First string token of the text\r
+  \r
+  StringTokenTwo            - Second string token of the text\r
+  \r
+  StringTokenThree          - Help string token of the text\r
+  \r
+  Flags                     - Flag of the text\r
+  \r
+  Key                       - Key of the text\r
+  \r
+  FormBuffer                - Output of text as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - Text created to be a form\r
+\r
+--*/\r
+{\r
+  EFI_IFR_TEXT  Text;\r
+\r
+  Text.Header.OpCode  = EFI_IFR_TEXT_OP;\r
+  Text.Header.Length  = sizeof (EFI_IFR_TEXT);\r
+  Text.Text           = StringToken;\r
+\r
+  Text.TextTwo        = StringTokenTwo;\r
+  Text.Help           = StringTokenThree;\r
+  Text.Flags          = Flags;\r
+  Text.Key            = Key;\r
+\r
+  CopyMem (FormBuffer, &Text, sizeof (EFI_IFR_TEXT));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateGotoOpCode (\r
+  IN      UINT16              FormId,\r
+  IN      STRING_REF          StringToken,\r
+  IN      STRING_REF          StringTokenTwo,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a hyperlink opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  FormId          - Form ID of the hyperlink\r
+  \r
+  StringToken     - Prompt string token of the hyperlink\r
+  \r
+  StringTokenTwo  - Help string token of the hyperlink\r
+  \r
+  Flags           - Flags of the hyperlink\r
+  \r
+  Key             - Key of the hyperlink\r
+  \r
+  FormBuffer      - Output of hyperlink as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS   - Hyperlink created to be a form\r
+\r
+--*/\r
+{\r
+  EFI_IFR_REF Hyperlink;\r
+\r
+  Hyperlink.Header.OpCode = EFI_IFR_REF_OP;\r
+  Hyperlink.Header.Length = sizeof (EFI_IFR_REF);\r
+  Hyperlink.FormId        = FormId;\r
+  Hyperlink.Prompt        = StringToken;\r
+  Hyperlink.Help          = StringTokenTwo;\r
+  Hyperlink.Key           = Key;\r
+  Hyperlink.Flags         = Flags;\r
+\r
+  CopyMem (FormBuffer, &Hyperlink, sizeof (EFI_IFR_REF));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateOneOfOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the one-of box\r
+  \r
+  DataWidth       - DataWidth of the one-of box\r
+  \r
+  PromptToken     - Prompt string token of the one-of box\r
+  \r
+  HelpToken       - Help string token of the one-of box\r
+  \r
+  OptionsList     - Each string in it is an option of the one-of box\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - Output of One-Of box as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS         - One-Of box created to be a form\r
+  \r
+  EFI_DEVICE_ERROR    - DataWidth > 2\r
+\r
+--*/\r
+{\r
+  UINTN                 Index;\r
+  EFI_IFR_ONE_OF        OneOf;\r
+  EFI_IFR_ONE_OF_OPTION OneOfOption;\r
+  EFI_IFR_END_ONE_OF    EndOneOf;\r
+  UINT8                 *LocalBuffer;\r
+\r
+  //\r
+  // We do not create op-code storage widths for one-of in excess of 16 bits for now\r
+  //\r
+  if (DataWidth > 2) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;\r
+  OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);\r
+  OneOf.QuestionId    = QuestionId;\r
+  OneOf.Width         = DataWidth;\r
+  OneOf.Prompt        = PromptToken;\r
+\r
+  OneOf.Help          = HelpToken;\r
+\r
+  LocalBuffer         = (UINT8 *) FormBuffer;\r
+\r
+  CopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));\r
+\r
+  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF));\r
+\r
+  for (Index = 0; Index < OptionCount; Index++) {\r
+    OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
+    OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
+\r
+    OneOfOption.Option        = OptionsList[Index].StringToken;\r
+    OneOfOption.Value         = OptionsList[Index].Value;\r
+    OneOfOption.Flags         = OptionsList[Index].Flags;\r
+    OneOfOption.Key           = OptionsList[Index].Key;\r
+\r
+    CopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));\r
+\r
+    LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));\r
+  }\r
+\r
+  EndOneOf.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
+  EndOneOf.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
+\r
+  CopyMem (LocalBuffer, &EndOneOf, sizeof (EFI_IFR_END_ONE_OF));\r
+\r
+  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+CreateOrderedListOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               MaxEntries,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      IFR_OPTION          *OptionsList,\r
+  IN      UINTN               OptionCount,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+\r
+  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
+  has been filled in since this routine will not generate StringToken values.\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the ordered list\r
+  \r
+  MaxEntries      - MaxEntries of the ordered list\r
+  \r
+  PromptToken     - Prompt string token of the ordered list\r
+  \r
+  HelpToken       - Help string token of the ordered list\r
+  \r
+  OptionsList     - Each string in it is an option of the ordered list\r
+  \r
+  OptionCount     - Option string count\r
+  \r
+  FormBuffer      - Output of ordered list as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Ordered list created to be a form\r
+\r
+--*/\r
+{\r
+  UINTN                 Index;\r
+  EFI_IFR_ORDERED_LIST  OrderedList;\r
+  EFI_IFR_ONE_OF_OPTION OrderedListOption;\r
+  EFI_IFR_END_ONE_OF    EndOrderedList;\r
+  UINT8                 *LocalBuffer;\r
+\r
+  OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;\r
+  OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);\r
+  OrderedList.QuestionId    = QuestionId;\r
+  OrderedList.MaxEntries    = MaxEntries;\r
+  OrderedList.Prompt        = PromptToken;\r
+\r
+  OrderedList.Help          = HelpToken;\r
+\r
+  LocalBuffer               = (UINT8 *) FormBuffer;\r
+\r
+  CopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));\r
+\r
+  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ORDERED_LIST));\r
+\r
+  for (Index = 0; Index < OptionCount; Index++) {\r
+    OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
+    OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
+\r
+    OrderedListOption.Option        = OptionsList[Index].StringToken;\r
+    OrderedListOption.Value         = OptionsList[Index].Value;\r
+    OrderedListOption.Flags         = OptionsList[Index].Flags;\r
+    OrderedListOption.Key           = OptionsList[Index].Key;\r
+\r
+    CopyMem (LocalBuffer, &OrderedListOption, sizeof (EFI_IFR_ONE_OF_OPTION));\r
+\r
+    LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));\r
+  }\r
+\r
+  EndOrderedList.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
+  EndOrderedList.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
+\r
+  CopyMem (LocalBuffer, &EndOrderedList, sizeof (EFI_IFR_END_ONE_OF));\r
+\r
+  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+CreateCheckBoxOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a checkbox opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the check box\r
+  \r
+  DataWidth       - DataWidth of the check box\r
+  \r
+  PromptToken     - Prompt string token of the check box\r
+  \r
+  HelpToken       - Help string token of the check box\r
+  \r
+  Flags           - Flags of the check box\r
+  \r
+  Key             - Key of the check box\r
+  \r
+  FormBuffer      - Output of the check box as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - Checkbox created to be a form\r
+  \r
+  EFI_DEVICE_ERROR  - DataWidth > 1\r
+\r
+--*/\r
+{\r
+  EFI_IFR_CHECKBOX  CheckBox;\r
+\r
+  //\r
+  // We do not create op-code storage widths for checkbox in excess of 8 bits for now\r
+  //\r
+  if (DataWidth > 1) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  CheckBox.Header.OpCode  = EFI_IFR_CHECKBOX_OP;\r
+  CheckBox.Header.Length  = sizeof (EFI_IFR_CHECKBOX);\r
+  CheckBox.QuestionId     = QuestionId;\r
+  CheckBox.Width          = DataWidth;\r
+  CheckBox.Prompt         = PromptToken;\r
+\r
+  CheckBox.Help           = HelpToken;\r
+  CheckBox.Flags          = Flags;\r
+  CheckBox.Key            = Key;\r
+\r
+  CopyMem (FormBuffer, &CheckBox, sizeof (EFI_IFR_CHECKBOX));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateNumericOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT16              Minimum,\r
+  IN      UINT16              Maximum,\r
+  IN      UINT16              Step,\r
+  IN      UINT16              Default,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the numeric\r
+  \r
+  DataWidth       - DataWidth of the numeric\r
+  \r
+  PromptToken     - Prompt string token of the numeric\r
+  \r
+  HelpToken       - Help string token of the numeric\r
+  \r
+  Minimum         - Minumun boundary of the numeric\r
+  \r
+  Maximum         - Maximum boundary of the numeric\r
+  \r
+  Step            - Step of the numeric\r
+  \r
+  Default         - Default value of the numeric\r
+  \r
+  Flags           - Flags of the numeric\r
+  \r
+  Key             - Key of the numeric\r
+  \r
+  FormBuffer      - Output of the numeric as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - The numeric created to be a form.\r
+  \r
+  EFI_DEVICE_ERROR  - DataWidth > 2\r
+\r
+--*/\r
+{\r
+  EFI_IFR_NUMERIC Numeric;\r
+\r
+  //\r
+  // We do not create op-code storage widths for numerics in excess of 16 bits for now\r
+  //\r
+  if (DataWidth > 2) {\r
+    return EFI_DEVICE_ERROR;\r
+  }\r
+\r
+  Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;\r
+  Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);\r
+  Numeric.QuestionId    = QuestionId;\r
+  Numeric.Width         = DataWidth;\r
+  Numeric.Prompt        = PromptToken;\r
+\r
+  Numeric.Help          = HelpToken;\r
+  Numeric.Minimum       = Minimum;\r
+  Numeric.Maximum       = Maximum;\r
+  Numeric.Step          = Step;\r
+  Numeric.Default       = Default;\r
+  Numeric.Flags         = Flags;\r
+  Numeric.Key           = Key;\r
+\r
+  CopyMem (FormBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateStringOpCode (\r
+  IN      UINT16              QuestionId,\r
+  IN      UINT8               DataWidth,\r
+  IN      STRING_REF          PromptToken,\r
+  IN      STRING_REF          HelpToken,\r
+  IN      UINT8               MinSize,\r
+  IN      UINT8               MaxSize,\r
+  IN      UINT8               Flags,\r
+  IN      UINT16              Key,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a numeric opcode independent of string creation\r
+  This is used primarily by users who need to create just one particular valid op-code and the string\r
+  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
+  location to pre-defined forms in HII)\r
+  \r
+Arguments:\r
+  \r
+  QuestionId      - Question ID of the string\r
+  \r
+  DataWidth       - DataWidth of the string\r
+  \r
+  PromptToken     - Prompt token of the string\r
+  \r
+  HelpToken       - Help token of the string\r
+  \r
+  MinSize         - Min size boundary of the string\r
+  \r
+  MaxSize         - Max size boundary of the string\r
+    \r
+  Flags           - Flags of the string\r
+  \r
+  Key             - Key of the string\r
+  \r
+  FormBuffer      - Output of the string as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS       - String created to be a form.\r
+\r
+--*/\r
+{\r
+  EFI_IFR_STRING  String;\r
+\r
+  String.Header.OpCode  = EFI_IFR_STRING_OP;\r
+  String.Header.Length  = sizeof (EFI_IFR_STRING);\r
+  String.QuestionId     = QuestionId;\r
+  String.Width          = DataWidth;\r
+  String.Prompt         = PromptToken;\r
+\r
+  String.Help           = HelpToken;\r
+  String.MinSize        = MinSize;\r
+  String.MaxSize        = MaxSize;\r
+  String.Flags          = Flags;\r
+  String.Key            = Key;\r
+\r
+  CopyMem (FormBuffer, &String, sizeof (EFI_IFR_STRING));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+CreateBannerOpCode (\r
+  IN      UINT16              Title,\r
+  IN      UINT16              LineNumber,\r
+  IN      UINT8               Alignment,\r
+  IN OUT  VOID                *FormBuffer\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
+  \r
+Arguments:\r
+  \r
+  Title       - Title of the banner\r
+  \r
+  LineNumber  - LineNumber of the banner\r
+  \r
+  Alignment   - Alignment of the banner\r
+  \r
+  FormBuffer  - Output of banner as a form\r
+  \r
+Returns: \r
+\r
+  EFI_SUCCESS     - Banner created to be a form.\r
+\r
+--*/\r
+{\r
+  EFI_IFR_BANNER  Banner;\r
+\r
+  Banner.Header.OpCode  = EFI_IFR_BANNER_OP;\r
+  Banner.Header.Length  = sizeof (EFI_IFR_BANNER);\r
+  CopyMem (&Banner.Title, &Title, sizeof (UINT16));\r
+  CopyMem (&Banner.LineNumber, &LineNumber, sizeof (UINT16));\r
+  Banner.Alignment = Alignment;\r
+\r
+  CopyMem (FormBuffer, &Banner, sizeof (EFI_IFR_BANNER));\r
+\r
+  return EFI_SUCCESS;\r
+}\r
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf
new file mode 100644 (file)
index 0000000..fa00698
--- /dev/null
@@ -0,0 +1,66 @@
+#/** @file\r
+# EDK Internal Form Refresentation Support Library Instance.\r
+#\r
+# The library instance provides common library routines help in \r
+#  IFR creation on-the-fly, HII variable access, HII database access, multi language supports.\r
+# Copyright (c) 2006 - 2007, Intel Corporation.\r
+#\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = FrameworkIfrSupportLib\r
+  FILE_GUID                      = ea55bada-d488-427b-9d2d-227e0aaa3707\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = FrameworkIfrSupportLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+  CONSTRUCTOR                    = IfrLibConstruct\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+#  Variable Guid C Name: gLanGuid Variable Name: L"Lan"\r
+#\r
+\r
+[Sources.common]\r
+  IfrVariable.c\r
+  IfrOpCodeCreation.c\r
+  IfrOnTheFly.c\r
+  IfrCommon.c\r
+  IfrSupportLibInternal.h\r
+\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+  UefiRuntimeServicesTableLib\r
+  UefiBootServicesTableLib\r
+  MemoryAllocationLib\r
+  BaseMemoryLib\r
+  BaseLib\r
+  DebugLib\r
+\r
+\r
+[Guids]\r
+  gEfiGlobalVariableGuid                        # ALWAYS_CONSUMED\r
+\r
+\r
+[Protocols]\r
+  gEfiHiiProtocolGuid                           # PROTOCOL ALWAYS_CONSUMED\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.msa b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.msa
new file mode 100644 (file)
index 0000000..87f4f74
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>EdkIfrSupportLib</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>ea55bada-d488-427b-9d2d-227e0aaa3707</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>EDK Internal Form Refresentation Support Library Instance.</Abstract>\r
+    <Description>The library instance provides common library routines help in 
+    IFR creation on-the-fly, HII variable access, HII database access, multi language supports.</Description>\r
+    <Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>EdkIfrSupportLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>EdkIfrSupportLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiRuntimeServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>IfrCommon.c</Filename>\r
+    <Filename>IfrOnTheFly.c</Filename>\r
+    <Filename>IfrOpCodeCreation.c</Filename>\r
+    <Filename>IfrVariable.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+    <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
+  </PackageDependencies>\r
+  <Protocols>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiHiiProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+  </Protocols>\r
+  <Variables>\r
+    <Variable Usage="ALWAYS_CONSUMED">\r
+      <VariableName>0x004C 0x0061 0x006E</VariableName>\r
+      <GuidC_Name>gLanGuid</GuidC_Name>\r
+    </Variable>\r
+  </Variables>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiGlobalVariableGuid</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+    <Extern>\r
+      <Constructor>IfrLibConstruct</Constructor>\r
+    </Extern>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLibInternal.h
new file mode 100644 (file)
index 0000000..033b396
--- /dev/null
@@ -0,0 +1,33 @@
+/**@file\r
+  Common header file shared by all source files.\r
+\r
+  This file includes package header files, library classes and protocol, PPI & GUID definitions.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation.\r
+  All rights reserved. This program and the accompanying materials\r
+   are licensed and made available under the terms and conditions of the BSD License\r
+   which accompanies this distribution. The full text of the license may be found at\r
+   http://opensource.org/licenses/bsd-license.php\r
+   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#ifndef __IFRSUPPORT_LIB_INTERNAL_H_\r
+#define __IFRSUPPORT_LIB_INTERNAL_H_\r
+\r
+\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Guid/GlobalVariable.h>\r
+#include <Protocol/FrameworkHii.h>\r
+\r
+#include <Library/FrameworkIfrSupportLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c b/IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrVariable.c
new file mode 100644 (file)
index 0000000..04aa4dc
--- /dev/null
@@ -0,0 +1,493 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+  IfrVariable.c\r
+\r
+Abstract:\r
+  Variable/Map manipulations routines\r
+\r
+--*/\r
+\r
+//\r
+// Include common header file for this module.\r
+//\r
+#include "IfrSupportLibInternal.h"\r
+\r
+VOID\r
+EfiLibHiiVariablePackGetMap (\r
+  IN    EFI_HII_VARIABLE_PACK       *Pack,  \r
+  OUT   CHAR16                      **Name,  OPTIONAL\r
+  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
+  OUT   UINT16                      *Id,     OPTIONAL\r
+  OUT   VOID                        **Var,   OPTIONAL\r
+  OUT   UINTN                       *Size    OPTIONAL\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Extracts a variable form a Pack.\r
+\r
+Arguments:\r
+\r
+  Pack - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns: \r
+\r
+  VOID\r
+  \r
+--*/\r
+{\r
+  if (NULL != Name) {\r
+    *Name = (VOID *) (Pack + 1);\r
+  }\r
+    \r
+  if (NULL != Guid) { \r
+    *Guid = (EFI_GUID *)(UINTN)&Pack->VariableGuid;\r
+  }\r
+    \r
+    \r
+  if (NULL != Id) {\r
+    *Id   = Pack->VariableId;\r
+  }\r
+    \r
+  if (NULL != Var) {\r
+    *Var  = (VOID *) ((CHAR8 *) (Pack + 1) + Pack->VariableNameLength);\r
+  }\r
+    \r
+  if (NULL != Size) {\r
+    *Size = Pack->Header.Length - sizeof (*Pack) - Pack->VariableNameLength;\r
+  }\r
+}\r
+\r
+\r
+UINTN\r
+EfiLibHiiVariablePackListGetMapCnt (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
+  )\r
+  \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a count of the variables/maps in the List.\r
+\r
+Arguments:\r
+\r
+  List - List of variables\r
+\r
+Returns: \r
+\r
+  UINTN - The number of map count.\r
+\r
+--*/\r
+\r
+{\r
+  UINTN   Cnt = 0;\r
+  while (NULL != List) {\r
+    Cnt++;\r
+    List = List->NextVariablePack;\r
+  }\r
+  return Cnt;\r
+}\r
+\r
+\r
+VOID\r
+EfiLibHiiVariablePackListForEachVar (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
+  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Will iterate all variable/maps as appearing \r
+  in List and for each, it will call the Callback.\r
+\r
+Arguments:\r
+\r
+  List     - List of variables\r
+  Callback - Routine to be called for each iterated variable.\r
+\r
+Returns: \r
+\r
+  VOID\r
+  \r
+--*/\r
+\r
+{\r
+  CHAR16    *MapName;\r
+  EFI_GUID  *MapGuid;\r
+  UINT16    MapId;\r
+  VOID      *Map;\r
+  UINTN     MapSize;\r
+\r
+  while (NULL != List) {\r
+    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
+    //\r
+    // call the callback\r
+    //\r
+    Callback (MapName, MapGuid, MapId, Map, MapSize); \r
+    List = List->NextVariablePack;\r
+  }\r
+}\r
+\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMapByIdx (\r
+  IN    UINTN                       Idx,  \r
+  IN    EFI_HII_VARIABLE_PACK_LIST  *List,  \r
+  OUT   CHAR16                      **Name,  OPTIONAL\r
+  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
+  OUT   UINT16                      *Id,     OPTIONAL\r
+  OUT   VOID                        **Var,\r
+  OUT   UINTN                       *Size\r
+  )\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form List given \r
+  the order number as appears in the List.\r
+\r
+Arguments:\r
+\r
+  Idx  - The index of the variable/map to retrieve\r
+  List - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+{\r
+  CHAR16     *MapName;\r
+  EFI_GUID   *MapGuid;\r
+  UINT16     MapId;\r
+  VOID       *Map;\r
+  UINTN      MapSize;\r
+\r
+  while (NULL != List) {\r
+    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
+    if (0 == Idx--) {\r
+      *Var  = Map;\r
+      *Size = MapSize;\r
+\r
+      if (NULL != Name) {\r
+        *Name = MapName;\r
+      }\r
+\r
+      if (NULL != Guid) {\r
+        *Guid = MapGuid;\r
+      }\r
+        \r
+      if (NULL != Id) {\r
+        *Id   = MapId;\r
+      }\r
+        \r
+      return EFI_SUCCESS; // Map found\r
+    }\r
+    List = List->NextVariablePack;\r
+  }\r
+  //\r
+  // If here, the map is not found\r
+  //\r
+  return EFI_NOT_FOUND; \r
+}\r
+\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMapById (\r
+  IN    UINT16                        Id,  \r
+  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
+  OUT   CHAR16                        **Name,  OPTIONAL\r
+  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
+  OUT   VOID                          **Var,\r
+  OUT   UINTN                         *Size\r
+  )\r
+  \r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form List given the \r
+  order number as appears in the List.\r
+\r
+Arguments:\r
+\r
+  Id   - The ID of the variable/map to retrieve\r
+  List - List of variables\r
+  Name - Name of the variable/map\r
+  Guid - GUID of the variable/map\r
+  Var  - Pointer to the variable/map\r
+  Size - Size of the variable/map in bytes\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+\r
+{ \r
+  CHAR16    *MapName;\r
+  EFI_GUID  *MapGuid;\r
+  UINT16    MapId;\r
+  VOID      *Map;\r
+  UINTN     MapSize;\r
+\r
+  while (NULL != List) {\r
+    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
+    if (MapId == Id) {\r
+      *Var  = Map;\r
+      *Size = MapSize;\r
+      if (NULL != Name) {\r
+         *Name = MapName;\r
+      }\r
+      if (NULL != Guid) {\r
+        *Guid = MapGuid;\r
+      }\r
+      //\r
+      // Map found\r
+      //\r
+      return EFI_SUCCESS; \r
+    }\r
+    List = List->NextVariablePack;\r
+  }\r
+  //\r
+  // If here, the map is not found\r
+  //\r
+  return EFI_NOT_FOUND; \r
+}\r
+\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariablePackListGetMap (\r
+  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
+  IN    CHAR16                       *Name,\r
+  IN    EFI_GUID                     *Guid,\r
+  OUT   UINT16                       *Id,\r
+  OUT   VOID                         **Var, \r
+  OUT   UINTN                        *Size\r
+  )\r
+\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
+\r
+Arguments:\r
+\r
+  List - List of variables\r
+  Name - Name of the variable/map to be found\r
+  Guid - GUID of the variable/map to be found\r
+  Var  - Pointer to the variable/map found\r
+  Size - Size of the variable/map in bytes found\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
+  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
+\r
+--*/\r
+\r
+{ \r
+  VOID      *Map;\r
+  UINTN     MapSize;\r
+  UINT16    MapId;\r
+  CHAR16    *MapName;\r
+  EFI_GUID  *MapGuid;\r
+\r
+  while (NULL != List) {\r
+    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
+    if ((0 == StrCmp (Name, MapName)) && CompareGuid (Guid, MapGuid)) {\r
+      *Id   = MapId;\r
+      *Var  = Map;\r
+      *Size = MapSize;\r
+      return EFI_SUCCESS;\r
+    }\r
+    List = List->NextVariablePack;\r
+  }\r
+  //\r
+  // If here, the map is not found\r
+  //\r
+  return EFI_NOT_FOUND;\r
+}\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableRetrieveFromNv (\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                  **Var\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
+  If it does, it will retrieve it into the Var. \r
+\r
+Arguments:\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
+                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
+Returns:\r
+  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
+  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                  Status;\r
+  UINTN                       SizeNv;\r
+\r
+  //\r
+  // Test for existence of the variable.\r
+  //\r
+  SizeNv = 0;\r
+  Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, NULL);\r
+  if (EFI_BUFFER_TOO_SMALL != Status) {\r
+    ASSERT (EFI_SUCCESS != Status);\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  if (SizeNv != Size) {\r
+    //\r
+    // The variable is considered corrupt, as it has different size from expected.\r
+    //\r
+    return EFI_LOAD_ERROR; \r
+  }\r
+\r
+  if (NULL == *Var) {\r
+    *Var = AllocatePool (Size);\r
+    ASSERT (NULL != *Var);\r
+  }\r
+  SizeNv = Size;\r
+  //\r
+  // Final read into the Var\r
+  //\r
+  Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, *Var); \r
+  //\r
+  // No tolerance for random failures. Such behavior is undetermined and not validated.\r
+  //\r
+  ASSERT_EFI_ERROR (Status); \r
+  ASSERT (SizeNv == Size);\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableOverrideIfSuffix (\r
+  IN  CHAR16                 *Suffix,\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                   *Var\r
+  )  \r
+/*++\r
+\r
+Routine Description:\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the Name ends with specified Suffix.\r
+  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
+  the Suffix matches the end of Name, so the variable will be loaded from NV\r
+  provided the variable exists and the GUID and Size matches.\r
+\r
+Arguments:\r
+  Suffix           - Suffix the Name should end with.\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into this buffer.\r
+                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+Returns:\r
+  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
+  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+{\r
+  UINTN         StrLength;\r
+  UINTN         StrLenSuffix;\r
+\r
+  StrLength       = StrLen (Name);\r
+  StrLenSuffix    = StrLen (Suffix);\r
+  if ((StrLength <= StrLenSuffix) || (0 != StrCmp (Suffix, &Name[StrLength - StrLenSuffix]))) {\r
+    //\r
+    // Not ending with <Suffix>.\r
+    //\r
+    return EFI_INVALID_PARAMETER; \r
+  }\r
+  return EfiLibHiiVariableRetrieveFromNv (Name, Guid, Size, &Var);\r
+}\r
+\r
+EFI_STATUS\r
+EfiLibHiiVariableOverrideBySuffix (\r
+  IN  CHAR16                 *Suffix,\r
+  IN  CHAR16                 *Name,\r
+  IN  EFI_GUID               *Guid,\r
+  IN  UINTN                   Size,\r
+  OUT VOID                   *Var\r
+  ) \r
+/*++\r
+\r
+Routine Description:\r
+  Overrrides the variable with NV data if found.\r
+  But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
+  For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
+  the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
+  will be loaded from NV provided the variable exists and the GUID and Size matches.\r
+\r
+Arguments:\r
+  Suffix           - Suffix the variable will be appended with.\r
+  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
+  Var              - Variable will be retrieved into this buffer.\r
+                     Caller is responsible for providing storage of exactly Size size in bytes.\r
+\r
+Returns:\r
+  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
+  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
+  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS    Status;\r
+  CHAR16       *NameSuffixed;\r
+  UINTN         NameLength;\r
+  UINTN         SuffixLength;\r
+\r
+  //\r
+  // enough to concatenate both strings.\r
+  //\r
+  NameLength   = StrLen (Name);\r
+  SuffixLength = StrLen (Suffix);\r
+  NameSuffixed = AllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16)); \r
+  \r
+  StrCpy (NameSuffixed, Name);\r
+  StrCat (NameSuffixed, Suffix);\r
+  \r
+  Status = EfiLibHiiVariableRetrieveFromNv (NameSuffixed, Guid, Size, &Var);\r
+  gBS->FreePool (NameSuffixed);\r
+  \r
+  return Status;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/Console.c
new file mode 100644 (file)
index 0000000..8baacaf
--- /dev/null
@@ -0,0 +1,282 @@
+/** @file\r
+  Mde UEFI library functions.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Console.c\r
+\r
+**/\r
+\r
+#include "FrameworkUefiLib.h"\r
+\r
+typedef struct {\r
+  CHAR16  WChar;\r
+  UINT32  Width;\r
+} UNICODE_WIDTH_ENTRY;\r
+\r
+UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {\r
+  //\r
+  // General script area\r
+  //\r
+  {(CHAR16)0x1FFF,  1},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all narrow glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x007F,  1},       // C0 controls and basic Latin. 0x0000-0x007F\r
+  {(CHAR16)0x00FF,  1},       // C1 controls and Latin-1 support. 0x0080-0x00FF\r
+  {(CHAR16)0x017F,  1},       // Latin extended-A. 0x0100-0x017F\r
+  {(CHAR16)0x024F,  1},       // Latin extended-B. 0x0180-0x024F\r
+  {(CHAR16)0x02AF,  1},       // IPA extensions. 0x0250-0x02AF\r
+  {(CHAR16)0x02FF,  1},       // Spacing modifier letters. 0x02B0-0x02FF\r
+  {(CHAR16)0x036F,  1},       // Combining diacritical marks. 0x0300-0x036F\r
+  {(CHAR16)0x03FF,  1},       // Greek. 0x0370-0x03FF\r
+  {(CHAR16)0x04FF,  1},       // Cyrillic. 0x0400-0x04FF\r
+  {(CHAR16)0x052F,  0},       // Unassigned. As Armenian in ver3.0. 0x0500-0x052F\r
+  {(CHAR16)0x058F,  1},       // Armenian. 0x0530-0x058F\r
+  {(CHAR16)0x05FF,  1},       // Hebrew. 0x0590-0x05FF\r
+  {(CHAR16)0x06FF,  1},       // Arabic. 0x0600-0x06FF\r
+  {(CHAR16)0x08FF,  0},       // Unassigned. 0x0700-0x08FF\r
+  {(CHAR16)0x097F,  1},       // Devanagari. 0x0900-0x097F\r
+  {(CHAR16)0x09FF,  1},       // Bengali. 0x0980-0x09FF\r
+  {(CHAR16)0x0A7F,  1},       // Gurmukhi. 0x0A00-0x0A7F\r
+  {(CHAR16)0x0AFF,  1},       // Gujarati. 0x0A80-0x0AFF\r
+  {(CHAR16)0x0B7F,  1},       // Oriya. 0x0B00-0x0B7F\r
+  {(CHAR16)0x0BFF,  1},       // Tamil. (See page 7-92). 0x0B80-0x0BFF\r
+  {(CHAR16)0x0C7F,  1},       // Telugu. 0x0C00-0x0C7F\r
+  {(CHAR16)0x0CFF,  1},       // Kannada. (See page 7-100). 0x0C80-0x0CFF\r
+  {(CHAR16)0x0D7F,  1},       // Malayalam (See page 7-104). 0x0D00-0x0D7F\r
+  {(CHAR16)0x0DFF,  0},       // Unassigned. 0x0D80-0x0DFF\r
+  {(CHAR16)0x0E7F,  1},       // Thai. 0x0E00-0x0E7F\r
+  {(CHAR16)0x0EFF,  1},       // Lao. 0x0E80-0x0EFF\r
+  {(CHAR16)0x0FBF,  1},       // Tibetan. 0x0F00-0x0FBF\r
+  {(CHAR16)0x109F,  0},       // Unassigned. 0x0FC0-0x109F\r
+  {(CHAR16)0x10FF,  1},       // Georgian. 0x10A0-0x10FF\r
+  {(CHAR16)0x11FF,  1},       // Hangul Jamo. 0x1100-0x11FF\r
+  {(CHAR16)0x1DFF,  0},       // Unassigned. 0x1200-0x1DFF\r
+  {(CHAR16)0x1EFF,  1},       // Latin extended additional. 0x1E00-0x1EFF\r
+  {(CHAR16)0x1FFF,  1},       // Greek extended. 0x1F00-0x1FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Symbol area\r
+  //\r
+  {(CHAR16)0x2FFF,  1},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all narrow glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x206F,  1},       // General punctuation. (See page7-154). 0x200-0x206F\r
+  {(CHAR16)0x209F,  1},       // Superscripts and subscripts. 0x2070-0x209F\r
+  {(CHAR16)0x20CF,  1},       // Currency symbols. 0x20A0-0x20CF\r
+  {(CHAR16)0x20FF,  1},       // Combining diacritical marks for symbols. 0x20D0-0x20FF\r
+  {(CHAR16)0x214F,  1},       // Letterlike sympbols. 0x2100-0x214F\r
+  {(CHAR16)0x218F,  1},       // Number forms. 0x2150-0x218F\r
+  {(CHAR16)0x21FF,  1},       // Arrows. 0x2190-0x21FF\r
+  {(CHAR16)0x22FF,  1},       // Mathematical operators. 0x2200-0x22FF\r
+  {(CHAR16)0x23FF,  1},       // Miscellaneous technical. 0x2300-0x23FF\r
+  {(CHAR16)0x243F,  1},       // Control pictures. 0x2400-0x243F\r
+  {(CHAR16)0x245F,  1},       // Optical character recognition. 0x2440-0x245F\r
+  {(CHAR16)0x24FF,  1},       // Enclosed alphanumerics. 0x2460-0x24FF\r
+  {(CHAR16)0x257F,  1},       // Box drawing. 0x2500-0x257F\r
+  {(CHAR16)0x259F,  1},       // Block elements. 0x2580-0x259F\r
+  {(CHAR16)0x25FF,  1},       // Geometric shapes. 0x25A0-0x25FF\r
+  {(CHAR16)0x26FF,  1},       // Miscellaneous symbols. 0x2600-0x26FF\r
+  {(CHAR16)0x27BF,  1},       // Dingbats. 0x2700-0x27BF\r
+  {(CHAR16)0x2FFF,  0},       // Reserved. 0x27C0-0x2FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // CJK phonetics and symbol area\r
+  //\r
+  {(CHAR16)0x33FF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x303F,  2},       // CJK symbols and punctuation. 0x3000-0x303F\r
+  {(CHAR16)0x309F,  2},       // Hiragana. 0x3040-0x309F\r
+  {(CHAR16)0x30FF,  2},       // Katakana. 0x30A0-0x30FF\r
+  {(CHAR16)0x312F,  2},       // Bopomofo. 0x3100-0x312F\r
+  {(CHAR16)0x318F,  2},       // Hangul compatibility jamo. 0x3130-0x318F\r
+  {(CHAR16)0x319F,  2},       // Kanbun. 0x3190-0x319F\r
+  {(CHAR16)0x31FF,  0},       // Reserved. As Bopomofo extended in ver3.0. 0x31A0-0x31FF\r
+  {(CHAR16)0x32FF,  2},       // Enclosed CJK letters and months. 0x3200-0x32FF\r
+  {(CHAR16)0x33FF,  2},       // CJK compatibility. 0x3300-0x33FF\r
+  *\r
+  */\r
+\r
+  //\r
+  // CJK ideograph area\r
+  //\r
+  {(CHAR16)0x9FFF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x4DFF,  0},       // Reserved. 0x3400-0x4DBF as CJK unified ideographs\r
+                      // extension A in ver3.0. 0x3400-0x4DFF\r
+  {(CHAR16)0x9FFF,  2},       // CJK unified ideographs. 0x4E00-0x9FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Reserved\r
+  //\r
+  {(CHAR16)0xABFF,  0},       // Reserved. 0xA000-0xA490 as Yi syllables. 0xA490-0xA4D0\r
+  // as Yi radicals in ver3.0. 0xA000-0xABFF\r
+  //\r
+  // Hangul syllables\r
+  //\r
+  {(CHAR16)0xD7FF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0xD7A3,  2},       // Hangul syllables. 0xAC00-0xD7A3\r
+  {(CHAR16)0xD7FF,  0},       // Reserved. 0xD7A3-0xD7FF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Surrogates area\r
+  //\r
+  {(CHAR16)0xDFFF,  0},       // Surrogates, not used now. 0xD800-0xDFFF\r
+\r
+  //\r
+  // Private use area\r
+  //\r
+  {(CHAR16)0xF8FF,  0},       // Private use area. 0xE000-0xF8FF\r
+\r
+  //\r
+  // Compatibility area and specials\r
+  //\r
+  {(CHAR16)0xFAFF,  2},       // CJK compatibility ideographs. 0xF900-0xFAFF\r
+  {(CHAR16)0xFB4F,  1},       // Alphabetic presentation forms. 0xFB00-0xFB4F\r
+  {(CHAR16)0xFDFF,  1},       // Arabic presentation forms-A. 0xFB50-0xFDFF\r
+  {(CHAR16)0xFE1F,  0},       // Reserved. As variation selectors in ver3.0. 0xFE00-0xFE1F\r
+  {(CHAR16)0xFE2F,  1},       // Combining half marks. 0xFE20-0xFE2F\r
+  {(CHAR16)0xFE4F,  2},       // CJK compatibility forms. 0xFE30-0xFE4F\r
+  {(CHAR16)0xFE6F,  1},       // Small Form Variants. 0xFE50-0xFE6F\r
+  {(CHAR16)0xFEFF,  1},       // Arabic presentation forms-B. 0xFE70-0xFEFF\r
+  {(CHAR16)0xFFEF,  1},       // Half width and full width forms. 0xFF00-0xFFEF\r
+  {(CHAR16)0xFFFF,  0},       // Speicials. 0xFFF0-0xFFFF\r
+};\r
+\r
+/**\r
+  This function computes and returns the width of the Unicode character\r
+  specified by UnicodeChar.\r
+\r
+  @param  UnicodeChar   A Unicode character.\r
+\r
+  @retval 0             The width if UnicodeChar could not be determined.\r
+  @retval 1             UnicodeChar is a narrow glyph.\r
+  @retval 2             UnicodeChar is a wide glyph.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+GetGlyphWidth (\r
+  IN CHAR16  UnicodeChar\r
+  )\r
+{\r
+  UINTN               Index;\r
+  UINTN               Low;\r
+  UINTN               High;\r
+  UNICODE_WIDTH_ENTRY *Item;\r
+\r
+  Item  = NULL;\r
+  Low   = 0;\r
+  High  = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;\r
+  while (Low <= High) {\r
+    Index = (Low + High) >> 1;\r
+    Item  = &(mUnicodeWidthTable[Index]);\r
+    if (Index == 0) {\r
+      if (UnicodeChar <= Item->WChar) {\r
+        break;\r
+      }\r
+\r
+      return 0;\r
+    }\r
+\r
+    if (UnicodeChar > Item->WChar) {\r
+      Low = Index + 1;\r
+    } else if (UnicodeChar <= mUnicodeWidthTable[Index - 1].WChar) {\r
+      High = Index - 1;\r
+    } else {\r
+      //\r
+      // Index - 1 < UnicodeChar <= Index. Found\r
+      //\r
+      break;\r
+    }\r
+  }\r
+\r
+  if (Low <= High) {\r
+    return Item->Width;\r
+  }\r
+\r
+  return 0;\r
+}\r
+\r
+/**\r
+  This function computes and returns the display length of\r
+  the Null-terminated Unicode string specified by String.\r
+  If String is NULL, then 0 is returned.\r
+  If any of the widths of the Unicode characters in String\r
+  can not be determined, then 0 is returned.\r
+\r
+  @param  String      A pointer to a Null-terminated Unicode string.\r
+\r
+  @return The display length of the Null-terminated Unicode string specified by String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeStringDisplayLength (\r
+  IN CONST CHAR16  *String\r
+  )\r
+{\r
+  UINTN      Length;\r
+  UINTN      Width;\r
+\r
+  if (String == NULL) {\r
+    return 0;\r
+  }\r
+\r
+  Length = 0;\r
+  while (*String != 0) {\r
+    Width = GetGlyphWidth (*String);\r
+    if (Width == 0) {\r
+      return 0;\r
+    }\r
+\r
+    Length += Width;\r
+    String++;\r
+  }\r
+\r
+  return Length;\r
+}\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.h b/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.h
new file mode 100644 (file)
index 0000000..89d4633
--- /dev/null
@@ -0,0 +1,44 @@
+/** @file\r
+  Header file to include header files common to all source files in\r
+  FrameworkUefiLib.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkUefiLib.h\r
+\r
+**/\r
+\r
+#ifndef _UEFI_LIB_FRAMEWORK_H_\r
+#define _UEFI_LIB_FRAMEWORK_H_\r
+\r
+\r
+#include <FrameworkDxe.h>\r
+\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/ComponentName2.h>\r
+#include <Protocol/DriverConfiguration.h>\r
+#include <Protocol/DriverDiagnostics.h>\r
+#include <Protocol/DriverDiagnostics2.h>\r
+\r
+#include <Guid/EventGroup.h>\r
+#include <Guid/EventLegacyBios.h>\r
+#include <Guid/FrameworkDevicePath.h>\r
+\r
+#include <Library/UefiLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/PrintLib.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf b/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf
new file mode 100644 (file)
index 0000000..a7a29bb
--- /dev/null
@@ -0,0 +1,80 @@
+#/** @file\r
+# Component description file for the entry point to a EFIDXE Drivers\r
+#\r
+# Library to abstract Framework extensions that conflict with UEFI 2.0 Specification\r
+#\r
+#  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\r
+#  (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.\r
+# Copyright (c) 2006, Intel Corporation.\r
+#\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = FrameworkUefiLib\r
+  FILE_GUID                      = B2F0D71A-A39F-4094-854B-0C6BA6910CCE\r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = UefiLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+  UefiLibPrint.c\r
+  UefiNotTiano.c\r
+  Console.c\r
+  UefiLib.c\r
+  UefiDriverModel.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+  PrintLib\r
+  PcdLib\r
+  MemoryAllocationLib\r
+  DebugLib\r
+  BaseMemoryLib\r
+  BaseLib\r
+  UefiBootServicesTableLib\r
+\r
+[Protocols]\r
+  gEfiDriverBindingProtocolGuid                 # ALWAYS_CONSUMED\r
+  gEfiComponentNameProtocolGuid                 # SOMETIMES_CONSUMED\r
+  gEfiComponentName2ProtocolGuid                # SOMETIMES_CONSUMED\r
+  gEfiDriverConfigurationProtocolGuid           # SOMETIMES_CONSUMED\r
+  gEfiDriverDiagnosticsProtocolGuid             # SOMETIMES_CONSUMED\r
+  gEfiDriverDiagnostics2ProtocolGuid            # SOMETIMES_CONSUMED\r
+  gEfiFirmwareVolume2ProtocolGuid               # ALWAYS_CONSUMED\r
+\r
+[Guids]\r
+  gEfiFrameworkDevicePathGuid                   # ALWAYS_CONSUMED\r
+  gEfiEventReadyToBootGuid                      # ALWAYS_CONSUMED\r
+  gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED\r
+\r
+\r
+[Pcd.common]\r
+  gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize\r
+\r
+[FeaturePcd.common]\r
+  gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable\r
+  gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable\r
+  gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable\r
+  gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.msa b/IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.msa
new file mode 100644 (file)
index 0000000..4986616
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>UefiLib</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>B2F0D71A-A39F-4094-854B-0C6BA6910CCE</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>\r
+    <Description>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.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>UefiLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>UefiLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PrintLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>UefiLib.c</Filename>\r
+    <Filename>Console.c</Filename>\r
+    <Filename>UefiNotTiano.c</Filename>\r
+    <Filename>UefiLibPrint.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiEventLegacyBootGuid</GuidCName>\r
+    </GuidCNames>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiEventReadyToBootGuid</GuidCName>\r
+    </GuidCNames>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiFrameworkDevicePathGuid</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdUefiLibMaxPrintBufferSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <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>\r
+    </PcdEntry>\r
+  </PcdCoded>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiDriverModel.c
new file mode 100644 (file)
index 0000000..c26599a
--- /dev/null
@@ -0,0 +1,667 @@
+/** @file\r
+  Library functions that abstract driver model protocols\r
+  installation.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR> All rights\r
+  reserved. This program and the accompanying materials are\r
+  licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+  \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/ \r
+\r
+#include "FrameworkUefiLib.h"\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol onto the driver's\r
+  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but\r
+  it can be different if the driver produces multiple DriverBinding Protocols. \r
+  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the installation fails, then ASSERT ().\r
+\r
+  @param  ImageHandle                 The image handle of the driver.\r
+  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
+  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
+  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
+                                      parameter is NULL, then a new handle is created.\r
+\r
+  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
+  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBinding (\r
+  IN CONST EFI_HANDLE             ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE       *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding,\r
+  IN EFI_HANDLE                   DriverBindingHandle\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  ASSERT (NULL != DriverBinding);\r
+\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &DriverBindingHandle,\r
+                  &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                  NULL\r
+                  );\r
+  //\r
+  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
+  //\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.  This is\r
+  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
+  DriverBinding Protocols. \r
+  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the installation fails, then ASSERT ().\r
+\r
+  @param  ImageHandle                 The image handle of the driver.\r
+  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
+  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
+  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
+                                      parameter is NULL, then a new handle is created.\r
+  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
+  @param  DriverConfiguration         A Driver Configuration Protocol instance that this driver is producing.\r
+  @param  DriverDiagnostics           A Driver Diagnostics Protocol instance that this driver is producing.\r
+\r
+  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
+  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols (\r
+  IN CONST EFI_HANDLE                         ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
+  IN EFI_HANDLE                               DriverBindingHandle,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics    OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  ASSERT (NULL != DriverBinding);\r
+\r
+  if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
+    if (DriverConfiguration == NULL) {\r
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                        NULL\r
+                        );\r
+      } else {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                        &gEfiComponentNameProtocolGuid, ComponentName,\r
+                        NULL\r
+                        );\r
+      }\r
+    } else {\r
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                        NULL\r
+                        );\r
+      } else {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
+                        &gEfiComponentNameProtocolGuid,       ComponentName,\r
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                        NULL\r
+                        );\r
+      }\r
+    }\r
+  } else {\r
+    if (DriverConfiguration == NULL) {\r
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
+                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                        NULL\r
+                        );\r
+      } else {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
+                        &gEfiComponentNameProtocolGuid,     ComponentName,\r
+                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                        NULL\r
+                        );\r
+      }\r
+    } else {\r
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+       Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
+                        NULL\r
+                        );\r
+      } else {\r
+        Status = gBS->InstallMultipleProtocolInterfaces (\r
+                        &DriverBindingHandle,\r
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
+                        &gEfiComponentNameProtocolGuid,       ComponentName,\r
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
+                        NULL\r
+                        );\r
+      }\r
+    }\r
+  }\r
+\r
+  //\r
+  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
+  //\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+  Component Name 2 onto the driver's DriverBindingHandle.  This is typically the same as the driver's\r
+  ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols. \r
+  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the installation fails, then ASSERT ().\r
+\r
+  @param  ImageHandle                 The image handle of the driver.\r
+  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
+  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
+  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
+                                      parameter is NULL, then a new handle is created.\r
+  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
+  @param  ComponentName2              A Component Name 2 Protocol instance that this driver is producing.\r
+\r
+  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
+  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBindingComponentName2 (\r
+  IN CONST EFI_HANDLE                         ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
+  IN EFI_HANDLE                               DriverBindingHandle,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2       OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  ASSERT (NULL != DriverBinding);\r
+\r
+  if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+    if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+      Status = gBS->InstallMultipleProtocolInterfaces (\r
+                      &DriverBindingHandle,\r
+                      &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                      NULL\r
+                      );\r
+      } else {\r
+      Status = gBS->InstallMultipleProtocolInterfaces (\r
+                      &DriverBindingHandle,\r
+                      &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                      &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                      NULL\r
+                      );\r
+     }\r
+  } else {\r
+     if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+       Status = gBS->InstallMultipleProtocolInterfaces (\r
+                       &DriverBindingHandle,\r
+                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                       &gEfiComponentNameProtocolGuid, ComponentName,\r
+                       NULL\r
+                       );\r
+     } else {\r
+       Status = gBS->InstallMultipleProtocolInterfaces (\r
+                       &DriverBindingHandle,\r
+                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                       &gEfiComponentNameProtocolGuid, ComponentName,\r
+                       &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                       NULL\r
+                       );\r
+    }\r
+  }\r
+  //\r
+  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
+  //\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+\r
+/**\r
+  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+  Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's\r
+  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but it can be different if\r
+  the driver produces multiple DriverBinding Protocols. \r
+  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+  If the installation fails, then ASSERT ().\r
+\r
+  @param  ImageHandle                 The image handle of the driver.\r
+  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
+  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
+  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
+                                      parameter is NULL, then a new handle is created.\r
+  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
+  @param  ComponentName2              A Component Name 2 Protocol instance that this driver is producing.\r
+  @param  DriverConfiguration         A Driver Configuration Protocol instance that this driver is producing.\r
+  @param  DriverDiagnostics           A Driver Diagnostics Protocol instance that this driver is producing.\r
+  @param  DriverDiagnostics2          A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
+\r
+  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
+  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols2 (\r
+  IN CONST EFI_HANDLE                         ImageHandle,\r
+  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
+  IN EFI_HANDLE                               DriverBindingHandle,\r
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2,      OPTIONAL\r
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics,   OPTIONAL\r
+  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2   OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  ASSERT (NULL != DriverBinding);\r
+\r
+  if (DriverConfiguration == NULL) {\r
+    if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
+      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      } else {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      }\r
+    } else {\r
+      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      } else {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      }\r
+    }\r
+  } else {\r
+    if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
+      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      } else {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      }\r
+    } else {\r
+      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      } else {\r
+        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        } else {\r
+          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          } else {\r
+            Status = gBS->InstallMultipleProtocolInterfaces (\r
+                            &DriverBindingHandle,\r
+                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
+                            &gEfiComponentNameProtocolGuid, ComponentName,\r
+                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
+                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
+                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
+                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
+                            NULL\r
+                            );\r
+          }\r
+        }\r
+      }\r
+    }\r
+  }\r
+\r
+  //\r
+  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
+  //\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
+  //\r
+  DriverBinding->ImageHandle         = ImageHandle;\r
+  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
+\r
+  return Status;\r
+}\r
+\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
new file mode 100644 (file)
index 0000000..af88f63
--- /dev/null
@@ -0,0 +1,813 @@
+/** @file\r
+  Mde UEFI library functions.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  UefiLib.c\r
+\r
+**/\r
+\r
+#include "FrameworkUefiLib.h"\r
+\r
+/**\r
+  Compare whether two names of languages are identical.\r
+\r
+  @param  Language1 Name of language 1.\r
+  @param  Language2 Name of language 2.\r
+\r
+  @retval TRUE      Language 1 and language 2 are the same.\r
+  @retval FALSE     Language 1 and language 2 are not the same.\r
+\r
+**/\r
+STATIC\r
+BOOLEAN\r
+CompareIso639LanguageCode (\r
+  IN CONST CHAR8  *Language1,\r
+  IN CONST CHAR8  *Language2\r
+  )\r
+{\r
+  UINT32  Name1;\r
+  UINT32  Name2;\r
+\r
+  Name1 = ReadUnaligned24 ((CONST UINT32 *) Language1);\r
+  Name2 = ReadUnaligned24 ((CONST UINT32 *) Language2);\r
+\r
+  return (BOOLEAN) (Name1 == Name2);\r
+}\r
+\r
+/**\r
+  This function searches the list of configuration tables stored in the EFI System\r
+  Table for a table with a GUID that matches TableGuid.  If a match is found,\r
+  then a pointer to the configuration table is returned in Table, and EFI_SUCCESS\r
+  is returned.  If a matching GUID is not found, then EFI_NOT_FOUND is returned.\r
+\r
+  @param  TableGuid       Pointer to table's GUID type..\r
+  @param  Table           Pointer to the table associated with TableGuid in the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS     A configuration table matching TableGuid was found.\r
+  @retval EFI_NOT_FOUND   A configuration table matching TableGuid could not be found.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiGetSystemConfigurationTable (\r
+  IN  EFI_GUID  *TableGuid,\r
+  OUT VOID      **Table\r
+  )\r
+{\r
+  EFI_SYSTEM_TABLE  *SystemTable;\r
+  UINTN             Index;\r
+\r
+  ASSERT (TableGuid != NULL);\r
+  ASSERT (Table != NULL);\r
+\r
+  SystemTable = gST;\r
+  *Table = NULL;\r
+  for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {\r
+    if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {\r
+      *Table = SystemTable->ConfigurationTable[Index].VendorTable;\r
+      return EFI_SUCCESS;\r
+    }\r
+  }\r
+\r
+  return EFI_NOT_FOUND;\r
+}\r
+\r
+/**\r
+  This function causes the notification function to be executed for every protocol\r
+  of type ProtocolGuid instance that exists in the system when this function is\r
+  invoked.  In addition, every time a protocol of type ProtocolGuid instance is\r
+  installed or reinstalled, the notification function is also executed.\r
+\r
+  @param  ProtocolGuid    Supplies GUID of the protocol upon whose installation the event is fired.\r
+  @param  NotifyTpl       Supplies the task priority level of the event notifications.\r
+  @param  NotifyFunction  Supplies the function to notify when the event is signaled.\r
+  @param  NotifyContext   The context parameter to pass to NotifyFunction.\r
+  @param  Registration    A pointer to a memory location to receive the registration value.\r
+\r
+  @return The notification event that was created.\r
+\r
+**/\r
+EFI_EVENT\r
+EFIAPI\r
+EfiCreateProtocolNotifyEvent(\r
+  IN  EFI_GUID          *ProtocolGuid,\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT VOID              **Registration\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_EVENT   Event;\r
+\r
+  //\r
+  // Create the event\r
+  //\r
+\r
+  Status = gBS->CreateEvent (\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  NotifyTpl,\r
+                  NotifyFunction,\r
+                  NotifyContext,\r
+                  &Event\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Register for protocol notifactions on this event\r
+  //\r
+\r
+  Status = gBS->RegisterProtocolNotify (\r
+                  ProtocolGuid,\r
+                  Event,\r
+                  Registration\r
+                  );\r
+\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Kick the event so we will perform an initial pass of\r
+  // current installed drivers\r
+  //\r
+\r
+  gBS->SignalEvent (Event);\r
+  return Event;\r
+}\r
+\r
+/**\r
+  This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r
+  This event is signaled with EfiNamedEventSignal().  This provide the ability for\r
+  one or more listeners on the same event named by the GUID specified by Name.\r
+\r
+  @param  Name                  Supplies GUID name of the event.\r
+  @param  NotifyTpl             Supplies the task priority level of the event notifications.\r
+  @param  NotifyFunction        Supplies the function to notify when the event is signaled.\r
+  @param  NotifyContext         The context parameter to pass to NotifyFunction.\r
+  @param  Registration          A pointer to a memory location to receive the registration value.\r
+\r
+  @retval EFI_SUCCESS           A named event was created.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to create the named event.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiNamedEventListen (\r
+  IN CONST EFI_GUID    *Name,\r
+  IN EFI_TPL           NotifyTpl,\r
+  IN EFI_EVENT_NOTIFY  NotifyFunction,\r
+  IN CONST VOID        *NotifyContext,  OPTIONAL\r
+  OUT VOID             *Registration OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_EVENT   Event;\r
+  VOID        *RegistrationLocal;\r
+\r
+  //\r
+  // Create event\r
+  //\r
+  Status = gBS->CreateEvent (\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  NotifyTpl,\r
+                  NotifyFunction,\r
+                  (VOID *) NotifyContext,\r
+                  &Event\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // The Registration is not optional to RegisterProtocolNotify().\r
+  // To make it optional to EfiNamedEventListen(), may need to substitute with a local.\r
+  //\r
+  if (Registration != NULL) {\r
+    RegistrationLocal = Registration;\r
+  } else {\r
+    RegistrationLocal = &RegistrationLocal;\r
+  }\r
+\r
+  //\r
+  // Register for an installation of protocol interface\r
+  //\r
+\r
+  Status = gBS->RegisterProtocolNotify (\r
+                  (EFI_GUID *) Name,\r
+                  Event,\r
+                  RegistrationLocal\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  This function signals the named event specified by Name.  The named event must\r
+  have been created with EfiNamedEventListen().\r
+\r
+  @param  Name                  Supplies GUID name of the event.\r
+\r
+  @retval EFI_SUCCESS           A named event was signaled.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to signal the named event.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiNamedEventSignal (\r
+  IN CONST EFI_GUID  *Name\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  Handle;\r
+\r
+  Handle = NULL;\r
+  Status = gBS->InstallProtocolInterface (\r
+                  &Handle,\r
+                  (EFI_GUID *) Name,\r
+                  EFI_NATIVE_INTERFACE,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  Status = gBS->UninstallProtocolInterface (\r
+                  Handle,\r
+                  (EFI_GUID *) Name,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Returns the current TPL.\r
+\r
+  This function returns the current TPL.  There is no EFI service to directly\r
+  retrieve the current TPL. Instead, the RaiseTPL() function is used to raise\r
+  the TPL to TPL_HIGH_LEVEL.  This will return the current TPL.  The TPL level\r
+  can then immediately be restored back to the current TPL level with a call\r
+  to RestoreTPL().\r
+\r
+  @param  VOID\r
+\r
+  @retvale EFI_TPL              The current TPL.\r
+\r
+**/\r
+EFI_TPL\r
+EFIAPI\r
+EfiGetCurrentTpl (\r
+  VOID\r
+  )\r
+{\r
+  EFI_TPL Tpl;\r
+\r
+  Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
+  gBS->RestoreTPL (Tpl);\r
+\r
+  return Tpl;\r
+}\r
+\r
+\r
+/**\r
+  This function initializes a basic mutual exclusion lock to the released state\r
+  and returns the lock.  Each lock provides mutual exclusion access at its task\r
+  priority level.  Since there is no preemption or multiprocessor support in EFI,\r
+  acquiring the lock only consists of raising to the locks TPL.\r
+\r
+  @param  Lock       A pointer to the lock data structure to initialize.\r
+  @param  Priority   EFI TPL associated with the lock.\r
+\r
+  @return The lock.\r
+\r
+**/\r
+EFI_LOCK *\r
+EFIAPI\r
+EfiInitializeLock (\r
+  IN OUT EFI_LOCK  *Lock,\r
+  IN EFI_TPL        Priority\r
+  )\r
+{\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Priority <= TPL_HIGH_LEVEL);\r
+\r
+  Lock->Tpl       = Priority;\r
+  Lock->OwnerTpl  = TPL_APPLICATION;\r
+  Lock->Lock      = EfiLockReleased ;\r
+  return Lock;\r
+}\r
+\r
+/**\r
+  This function raises the system's current task priority level to the task\r
+  priority level of the mutual exclusion lock.  Then, it places the lock in the\r
+  acquired state.\r
+\r
+  @param  Priority  The task priority level of the lock.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiAcquireLock (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock == EfiLockReleased);\r
+\r
+  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
+  Lock->Lock     = EfiLockAcquired;\r
+}\r
+\r
+/**\r
+  This function raises the system's current task priority level to the task\r
+  priority level of the mutual exclusion lock.  Then, it attempts to place the\r
+  lock in the acquired state.\r
+\r
+  @param  Lock              A pointer to the lock to acquire.\r
+\r
+  @retval EFI_SUCCESS       The lock was acquired.\r
+  @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiAcquireLockOrFail (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock != EfiLockUninitialized);\r
+\r
+  if (Lock->Lock == EfiLockAcquired) {\r
+    //\r
+    // Lock is already owned, so bail out\r
+    //\r
+    return EFI_ACCESS_DENIED;\r
+  }\r
+\r
+  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
+\r
+  Lock->Lock = EfiLockAcquired;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  This function transitions a mutual exclusion lock from the acquired state to\r
+  the released state, and restores the system's task priority level to its\r
+  previous level.\r
+\r
+  @param  Lock  A pointer to the lock to release.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiReleaseLock (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+  EFI_TPL Tpl;\r
+\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock == EfiLockAcquired);\r
+\r
+  Tpl = Lock->OwnerTpl;\r
+\r
+  Lock->Lock = EfiLockReleased;\r
+\r
+  gBS->RestoreTPL (Tpl);\r
+}\r
+\r
+/**\r
+  Tests whether a controller handle is being managed by a specific driver.\r
+\r
+  This function tests whether the driver specified by DriverBindingHandle is\r
+  currently managing the controller specified by ControllerHandle.  This test\r
+  is performed by evaluating if the the protocol specified by ProtocolGuid is\r
+  present on ControllerHandle and is was opened by DriverBindingHandle with an\r
+  attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+\r
+  @param  ControllerHandle     A handle for a controller to test.\r
+  @param  DriverBindingHandle  Specifies the driver binding handle for the\r
+                               driver.\r
+  @param  ProtocolGuid         Specifies the protocol that the driver specified\r
+                               by DriverBindingHandle opens in its Start()\r
+                               function.\r
+\r
+  @retval EFI_SUCCESS          ControllerHandle is managed by the driver\r
+                               specifed by DriverBindingHandle.\r
+  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the driver\r
+                               specifed by DriverBindingHandle.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestManagedDevice (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       DriverBindingHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  )\r
+{\r
+  EFI_STATUS     Status;\r
+  VOID           *ManagedInterface;\r
+\r
+  ASSERT (ProtocolGuid != NULL);\r
+\r
+  Status = gBS->OpenProtocol (\r
+                  ControllerHandle,\r
+                  (EFI_GUID *) ProtocolGuid,\r
+                  &ManagedInterface,\r
+                  DriverBindingHandle,\r
+                  ControllerHandle,\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                  );\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->CloseProtocol (\r
+           ControllerHandle,\r
+           (EFI_GUID *) ProtocolGuid,\r
+           DriverBindingHandle,\r
+           ControllerHandle\r
+           );\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  if (Status != EFI_ALREADY_STARTED) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Tests whether a child handle is a child device of the controller.\r
+\r
+  This function tests whether ChildHandle is one of the children of\r
+  ControllerHandle.  This test is performed by checking to see if the protocol\r
+  specified by ProtocolGuid is present on ControllerHandle and opened by\r
+  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+\r
+  @param  ControllerHandle     A handle for a (parent) controller to test.\r
+  @param  ChildHandle          A child handle to test.\r
+  @param  ConsumsedGuid        Supplies the protocol that the child controller\r
+                               opens on its parent controller.\r
+\r
+  @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.\r
+  @retval EFI_UNSUPPORTED      ChildHandle is not a child of the\r
+                               ControllerHandle.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestChildHandle (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       ChildHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  )\r
+{\r
+  EFI_STATUS                            Status;\r
+  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY   *OpenInfoBuffer;\r
+  UINTN                                 EntryCount;\r
+  UINTN                                 Index;\r
+\r
+  ASSERT (ProtocolGuid != NULL);\r
+\r
+  //\r
+  // Retrieve the list of agents that are consuming the specific protocol\r
+  // on ControllerHandle.\r
+  //\r
+  Status = gBS->OpenProtocolInformation (\r
+                  ControllerHandle,\r
+                  (EFI_GUID *) ProtocolGuid,\r
+                  &OpenInfoBuffer,\r
+                  &EntryCount\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Inspect if ChildHandle is one of the agents.\r
+  //\r
+  Status = EFI_UNSUPPORTED;\r
+  for (Index = 0; Index < EntryCount; Index++) {\r
+    if ((OpenInfoBuffer[Index].ControllerHandle == ChildHandle) &&\r
+        (OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+      Status = EFI_SUCCESS;\r
+      break;\r
+    }\r
+  }\r
+\r
+  FreePool (OpenInfoBuffer);\r
+  return Status;\r
+}\r
+\r
+/**\r
+  This function looks up a Unicode string in UnicodeStringTable.  If Language is\r
+  a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r
+  that matches the language code specified by Language, then it is returned in\r
+  UnicodeString.\r
+\r
+  @param  Language                A pointer to the ISO 639-2 language code for the\r
+                                  Unicode string to look up and return.\r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.  Language\r
+                                  must be a member of this set.\r
+  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
+  @param  UnicodeString           A pointer to the Unicode string from UnicodeStringTable\r
+                                  that matches the language specified by Language.\r
+\r
+  @retval  EFI_SUCCESS            The Unicode string that matches the language\r
+                                  specified by Language was found\r
+                                  in the table of Unicoide strings UnicodeStringTable,\r
+                                  and it was returned in UnicodeString.\r
+  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
+  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
+  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not a\r
+                                  member of SupportedLanguages.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not\r
+                                  supported by UnicodeStringTable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LookupUnicodeString (\r
+  IN CONST CHAR8                     *Language,\r
+  IN CONST CHAR8                     *SupportedLanguages,\r
+  IN CONST EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,\r
+  OUT CHAR16                         **UnicodeString\r
+  )\r
+{\r
+  //\r
+  // Make sure the parameters are valid\r
+  //\r
+  if (Language == NULL || UnicodeString == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // If there are no supported languages, or the Unicode String Table is empty, then the\r
+  // Unicode String specified by Language is not supported by this Unicode String Table\r
+  //\r
+  if (SupportedLanguages == NULL || UnicodeStringTable == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Make sure Language is in the set of Supported Languages\r
+  //\r
+  while (*SupportedLanguages != 0) {\r
+    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
+\r
+      //\r
+      // Search the Unicode String Table for the matching Language specifier\r
+      //\r
+      while (UnicodeStringTable->Language != NULL) {\r
+        if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {\r
+\r
+          //\r
+          // A matching string was found, so return it\r
+          //\r
+          *UnicodeString = UnicodeStringTable->UnicodeString;\r
+          return EFI_SUCCESS;\r
+        }\r
+\r
+        UnicodeStringTable++;\r
+      }\r
+\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+\r
+    SupportedLanguages += 3;\r
+  }\r
+\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  This function adds a Unicode string to UnicodeStringTable.\r
+  If Language is a member of SupportedLanguages then UnicodeString is added to\r
+  UnicodeStringTable.  New buffers are allocated for both Language and\r
+  UnicodeString.  The contents of Language and UnicodeString are copied into\r
+  these new buffers.  These buffers are automatically freed when\r
+  FreeUnicodeStringTable() is called.\r
+\r
+  @param  Language                A pointer to the ISO 639-2 language code for the Unicode\r
+                                  string to add.\r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.\r
+                                  Language must be a member of this set.\r
+  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
+  @param  UnicodeString           A pointer to the Unicode string to add.\r
+\r
+  @retval EFI_SUCCESS             The Unicode string that matches the language\r
+                                  specified by Language was found in the table of\r
+                                  Unicode strings UnicodeStringTable, and it was\r
+                                  returned in UnicodeString.\r
+  @retval EFI_INVALID_PARAMETER   Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
+  @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
+  @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
+  @retval EFI_ALREADY_STARTED     A Unicode string with language Language is\r
+                                  already present in UnicodeStringTable.\r
+  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to add another\r
+                                  Unicode string to UnicodeStringTable.\r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not a\r
+                                  member of SupportedLanguages.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddUnicodeString (\r
+  IN CONST CHAR8               *Language,\r
+  IN CONST CHAR8               *SupportedLanguages,\r
+  IN EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
+  IN CONST CHAR16              *UnicodeString\r
+  )\r
+{\r
+  UINTN                     NumberOfEntries;\r
+  EFI_UNICODE_STRING_TABLE  *OldUnicodeStringTable;\r
+  EFI_UNICODE_STRING_TABLE  *NewUnicodeStringTable;\r
+  UINTN                     UnicodeStringLength;\r
+\r
+  //\r
+  // Make sure the parameter are valid\r
+  //\r
+  if (Language == NULL || UnicodeString == NULL || UnicodeStringTable == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // If there are no supported languages, then a Unicode String can not be added\r
+  //\r
+  if (SupportedLanguages == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // If the Unicode String is empty, then a Unicode String can not be added\r
+  //\r
+  if (UnicodeString[0] == 0) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Make sure Language is a member of SupportedLanguages\r
+  //\r
+  while (*SupportedLanguages != 0) {\r
+    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
+\r
+      //\r
+      // Determine the size of the Unicode String Table by looking for a NULL Language entry\r
+      //\r
+      NumberOfEntries = 0;\r
+      if (*UnicodeStringTable != NULL) {\r
+        OldUnicodeStringTable = *UnicodeStringTable;\r
+        while (OldUnicodeStringTable->Language != NULL) {\r
+          if (CompareIso639LanguageCode (Language, OldUnicodeStringTable->Language)) {\r
+            return EFI_ALREADY_STARTED;\r
+          }\r
+\r
+          OldUnicodeStringTable++;\r
+          NumberOfEntries++;\r
+        }\r
+      }\r
+\r
+      //\r
+      // Allocate space for a new Unicode String Table.  It must hold the current number of\r
+      // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table\r
+      // marker\r
+      //\r
+      NewUnicodeStringTable = AllocatePool ((NumberOfEntries + 2) * sizeof (EFI_UNICODE_STRING_TABLE));\r
+      if (NewUnicodeStringTable == NULL) {\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // If the current Unicode String Table contains any entries, then copy them to the\r
+      // newly allocated Unicode String Table.\r
+      //\r
+      if (*UnicodeStringTable != NULL) {\r
+        CopyMem (\r
+           NewUnicodeStringTable,\r
+           *UnicodeStringTable,\r
+           NumberOfEntries * sizeof (EFI_UNICODE_STRING_TABLE)\r
+           );\r
+      }\r
+\r
+      //\r
+      // Allocate space for a copy of the Language specifier\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language);\r
+      if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {\r
+        gBS->FreePool (NewUnicodeStringTable);\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // Compute the length of the Unicode String\r
+      //\r
+      for (UnicodeStringLength = 0; UnicodeString[UnicodeStringLength] != 0; UnicodeStringLength++)\r
+        ;\r
+\r
+      //\r
+      // Allocate space for a copy of the Unicode String\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries].UnicodeString = AllocateCopyPool (\r
+                                                              (UnicodeStringLength + 1) * sizeof (CHAR16),\r
+                                                              UnicodeString\r
+                                                              );\r
+      if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) {\r
+        gBS->FreePool (NewUnicodeStringTable[NumberOfEntries].Language);\r
+        gBS->FreePool (NewUnicodeStringTable);\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // Mark the end of the Unicode String Table\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries + 1].Language       = NULL;\r
+      NewUnicodeStringTable[NumberOfEntries + 1].UnicodeString  = NULL;\r
+\r
+      //\r
+      // Free the old Unicode String Table\r
+      //\r
+      if (*UnicodeStringTable != NULL) {\r
+        gBS->FreePool (*UnicodeStringTable);\r
+      }\r
+\r
+      //\r
+      // Point UnicodeStringTable at the newly allocated Unicode String Table\r
+      //\r
+      *UnicodeStringTable = NewUnicodeStringTable;\r
+\r
+      return EFI_SUCCESS;\r
+    }\r
+\r
+    SupportedLanguages += 3;\r
+  }\r
+\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  This function frees the table of Unicode strings in UnicodeStringTable.\r
+  If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
+  Otherwise, each language code, and each Unicode string in the Unicode string\r
+  table are freed, and EFI_SUCCESS is returned.\r
+\r
+  @param  UnicodeStringTable  A pointer to the table of Unicode strings.\r
+\r
+  @retval EFI_SUCCESS         The Unicode string table was freed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FreeUnicodeStringTable (\r
+  IN EFI_UNICODE_STRING_TABLE  *UnicodeStringTable\r
+  )\r
+{\r
+  UINTN Index;\r
+\r
+  //\r
+  // If the Unicode String Table is NULL, then it is already freed\r
+  //\r
+  if (UnicodeStringTable == NULL) {\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
+  //\r
+  // Loop through the Unicode String Table until we reach the end of table marker\r
+  //\r
+  for (Index = 0; UnicodeStringTable[Index].Language != NULL; Index++) {\r
+\r
+    //\r
+    // Free the Language string from the Unicode String Table\r
+    //\r
+    gBS->FreePool (UnicodeStringTable[Index].Language);\r
+\r
+    //\r
+    // Free the Unicode String from the Unicode String Table\r
+    //\r
+    if (UnicodeStringTable[Index].UnicodeString != NULL) {\r
+      gBS->FreePool (UnicodeStringTable[Index].UnicodeString);\r
+    }\r
+  }\r
+\r
+  //\r
+  // Free the Unicode String Table itself\r
+  //\r
+  gBS->FreePool (UnicodeStringTable);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c
new file mode 100644 (file)
index 0000000..7bc5f8a
--- /dev/null
@@ -0,0 +1,261 @@
+/** @file\r
+  Mde UEFI library API implemention.\r
+  Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "FrameworkUefiLib.h"\r
+\r
+/**\r
+  Internal function which prints a formatted Unicode string to the console output device\r
+  specified by Console\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by Console and returns the number of Unicode characters that printed\r
+  to it.  If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,\r
+  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param Console  The output console.\r
+  @param Marker   VA_LIST marker for the variable argument list.\r
+\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+\r
+STATIC\r
+UINTN\r
+InternalPrint (\r
+  IN  CONST CHAR16                     *Format,\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Console,\r
+  IN  VA_LIST                          Marker\r
+  )\r
+{\r
+  UINTN   Return;\r
+  CHAR16  *Buffer;\r
+  UINTN   BufferSize;\r
+\r
+  ASSERT (Format != NULL);\r
+  ASSERT (((UINTN) Format & 0x01) == 0);\r
+\r
+  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
+\r
+  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
+  ASSERT (Buffer != NULL);\r
+\r
+  Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);\r
+\r
+  if (Console != NULL) {\r
+    //\r
+    // To be extra safe make sure Console has been initialized\r
+    //\r
+    Console->OutputString (Console, Buffer);\r
+  }\r
+\r
+  FreePool (Buffer);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to ConOut.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+Print (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = InternalPrint (Format, gST->ConOut, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to StdErr.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+\r
+UINTN\r
+EFIAPI\r
+ErrorPrint (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = InternalPrint( Format, gST->StdErr, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+\r
+/**\r
+  Internal function which prints a formatted ASCII string to the console output device\r
+  specified by Console\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by Console and returns the number of ASCII characters that printed\r
+  to it.  If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,\r
+  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param Console  The output console.\r
+  @param Marker   VA_LIST marker for the variable argument list.\r
+\r
+  If Format is NULL, then ASSERT().\r
+\r
+**/\r
+\r
+STATIC\r
+UINTN\r
+AsciiInternalPrint (\r
+  IN  CONST CHAR8                      *Format,\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Console,\r
+  IN  VA_LIST                          Marker\r
+  )\r
+{\r
+  UINTN   Return;\r
+  CHAR16  *Buffer;\r
+  UINTN   BufferSize;\r
+\r
+  ASSERT (Format != NULL);\r
+\r
+  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
+\r
+  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
+  ASSERT (Buffer != NULL);\r
+\r
+  Return = UnicodeVSPrintAsciiFormat (Buffer, BufferSize, Format, Marker);\r
+\r
+  if (Console != NULL) {\r
+    //\r
+    // To be extra safe make sure Console has been initialized\r
+    //\r
+    Console->OutputString (Console, Buffer);\r
+  }\r
+\r
+  FreePool (Buffer);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to ConOut.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to StdErr.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiErrorPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiNotTiano.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiNotTiano.c
new file mode 100644 (file)
index 0000000..f08b1ee
--- /dev/null
@@ -0,0 +1,360 @@
+/** @file\r
+  Library functions that abstract areas of conflict between Tiano an UEFI 2.1.\r
+\r
+  Help Port Framework/Tinao code that has conflicts with UEFI 2.1 by hiding the\r
+  oldconflicts with library functions and supporting implementations of the old\r
+  (EDK/EFI 1.10) and new (EDK II/UEFI 2.1) way. This module is a DXE driver as\r
+  it contains DXE enum extensions for EFI event services.\r
+\r
+Copyright (c) 2007, Intel Corporation<BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "FrameworkUefiLib.h"\r
+\r
+/**\r
+  An empty function to pass error checking of CreateEventEx ().\r
+\r
+  This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error\r
+  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+EFIAPI\r
+InternalEmptyFuntion (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+  return;\r
+}\r
+\r
+/**\r
+  Create a Legacy Boot Event.\r
+\r
+  Tiano extended the CreateEvent Type enum to add a legacy boot event type.\r
+  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
+  added and now it's possible to not voilate the UEFI specification by\r
+  declaring a GUID for the legacy boot event class. This library supports\r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
+  work both ways.\r
+\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventLegacyBoot (\r
+  OUT EFI_EVENT  *LegacyBootEvent\r
+  )\r
+{\r
+  return EfiCreateEventLegacyBootEx (\r
+           TPL_CALLBACK,\r
+           InternalEmptyFuntion,\r
+           NULL,\r
+           LegacyBootEvent\r
+           );\r
+}\r
+\r
+/**\r
+  Create an EFI event in the Legacy Boot Event Group and allows\r
+  the caller to specify a notification function.\r
+\r
+  This function abstracts the creation of the Legacy Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If LegacyBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventLegacyBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *LegacyBootEvent\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+\r
+  ASSERT (LegacyBootEvent != NULL);\r
+\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+    //\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
+    //\r
+    Status = gBS->CreateEvent (\r
+                    EFI_EVENT_SIGNAL_LEGACY_BOOT | EVT_NOTIFY_SIGNAL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    LegacyBootEvent\r
+                    );\r
+  } else {\r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventLegacyBootGuid,\r
+                    LegacyBootEvent\r
+                    );\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+/**\r
+  Create a Read to Boot Event.\r
+\r
+  Tiano extended the CreateEvent Type enum to add a ready to boot event type.\r
+  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
+  added and now it's possible to not voilate the UEFI specification and use\r
+  the ready to boot event class defined in UEFI 2.0. This library supports\r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
+  work both ways.\r
+\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventReadyToBoot (\r
+  OUT EFI_EVENT  *ReadyToBootEvent\r
+  )\r
+{\r
+  return EfiCreateEventReadyToBootEx (\r
+           TPL_CALLBACK,\r
+           InternalEmptyFuntion,\r
+           NULL,\r
+           ReadyToBootEvent\r
+           );\r
+}\r
+\r
+/**\r
+  Create an EFI event in the Ready To Boot Event Group and allows\r
+  the caller to specify a notification function.\r
+\r
+  This function abstracts the creation of the Ready to Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If ReadyToBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventReadyToBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *ReadyToBootEvent\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+\r
+  ASSERT (ReadyToBootEvent != NULL);\r
+\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+    //\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
+    //\r
+    Status = gBS->CreateEvent (\r
+                    EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    ReadyToBootEvent\r
+                    );\r
+  } else {\r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventReadyToBootGuid,\r
+                    ReadyToBootEvent\r
+                    );\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+/**\r
+  Signal a Ready to Boot Event.\r
+\r
+  Create a Ready to Boot Event. Signal it and close it. This causes other\r
+  events of the same event group to be signaled in other modules.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiSignalEventReadyToBoot (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+  EFI_EVENT     ReadyToBootEvent;\r
+\r
+  Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent);\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->SignalEvent (ReadyToBootEvent);\r
+    gBS->CloseEvent (ReadyToBootEvent);\r
+  }\r
+}\r
+\r
+/**\r
+  Signal a Legacy Boot Event.\r
+\r
+  Create a legacy Boot Event. Signal it and close it. This causes other\r
+  events of the same event group to be signaled in other modules.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiSignalEventLegacyBoot (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+  EFI_EVENT     LegacyBootEvent;\r
+\r
+  Status = EfiCreateEventLegacyBoot (&LegacyBootEvent);\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->SignalEvent (LegacyBootEvent);\r
+    gBS->CloseEvent (LegacyBootEvent);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  Check to see if the Firmware Volume (FV) Media Device Path is valid\r
+\r
+  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
+  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
+  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
+  device path is defined for Tiano extensions of device path. If the code\r
+  is compiled to conform with the UEFI 2.0 specification use the new device path\r
+  else use the old form for backwards compatability. The return value to this\r
+  function points to a location in FvDevicePathNode and it does not allocate\r
+  new memory for the GUID pointer that is returned.\r
+\r
+  @param  FvDevicePathNode  Pointer to FV device path to check.\r
+\r
+  @retval NULL              FvDevicePathNode is not valid.\r
+  @retval Other             FvDevicePathNode is valid and pointer to NameGuid was returned.\r
+\r
+**/\r
+EFI_GUID *\r
+EFIAPI\r
+EfiGetNameGuidFromFwVolDevicePathNode (\r
+  IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
+  )\r
+{\r
+  FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FrameworkFvDevicePathNode;\r
+\r
+  ASSERT (FvDevicePathNode != NULL);\r
+\r
+  FrameworkFvDevicePathNode = (FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *) FvDevicePathNode;\r
+  //\r
+  // Use the new Device path that does not conflict with the UEFI\r
+  //\r
+  if (DevicePathType (&FrameworkFvDevicePathNode->Tiano.Header) == MEDIA_DEVICE_PATH &&\r
+      DevicePathSubType (&FrameworkFvDevicePathNode->Tiano.Header) == MEDIA_VENDOR_DP) {\r
+    if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FrameworkFvDevicePathNode->Tiano.TianoSpecificDevicePath)) {\r
+      if (FrameworkFvDevicePathNode->Tiano.Type == TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) {\r
+        return (EFI_GUID *) &FrameworkFvDevicePathNode->NameGuid;\r
+      }\r
+    }\r
+  }\r
+\r
+  return NULL;\r
+}\r
+\r
+\r
+/**\r
+  Initialize a Firmware Volume (FV) Media Device Path node.\r
+\r
+  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
+  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
+  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
+  device path is defined for Tiano extensions of device path. If the code\r
+  is compiled to conform with the UEFI 2.0 specification use the new device path\r
+  else use the old form for backwards compatability.\r
+\r
+  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
+  @param  NameGuid          FV file name to use in FvDevicePathNode\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiInitializeFwVolDevicepathNode (\r
+  IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode,\r
+  IN CONST EFI_GUID                         *NameGuid\r
+  )\r
+{\r
+  FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FrameworkFvDevicePathNode;\r
+\r
+  ASSERT (FvDevicePathNode  != NULL);\r
+  ASSERT (NameGuid          != NULL);\r
+\r
+  FrameworkFvDevicePathNode = (FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *) FvDevicePathNode;\r
+\r
+  //\r
+  // Use the new Device path that does not conflict with the UEFI\r
+  //\r
+  FrameworkFvDevicePathNode->Tiano.Header.Type     = MEDIA_DEVICE_PATH;\r
+  FrameworkFvDevicePathNode->Tiano.Header.SubType  = MEDIA_VENDOR_DP;\r
+  SetDevicePathNodeLength (&FrameworkFvDevicePathNode->Tiano.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
+\r
+  //\r
+  // Add the GUID for generic Tiano device paths\r
+  //\r
+  CopyGuid (&FrameworkFvDevicePathNode->Tiano.TianoSpecificDevicePath, &gEfiFrameworkDevicePathGuid);\r
+\r
+  //\r
+  // Add in the FW Vol File Path Tiano defined information\r
+  //\r
+  FrameworkFvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;\r
+\r
+  CopyGuid (&FrameworkFvDevicePathNode->NameGuid, NameGuid);\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.c b/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.c
deleted file mode 100644 (file)
index 354215a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file\r
-  HII Library implementation that uses DXE protocols and services.\r
-\r
-  Copyright (c) 2006, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  HiiLib.c\r
-\r
-**/\r
-\r
-\r
-#include <FrameworkDxe.h>\r
-\r
-\r
-#include <Library/HiiLibFramework.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
-/**\r
-  This function allocates pool for an EFI_HII_PACKAGES structure\r
-  with enough space for the variable argument list of package pointers.\r
-  The allocated structure is initialized using NumberOfPackages, Guid,\r
-  and the variable length argument list of package pointers.\r
-\r
-  @param  NumberOfPackages The number of HII packages to prepare.\r
-  @param  Guid Package GUID.\r
-\r
-  @return The allocated and initialized packages.\r
-\r
-**/\r
-EFI_HII_PACKAGES *\r
-EFIAPI\r
-PreparePackages (\r
-  IN UINTN           NumberOfPackages,\r
-  IN CONST EFI_GUID  *Guid OPTIONAL,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST           Args;\r
-  EFI_HII_PACKAGES  *HiiPackages;\r
-  VOID              **Package;\r
-  UINTN             Index;\r
-\r
-  ASSERT (NumberOfPackages > 0);\r
-\r
-  HiiPackages                   = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));\r
-  ASSERT (HiiPackages != NULL);\r
-\r
-  HiiPackages->GuidId           = (EFI_GUID *) Guid;\r
-  HiiPackages->NumberOfPackages = NumberOfPackages;\r
-  Package                       = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));\r
-\r
-  VA_START (Args, Guid);\r
-\r
-  for (Index = 0; Index < NumberOfPackages; Index++) {\r
-    *Package = VA_ARG (Args, VOID *);\r
-    Package++;\r
-  }\r
-\r
-  VA_END (Args);\r
-\r
-  return HiiPackages;\r
-\r
-}\r
diff --git a/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf b/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf
deleted file mode 100644 (file)
index 6a96b50..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#/** @file\r
-# Library instance for HII common routines.\r
-#\r
-# This library instance implements the common HII routines.\r
-# Copyright (c) 2006, Intel Corporation\r
-#\r
-#  All rights reserved. This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = HiiLibFramework\r
-  FILE_GUID                      = 1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = HiiLibFramework|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
-  EDK_RELEASE_VERSION            = 0x00020000\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
-  HiiLib.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-\r
-[LibraryClasses]\r
-  MemoryAllocationLib\r
-  DebugLib\r
-\r
diff --git a/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.msa b/IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.msa
deleted file mode 100644 (file)
index 67e1f0d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-  <MsaHeader>\r
-    <ModuleName>HiiLibFramework</ModuleName>\r
-    <ModuleType>DXE_DRIVER</ModuleType>\r
-    <GuidValue>1e2c4c2e-67e6-4e57-b3ae-cf5a5af72c2c</GuidValue>\r
-    <Version>1.0</Version>\r
-    <Abstract>Library instance for HII common routines.</Abstract>\r
-    <Description>This library instance implements the common HII routines.</Description>\r
-    <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
-    <License>All rights reserved. This program and the accompanying materials
-      are licensed and made available under the terms and conditions of the BSD License
-      which accompanies this distribution.  The full text of the license may be found at
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
-    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
-  </MsaHeader>\r
-  <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
-    <BinaryModule>false</BinaryModule>\r
-    <OutputFileBasename>HiiLibFramework</OutputFileBasename>\r
-  </ModuleDefinitions>\r
-  <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
-      <Keyword>HiiLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>DebugLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>MemoryAllocationLib</Keyword>\r
-    </LibraryClass>\r
-  </LibraryClassDefinitions>\r
-  <SourceFiles>\r
-    <Filename>HiiLib.c</Filename>\r
-  </SourceFiles>\r
-  <PackageDependencies>\r
-    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
-  </PackageDependencies>\r
-  <Externs>\r
-    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
-    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
-  </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrCommon.c b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrCommon.c
deleted file mode 100644 (file)
index d9894c4..0000000
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*++\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php                                            \r
-        \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-Module Name:\r
-  IfrCommon.c\r
-\r
-Abstract:\r
-\r
-  Common Library Routines to assist in IFR creation on-the-fly\r
-\r
-Revision History:\r
-\r
---*/\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "IfrSupportLibInternal.h"\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-IfrLibConstruct (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\r
-  )\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-GetCurrentLanguage (\r
-  OUT     CHAR16              *Lang\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Determine what is the current language setting\r
-\r
-Arguments:\r
-\r
-  Lang      - Pointer of system language\r
-\r
-Returns:\r
-\r
-  Status code\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  UINTN       Size;\r
-  UINTN       Index;\r
-  CHAR8       Language[4];\r
-\r
-  //\r
-  // Getting the system language and placing it into our Global Data\r
-  //\r
-  Size = sizeof (Language);\r
-\r
-  Status = gRT->GetVariable (\r
-                  (CHAR16 *) L"Lang",\r
-                  &gEfiGlobalVariableGuid,\r
-                  NULL,\r
-                  &Size,\r
-                  Language\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    AsciiStrCpy (Language, "eng");\r
-  }\r
-\r
-  for (Index = 0; Index < 3; Index++) {\r
-    //\r
-    // Bitwise AND ascii value with 0xDF yields an uppercase value.\r
-    // Sign extend into a unicode value\r
-    //\r
-    Lang[Index] = (CHAR16) (Language[Index] & 0xDF);\r
-  }\r
-\r
-  //\r
-  // Null-terminate the value\r
-  //\r
-  Lang[3] = (CHAR16) 0;\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-AddString (\r
-  IN      VOID                *StringBuffer,\r
-  IN      CHAR16              *Language,\r
-  IN      CHAR16              *String,\r
-  IN OUT  STRING_REF          *StringToken\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add a string to the incoming buffer and return the token and offset data\r
-\r
-Arguments:\r
-\r
-  StringBuffer      - The incoming buffer\r
-\r
-  Language          - Currrent language\r
-\r
-  String            - The string to be added\r
-\r
-  StringToken       - The index where the string placed\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS             - String successfully added to the incoming buffer\r
-\r
---*/\r
-{\r
-  EFI_HII_STRING_PACK *StringPack;\r
-  EFI_HII_STRING_PACK *StringPackBuffer;\r
-  VOID                *NewBuffer;\r
-  RELOFST             *PackSource;\r
-  RELOFST             *PackDestination;\r
-  UINT8               *Source;\r
-  UINT8               *Destination;\r
-  UINTN               Index;\r
-  BOOLEAN             Finished;\r
-  UINTN               SizeofLanguage;\r
-  UINTN               SizeofString;\r
-\r
-  StringPack  = (EFI_HII_STRING_PACK *) StringBuffer;\r
-  Finished    = FALSE;\r
-\r
-  //\r
-  // Pre-allocate a buffer sufficient for us to work on.\r
-  // We will use it as a destination scratch pad to build data on\r
-  // and when complete shift the data back to the original buffer\r
-  //\r
-  NewBuffer = AllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);\r
-  if (NewBuffer == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  StringPackBuffer = (EFI_HII_STRING_PACK *) NewBuffer;\r
-\r
-  //\r
-  // StringPack is terminated with a length 0 entry\r
-  //\r
-  for (; StringPack->Header.Length != 0;) {\r
-    //\r
-    // If this stringpack's language is same as CurrentLanguage, use it\r
-    //\r
-    if (CompareMem ((VOID *) ((CHAR8 *) (StringPack) + StringPack->LanguageNameString), Language, 3) == 0) {\r
-      //\r
-      // We have some data in this string pack, copy the string package up to the string data\r
-      //\r
-      CopyMem (&StringPackBuffer->Header, &StringPack->Header, sizeof (StringPack));\r
-\r
-      //\r
-      // These are references in the structure to tokens, need to increase them by the space occupied by an additional StringPointer\r
-      //\r
-      StringPackBuffer->LanguageNameString = (UINT16) (StringPackBuffer->LanguageNameString + (UINT16) sizeof (RELOFST));\r
-      StringPackBuffer->PrintableLanguageName = (UINT16) (StringPackBuffer->PrintableLanguageName + (UINT16) sizeof (RELOFST));\r
-\r
-      PackSource      = (RELOFST *) (StringPack + 1);\r
-      PackDestination = (RELOFST *) (StringPackBuffer + 1);\r
-      for (Index = 0; PackSource[Index] != 0x0000; Index++) {\r
-        //\r
-        // Copy the stringpointers from old to new buffer\r
-        // remember that we are adding a string, so the string offsets will all go up by sizeof (RELOFST)\r
-        //\r
-        PackDestination[Index] = (UINT16) (PackDestination[Index] + sizeof (RELOFST));\r
-      }\r
-\r
-      //\r
-      // Add a new stringpointer in the new buffer since we are adding a string.  Null terminate it\r
-      //\r
-      PackDestination[Index] = (UINT16)(PackDestination[Index-1] +\r
-                                        StrSize((CHAR16 *)((CHAR8 *)(StringPack) + PackSource[Index-1])));\r
-      PackDestination[Index + 1] = (UINT16) 0;\r
-\r
-      //\r
-      // Index is the token value for the new string\r
-      //\r
-      *StringToken = (UINT16) Index;\r
-\r
-      //\r
-      // Source now points to the beginning of the old buffer strings\r
-      // Destination now points to the beginning of the new buffer strings\r
-      //\r
-      Source      = (UINT8 *) &PackSource[Index + 1];\r
-      Destination = (UINT8 *) &PackDestination[Index + 2];\r
-\r
-      //\r
-      // This should copy all the strings from the old buffer to the new buffer\r
-      //\r
-      for (; Index != 0; Index--) {\r
-        //\r
-        // Copy Source string to destination buffer\r
-        //\r
-        StrCpy ((CHAR16 *) Destination, (CHAR16 *) Source);\r
-\r
-        //\r
-        // Adjust the source/destination to the next string location\r
-        //\r
-        Destination = Destination + StrSize ((CHAR16 *) Source);\r
-        Source      = Source + StrSize ((CHAR16 *) Source);\r
-      }\r
-\r
-      //\r
-      // This copies the new string to the destination buffer\r
-      //\r
-      StrCpy ((CHAR16 *) Destination, (CHAR16 *) String);\r
-\r
-      //\r
-      // Adjust the size of the changed string pack by adding the size of the new string\r
-      // along with the size of the additional offset entry for the new string\r
-      //\r
-      StringPackBuffer->Header.Length = (UINT32) ((UINTN) StringPackBuffer->Header.Length + StrSize (String) + sizeof (RELOFST));\r
-\r
-      //\r
-      // Advance the buffers to point to the next spots.\r
-      //\r
-      StringPackBuffer  = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPackBuffer->Header.Length);\r
-      StringPack        = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);\r
-      Finished          = TRUE;\r
-      continue;\r
-    }\r
-    //\r
-    // This isn't the language of the stringpack we were asked to add a string to\r
-    // so we need to copy it to the new buffer.\r
-    //\r
-    CopyMem (&StringPackBuffer->Header, &StringPack->Header, StringPack->Header.Length);\r
-\r
-    //\r
-    // Advance the buffers to point to the next spots.\r
-    //\r
-    StringPackBuffer  = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPack->Header.Length);\r
-    StringPack        = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);\r
-  }\r
-\r
-  //\r
-  // If we didn't copy the new data to a stringpack yet\r
-  //\r
-  if (!Finished) {\r
-    PackDestination = (RELOFST *) (StringPackBuffer + 1);\r
-    //\r
-    // Pointing to a new string pack location\r
-    //\r
-    SizeofLanguage = StrSize (Language);\r
-    SizeofString   = StrSize (String);\r
-    StringPackBuffer->Header.Length = (UINT32)\r
-      (\r
-        sizeof (EFI_HII_STRING_PACK) -\r
-        sizeof (EFI_STRING) +\r
-        sizeof (RELOFST) +\r
-        sizeof (RELOFST) +\r
-        SizeofLanguage +\r
-        SizeofString\r
-      );\r
-    StringPackBuffer->Header.Type           = EFI_HII_STRING;\r
-    StringPackBuffer->LanguageNameString    = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
-    StringPackBuffer->PrintableLanguageName = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
-    StringPackBuffer->Attributes            = 0;\r
-    PackDestination[0]                      = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);\r
-    PackDestination[1]                      = (UINT16) (PackDestination[0] + StrSize (Language));\r
-    PackDestination[2]                      = (UINT16) 0;\r
-\r
-    //\r
-    // The first string location will be set to destination.  The minimum number of strings\r
-    // associated with a stringpack will always be token 0 stored as the languagename (e.g. ENG, SPA, etc)\r
-    // and token 1 as the new string being added and and null entry for the stringpointers\r
-    //\r
-    Destination = (UINT8 *) &PackDestination[3];\r
-\r
-    //\r
-    // Copy the language name string to the new buffer\r
-    //\r
-    StrCpy ((CHAR16 *) Destination, Language);\r
-\r
-    //\r
-    // Advance the destination to the new empty spot\r
-    //\r
-    Destination = Destination + StrSize (Language);\r
-\r
-    //\r
-    // Copy the string to the new buffer\r
-    //\r
-    StrCpy ((CHAR16 *) Destination, String);\r
-\r
-    //\r
-    // Since we are starting with a new string pack - we know the new string is token 1\r
-    //\r
-    *StringToken = (UINT16) 1;\r
-  }\r
-\r
-  //\r
-  // Zero out the original buffer and copy the updated data in the new buffer to the old buffer\r
-  //\r
-  ZeroMem (StringBuffer, DEFAULT_STRING_BUFFER_SIZE);\r
-  CopyMem (StringBuffer, NewBuffer, DEFAULT_STRING_BUFFER_SIZE);\r
-\r
-  //\r
-  // Free the newly created buffer since we don't need it anymore\r
-  //\r
-  gBS->FreePool (NewBuffer);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-AddOpCode (\r
-  IN      VOID                *FormBuffer,\r
-  IN OUT  VOID                *OpCodeData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add op-code data to the FormBuffer\r
-\r
-Arguments:\r
-\r
-  FormBuffer      - Form buffer to be inserted to\r
-\r
-  OpCodeData      - Op-code data to be inserted\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS             - Op-code data successfully inserted\r
-\r
---*/\r
-{\r
-  EFI_HII_PACK_HEADER *NewBuffer;\r
-  UINT8               *Source;\r
-  UINT8               *Destination;\r
-\r
-  //\r
-  // Pre-allocate a buffer sufficient for us to work on.\r
-  // We will use it as a destination scratch pad to build data on\r
-  // and when complete shift the data back to the original buffer\r
-  //\r
-  NewBuffer = AllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);\r
-  if (NewBuffer == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  Source      = (UINT8 *) FormBuffer;\r
-  Destination = (UINT8 *) NewBuffer;\r
-\r
-  //\r
-  // Copy the IFR Package header to the new buffer\r
-  //\r
-  CopyMem (Destination, Source, sizeof (EFI_HII_PACK_HEADER));\r
-\r
-  //\r
-  // Advance Source and Destination to next op-code\r
-  //\r
-  Source      = Source + sizeof (EFI_HII_PACK_HEADER);\r
-  Destination = Destination + sizeof (EFI_HII_PACK_HEADER);\r
-\r
-  //\r
-  // Copy data to the new buffer until we run into the end_form\r
-  //\r
-  for (; ((EFI_IFR_OP_HEADER *) Source)->OpCode != EFI_IFR_END_FORM_OP;) {\r
-    //\r
-    // If the this opcode is an end_form_set we better be creating and endform\r
-    // Nonetheless, we will add data before the end_form_set.  This also provides\r
-    // for interesting behavior in the code we will run, but has no bad side-effects\r
-    // since we will possibly do a 0 byte copy in this particular end-case.\r
-    //\r
-    if (((EFI_IFR_OP_HEADER *) Source)->OpCode == EFI_IFR_END_FORM_SET_OP) {\r
-      break;\r
-    }\r
-\r
-    //\r
-    // Copy data to new buffer\r
-    //\r
-    CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
-\r
-    //\r
-    // Adjust Source/Destination to next op-code location\r
-    //\r
-    Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
-    Source      = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
-  }\r
-\r
-  //\r
-  // Prior to the end_form is where we insert the new op-code data\r
-  //\r
-  CopyMem (Destination, OpCodeData, ((EFI_IFR_OP_HEADER *) OpCodeData)->Length);\r
-  Destination       = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;\r
-\r
-  NewBuffer->Length = (UINT32) (NewBuffer->Length + (UINT32) (((EFI_IFR_OP_HEADER *) OpCodeData)->Length));\r
-\r
-  //\r
-  // Copy end-form data to new buffer\r
-  //\r
-  CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
-\r
-  //\r
-  // Adjust Source/Destination to next op-code location\r
-  //\r
-  Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
-  Source      = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;\r
-\r
-  //\r
-  // Copy end-formset data to new buffer\r
-  //\r
-  CopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);\r
-\r
-  //\r
-  // Zero out the original buffer and copy the updated data in the new buffer to the old buffer\r
-  //\r
-  ZeroMem (FormBuffer, DEFAULT_FORM_BUFFER_SIZE);\r
-  CopyMem (FormBuffer, NewBuffer, DEFAULT_FORM_BUFFER_SIZE);\r
-\r
-  //\r
-  // Free the newly created buffer since we don't need it anymore\r
-  //\r
-  gBS->FreePool (NewBuffer);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-STATIC\r
-EFI_STATUS\r
-GetHiiInterface (\r
-  OUT     EFI_HII_PROTOCOL    **Hii\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get the HII protocol interface\r
-\r
-Arguments:\r
-\r
-  Hii     - HII protocol interface\r
-\r
-Returns:\r
-\r
-  Status code\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  //\r
-  // There should only be one HII protocol\r
-  //\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiHiiProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) Hii\r
-                  );\r
-\r
-  return Status;;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-ExtractDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  IN OUT  UINT16              *ImageLength,\r
-  OUT     UINT8               *DefaultImage,\r
-  OUT     EFI_GUID            *Guid\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extract information pertaining to the HiiHandle\r
-\r
-Arguments:\r
-\r
-  HiiHandle       - Hii handle\r
-\r
-  ImageLength     - For input, length of DefaultImage;\r
-                    For output, length of actually required\r
-\r
-  DefaultImage    - Image buffer prepared by caller\r
-\r
-  Guid            - Guid information about the form\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-\r
-  EFI_BUFFER_TOO_SMALL    - DefualtImage has no enough ImageLength\r
-\r
-  EFI_SUCCESS             - Successfully extract data from Hii database.\r
-\r
-\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-  EFI_HII_PROTOCOL  *Hii;\r
-  UINTN             DataLength;\r
-  UINT8             *RawData;\r
-  UINT8             *OldData;\r
-  UINTN             Index;\r
-  UINTN             Temp;\r
-  UINTN             SizeOfNvStore;\r
-  UINTN             CachedStart;\r
-\r
-  DataLength    = DEFAULT_FORM_BUFFER_SIZE;\r
-  SizeOfNvStore = 0;\r
-  CachedStart   = 0;\r
-\r
-  Status        = GetHiiInterface (&Hii);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Allocate space for retrieval of IFR data\r
-  //\r
-  RawData = AllocateZeroPool (DataLength);\r
-  if (RawData == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Get all the forms associated with this HiiHandle\r
-  //\r
-  Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (RawData);\r
-\r
-    //\r
-    // Allocate space for retrieval of IFR data\r
-    //\r
-    RawData = AllocateZeroPool (DataLength);\r
-    if (RawData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    //\r
-    // Get all the forms associated with this HiiHandle\r
-    //\r
-    Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);\r
-  }\r
-\r
-  OldData = RawData;\r
-\r
-  //\r
-  // Point RawData to the beginning of the form data\r
-  //\r
-  RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));\r
-\r
-  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
-    switch (RawData[Index]) {\r
-    case EFI_IFR_FORM_SET_OP:\r
-      //\r
-      // Copy the GUID information from this handle\r
-      //\r
-      CopyMem (Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));\r
-      break;\r
-\r
-    case EFI_IFR_ONE_OF_OP:\r
-    case EFI_IFR_CHECKBOX_OP:\r
-    case EFI_IFR_NUMERIC_OP:\r
-    case EFI_IFR_DATE_OP:\r
-    case EFI_IFR_TIME_OP:\r
-    case EFI_IFR_PASSWORD_OP:\r
-    case EFI_IFR_STRING_OP:\r
-      //\r
-      // Remember, multiple op-codes may reference the same item, so let's keep a running\r
-      // marker of what the highest QuestionId that wasn't zero length.  This will accurately\r
-      // maintain the Size of the NvStore\r
-      //\r
-      if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {\r
-        Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
-        if (SizeOfNvStore < Temp) {\r
-          SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
-        }\r
-      }\r
-    }\r
-\r
-    Index = RawData[Index + 1] + Index;\r
-  }\r
-\r
-  //\r
-  // Return an error if buffer is too small\r
-  //\r
-  if (SizeOfNvStore > *ImageLength) {\r
-    gBS->FreePool (OldData);\r
-    *ImageLength = (UINT16) SizeOfNvStore;\r
-    return EFI_BUFFER_TOO_SMALL;\r
-  }\r
-\r
-  if (DefaultImage != NULL) {\r
-    ZeroMem (DefaultImage, SizeOfNvStore);\r
-  }\r
-\r
-  //\r
-  // Copy the default image information to the user's buffer\r
-  //\r
-  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
-    switch (RawData[Index]) {\r
-    case EFI_IFR_ONE_OF_OP:\r
-      CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;\r
-      break;\r
-\r
-    case EFI_IFR_ONE_OF_OPTION_OP:\r
-      if (((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Flags & EFI_IFR_FLAG_DEFAULT) {\r
-        CopyMem (&DefaultImage[CachedStart], &((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value, 2);\r
-      }\r
-      break;\r
-\r
-    case EFI_IFR_CHECKBOX_OP:\r
-      DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId] = ((EFI_IFR_CHECKBOX *) &RawData[Index])->Flags;\r
-      break;\r
-\r
-    case EFI_IFR_NUMERIC_OP:\r
-      CopyMem (\r
-        &DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId],\r
-        &((EFI_IFR_NUMERIC *) &RawData[Index])->Default,\r
-        2\r
-        );\r
-      break;\r
-\r
-    }\r
-\r
-    Index = RawData[Index + 1] + Index;\r
-  }\r
-\r
-  *ImageLength = (UINT16) SizeOfNvStore;\r
-\r
-  //\r
-  // Free our temporary repository of form data\r
-  //\r
-  gBS->FreePool (OldData);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_HII_HANDLE\r
-FindHiiHandle (\r
-  IN OUT EFI_HII_PROTOCOL    **HiiProtocol, OPTIONAL\r
-  IN     EFI_GUID            *Guid\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds HII handle for given pack GUID previously registered with the HII.\r
-\r
-Arguments:\r
-  HiiProtocol - pointer to pointer to HII protocol interface.\r
-                If NULL, the interface will be found but not returned.\r
-                If it points to NULL, the interface will be found and\r
-                written back to the pointer that is pointed to.\r
-  Guid        - The GUID of the pack that registered with the HII.\r
-\r
-Returns:\r
-  Handle to the HII pack previously registered by the memory driver.\r
-\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-\r
-  EFI_HII_HANDLE    *HiiHandleBuffer;\r
-  EFI_HII_HANDLE    HiiHandle;\r
-  UINT16            HiiHandleBufferLength;\r
-  UINT32            NumberOfHiiHandles;\r
-  EFI_GUID          HiiGuid;\r
-  EFI_HII_PROTOCOL  *HiiProt;\r
-  UINT32            Index;\r
-  UINT16            Length;\r
-\r
-  HiiHandle = 0;\r
-  if ((HiiProtocol != NULL) && (*HiiProtocol != NULL)) {\r
-    //\r
-    // The protocol has been passed in\r
-    //\r
-    HiiProt = *HiiProtocol;\r
-  } else {\r
-    gBS->LocateProtocol (\r
-          &gEfiHiiProtocolGuid,\r
-          NULL,\r
-          (VOID **) &HiiProt\r
-          );\r
-    if (HiiProt == NULL) {\r
-      return HiiHandle;\r
-    }\r
-\r
-    if (HiiProtocol != NULL) {\r
-      //\r
-      // Return back the HII protocol for the caller as promissed\r
-      //\r
-      *HiiProtocol = HiiProt;\r
-    }\r
-  }\r
-  //\r
-  // Allocate buffer\r
-  //\r
-  HiiHandleBufferLength = 10;\r
-  HiiHandleBuffer       = AllocatePool (HiiHandleBufferLength);\r
-  ASSERT (HiiHandleBuffer != NULL);\r
-\r
-  //\r
-  // Get the Handles of the packages that were registered with Hii\r
-  //\r
-  Status = HiiProt->FindHandles (\r
-                      HiiProt,\r
-                      &HiiHandleBufferLength,\r
-                      HiiHandleBuffer\r
-                      );\r
-\r
-  //\r
-  // Get a bigger bugffer if this one is to small, and try again\r
-  //\r
-  if (Status == EFI_BUFFER_TOO_SMALL) {\r
-\r
-    gBS->FreePool (HiiHandleBuffer);\r
-\r
-    HiiHandleBuffer = AllocatePool (HiiHandleBufferLength);\r
-    ASSERT (HiiHandleBuffer != NULL);\r
-\r
-    Status = HiiProt->FindHandles (\r
-                        HiiProt,\r
-                        &HiiHandleBufferLength,\r
-                        HiiHandleBuffer\r
-                        );\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto lbl_exit;\r
-  }\r
-\r
-  NumberOfHiiHandles = HiiHandleBufferLength / sizeof (EFI_HII_HANDLE);\r
-\r
-  //\r
-  // Iterate Hii handles and look for the one that matches our Guid\r
-  //\r
-  for (Index = 0; Index < NumberOfHiiHandles; Index++) {\r
-\r
-    Length = 0;\r
-    ExtractDataFromHiiHandle (HiiHandleBuffer[Index], &Length, NULL, &HiiGuid);\r
-\r
-    if (CompareGuid (&HiiGuid, Guid)) {\r
-\r
-      HiiHandle = HiiHandleBuffer[Index];\r
-      break;\r
-    }\r
-  }\r
-\r
-lbl_exit:\r
-  gBS->FreePool (HiiHandleBuffer);\r
-  return HiiHandle;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-ValidateDataFromHiiHandle (\r
-  IN      EFI_HII_HANDLE      HiiHandle,\r
-  OUT     BOOLEAN             *Results\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Validate that the data associated with the HiiHandle in NVRAM is within\r
-  the reasonable parameters for that FormSet.  Values for strings and passwords\r
-  are not verified due to their not having the equivalent of valid range settings.\r
-\r
-Arguments:\r
-\r
-  HiiHandle -   Handle of the HII database entry to query\r
-\r
-  Results -     If return Status is EFI_SUCCESS, Results provides valid data\r
-                TRUE  = NVRAM Data is within parameters\r
-                FALSE = NVRAM Data is NOT within parameters\r
-\r
-Returns:\r
-\r
-  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate\r
-\r
-  EFI_SUCCESS               - Data successfully validated\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-  EFI_HII_PROTOCOL  *Hii;\r
-  EFI_GUID          Guid;\r
-  UINT8             *RawData;\r
-  UINT8             *OldData;\r
-  UINTN             RawDataLength;\r
-  UINT8             *VariableData;\r
-  UINTN             Index;\r
-  UINTN             Temp;\r
-  UINTN             SizeOfNvStore;\r
-  UINTN             CachedStart;\r
-  BOOLEAN           GotMatch;\r
-\r
-  RawDataLength = DEFAULT_FORM_BUFFER_SIZE;\r
-  SizeOfNvStore = 0;\r
-  CachedStart   = 0;\r
-  GotMatch      = FALSE;\r
-  *Results      = TRUE;\r
-\r
-  Status        = GetHiiInterface (&Hii);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Allocate space for retrieval of IFR data\r
-  //\r
-  RawData = AllocateZeroPool (RawDataLength);\r
-  if (RawData == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Get all the forms associated with this HiiHandle\r
-  //\r
-  Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (RawData);\r
-\r
-    //\r
-    // Allocate space for retrieval of IFR data\r
-    //\r
-    RawData = AllocateZeroPool (RawDataLength);\r
-    if (RawData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    //\r
-    // Get all the forms associated with this HiiHandle\r
-    //\r
-    Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);\r
-  }\r
-\r
-  OldData = RawData;\r
-\r
-  //\r
-  // Point RawData to the beginning of the form data\r
-  //\r
-  RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));\r
-\r
-  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
-    if (RawData[Index] == EFI_IFR_FORM_SET_OP) {\r
-      CopyMem (&Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));\r
-      break;\r
-    }\r
-\r
-    Index = RawData[Index + 1] + Index;\r
-  }\r
-\r
-  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
-    switch (RawData[Index]) {\r
-    case EFI_IFR_FORM_SET_OP:\r
-      break;\r
-\r
-    case EFI_IFR_ONE_OF_OP:\r
-    case EFI_IFR_CHECKBOX_OP:\r
-    case EFI_IFR_NUMERIC_OP:\r
-    case EFI_IFR_DATE_OP:\r
-    case EFI_IFR_TIME_OP:\r
-    case EFI_IFR_PASSWORD_OP:\r
-    case EFI_IFR_STRING_OP:\r
-      //\r
-      // Remember, multiple op-codes may reference the same item, so let's keep a running\r
-      // marker of what the highest QuestionId that wasn't zero length.  This will accurately\r
-      // maintain the Size of the NvStore\r
-      //\r
-      if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {\r
-        Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
-        if (SizeOfNvStore < Temp) {\r
-          SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;\r
-        }\r
-      }\r
-    }\r
-\r
-    Index = RawData[Index + 1] + Index;\r
-  }\r
-\r
-  //\r
-  // Allocate memory for our File Form Tags\r
-  //\r
-  VariableData = AllocateZeroPool (SizeOfNvStore);\r
-  if (VariableData == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  Status = gRT->GetVariable (\r
-                  (CHAR16 *) L"Setup",\r
-                  &Guid,\r
-                  NULL,\r
-                  &SizeOfNvStore,\r
-                  (VOID *) VariableData\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-\r
-    //\r
-    // If there is a variable that exists already and it is larger than what we calculated the\r
-    // storage needs to be, we must assume the variable size from GetVariable is correct and not\r
-    // allow the truncation of the variable.  It is very possible that the user who created the IFR\r
-    // we are cracking is not referring to a variable that was in a previous map, however we cannot\r
-    // allow it's truncation.\r
-    //\r
-    if (Status == EFI_BUFFER_TOO_SMALL) {\r
-      //\r
-      // Free the buffer that was allocated that was too small\r
-      //\r
-      gBS->FreePool (VariableData);\r
-\r
-      VariableData = AllocatePool (SizeOfNvStore);\r
-      if (VariableData == NULL) {\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-\r
-      Status = gRT->GetVariable (\r
-                      (CHAR16 *) L"Setup",\r
-                      &Guid,\r
-                      NULL,\r
-                      &SizeOfNvStore,\r
-                      (VOID *) VariableData\r
-                      );\r
-    }\r
-  }\r
-\r
-  //\r
-  // Walk through the form and see that the variable data it refers to is ok.\r
-  // This allows for the possibility of stale (obsoleted) data in the variable\r
-  // can be overlooked without causing an error\r
-  //\r
-  for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {\r
-    switch (RawData[Index]) {\r
-    case EFI_IFR_ONE_OF_OP:\r
-      //\r
-      // A one_of has no data, its the option that does - cache the storage Id\r
-      //\r
-      CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;\r
-      break;\r
-\r
-    case EFI_IFR_ONE_OF_OPTION_OP:\r
-      //\r
-      // A one_of_option can be any value\r
-      //\r
-      if (VariableData[CachedStart] == ((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value) {\r
-        GotMatch = TRUE;\r
-      }\r
-      break;\r
-\r
-    case EFI_IFR_END_ONE_OF_OP:\r
-      //\r
-      // At this point lets make sure that the data value in the NVRAM matches one of the options\r
-      //\r
-      if (!GotMatch) {\r
-        *Results = FALSE;\r
-        return EFI_SUCCESS;\r
-      }\r
-      break;\r
-\r
-    case EFI_IFR_CHECKBOX_OP:\r
-      //\r
-      // A checkbox is a boolean, so 0 and 1 are valid\r
-      // Remember, QuestionId corresponds to the offset location of the data in the variable\r
-      //\r
-      if (VariableData[((EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) {\r
-        *Results = FALSE;\r
-        return EFI_SUCCESS;\r
-      }\r
-      break;\r
-\r
-    case EFI_IFR_NUMERIC_OP:\r
-        if ((VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||\r
-            (VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {\r
-        *Results = FALSE;\r
-        return EFI_SUCCESS;\r
-      }\r
-      break;\r
-\r
-    }\r
-\r
-    Index = RawData[Index + 1] + Index;\r
-  }\r
-\r
-  //\r
-  // Free our temporary repository of form data\r
-  //\r
-  gBS->FreePool (OldData);\r
-  gBS->FreePool (VariableData);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOnTheFly.c b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOnTheFly.c
deleted file mode 100644 (file)
index e9ab482..0000000
+++ /dev/null
@@ -1,977 +0,0 @@
-/*++\r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  IfrOnTheFly.c\r
-\r
-Abstract:\r
-\r
-  Library Routines to create IFR on-the-fly\r
-\r
-Revision History:\r
-\r
---*/\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "IfrSupportLibInternal.h"\r
-\r
-EFI_STATUS\r
-CreateFormSet (\r
-  IN      CHAR16              *FormSetTitle,\r
-  IN      EFI_GUID            *Guid,\r
-  IN      UINT8               Class,\r
-  IN      UINT8               SubClass,\r
-  IN OUT  VOID                **FormBuffer,\r
-  IN OUT  VOID                **StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a formset\r
-  \r
-Arguments:\r
-  \r
-  FormSetTitle        - Title of formset\r
-  \r
-  Guid                - Guid of formset\r
-  \r
-  Class               - Class of formset\r
-  \r
-  SubClass            - Sub class of formset\r
-  \r
-  FormBuffer          - Pointer of the formset created\r
-  \r
-  StringBuffer        - Pointer of FormSetTitile string created\r
-  \r
-Returns: \r
-\r
-  EFI_OUT_OF_RESOURCES    - No enough buffer to allocate\r
-  \r
-  EFI_SUCCESS             - Formset successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_HII_IFR_PACK      IfrPack;\r
-  EFI_IFR_FORM_SET      FormSet;\r
-  EFI_IFR_END_FORM_SET  EndFormSet;\r
-  UINT8                 *Destination;\r
-  CHAR16                CurrentLanguage[4];\r
-  STRING_REF            StringToken;\r
-\r
-  //\r
-  // Pre-allocate a buffer sufficient for us to work from.\r
-  //\r
-  FormBuffer = AllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);\r
-  if (FormBuffer == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Pre-allocate a buffer sufficient for us to work from.\r
-  //\r
-  StringBuffer = AllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);\r
-  if (StringBuffer == NULL) {\r
-    gBS->FreePool (FormBuffer);\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add the FormSetTitle to the string buffer and get the StringToken\r
-  //\r
-  Status = AddString (*StringBuffer, CurrentLanguage, FormSetTitle, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Initialize the Ifr Package header data\r
-  //\r
-  IfrPack.Header.Length = sizeof (EFI_HII_PACK_HEADER) + sizeof (EFI_IFR_FORM_SET) + sizeof (EFI_IFR_END_FORM_SET);\r
-  IfrPack.Header.Type   = EFI_HII_IFR;\r
-\r
-  //\r
-  // Initialize FormSet with the appropriate information\r
-  //\r
-  FormSet.Header.OpCode = EFI_IFR_FORM_SET_OP;\r
-  FormSet.Header.Length = sizeof (EFI_IFR_FORM_SET);\r
-  FormSet.FormSetTitle  = StringToken;\r
-  FormSet.Class         = Class;\r
-  FormSet.SubClass      = SubClass;\r
-  CopyMem (&FormSet.Guid, Guid, sizeof (EFI_GUID));\r
-\r
-  //\r
-  // Initialize the end formset data\r
-  //\r
-  EndFormSet.Header.Length  = sizeof (EFI_IFR_END_FORM_SET);\r
-  EndFormSet.Header.OpCode  = EFI_IFR_END_FORM_SET_OP;\r
-\r
-  Destination               = (UINT8 *) *FormBuffer;\r
-\r
-  //\r
-  // Copy the formset/endformset data to the form buffer\r
-  //\r
-  CopyMem (Destination, &IfrPack, sizeof (EFI_HII_PACK_HEADER));\r
-\r
-  Destination = Destination + sizeof (EFI_HII_PACK_HEADER);\r
-\r
-  CopyMem (Destination, &FormSet, sizeof (EFI_IFR_FORM_SET));\r
-\r
-  Destination = Destination + sizeof (EFI_IFR_FORM_SET);\r
-\r
-  CopyMem (Destination, &EndFormSet, sizeof (EFI_IFR_END_FORM_SET));\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateForm (\r
-  IN      CHAR16              *FormTitle,\r
-  IN      UINT16              FormId,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a form\r
-  \r
-Arguments:\r
-  \r
-  FormTitle       - Title of the form\r
-  \r
-  FormId          - Id of the form\r
-  \r
-  FormBuffer          - Pointer of the form created\r
-  \r
-  StringBuffer        - Pointer of FormTitil string created\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Form successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-  EFI_IFR_FORM      Form;\r
-  EFI_IFR_END_FORM  EndForm;\r
-  CHAR16            CurrentLanguage[4];\r
-  STRING_REF        StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  Status = AddString (StringBuffer, CurrentLanguage, FormTitle, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Form.Header.OpCode  = EFI_IFR_FORM_OP;\r
-  Form.Header.Length  = sizeof (EFI_IFR_FORM);\r
-  Form.FormId         = FormId;\r
-  Form.FormTitle      = StringToken;\r
-\r
-  Status              = AddOpCode (FormBuffer, &Form);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  EndForm.Header.OpCode = EFI_IFR_END_FORM_OP;\r
-  EndForm.Header.Length = sizeof (EFI_IFR_END_FORM);\r
-\r
-  Status                = AddOpCode (FormBuffer, &EndForm);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateSubTitle (\r
-  IN      CHAR16              *SubTitle,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a SubTitle\r
-  \r
-Arguments:\r
-  \r
-  SubTitle        - Sub title to be created\r
-  \r
-  FormBuffer      - Where this subtitle to add to\r
-  \r
-  StringBuffer    - String buffer created for subtitle\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-  EFI_IFR_SUBTITLE  Subtitle;\r
-  CHAR16            CurrentLanguage[4];\r
-  STRING_REF        StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  Status = AddString (StringBuffer, CurrentLanguage, SubTitle, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Subtitle.Header.OpCode  = EFI_IFR_SUBTITLE_OP;\r
-  Subtitle.Header.Length  = sizeof (EFI_IFR_SUBTITLE);\r
-  Subtitle.SubTitle       = StringToken;\r
-\r
-  Status                  = AddOpCode (FormBuffer, &Subtitle);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateText (\r
-  IN      CHAR16              *String,\r
-  IN      CHAR16              *String2,\r
-  IN      CHAR16              *String3,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a line of text\r
-  \r
-Arguments:\r
-  \r
-  String          - First string of the text\r
-  \r
-  String2         - Second string of the text\r
-  \r
-  String3         - Help string of the text\r
-  \r
-  Flags           - Flag of the text\r
-  \r
-  Key             - Key of the text\r
-  \r
-  FormBuffer      - The form where this text adds to\r
-  \r
-  StringBuffer    - String buffer created for String, String2 and String3\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Text successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS    Status;\r
-  EFI_IFR_TEXT  Text;\r
-  CHAR16        CurrentLanguage[4];\r
-  STRING_REF    StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, String, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Text.Header.OpCode  = EFI_IFR_TEXT_OP;\r
-  Text.Header.Length  = sizeof (EFI_IFR_TEXT);\r
-  Text.Text           = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, String2, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Text.TextTwo  = StringToken;\r
-\r
-  Text.Flags    = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
-  Text.Key      = Key;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, String3, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Text.Help = StringToken;\r
-\r
-  Status    = AddOpCode (FormBuffer, &Text);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateGoto (\r
-  IN      UINT16              FormId,\r
-  IN      CHAR16              *Prompt,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a hyperlink\r
-  \r
-Arguments:\r
-  \r
-  FormId        - Form ID of the hyperlink\r
-  \r
-  Prompt        - Prompt of the hyperlink\r
-  \r
-  FormBuffer    - The form where this hyperlink adds to\r
-  \r
-  StringBuffer  - String buffer created for Prompt\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Hyperlink successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_IFR_REF Hyperlink;\r
-  CHAR16      CurrentLanguage[4];\r
-  STRING_REF  StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Hyperlink.Header.OpCode = EFI_IFR_REF_OP;\r
-  Hyperlink.Header.Length = sizeof (EFI_IFR_REF);\r
-  Hyperlink.FormId        = FormId;\r
-  Hyperlink.Prompt        = StringToken;\r
-\r
-  Status                  = AddOpCode (FormBuffer, &Hyperlink);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateOneOf (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  Prompt          - Prompt of the one-of box\r
-  \r
-  Help            - Help of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this one-of box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
-  EFI_SUCCESS         - One-Of box successfully created.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  UINTN                 Index;\r
-  EFI_IFR_ONE_OF        OneOf;\r
-  EFI_IFR_ONE_OF_OPTION OneOfOption;\r
-  EFI_IFR_END_ONE_OF    EndOneOf;\r
-  CHAR16                CurrentLanguage[4];\r
-  STRING_REF            StringToken;\r
-\r
-  //\r
-  // We do not create op-code storage widths for one-of in excess of 16 bits for now\r
-  //\r
-  if (DataWidth > 2) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;\r
-  OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);\r
-  OneOf.QuestionId    = QuestionId;\r
-  OneOf.Width         = DataWidth;\r
-  OneOf.Prompt        = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  OneOf.Help  = StringToken;\r
-\r
-  Status      = AddOpCode (FormBuffer, &OneOf);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  for (Index = 0; Index < OptionCount; Index++) {\r
-    OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
-    OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
-\r
-    //\r
-    // Add string and get token back\r
-    //\r
-    Status              = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);\r
-\r
-    OneOfOption.Option  = StringToken;\r
-    OneOfOption.Value   = OptionsList[Index].Value;\r
-    OneOfOption.Flags   = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);\r
-    OneOfOption.Key     = OptionsList[Index].Key;\r
-\r
-    Status              = AddOpCode (FormBuffer, &OneOfOption);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  EndOneOf.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
-  EndOneOf.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
-\r
-  Status                  = AddOpCode (FormBuffer, &EndOneOf);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-CreateOrderedList (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of question with a set of options to choose from.  The\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  Prompt          - Prompt of the ordered list\r
-  \r
-  Help            - Help of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - The form where this ordered list adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt, Help and Option strings\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list successfully created.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  UINTN                 Index;\r
-  EFI_IFR_ORDERED_LIST  OrderedList;\r
-  EFI_IFR_ONE_OF_OPTION OrderedListOption;\r
-  EFI_IFR_END_ONE_OF    EndOrderedList;\r
-  CHAR16                CurrentLanguage[4];\r
-  STRING_REF            StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;\r
-  OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);\r
-  OrderedList.QuestionId    = QuestionId;\r
-  OrderedList.MaxEntries    = MaxEntries;\r
-  OrderedList.Prompt        = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  OrderedList.Help  = StringToken;\r
-\r
-  Status            = AddOpCode (FormBuffer, &OrderedList);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  for (Index = 0; Index < OptionCount; Index++) {\r
-    OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
-    OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
-\r
-    //\r
-    // Add string and get token back\r
-    //\r
-    Status                    = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);\r
-\r
-    OrderedListOption.Option  = StringToken;\r
-    OrderedListOption.Value   = OptionsList[Index].Value;\r
-    OrderedListOption.Flags   = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);\r
-    OrderedListOption.Key     = OptionsList[Index].Key;\r
-\r
-    Status                    = AddOpCode (FormBuffer, &OrderedListOption);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-  }\r
-\r
-  EndOrderedList.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
-  EndOrderedList.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
-\r
-  Status                        = AddOpCode (FormBuffer, &EndOrderedList);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateCheckBox (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               Flags,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a checkbox\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  Prompt          - Prompt of the check box\r
-  \r
-  Help            - Help of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  FormBuffer      - The form where this check box adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR    - DataWidth > 1\r
-\r
-  EFI_SUCCESS         - Check box successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS        Status;\r
-  EFI_IFR_CHECKBOX  CheckBox;\r
-  CHAR16            CurrentLanguage[4];\r
-  STRING_REF        StringToken;\r
-\r
-  //\r
-  // We do not create op-code storage widths for checkbox in excess of 8 bits for now\r
-  //\r
-  if (DataWidth > 1) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  CheckBox.Header.OpCode  = EFI_IFR_CHECKBOX_OP;\r
-  CheckBox.Header.Length  = sizeof (EFI_IFR_CHECKBOX);\r
-  CheckBox.QuestionId     = QuestionId;\r
-  CheckBox.Width          = DataWidth;\r
-  CheckBox.Prompt         = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  CheckBox.Help   = StringToken;\r
-  CheckBox.Flags  = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
-\r
-  Status          = AddOpCode (FormBuffer, &CheckBox);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateNumeric (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  Prompt          - Prompt of the numeric\r
-  \r
-  Help            - Help of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - The form where this numeric adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_DEVICE_ERROR      - DataWidth > 2\r
-  \r
-  EFI_SUCCESS           - Numeric is successfully created\r
-\r
---*/\r
-{\r
-  EFI_STATUS      Status;\r
-  EFI_IFR_NUMERIC Numeric;\r
-  CHAR16          CurrentLanguage[4];\r
-  STRING_REF      StringToken;\r
-\r
-  //\r
-  // We do not create op-code storage widths for numerics in excess of 16 bits for now\r
-  //\r
-  if (DataWidth > 2) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;\r
-  Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);\r
-  Numeric.QuestionId    = QuestionId;\r
-  Numeric.Width         = DataWidth;\r
-  Numeric.Prompt        = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Numeric.Help    = StringToken;\r
-  Numeric.Minimum = Minimum;\r
-  Numeric.Maximum = Maximum;\r
-  Numeric.Step    = Step;\r
-  Numeric.Default = Default;\r
-  Numeric.Flags   = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
-  Numeric.Key     = Key;\r
-\r
-  Status          = AddOpCode (FormBuffer, &Numeric);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateString (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      CHAR16              *Prompt,\r
-  IN      CHAR16              *Help,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer,\r
-  IN OUT  VOID                *StringBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a string\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  Prompt          - Prompt of the string\r
-  \r
-  Help            - Help of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - The form where this string adds to\r
-  \r
-  StringBuffer    - String buffer created for Prompt and Help.\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - String successfully created.\r
-\r
---*/\r
-{\r
-  EFI_STATUS      Status;\r
-  EFI_IFR_STRING  String;\r
-  CHAR16          CurrentLanguage[4];\r
-  STRING_REF      StringToken;\r
-\r
-  //\r
-  // Obtain current language value\r
-  //\r
-  GetCurrentLanguage (CurrentLanguage);\r
-\r
-  //\r
-  // Add first string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  String.Header.OpCode  = EFI_IFR_STRING_OP;\r
-  String.Header.Length  = sizeof (EFI_IFR_STRING);\r
-  String.QuestionId     = QuestionId;\r
-  String.Width          = DataWidth;\r
-  String.Prompt         = StringToken;\r
-\r
-  //\r
-  // Add second string, get first string's token\r
-  //\r
-  Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  String.Help     = StringToken;\r
-  String.MinSize  = MinSize;\r
-  String.MaxSize  = MaxSize;\r
-  String.Flags    = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);\r
-  String.Key      = Key;\r
-\r
-  Status          = AddOpCode (FormBuffer, &String);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOpCodeCreation.c b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrOpCodeCreation.c
deleted file mode 100644 (file)
index 05b1238..0000000
+++ /dev/null
@@ -1,618 +0,0 @@
-/*++\r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  IfrOpCodeCreation.c\r
-\r
-Abstract:\r
-\r
-  Library Routines to create IFR independent of string data - assume tokens already exist\r
-  Primarily to be used for exporting op-codes at a label in pre-defined forms.\r
-\r
-Revision History:\r
-\r
---*/\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "IfrSupportLibInternal.h"\r
-\r
-EFI_STATUS\r
-CreateSubTitleOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a SubTitle opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  StringToken     - StringToken of the subtitle\r
-  \r
-  FormBuffer      - Output of subtitle as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Subtitle created to be a form\r
-\r
---*/\r
-{\r
-  EFI_IFR_SUBTITLE  Subtitle;\r
-\r
-  Subtitle.Header.OpCode  = EFI_IFR_SUBTITLE_OP;\r
-  Subtitle.Header.Length  = sizeof (EFI_IFR_SUBTITLE);\r
-  Subtitle.SubTitle       = StringToken;\r
-\r
-  CopyMem (FormBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateTextOpCode (\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      STRING_REF          StringTokenThree,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a Text opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  StringToken               - First string token of the text\r
-  \r
-  StringTokenTwo            - Second string token of the text\r
-  \r
-  StringTokenThree          - Help string token of the text\r
-  \r
-  Flags                     - Flag of the text\r
-  \r
-  Key                       - Key of the text\r
-  \r
-  FormBuffer                - Output of text as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Text created to be a form\r
-\r
---*/\r
-{\r
-  EFI_IFR_TEXT  Text;\r
-\r
-  Text.Header.OpCode  = EFI_IFR_TEXT_OP;\r
-  Text.Header.Length  = sizeof (EFI_IFR_TEXT);\r
-  Text.Text           = StringToken;\r
-\r
-  Text.TextTwo        = StringTokenTwo;\r
-  Text.Help           = StringTokenThree;\r
-  Text.Flags          = Flags;\r
-  Text.Key            = Key;\r
-\r
-  CopyMem (FormBuffer, &Text, sizeof (EFI_IFR_TEXT));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateGotoOpCode (\r
-  IN      UINT16              FormId,\r
-  IN      STRING_REF          StringToken,\r
-  IN      STRING_REF          StringTokenTwo,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a hyperlink opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  FormId          - Form ID of the hyperlink\r
-  \r
-  StringToken     - Prompt string token of the hyperlink\r
-  \r
-  StringTokenTwo  - Help string token of the hyperlink\r
-  \r
-  Flags           - Flags of the hyperlink\r
-  \r
-  Key             - Key of the hyperlink\r
-  \r
-  FormBuffer      - Output of hyperlink as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS   - Hyperlink created to be a form\r
-\r
---*/\r
-{\r
-  EFI_IFR_REF Hyperlink;\r
-\r
-  Hyperlink.Header.OpCode = EFI_IFR_REF_OP;\r
-  Hyperlink.Header.Length = sizeof (EFI_IFR_REF);\r
-  Hyperlink.FormId        = FormId;\r
-  Hyperlink.Prompt        = StringToken;\r
-  Hyperlink.Help          = StringTokenTwo;\r
-  Hyperlink.Key           = Key;\r
-  Hyperlink.Flags         = Flags;\r
-\r
-  CopyMem (FormBuffer, &Hyperlink, sizeof (EFI_IFR_REF));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateOneOfOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a one-of opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the one-of box\r
-  \r
-  DataWidth       - DataWidth of the one-of box\r
-  \r
-  PromptToken     - Prompt string token of the one-of box\r
-  \r
-  HelpToken       - Help string token of the one-of box\r
-  \r
-  OptionsList     - Each string in it is an option of the one-of box\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of One-Of box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS         - One-Of box created to be a form\r
-  \r
-  EFI_DEVICE_ERROR    - DataWidth > 2\r
-\r
---*/\r
-{\r
-  UINTN                 Index;\r
-  EFI_IFR_ONE_OF        OneOf;\r
-  EFI_IFR_ONE_OF_OPTION OneOfOption;\r
-  EFI_IFR_END_ONE_OF    EndOneOf;\r
-  UINT8                 *LocalBuffer;\r
-\r
-  //\r
-  // We do not create op-code storage widths for one-of in excess of 16 bits for now\r
-  //\r
-  if (DataWidth > 2) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;\r
-  OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);\r
-  OneOf.QuestionId    = QuestionId;\r
-  OneOf.Width         = DataWidth;\r
-  OneOf.Prompt        = PromptToken;\r
-\r
-  OneOf.Help          = HelpToken;\r
-\r
-  LocalBuffer         = (UINT8 *) FormBuffer;\r
-\r
-  CopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));\r
-\r
-  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF));\r
-\r
-  for (Index = 0; Index < OptionCount; Index++) {\r
-    OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
-    OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
-\r
-    OneOfOption.Option        = OptionsList[Index].StringToken;\r
-    OneOfOption.Value         = OptionsList[Index].Value;\r
-    OneOfOption.Flags         = OptionsList[Index].Flags;\r
-    OneOfOption.Key           = OptionsList[Index].Key;\r
-\r
-    CopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));\r
-\r
-    LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));\r
-  }\r
-\r
-  EndOneOf.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
-  EndOneOf.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
-\r
-  CopyMem (LocalBuffer, &EndOneOf, sizeof (EFI_IFR_END_ONE_OF));\r
-\r
-  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-CreateOrderedListOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               MaxEntries,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      IFR_OPTION          *OptionsList,\r
-  IN      UINTN               OptionCount,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-\r
-  OptionsList is a pointer to a null-terminated list of option descriptions.  Ensure that OptionsList[x].StringToken\r
-  has been filled in since this routine will not generate StringToken values.\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the ordered list\r
-  \r
-  MaxEntries      - MaxEntries of the ordered list\r
-  \r
-  PromptToken     - Prompt string token of the ordered list\r
-  \r
-  HelpToken       - Help string token of the ordered list\r
-  \r
-  OptionsList     - Each string in it is an option of the ordered list\r
-  \r
-  OptionCount     - Option string count\r
-  \r
-  FormBuffer      - Output of ordered list as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Ordered list created to be a form\r
-\r
---*/\r
-{\r
-  UINTN                 Index;\r
-  EFI_IFR_ORDERED_LIST  OrderedList;\r
-  EFI_IFR_ONE_OF_OPTION OrderedListOption;\r
-  EFI_IFR_END_ONE_OF    EndOrderedList;\r
-  UINT8                 *LocalBuffer;\r
-\r
-  OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;\r
-  OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);\r
-  OrderedList.QuestionId    = QuestionId;\r
-  OrderedList.MaxEntries    = MaxEntries;\r
-  OrderedList.Prompt        = PromptToken;\r
-\r
-  OrderedList.Help          = HelpToken;\r
-\r
-  LocalBuffer               = (UINT8 *) FormBuffer;\r
-\r
-  CopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));\r
-\r
-  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ORDERED_LIST));\r
-\r
-  for (Index = 0; Index < OptionCount; Index++) {\r
-    OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;\r
-    OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);\r
-\r
-    OrderedListOption.Option        = OptionsList[Index].StringToken;\r
-    OrderedListOption.Value         = OptionsList[Index].Value;\r
-    OrderedListOption.Flags         = OptionsList[Index].Flags;\r
-    OrderedListOption.Key           = OptionsList[Index].Key;\r
-\r
-    CopyMem (LocalBuffer, &OrderedListOption, sizeof (EFI_IFR_ONE_OF_OPTION));\r
-\r
-    LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));\r
-  }\r
-\r
-  EndOrderedList.Header.Length  = sizeof (EFI_IFR_END_ONE_OF);\r
-  EndOrderedList.Header.OpCode  = EFI_IFR_END_ONE_OF_OP;\r
-\r
-  CopyMem (LocalBuffer, &EndOrderedList, sizeof (EFI_IFR_END_ONE_OF));\r
-\r
-  LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-CreateCheckBoxOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a checkbox opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the check box\r
-  \r
-  DataWidth       - DataWidth of the check box\r
-  \r
-  PromptToken     - Prompt string token of the check box\r
-  \r
-  HelpToken       - Help string token of the check box\r
-  \r
-  Flags           - Flags of the check box\r
-  \r
-  Key             - Key of the check box\r
-  \r
-  FormBuffer      - Output of the check box as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - Checkbox created to be a form\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 1\r
-\r
---*/\r
-{\r
-  EFI_IFR_CHECKBOX  CheckBox;\r
-\r
-  //\r
-  // We do not create op-code storage widths for checkbox in excess of 8 bits for now\r
-  //\r
-  if (DataWidth > 1) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  CheckBox.Header.OpCode  = EFI_IFR_CHECKBOX_OP;\r
-  CheckBox.Header.Length  = sizeof (EFI_IFR_CHECKBOX);\r
-  CheckBox.QuestionId     = QuestionId;\r
-  CheckBox.Width          = DataWidth;\r
-  CheckBox.Prompt         = PromptToken;\r
-\r
-  CheckBox.Help           = HelpToken;\r
-  CheckBox.Flags          = Flags;\r
-  CheckBox.Key            = Key;\r
-\r
-  CopyMem (FormBuffer, &CheckBox, sizeof (EFI_IFR_CHECKBOX));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateNumericOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT16              Minimum,\r
-  IN      UINT16              Maximum,\r
-  IN      UINT16              Step,\r
-  IN      UINT16              Default,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the numeric\r
-  \r
-  DataWidth       - DataWidth of the numeric\r
-  \r
-  PromptToken     - Prompt string token of the numeric\r
-  \r
-  HelpToken       - Help string token of the numeric\r
-  \r
-  Minimum         - Minumun boundary of the numeric\r
-  \r
-  Maximum         - Maximum boundary of the numeric\r
-  \r
-  Step            - Step of the numeric\r
-  \r
-  Default         - Default value of the numeric\r
-  \r
-  Flags           - Flags of the numeric\r
-  \r
-  Key             - Key of the numeric\r
-  \r
-  FormBuffer      - Output of the numeric as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - The numeric created to be a form.\r
-  \r
-  EFI_DEVICE_ERROR  - DataWidth > 2\r
-\r
---*/\r
-{\r
-  EFI_IFR_NUMERIC Numeric;\r
-\r
-  //\r
-  // We do not create op-code storage widths for numerics in excess of 16 bits for now\r
-  //\r
-  if (DataWidth > 2) {\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;\r
-  Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);\r
-  Numeric.QuestionId    = QuestionId;\r
-  Numeric.Width         = DataWidth;\r
-  Numeric.Prompt        = PromptToken;\r
-\r
-  Numeric.Help          = HelpToken;\r
-  Numeric.Minimum       = Minimum;\r
-  Numeric.Maximum       = Maximum;\r
-  Numeric.Step          = Step;\r
-  Numeric.Default       = Default;\r
-  Numeric.Flags         = Flags;\r
-  Numeric.Key           = Key;\r
-\r
-  CopyMem (FormBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateStringOpCode (\r
-  IN      UINT16              QuestionId,\r
-  IN      UINT8               DataWidth,\r
-  IN      STRING_REF          PromptToken,\r
-  IN      STRING_REF          HelpToken,\r
-  IN      UINT8               MinSize,\r
-  IN      UINT8               MaxSize,\r
-  IN      UINT8               Flags,\r
-  IN      UINT16              Key,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a numeric opcode independent of string creation\r
-  This is used primarily by users who need to create just one particular valid op-code and the string\r
-  data will be assumed to exist in the HiiDatabase already.  (Useful when exporting op-codes at a label\r
-  location to pre-defined forms in HII)\r
-  \r
-Arguments:\r
-  \r
-  QuestionId      - Question ID of the string\r
-  \r
-  DataWidth       - DataWidth of the string\r
-  \r
-  PromptToken     - Prompt token of the string\r
-  \r
-  HelpToken       - Help token of the string\r
-  \r
-  MinSize         - Min size boundary of the string\r
-  \r
-  MaxSize         - Max size boundary of the string\r
-    \r
-  Flags           - Flags of the string\r
-  \r
-  Key             - Key of the string\r
-  \r
-  FormBuffer      - Output of the string as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS       - String created to be a form.\r
-\r
---*/\r
-{\r
-  EFI_IFR_STRING  String;\r
-\r
-  String.Header.OpCode  = EFI_IFR_STRING_OP;\r
-  String.Header.Length  = sizeof (EFI_IFR_STRING);\r
-  String.QuestionId     = QuestionId;\r
-  String.Width          = DataWidth;\r
-  String.Prompt         = PromptToken;\r
-\r
-  String.Help           = HelpToken;\r
-  String.MinSize        = MinSize;\r
-  String.MaxSize        = MaxSize;\r
-  String.Flags          = Flags;\r
-  String.Key            = Key;\r
-\r
-  CopyMem (FormBuffer, &String, sizeof (EFI_IFR_STRING));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CreateBannerOpCode (\r
-  IN      UINT16              Title,\r
-  IN      UINT16              LineNumber,\r
-  IN      UINT8               Alignment,\r
-  IN OUT  VOID                *FormBuffer\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a banner opcode.  This is primarily used by the FrontPage implementation from BDS.\r
-  \r
-Arguments:\r
-  \r
-  Title       - Title of the banner\r
-  \r
-  LineNumber  - LineNumber of the banner\r
-  \r
-  Alignment   - Alignment of the banner\r
-  \r
-  FormBuffer  - Output of banner as a form\r
-  \r
-Returns: \r
-\r
-  EFI_SUCCESS     - Banner created to be a form.\r
-\r
---*/\r
-{\r
-  EFI_IFR_BANNER  Banner;\r
-\r
-  Banner.Header.OpCode  = EFI_IFR_BANNER_OP;\r
-  Banner.Header.Length  = sizeof (EFI_IFR_BANNER);\r
-  CopyMem (&Banner.Title, &Title, sizeof (UINT16));\r
-  CopyMem (&Banner.LineNumber, &LineNumber, sizeof (UINT16));\r
-  Banner.Alignment = Alignment;\r
-\r
-  CopyMem (FormBuffer, &Banner, sizeof (EFI_IFR_BANNER));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf
deleted file mode 100644 (file)
index 8b21d43..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#/** @file\r
-# EDK Internal Form Refresentation Support Library Instance.\r
-#\r
-# The library instance provides common library routines help in \r
-#  IFR creation on-the-fly, HII variable access, HII database access, multi language supports.\r
-# Copyright (c) 2006 - 2007, Intel Corporation.\r
-#\r
-#  All rights reserved. This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = IfrSupportLibFramework\r
-  FILE_GUID                      = ea55bada-d488-427b-9d2d-227e0aaa3707\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = IfrSupportLibFramework|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
-  EDK_RELEASE_VERSION            = 0x00020000\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
-\r
-  CONSTRUCTOR                    = IfrLibConstruct\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-#  Variable Guid C Name: gLanGuid Variable Name: L"Lan"\r
-#\r
-\r
-[Sources.common]\r
-  IfrVariable.c\r
-  IfrOpCodeCreation.c\r
-  IfrOnTheFly.c\r
-  IfrCommon.c\r
-  IfrSupportLibInternal.h\r
-\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiRuntimeServicesTableLib\r
-  UefiBootServicesTableLib\r
-  MemoryAllocationLib\r
-  BaseMemoryLib\r
-  BaseLib\r
-  DebugLib\r
-\r
-\r
-[Guids]\r
-  gEfiGlobalVariableGuid                        # ALWAYS_CONSUMED\r
-\r
-\r
-[Protocols]\r
-  gEfiHiiProtocolGuid                           # PROTOCOL ALWAYS_CONSUMED\r
-\r
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.msa b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.msa
deleted file mode 100644 (file)
index 87f4f74..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-  <MsaHeader>\r
-    <ModuleName>EdkIfrSupportLib</ModuleName>\r
-    <ModuleType>DXE_DRIVER</ModuleType>\r
-    <GuidValue>ea55bada-d488-427b-9d2d-227e0aaa3707</GuidValue>\r
-    <Version>1.0</Version>\r
-    <Abstract>EDK Internal Form Refresentation Support Library Instance.</Abstract>\r
-    <Description>The library instance provides common library routines help in 
-    IFR creation on-the-fly, HII variable access, HII database access, multi language supports.</Description>\r
-    <Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>\r
-    <License>All rights reserved. This program and the accompanying materials
-      are licensed and made available under the terms and conditions of the BSD License
-      which accompanies this distribution.  The full text of the license may be found at
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
-    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
-  </MsaHeader>\r
-  <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
-    <BinaryModule>false</BinaryModule>\r
-    <OutputFileBasename>EdkIfrSupportLib</OutputFileBasename>\r
-  </ModuleDefinitions>\r
-  <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
-      <Keyword>EdkIfrSupportLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>DebugLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>BaseLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>BaseMemoryLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>MemoryAllocationLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>UefiBootServicesTableLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>UefiRuntimeServicesTableLib</Keyword>\r
-    </LibraryClass>\r
-  </LibraryClassDefinitions>\r
-  <SourceFiles>\r
-    <Filename>IfrCommon.c</Filename>\r
-    <Filename>IfrOnTheFly.c</Filename>\r
-    <Filename>IfrOpCodeCreation.c</Filename>\r
-    <Filename>IfrVariable.c</Filename>\r
-  </SourceFiles>\r
-  <PackageDependencies>\r
-    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
-    <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
-  </PackageDependencies>\r
-  <Protocols>\r
-    <Protocol Usage="ALWAYS_CONSUMED">\r
-      <ProtocolCName>gEfiHiiProtocolGuid</ProtocolCName>\r
-    </Protocol>\r
-  </Protocols>\r
-  <Variables>\r
-    <Variable Usage="ALWAYS_CONSUMED">\r
-      <VariableName>0x004C 0x0061 0x006E</VariableName>\r
-      <GuidC_Name>gLanGuid</GuidC_Name>\r
-    </Variable>\r
-  </Variables>\r
-  <Guids>\r
-    <GuidCNames Usage="ALWAYS_CONSUMED">\r
-      <GuidCName>gEfiGlobalVariableGuid</GuidCName>\r
-    </GuidCNames>\r
-  </Guids>\r
-  <Externs>\r
-    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
-    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
-    <Extern>\r
-      <Constructor>IfrLibConstruct</Constructor>\r
-    </Extern>\r
-  </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLibInternal.h b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLibInternal.h
deleted file mode 100644 (file)
index ed7cfd9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/**@file\r
-  Common header file shared by all source files.\r
-\r
-  This file includes package header files, library classes and protocol, PPI & GUID definitions.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation.\r
-  All rights reserved. This program and the accompanying materials\r
-   are licensed and made available under the terms and conditions of the BSD License\r
-   which accompanies this distribution. The full text of the license may be found at\r
-   http://opensource.org/licenses/bsd-license.php\r
-   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-**/\r
-\r
-#ifndef __IFRSUPPORT_LIB_INTERNAL_H_\r
-#define __IFRSUPPORT_LIB_INTERNAL_H_\r
-\r
-\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Guid/GlobalVariable.h>\r
-#include <Protocol/HiiFramework.h>\r
-\r
-#include <Library/IfrSupportLibFramework.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrVariable.c b/IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrVariable.c
deleted file mode 100644 (file)
index 04aa4dc..0000000
+++ /dev/null
@@ -1,493 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-  IfrVariable.c\r
-\r
-Abstract:\r
-  Variable/Map manipulations routines\r
-\r
---*/\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "IfrSupportLibInternal.h"\r
-\r
-VOID\r
-EfiLibHiiVariablePackGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK       *Pack,  \r
-  OUT   CHAR16                      **Name,  OPTIONAL\r
-  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
-  OUT   UINT16                      *Id,     OPTIONAL\r
-  OUT   VOID                        **Var,   OPTIONAL\r
-  OUT   UINTN                       *Size    OPTIONAL\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extracts a variable form a Pack.\r
-\r
-Arguments:\r
-\r
-  Pack - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
-{\r
-  if (NULL != Name) {\r
-    *Name = (VOID *) (Pack + 1);\r
-  }\r
-    \r
-  if (NULL != Guid) { \r
-    *Guid = (EFI_GUID *)(UINTN)&Pack->VariableGuid;\r
-  }\r
-    \r
-    \r
-  if (NULL != Id) {\r
-    *Id   = Pack->VariableId;\r
-  }\r
-    \r
-  if (NULL != Var) {\r
-    *Var  = (VOID *) ((CHAR8 *) (Pack + 1) + Pack->VariableNameLength);\r
-  }\r
-    \r
-  if (NULL != Size) {\r
-    *Size = Pack->Header.Length - sizeof (*Pack) - Pack->VariableNameLength;\r
-  }\r
-}\r
-\r
-\r
-UINTN\r
-EfiLibHiiVariablePackListGetMapCnt (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List\r
-  )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a count of the variables/maps in the List.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-\r
-Returns: \r
-\r
-  UINTN - The number of map count.\r
-\r
---*/\r
-\r
-{\r
-  UINTN   Cnt = 0;\r
-  while (NULL != List) {\r
-    Cnt++;\r
-    List = List->NextVariablePack;\r
-  }\r
-  return Cnt;\r
-}\r
-\r
-\r
-VOID\r
-EfiLibHiiVariablePackListForEachVar (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST               *List,\r
-  IN    EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK  *Callback\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Will iterate all variable/maps as appearing \r
-  in List and for each, it will call the Callback.\r
-\r
-Arguments:\r
-\r
-  List     - List of variables\r
-  Callback - Routine to be called for each iterated variable.\r
-\r
-Returns: \r
-\r
-  VOID\r
-  \r
---*/\r
-\r
-{\r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
-  UINT16    MapId;\r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
-\r
-  while (NULL != List) {\r
-    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
-    //\r
-    // call the callback\r
-    //\r
-    Callback (MapName, MapGuid, MapId, Map, MapSize); \r
-    List = List->NextVariablePack;\r
-  }\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapByIdx (\r
-  IN    UINTN                       Idx,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST  *List,  \r
-  OUT   CHAR16                      **Name,  OPTIONAL\r
-  OUT   EFI_GUID                    **Guid,  OPTIONAL\r
-  OUT   UINT16                      *Id,     OPTIONAL\r
-  OUT   VOID                        **Var,\r
-  OUT   UINTN                       *Size\r
-  )\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given \r
-  the order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Idx  - The index of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-{\r
-  CHAR16     *MapName;\r
-  EFI_GUID   *MapGuid;\r
-  UINT16     MapId;\r
-  VOID       *Map;\r
-  UINTN      MapSize;\r
-\r
-  while (NULL != List) {\r
-    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
-    if (0 == Idx--) {\r
-      *Var  = Map;\r
-      *Size = MapSize;\r
-\r
-      if (NULL != Name) {\r
-        *Name = MapName;\r
-      }\r
-\r
-      if (NULL != Guid) {\r
-        *Guid = MapGuid;\r
-      }\r
-        \r
-      if (NULL != Id) {\r
-        *Id   = MapId;\r
-      }\r
-        \r
-      return EFI_SUCCESS; // Map found\r
-    }\r
-    List = List->NextVariablePack;\r
-  }\r
-  //\r
-  // If here, the map is not found\r
-  //\r
-  return EFI_NOT_FOUND; \r
-}\r
-\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMapById (\r
-  IN    UINT16                        Id,  \r
-  IN    EFI_HII_VARIABLE_PACK_LIST    *List,\r
-  OUT   CHAR16                        **Name,  OPTIONAL\r
-  OUT   EFI_GUID                      **Guid,  OPTIONAL\r
-  OUT   VOID                          **Var,\r
-  OUT   UINTN                         *Size\r
-  )\r
-  \r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form List given the \r
-  order number as appears in the List.\r
-\r
-Arguments:\r
-\r
-  Id   - The ID of the variable/map to retrieve\r
-  List - List of variables\r
-  Name - Name of the variable/map\r
-  Guid - GUID of the variable/map\r
-  Var  - Pointer to the variable/map\r
-  Size - Size of the variable/map in bytes\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - Variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
-{ \r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
-  UINT16    MapId;\r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
-\r
-  while (NULL != List) {\r
-    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
-    if (MapId == Id) {\r
-      *Var  = Map;\r
-      *Size = MapSize;\r
-      if (NULL != Name) {\r
-         *Name = MapName;\r
-      }\r
-      if (NULL != Guid) {\r
-        *Guid = MapGuid;\r
-      }\r
-      //\r
-      // Map found\r
-      //\r
-      return EFI_SUCCESS; \r
-    }\r
-    List = List->NextVariablePack;\r
-  }\r
-  //\r
-  // If here, the map is not found\r
-  //\r
-  return EFI_NOT_FOUND; \r
-}\r
-\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariablePackListGetMap (\r
-  IN    EFI_HII_VARIABLE_PACK_LIST   *List,\r
-  IN    CHAR16                       *Name,\r
-  IN    EFI_GUID                     *Guid,\r
-  OUT   UINT16                       *Id,\r
-  OUT   VOID                         **Var, \r
-  OUT   UINTN                        *Size\r
-  )\r
-\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.\r
-\r
-Arguments:\r
-\r
-  List - List of variables\r
-  Name - Name of the variable/map to be found\r
-  Guid - GUID of the variable/map to be found\r
-  Var  - Pointer to the variable/map found\r
-  Size - Size of the variable/map in bytes found\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - variable is found, OUT parameters are valid\r
-  EFI_NOT_FOUND - variable is not found, OUT parameters are not valid\r
-\r
---*/\r
-\r
-{ \r
-  VOID      *Map;\r
-  UINTN     MapSize;\r
-  UINT16    MapId;\r
-  CHAR16    *MapName;\r
-  EFI_GUID  *MapGuid;\r
-\r
-  while (NULL != List) {\r
-    EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);\r
-    if ((0 == StrCmp (Name, MapName)) && CompareGuid (Guid, MapGuid)) {\r
-      *Id   = MapId;\r
-      *Var  = Map;\r
-      *Size = MapSize;\r
-      return EFI_SUCCESS;\r
-    }\r
-    List = List->NextVariablePack;\r
-  }\r
-  //\r
-  // If here, the map is not found\r
-  //\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableRetrieveFromNv (\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                  **Var\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Finds out if a variable of specific Name/Guid/Size exists in NV. \r
-  If it does, it will retrieve it into the Var. \r
-\r
-Arguments:\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into buffer pointed by this pointer.\r
-                     If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.\r
-Returns:\r
-  EFI_SUCCESS    - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  UINTN                       SizeNv;\r
-\r
-  //\r
-  // Test for existence of the variable.\r
-  //\r
-  SizeNv = 0;\r
-  Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, NULL);\r
-  if (EFI_BUFFER_TOO_SMALL != Status) {\r
-    ASSERT (EFI_SUCCESS != Status);\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  if (SizeNv != Size) {\r
-    //\r
-    // The variable is considered corrupt, as it has different size from expected.\r
-    //\r
-    return EFI_LOAD_ERROR; \r
-  }\r
-\r
-  if (NULL == *Var) {\r
-    *Var = AllocatePool (Size);\r
-    ASSERT (NULL != *Var);\r
-  }\r
-  SizeNv = Size;\r
-  //\r
-  // Final read into the Var\r
-  //\r
-  Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, *Var); \r
-  //\r
-  // No tolerance for random failures. Such behavior is undetermined and not validated.\r
-  //\r
-  ASSERT_EFI_ERROR (Status); \r
-  ASSERT (SizeNv == Size);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideIfSuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  )  \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the Name ends with specified Suffix.\r
-  For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",\r
-  the Suffix matches the end of Name, so the variable will be loaded from NV\r
-  provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
-  Suffix           - Suffix the Name should end with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-Returns:\r
-  EFI_SUCCESS           - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.\r
-  EFI_NOT_FOUND         - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR        - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-{\r
-  UINTN         StrLength;\r
-  UINTN         StrLenSuffix;\r
-\r
-  StrLength       = StrLen (Name);\r
-  StrLenSuffix    = StrLen (Suffix);\r
-  if ((StrLength <= StrLenSuffix) || (0 != StrCmp (Suffix, &Name[StrLength - StrLenSuffix]))) {\r
-    //\r
-    // Not ending with <Suffix>.\r
-    //\r
-    return EFI_INVALID_PARAMETER; \r
-  }\r
-  return EfiLibHiiVariableRetrieveFromNv (Name, Guid, Size, &Var);\r
-}\r
-\r
-EFI_STATUS\r
-EfiLibHiiVariableOverrideBySuffix (\r
-  IN  CHAR16                 *Suffix,\r
-  IN  CHAR16                 *Name,\r
-  IN  EFI_GUID               *Guid,\r
-  IN  UINTN                   Size,\r
-  OUT VOID                   *Var\r
-  ) \r
-/*++\r
-\r
-Routine Description:\r
-  Overrrides the variable with NV data if found.\r
-  But it only does it if the NV contains the same variable with Name is appended with Suffix.  \r
-  For example, if Suffix="MyOverride" and the Name="XyzSetup",\r
-  the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"\r
-  will be loaded from NV provided the variable exists and the GUID and Size matches.\r
-\r
-Arguments:\r
-  Suffix           - Suffix the variable will be appended with.\r
-  Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.\r
-  Var              - Variable will be retrieved into this buffer.\r
-                     Caller is responsible for providing storage of exactly Size size in bytes.\r
-\r
-Returns:\r
-  EFI_SUCCESS    - The variable was overriden with NV variable of same Name/Guid/Size.\r
-  EFI_NOT_FOUND  - The variable of this Name/Guid was not found in the NV.\r
-  EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.\r
-\r
---*/\r
-{\r
-  EFI_STATUS    Status;\r
-  CHAR16       *NameSuffixed;\r
-  UINTN         NameLength;\r
-  UINTN         SuffixLength;\r
-\r
-  //\r
-  // enough to concatenate both strings.\r
-  //\r
-  NameLength   = StrLen (Name);\r
-  SuffixLength = StrLen (Suffix);\r
-  NameSuffixed = AllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16)); \r
-  \r
-  StrCpy (NameSuffixed, Name);\r
-  StrCat (NameSuffixed, Suffix);\r
-  \r
-  Status = EfiLibHiiVariableRetrieveFromNv (NameSuffixed, Guid, Size, &Var);\r
-  gBS->FreePool (NameSuffixed);\r
-  \r
-  return Status;\r
-}\r
-\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/Console.c b/IntelFrameworkPkg/Library/UefiLibFramework/Console.c
deleted file mode 100644 (file)
index 6260555..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/** @file\r
-  Mde UEFI library functions.\r
-\r
-  Copyright (c) 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  Console.c\r
-\r
-**/\r
-\r
-#include "UefiLibFramework.h"\r
-\r
-typedef struct {\r
-  CHAR16  WChar;\r
-  UINT32  Width;\r
-} UNICODE_WIDTH_ENTRY;\r
-\r
-UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {\r
-  //\r
-  // General script area\r
-  //\r
-  {(CHAR16)0x1FFF,  1},\r
-  /*\r
-   * Merge the blocks and replace them with the above entry as they fall to\r
-   * the same category and they are all narrow glyph. This will reduce search\r
-   * time and table size. The merge will omit the reserved code.\r
-   *\r
-   * Remove the above item if below is un-commented.\r
-   *\r
-  {(CHAR16)0x007F,  1},       // C0 controls and basic Latin. 0x0000-0x007F\r
-  {(CHAR16)0x00FF,  1},       // C1 controls and Latin-1 support. 0x0080-0x00FF\r
-  {(CHAR16)0x017F,  1},       // Latin extended-A. 0x0100-0x017F\r
-  {(CHAR16)0x024F,  1},       // Latin extended-B. 0x0180-0x024F\r
-  {(CHAR16)0x02AF,  1},       // IPA extensions. 0x0250-0x02AF\r
-  {(CHAR16)0x02FF,  1},       // Spacing modifier letters. 0x02B0-0x02FF\r
-  {(CHAR16)0x036F,  1},       // Combining diacritical marks. 0x0300-0x036F\r
-  {(CHAR16)0x03FF,  1},       // Greek. 0x0370-0x03FF\r
-  {(CHAR16)0x04FF,  1},       // Cyrillic. 0x0400-0x04FF\r
-  {(CHAR16)0x052F,  0},       // Unassigned. As Armenian in ver3.0. 0x0500-0x052F\r
-  {(CHAR16)0x058F,  1},       // Armenian. 0x0530-0x058F\r
-  {(CHAR16)0x05FF,  1},       // Hebrew. 0x0590-0x05FF\r
-  {(CHAR16)0x06FF,  1},       // Arabic. 0x0600-0x06FF\r
-  {(CHAR16)0x08FF,  0},       // Unassigned. 0x0700-0x08FF\r
-  {(CHAR16)0x097F,  1},       // Devanagari. 0x0900-0x097F\r
-  {(CHAR16)0x09FF,  1},       // Bengali. 0x0980-0x09FF\r
-  {(CHAR16)0x0A7F,  1},       // Gurmukhi. 0x0A00-0x0A7F\r
-  {(CHAR16)0x0AFF,  1},       // Gujarati. 0x0A80-0x0AFF\r
-  {(CHAR16)0x0B7F,  1},       // Oriya. 0x0B00-0x0B7F\r
-  {(CHAR16)0x0BFF,  1},       // Tamil. (See page 7-92). 0x0B80-0x0BFF\r
-  {(CHAR16)0x0C7F,  1},       // Telugu. 0x0C00-0x0C7F\r
-  {(CHAR16)0x0CFF,  1},       // Kannada. (See page 7-100). 0x0C80-0x0CFF\r
-  {(CHAR16)0x0D7F,  1},       // Malayalam (See page 7-104). 0x0D00-0x0D7F\r
-  {(CHAR16)0x0DFF,  0},       // Unassigned. 0x0D80-0x0DFF\r
-  {(CHAR16)0x0E7F,  1},       // Thai. 0x0E00-0x0E7F\r
-  {(CHAR16)0x0EFF,  1},       // Lao. 0x0E80-0x0EFF\r
-  {(CHAR16)0x0FBF,  1},       // Tibetan. 0x0F00-0x0FBF\r
-  {(CHAR16)0x109F,  0},       // Unassigned. 0x0FC0-0x109F\r
-  {(CHAR16)0x10FF,  1},       // Georgian. 0x10A0-0x10FF\r
-  {(CHAR16)0x11FF,  1},       // Hangul Jamo. 0x1100-0x11FF\r
-  {(CHAR16)0x1DFF,  0},       // Unassigned. 0x1200-0x1DFF\r
-  {(CHAR16)0x1EFF,  1},       // Latin extended additional. 0x1E00-0x1EFF\r
-  {(CHAR16)0x1FFF,  1},       // Greek extended. 0x1F00-0x1FFF\r
-  *\r
-  */\r
-\r
-  //\r
-  // Symbol area\r
-  //\r
-  {(CHAR16)0x2FFF,  1},\r
-  /*\r
-   * Merge the blocks and replace them with the above entry as they fall to\r
-   * the same category and they are all narrow glyph. This will reduce search\r
-   * time and table size. The merge will omit the reserved code.\r
-   *\r
-   * Remove the above item if below is un-commented.\r
-   *\r
-  {(CHAR16)0x206F,  1},       // General punctuation. (See page7-154). 0x200-0x206F\r
-  {(CHAR16)0x209F,  1},       // Superscripts and subscripts. 0x2070-0x209F\r
-  {(CHAR16)0x20CF,  1},       // Currency symbols. 0x20A0-0x20CF\r
-  {(CHAR16)0x20FF,  1},       // Combining diacritical marks for symbols. 0x20D0-0x20FF\r
-  {(CHAR16)0x214F,  1},       // Letterlike sympbols. 0x2100-0x214F\r
-  {(CHAR16)0x218F,  1},       // Number forms. 0x2150-0x218F\r
-  {(CHAR16)0x21FF,  1},       // Arrows. 0x2190-0x21FF\r
-  {(CHAR16)0x22FF,  1},       // Mathematical operators. 0x2200-0x22FF\r
-  {(CHAR16)0x23FF,  1},       // Miscellaneous technical. 0x2300-0x23FF\r
-  {(CHAR16)0x243F,  1},       // Control pictures. 0x2400-0x243F\r
-  {(CHAR16)0x245F,  1},       // Optical character recognition. 0x2440-0x245F\r
-  {(CHAR16)0x24FF,  1},       // Enclosed alphanumerics. 0x2460-0x24FF\r
-  {(CHAR16)0x257F,  1},       // Box drawing. 0x2500-0x257F\r
-  {(CHAR16)0x259F,  1},       // Block elements. 0x2580-0x259F\r
-  {(CHAR16)0x25FF,  1},       // Geometric shapes. 0x25A0-0x25FF\r
-  {(CHAR16)0x26FF,  1},       // Miscellaneous symbols. 0x2600-0x26FF\r
-  {(CHAR16)0x27BF,  1},       // Dingbats. 0x2700-0x27BF\r
-  {(CHAR16)0x2FFF,  0},       // Reserved. 0x27C0-0x2FFF\r
-  *\r
-  */\r
-\r
-  //\r
-  // CJK phonetics and symbol area\r
-  //\r
-  {(CHAR16)0x33FF,  2},\r
-  /*\r
-   * Merge the blocks and replace them with the above entry as they fall to\r
-   * the same category and they are all wide glyph. This will reduce search\r
-   * time and table size. The merge will omit the reserved code.\r
-   *\r
-   * Remove the above item if below is un-commented.\r
-   *\r
-  {(CHAR16)0x303F,  2},       // CJK symbols and punctuation. 0x3000-0x303F\r
-  {(CHAR16)0x309F,  2},       // Hiragana. 0x3040-0x309F\r
-  {(CHAR16)0x30FF,  2},       // Katakana. 0x30A0-0x30FF\r
-  {(CHAR16)0x312F,  2},       // Bopomofo. 0x3100-0x312F\r
-  {(CHAR16)0x318F,  2},       // Hangul compatibility jamo. 0x3130-0x318F\r
-  {(CHAR16)0x319F,  2},       // Kanbun. 0x3190-0x319F\r
-  {(CHAR16)0x31FF,  0},       // Reserved. As Bopomofo extended in ver3.0. 0x31A0-0x31FF\r
-  {(CHAR16)0x32FF,  2},       // Enclosed CJK letters and months. 0x3200-0x32FF\r
-  {(CHAR16)0x33FF,  2},       // CJK compatibility. 0x3300-0x33FF\r
-  *\r
-  */\r
-\r
-  //\r
-  // CJK ideograph area\r
-  //\r
-  {(CHAR16)0x9FFF,  2},\r
-  /*\r
-   * Merge the blocks and replace them with the above entry as they fall to\r
-   * the same category and they are all wide glyph. This will reduce search\r
-   * time and table size. The merge will omit the reserved code.\r
-   *\r
-   * Remove the above item if below is un-commented.\r
-   *\r
-  {(CHAR16)0x4DFF,  0},       // Reserved. 0x3400-0x4DBF as CJK unified ideographs\r
-                      // extension A in ver3.0. 0x3400-0x4DFF\r
-  {(CHAR16)0x9FFF,  2},       // CJK unified ideographs. 0x4E00-0x9FFF\r
-  *\r
-  */\r
-\r
-  //\r
-  // Reserved\r
-  //\r
-  {(CHAR16)0xABFF,  0},       // Reserved. 0xA000-0xA490 as Yi syllables. 0xA490-0xA4D0\r
-  // as Yi radicals in ver3.0. 0xA000-0xABFF\r
-  //\r
-  // Hangul syllables\r
-  //\r
-  {(CHAR16)0xD7FF,  2},\r
-  /*\r
-   * Merge the blocks and replace them with the above entry as they fall to\r
-   * the same category and they are all wide glyph. This will reduce search\r
-   * time and table size. The merge will omit the reserved code.\r
-   *\r
-   * Remove the above item if below is un-commented.\r
-   *\r
-  {(CHAR16)0xD7A3,  2},       // Hangul syllables. 0xAC00-0xD7A3\r
-  {(CHAR16)0xD7FF,  0},       // Reserved. 0xD7A3-0xD7FF\r
-  *\r
-  */\r
-\r
-  //\r
-  // Surrogates area\r
-  //\r
-  {(CHAR16)0xDFFF,  0},       // Surrogates, not used now. 0xD800-0xDFFF\r
-\r
-  //\r
-  // Private use area\r
-  //\r
-  {(CHAR16)0xF8FF,  0},       // Private use area. 0xE000-0xF8FF\r
-\r
-  //\r
-  // Compatibility area and specials\r
-  //\r
-  {(CHAR16)0xFAFF,  2},       // CJK compatibility ideographs. 0xF900-0xFAFF\r
-  {(CHAR16)0xFB4F,  1},       // Alphabetic presentation forms. 0xFB00-0xFB4F\r
-  {(CHAR16)0xFDFF,  1},       // Arabic presentation forms-A. 0xFB50-0xFDFF\r
-  {(CHAR16)0xFE1F,  0},       // Reserved. As variation selectors in ver3.0. 0xFE00-0xFE1F\r
-  {(CHAR16)0xFE2F,  1},       // Combining half marks. 0xFE20-0xFE2F\r
-  {(CHAR16)0xFE4F,  2},       // CJK compatibility forms. 0xFE30-0xFE4F\r
-  {(CHAR16)0xFE6F,  1},       // Small Form Variants. 0xFE50-0xFE6F\r
-  {(CHAR16)0xFEFF,  1},       // Arabic presentation forms-B. 0xFE70-0xFEFF\r
-  {(CHAR16)0xFFEF,  1},       // Half width and full width forms. 0xFF00-0xFFEF\r
-  {(CHAR16)0xFFFF,  0},       // Speicials. 0xFFF0-0xFFFF\r
-};\r
-\r
-/**\r
-  This function computes and returns the width of the Unicode character\r
-  specified by UnicodeChar.\r
-\r
-  @param  UnicodeChar   A Unicode character.\r
-\r
-  @retval 0             The width if UnicodeChar could not be determined.\r
-  @retval 1             UnicodeChar is a narrow glyph.\r
-  @retval 2             UnicodeChar is a wide glyph.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-GetGlyphWidth (\r
-  IN CHAR16  UnicodeChar\r
-  )\r
-{\r
-  UINTN               Index;\r
-  UINTN               Low;\r
-  UINTN               High;\r
-  UNICODE_WIDTH_ENTRY *Item;\r
-\r
-  Item  = NULL;\r
-  Low   = 0;\r
-  High  = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;\r
-  while (Low <= High) {\r
-    Index = (Low + High) >> 1;\r
-    Item  = &(mUnicodeWidthTable[Index]);\r
-    if (Index == 0) {\r
-      if (UnicodeChar <= Item->WChar) {\r
-        break;\r
-      }\r
-\r
-      return 0;\r
-    }\r
-\r
-    if (UnicodeChar > Item->WChar) {\r
-      Low = Index + 1;\r
-    } else if (UnicodeChar <= mUnicodeWidthTable[Index - 1].WChar) {\r
-      High = Index - 1;\r
-    } else {\r
-      //\r
-      // Index - 1 < UnicodeChar <= Index. Found\r
-      //\r
-      break;\r
-    }\r
-  }\r
-\r
-  if (Low <= High) {\r
-    return Item->Width;\r
-  }\r
-\r
-  return 0;\r
-}\r
-\r
-/**\r
-  This function computes and returns the display length of\r
-  the Null-terminated Unicode string specified by String.\r
-  If String is NULL, then 0 is returned.\r
-  If any of the widths of the Unicode characters in String\r
-  can not be determined, then 0 is returned.\r
-\r
-  @param  String      A pointer to a Null-terminated Unicode string.\r
-\r
-  @return The display length of the Null-terminated Unicode string specified by String.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-UnicodeStringDisplayLength (\r
-  IN CONST CHAR16  *String\r
-  )\r
-{\r
-  UINTN      Length;\r
-  UINTN      Width;\r
-\r
-  if (String == NULL) {\r
-    return 0;\r
-  }\r
-\r
-  Length = 0;\r
-  while (*String != 0) {\r
-    Width = GetGlyphWidth (*String);\r
-    if (Width == 0) {\r
-      return 0;\r
-    }\r
-\r
-    Length += Width;\r
-    String++;\r
-  }\r
-\r
-  return Length;\r
-}\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiDriverModel.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiDriverModel.c
deleted file mode 100644 (file)
index f6919a6..0000000
+++ /dev/null
@@ -1,667 +0,0 @@
-/** @file\r
-  Library functions that abstract driver model protocols\r
-  installation.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR> All rights\r
-  reserved. This program and the accompanying materials are\r
-  licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-  \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/ \r
-\r
-#include "UefiLibFramework.h"\r
-\r
-/**\r
-  Intialize a driver by installing the Driver Binding Protocol onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but\r
-  it can be different if the driver produces multiple DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
-  If the installation fails, then ASSERT ().\r
-\r
-  @param  ImageHandle                 The image handle of the driver.\r
-  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
-  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
-  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
-                                      parameter is NULL, then a new handle is created.\r
-\r
-  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
-  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiLibInstallDriverBinding (\r
-  IN CONST EFI_HANDLE             ImageHandle,\r
-  IN CONST EFI_SYSTEM_TABLE       *SystemTable,\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding,\r
-  IN EFI_HANDLE                   DriverBindingHandle\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  ASSERT (NULL != DriverBinding);\r
-\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &DriverBindingHandle,\r
-                  &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                  NULL\r
-                  );\r
-  //\r
-  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
-  //\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
-  Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle.  This is\r
-  typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
-  DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
-  If the installation fails, then ASSERT ().\r
-\r
-  @param  ImageHandle                 The image handle of the driver.\r
-  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
-  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
-  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
-                                      parameter is NULL, then a new handle is created.\r
-  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
-  @param  DriverConfiguration         A Driver Configuration Protocol instance that this driver is producing.\r
-  @param  DriverDiagnostics           A Driver Diagnostics Protocol instance that this driver is producing.\r
-\r
-  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
-  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiLibInstallAllDriverProtocols (\r
-  IN CONST EFI_HANDLE                         ImageHandle,\r
-  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
-  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
-  IN EFI_HANDLE                               DriverBindingHandle,\r
-  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
-  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
-  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics    OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  ASSERT (NULL != DriverBinding);\r
-\r
-  if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
-    if (DriverConfiguration == NULL) {\r
-      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                        NULL\r
-                        );\r
-      } else {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                        &gEfiComponentNameProtocolGuid, ComponentName,\r
-                        NULL\r
-                        );\r
-      }\r
-    } else {\r
-      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
-                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                        NULL\r
-                        );\r
-      } else {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
-                        &gEfiComponentNameProtocolGuid,       ComponentName,\r
-                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                        NULL\r
-                        );\r
-      }\r
-    }\r
-  } else {\r
-    if (DriverConfiguration == NULL) {\r
-      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
-                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                        NULL\r
-                        );\r
-      } else {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,     DriverBinding,\r
-                        &gEfiComponentNameProtocolGuid,     ComponentName,\r
-                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                        NULL\r
-                        );\r
-      }\r
-    } else {\r
-      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
-                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
-                        NULL\r
-                        );\r
-      } else {\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &DriverBindingHandle,\r
-                        &gEfiDriverBindingProtocolGuid,       DriverBinding,\r
-                        &gEfiComponentNameProtocolGuid,       ComponentName,\r
-                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,\r
-                        NULL\r
-                        );\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
-  //\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
-  Component Name 2 onto the driver's DriverBindingHandle.  This is typically the same as the driver's\r
-  ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
-  If the installation fails, then ASSERT ().\r
-\r
-  @param  ImageHandle                 The image handle of the driver.\r
-  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
-  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
-  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
-                                      parameter is NULL, then a new handle is created.\r
-  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
-  @param  ComponentName2              A Component Name 2 Protocol instance that this driver is producing.\r
-\r
-  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
-  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiLibInstallDriverBindingComponentName2 (\r
-  IN CONST EFI_HANDLE                         ImageHandle,\r
-  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
-  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
-  IN EFI_HANDLE                               DriverBindingHandle,\r
-  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
-  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2       OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  ASSERT (NULL != DriverBinding);\r
-\r
-  if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-    if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-      Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
-                      &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                      NULL\r
-                      );\r
-      } else {\r
-      Status = gBS->InstallMultipleProtocolInterfaces (\r
-                      &DriverBindingHandle,\r
-                      &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                      &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                      NULL\r
-                      );\r
-     }\r
-  } else {\r
-     if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
-                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                       &gEfiComponentNameProtocolGuid, ComponentName,\r
-                       NULL\r
-                       );\r
-     } else {\r
-       Status = gBS->InstallMultipleProtocolInterfaces (\r
-                       &DriverBindingHandle,\r
-                       &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                       &gEfiComponentNameProtocolGuid, ComponentName,\r
-                       &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                       NULL\r
-                       );\r
-    }\r
-  }\r
-  //\r
-  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
-  //\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-/**\r
-  Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
-  Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's\r
-  DriverBindingHandle.  This is typically the same as the driver's ImageHandle, but it can be different if\r
-  the driver produces multiple DriverBinding Protocols. \r
-  If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
-  If the installation fails, then ASSERT ().\r
-\r
-  @param  ImageHandle                 The image handle of the driver.\r
-  @param  SystemTable                 The EFI System Table that was passed to the driver's entry point.\r
-  @param  DriverBinding               A Driver Binding Protocol instance that this driver is producing.\r
-  @param  DriverBindingHandle         The handle that DriverBinding is to be installe onto.  If this\r
-                                      parameter is NULL, then a new handle is created.\r
-  @param  ComponentName               A Component Name Protocol instance that this driver is producing.\r
-  @param  ComponentName2              A Component Name 2 Protocol instance that this driver is producing.\r
-  @param  DriverConfiguration         A Driver Configuration Protocol instance that this driver is producing.\r
-  @param  DriverDiagnostics           A Driver Diagnostics Protocol instance that this driver is producing.\r
-  @param  DriverDiagnostics2          A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
-\r
-  @retval EFI_SUCCESS                 The protocol installation is completed successfully.\r
-  @retval Others                      Status from gBS->InstallMultipleProtocolInterfaces().\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiLibInstallAllDriverProtocols2 (\r
-  IN CONST EFI_HANDLE                         ImageHandle,\r
-  IN CONST EFI_SYSTEM_TABLE                   *SystemTable,\r
-  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,\r
-  IN EFI_HANDLE                               DriverBindingHandle,\r
-  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL\r
-  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2,      OPTIONAL\r
-  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL\r
-  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics,   OPTIONAL\r
-  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2   OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  ASSERT (NULL != DriverBinding);\r
-\r
-  if (DriverConfiguration == NULL) {\r
-    if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
-      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      } else {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      }\r
-    } else {\r
-      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      } else {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      }\r
-    }\r
-  } else {\r
-    if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {\r
-      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      } else {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      }\r
-    } else {\r
-      if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      } else {\r
-        if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        } else {\r
-          if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          } else {\r
-            Status = gBS->InstallMultipleProtocolInterfaces (\r
-                            &DriverBindingHandle,\r
-                            &gEfiDriverBindingProtocolGuid, DriverBinding,\r
-                            &gEfiComponentNameProtocolGuid, ComponentName,\r
-                            &gEfiComponentName2ProtocolGuid, ComponentName2,\r
-                            &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,\r
-                            &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,\r
-                            &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,\r
-                            NULL\r
-                            );\r
-          }\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  //\r
-  // ASSERT if the call to InstallMultipleProtocolInterfaces() failed\r
-  //\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol\r
-  //\r
-  DriverBinding->ImageHandle         = ImageHandle;\r
-  DriverBinding->DriverBindingHandle = DriverBindingHandle;\r
-\r
-  return Status;\r
-}\r
-\r
-\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c
deleted file mode 100644 (file)
index 65c7641..0000000
+++ /dev/null
@@ -1,813 +0,0 @@
-/** @file\r
-  Mde UEFI library functions.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  UefiLib.c\r
-\r
-**/\r
-\r
-#include "UefiLibFramework.h"\r
-\r
-/**\r
-  Compare whether two names of languages are identical.\r
-\r
-  @param  Language1 Name of language 1.\r
-  @param  Language2 Name of language 2.\r
-\r
-  @retval TRUE      Language 1 and language 2 are the same.\r
-  @retval FALSE     Language 1 and language 2 are not the same.\r
-\r
-**/\r
-STATIC\r
-BOOLEAN\r
-CompareIso639LanguageCode (\r
-  IN CONST CHAR8  *Language1,\r
-  IN CONST CHAR8  *Language2\r
-  )\r
-{\r
-  UINT32  Name1;\r
-  UINT32  Name2;\r
-\r
-  Name1 = ReadUnaligned24 ((CONST UINT32 *) Language1);\r
-  Name2 = ReadUnaligned24 ((CONST UINT32 *) Language2);\r
-\r
-  return (BOOLEAN) (Name1 == Name2);\r
-}\r
-\r
-/**\r
-  This function searches the list of configuration tables stored in the EFI System\r
-  Table for a table with a GUID that matches TableGuid.  If a match is found,\r
-  then a pointer to the configuration table is returned in Table, and EFI_SUCCESS\r
-  is returned.  If a matching GUID is not found, then EFI_NOT_FOUND is returned.\r
-\r
-  @param  TableGuid       Pointer to table's GUID type..\r
-  @param  Table           Pointer to the table associated with TableGuid in the EFI System Table.\r
-\r
-  @retval EFI_SUCCESS     A configuration table matching TableGuid was found.\r
-  @retval EFI_NOT_FOUND   A configuration table matching TableGuid could not be found.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiGetSystemConfigurationTable (\r
-  IN  EFI_GUID  *TableGuid,\r
-  OUT VOID      **Table\r
-  )\r
-{\r
-  EFI_SYSTEM_TABLE  *SystemTable;\r
-  UINTN             Index;\r
-\r
-  ASSERT (TableGuid != NULL);\r
-  ASSERT (Table != NULL);\r
-\r
-  SystemTable = gST;\r
-  *Table = NULL;\r
-  for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {\r
-    if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {\r
-      *Table = SystemTable->ConfigurationTable[Index].VendorTable;\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-/**\r
-  This function causes the notification function to be executed for every protocol\r
-  of type ProtocolGuid instance that exists in the system when this function is\r
-  invoked.  In addition, every time a protocol of type ProtocolGuid instance is\r
-  installed or reinstalled, the notification function is also executed.\r
-\r
-  @param  ProtocolGuid    Supplies GUID of the protocol upon whose installation the event is fired.\r
-  @param  NotifyTpl       Supplies the task priority level of the event notifications.\r
-  @param  NotifyFunction  Supplies the function to notify when the event is signaled.\r
-  @param  NotifyContext   The context parameter to pass to NotifyFunction.\r
-  @param  Registration    A pointer to a memory location to receive the registration value.\r
-\r
-  @return The notification event that was created.\r
-\r
-**/\r
-EFI_EVENT\r
-EFIAPI\r
-EfiCreateProtocolNotifyEvent(\r
-  IN  EFI_GUID          *ProtocolGuid,\r
-  IN  EFI_TPL           NotifyTpl,\r
-  IN  EFI_EVENT_NOTIFY  NotifyFunction,\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
-  OUT VOID              **Registration\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_EVENT   Event;\r
-\r
-  //\r
-  // Create the event\r
-  //\r
-\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  NotifyTpl,\r
-                  NotifyFunction,\r
-                  NotifyContext,\r
-                  &Event\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Register for protocol notifactions on this event\r
-  //\r
-\r
-  Status = gBS->RegisterProtocolNotify (\r
-                  ProtocolGuid,\r
-                  Event,\r
-                  Registration\r
-                  );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Kick the event so we will perform an initial pass of\r
-  // current installed drivers\r
-  //\r
-\r
-  gBS->SignalEvent (Event);\r
-  return Event;\r
-}\r
-\r
-/**\r
-  This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r
-  This event is signaled with EfiNamedEventSignal().  This provide the ability for\r
-  one or more listeners on the same event named by the GUID specified by Name.\r
-\r
-  @param  Name                  Supplies GUID name of the event.\r
-  @param  NotifyTpl             Supplies the task priority level of the event notifications.\r
-  @param  NotifyFunction        Supplies the function to notify when the event is signaled.\r
-  @param  NotifyContext         The context parameter to pass to NotifyFunction.\r
-  @param  Registration          A pointer to a memory location to receive the registration value.\r
-\r
-  @retval EFI_SUCCESS           A named event was created.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to create the named event.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiNamedEventListen (\r
-  IN CONST EFI_GUID    *Name,\r
-  IN EFI_TPL           NotifyTpl,\r
-  IN EFI_EVENT_NOTIFY  NotifyFunction,\r
-  IN CONST VOID        *NotifyContext,  OPTIONAL\r
-  OUT VOID             *Registration OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_EVENT   Event;\r
-  VOID        *RegistrationLocal;\r
-\r
-  //\r
-  // Create event\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  NotifyTpl,\r
-                  NotifyFunction,\r
-                  (VOID *) NotifyContext,\r
-                  &Event\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // The Registration is not optional to RegisterProtocolNotify().\r
-  // To make it optional to EfiNamedEventListen(), may need to substitute with a local.\r
-  //\r
-  if (Registration != NULL) {\r
-    RegistrationLocal = Registration;\r
-  } else {\r
-    RegistrationLocal = &RegistrationLocal;\r
-  }\r
-\r
-  //\r
-  // Register for an installation of protocol interface\r
-  //\r
-\r
-  Status = gBS->RegisterProtocolNotify (\r
-                  (EFI_GUID *) Name,\r
-                  Event,\r
-                  RegistrationLocal\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  This function signals the named event specified by Name.  The named event must\r
-  have been created with EfiNamedEventListen().\r
-\r
-  @param  Name                  Supplies GUID name of the event.\r
-\r
-  @retval EFI_SUCCESS           A named event was signaled.\r
-  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to signal the named event.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiNamedEventSignal (\r
-  IN CONST EFI_GUID  *Name\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-  EFI_HANDLE  Handle;\r
-\r
-  Handle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
-                  &Handle,\r
-                  (EFI_GUID *) Name,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = gBS->UninstallProtocolInterface (\r
-                  Handle,\r
-                  (EFI_GUID *) Name,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Returns the current TPL.\r
-\r
-  This function returns the current TPL.  There is no EFI service to directly\r
-  retrieve the current TPL. Instead, the RaiseTPL() function is used to raise\r
-  the TPL to TPL_HIGH_LEVEL.  This will return the current TPL.  The TPL level\r
-  can then immediately be restored back to the current TPL level with a call\r
-  to RestoreTPL().\r
-\r
-  @param  VOID\r
-\r
-  @retvale EFI_TPL              The current TPL.\r
-\r
-**/\r
-EFI_TPL\r
-EFIAPI\r
-EfiGetCurrentTpl (\r
-  VOID\r
-  )\r
-{\r
-  EFI_TPL Tpl;\r
-\r
-  Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
-  gBS->RestoreTPL (Tpl);\r
-\r
-  return Tpl;\r
-}\r
-\r
-\r
-/**\r
-  This function initializes a basic mutual exclusion lock to the released state\r
-  and returns the lock.  Each lock provides mutual exclusion access at its task\r
-  priority level.  Since there is no preemption or multiprocessor support in EFI,\r
-  acquiring the lock only consists of raising to the locks TPL.\r
-\r
-  @param  Lock       A pointer to the lock data structure to initialize.\r
-  @param  Priority   EFI TPL associated with the lock.\r
-\r
-  @return The lock.\r
-\r
-**/\r
-EFI_LOCK *\r
-EFIAPI\r
-EfiInitializeLock (\r
-  IN OUT EFI_LOCK  *Lock,\r
-  IN EFI_TPL        Priority\r
-  )\r
-{\r
-  ASSERT (Lock != NULL);\r
-  ASSERT (Priority <= TPL_HIGH_LEVEL);\r
-\r
-  Lock->Tpl       = Priority;\r
-  Lock->OwnerTpl  = TPL_APPLICATION;\r
-  Lock->Lock      = EfiLockReleased ;\r
-  return Lock;\r
-}\r
-\r
-/**\r
-  This function raises the system's current task priority level to the task\r
-  priority level of the mutual exclusion lock.  Then, it places the lock in the\r
-  acquired state.\r
-\r
-  @param  Priority  The task priority level of the lock.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiAcquireLock (\r
-  IN EFI_LOCK  *Lock\r
-  )\r
-{\r
-  ASSERT (Lock != NULL);\r
-  ASSERT (Lock->Lock == EfiLockReleased);\r
-\r
-  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
-  Lock->Lock     = EfiLockAcquired;\r
-}\r
-\r
-/**\r
-  This function raises the system's current task priority level to the task\r
-  priority level of the mutual exclusion lock.  Then, it attempts to place the\r
-  lock in the acquired state.\r
-\r
-  @param  Lock              A pointer to the lock to acquire.\r
-\r
-  @retval EFI_SUCCESS       The lock was acquired.\r
-  @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiAcquireLockOrFail (\r
-  IN EFI_LOCK  *Lock\r
-  )\r
-{\r
-\r
-  ASSERT (Lock != NULL);\r
-  ASSERT (Lock->Lock != EfiLockUninitialized);\r
-\r
-  if (Lock->Lock == EfiLockAcquired) {\r
-    //\r
-    // Lock is already owned, so bail out\r
-    //\r
-    return EFI_ACCESS_DENIED;\r
-  }\r
-\r
-  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
-\r
-  Lock->Lock = EfiLockAcquired;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  This function transitions a mutual exclusion lock from the acquired state to\r
-  the released state, and restores the system's task priority level to its\r
-  previous level.\r
-\r
-  @param  Lock  A pointer to the lock to release.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiReleaseLock (\r
-  IN EFI_LOCK  *Lock\r
-  )\r
-{\r
-  EFI_TPL Tpl;\r
-\r
-  ASSERT (Lock != NULL);\r
-  ASSERT (Lock->Lock == EfiLockAcquired);\r
-\r
-  Tpl = Lock->OwnerTpl;\r
-\r
-  Lock->Lock = EfiLockReleased;\r
-\r
-  gBS->RestoreTPL (Tpl);\r
-}\r
-\r
-/**\r
-  Tests whether a controller handle is being managed by a specific driver.\r
-\r
-  This function tests whether the driver specified by DriverBindingHandle is\r
-  currently managing the controller specified by ControllerHandle.  This test\r
-  is performed by evaluating if the the protocol specified by ProtocolGuid is\r
-  present on ControllerHandle and is was opened by DriverBindingHandle with an\r
-  attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.\r
-  If ProtocolGuid is NULL, then ASSERT().\r
-\r
-  @param  ControllerHandle     A handle for a controller to test.\r
-  @param  DriverBindingHandle  Specifies the driver binding handle for the\r
-                               driver.\r
-  @param  ProtocolGuid         Specifies the protocol that the driver specified\r
-                               by DriverBindingHandle opens in its Start()\r
-                               function.\r
-\r
-  @retval EFI_SUCCESS          ControllerHandle is managed by the driver\r
-                               specifed by DriverBindingHandle.\r
-  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the driver\r
-                               specifed by DriverBindingHandle.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiTestManagedDevice (\r
-  IN CONST EFI_HANDLE       ControllerHandle,\r
-  IN CONST EFI_HANDLE       DriverBindingHandle,\r
-  IN CONST EFI_GUID         *ProtocolGuid\r
-  )\r
-{\r
-  EFI_STATUS     Status;\r
-  VOID           *ManagedInterface;\r
-\r
-  ASSERT (ProtocolGuid != NULL);\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  (EFI_GUID *) ProtocolGuid,\r
-                  &ManagedInterface,\r
-                  DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-           ControllerHandle,\r
-           (EFI_GUID *) ProtocolGuid,\r
-           DriverBindingHandle,\r
-           ControllerHandle\r
-           );\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Tests whether a child handle is a child device of the controller.\r
-\r
-  This function tests whether ChildHandle is one of the children of\r
-  ControllerHandle.  This test is performed by checking to see if the protocol\r
-  specified by ProtocolGuid is present on ControllerHandle and opened by\r
-  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
-  If ProtocolGuid is NULL, then ASSERT().\r
-\r
-  @param  ControllerHandle     A handle for a (parent) controller to test.\r
-  @param  ChildHandle          A child handle to test.\r
-  @param  ConsumsedGuid        Supplies the protocol that the child controller\r
-                               opens on its parent controller.\r
-\r
-  @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.\r
-  @retval EFI_UNSUPPORTED      ChildHandle is not a child of the\r
-                               ControllerHandle.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiTestChildHandle (\r
-  IN CONST EFI_HANDLE       ControllerHandle,\r
-  IN CONST EFI_HANDLE       ChildHandle,\r
-  IN CONST EFI_GUID         *ProtocolGuid\r
-  )\r
-{\r
-  EFI_STATUS                            Status;\r
-  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY   *OpenInfoBuffer;\r
-  UINTN                                 EntryCount;\r
-  UINTN                                 Index;\r
-\r
-  ASSERT (ProtocolGuid != NULL);\r
-\r
-  //\r
-  // Retrieve the list of agents that are consuming the specific protocol\r
-  // on ControllerHandle.\r
-  //\r
-  Status = gBS->OpenProtocolInformation (\r
-                  ControllerHandle,\r
-                  (EFI_GUID *) ProtocolGuid,\r
-                  &OpenInfoBuffer,\r
-                  &EntryCount\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Inspect if ChildHandle is one of the agents.\r
-  //\r
-  Status = EFI_UNSUPPORTED;\r
-  for (Index = 0; Index < EntryCount; Index++) {\r
-    if ((OpenInfoBuffer[Index].ControllerHandle == ChildHandle) &&\r
-        (OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
-      Status = EFI_SUCCESS;\r
-      break;\r
-    }\r
-  }\r
-\r
-  FreePool (OpenInfoBuffer);\r
-  return Status;\r
-}\r
-\r
-/**\r
-  This function looks up a Unicode string in UnicodeStringTable.  If Language is\r
-  a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r
-  that matches the language code specified by Language, then it is returned in\r
-  UnicodeString.\r
-\r
-  @param  Language                A pointer to the ISO 639-2 language code for the\r
-                                  Unicode string to look up and return.\r
-  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
-                                  that the Unicode string table supports.  Language\r
-                                  must be a member of this set.\r
-  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
-  @param  UnicodeString           A pointer to the Unicode string from UnicodeStringTable\r
-                                  that matches the language specified by Language.\r
-\r
-  @retval  EFI_SUCCESS            The Unicode string that matches the language\r
-                                  specified by Language was found\r
-                                  in the table of Unicoide strings UnicodeStringTable,\r
-                                  and it was returned in UnicodeString.\r
-  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
-  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
-  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
-  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
-  @retval  EFI_UNSUPPORTED        The language specified by Language is not a\r
-                                  member of SupportedLanguages.\r
-  @retval  EFI_UNSUPPORTED        The language specified by Language is not\r
-                                  supported by UnicodeStringTable.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LookupUnicodeString (\r
-  IN CONST CHAR8                     *Language,\r
-  IN CONST CHAR8                     *SupportedLanguages,\r
-  IN CONST EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,\r
-  OUT CHAR16                         **UnicodeString\r
-  )\r
-{\r
-  //\r
-  // Make sure the parameters are valid\r
-  //\r
-  if (Language == NULL || UnicodeString == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // If there are no supported languages, or the Unicode String Table is empty, then the\r
-  // Unicode String specified by Language is not supported by this Unicode String Table\r
-  //\r
-  if (SupportedLanguages == NULL || UnicodeStringTable == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Make sure Language is in the set of Supported Languages\r
-  //\r
-  while (*SupportedLanguages != 0) {\r
-    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
-\r
-      //\r
-      // Search the Unicode String Table for the matching Language specifier\r
-      //\r
-      while (UnicodeStringTable->Language != NULL) {\r
-        if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {\r
-\r
-          //\r
-          // A matching string was found, so return it\r
-          //\r
-          *UnicodeString = UnicodeStringTable->UnicodeString;\r
-          return EFI_SUCCESS;\r
-        }\r
-\r
-        UnicodeStringTable++;\r
-      }\r
-\r
-      return EFI_UNSUPPORTED;\r
-    }\r
-\r
-    SupportedLanguages += 3;\r
-  }\r
-\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
-  This function adds a Unicode string to UnicodeStringTable.\r
-  If Language is a member of SupportedLanguages then UnicodeString is added to\r
-  UnicodeStringTable.  New buffers are allocated for both Language and\r
-  UnicodeString.  The contents of Language and UnicodeString are copied into\r
-  these new buffers.  These buffers are automatically freed when\r
-  FreeUnicodeStringTable() is called.\r
-\r
-  @param  Language                A pointer to the ISO 639-2 language code for the Unicode\r
-                                  string to add.\r
-  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
-                                  that the Unicode string table supports.\r
-                                  Language must be a member of this set.\r
-  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
-  @param  UnicodeString           A pointer to the Unicode string to add.\r
-\r
-  @retval EFI_SUCCESS             The Unicode string that matches the language\r
-                                  specified by Language was found in the table of\r
-                                  Unicode strings UnicodeStringTable, and it was\r
-                                  returned in UnicodeString.\r
-  @retval EFI_INVALID_PARAMETER   Language is NULL.\r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
-  @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
-  @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
-  @retval EFI_ALREADY_STARTED     A Unicode string with language Language is\r
-                                  already present in UnicodeStringTable.\r
-  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to add another\r
-                                  Unicode string to UnicodeStringTable.\r
-  @retval EFI_UNSUPPORTED         The language specified by Language is not a\r
-                                  member of SupportedLanguages.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-AddUnicodeString (\r
-  IN CONST CHAR8               *Language,\r
-  IN CONST CHAR8               *SupportedLanguages,\r
-  IN EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
-  IN CONST CHAR16              *UnicodeString\r
-  )\r
-{\r
-  UINTN                     NumberOfEntries;\r
-  EFI_UNICODE_STRING_TABLE  *OldUnicodeStringTable;\r
-  EFI_UNICODE_STRING_TABLE  *NewUnicodeStringTable;\r
-  UINTN                     UnicodeStringLength;\r
-\r
-  //\r
-  // Make sure the parameter are valid\r
-  //\r
-  if (Language == NULL || UnicodeString == NULL || UnicodeStringTable == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // If there are no supported languages, then a Unicode String can not be added\r
-  //\r
-  if (SupportedLanguages == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // If the Unicode String is empty, then a Unicode String can not be added\r
-  //\r
-  if (UnicodeString[0] == 0) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Make sure Language is a member of SupportedLanguages\r
-  //\r
-  while (*SupportedLanguages != 0) {\r
-    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
-\r
-      //\r
-      // Determine the size of the Unicode String Table by looking for a NULL Language entry\r
-      //\r
-      NumberOfEntries = 0;\r
-      if (*UnicodeStringTable != NULL) {\r
-        OldUnicodeStringTable = *UnicodeStringTable;\r
-        while (OldUnicodeStringTable->Language != NULL) {\r
-          if (CompareIso639LanguageCode (Language, OldUnicodeStringTable->Language)) {\r
-            return EFI_ALREADY_STARTED;\r
-          }\r
-\r
-          OldUnicodeStringTable++;\r
-          NumberOfEntries++;\r
-        }\r
-      }\r
-\r
-      //\r
-      // Allocate space for a new Unicode String Table.  It must hold the current number of\r
-      // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table\r
-      // marker\r
-      //\r
-      NewUnicodeStringTable = AllocatePool ((NumberOfEntries + 2) * sizeof (EFI_UNICODE_STRING_TABLE));\r
-      if (NewUnicodeStringTable == NULL) {\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-\r
-      //\r
-      // If the current Unicode String Table contains any entries, then copy them to the\r
-      // newly allocated Unicode String Table.\r
-      //\r
-      if (*UnicodeStringTable != NULL) {\r
-        CopyMem (\r
-           NewUnicodeStringTable,\r
-           *UnicodeStringTable,\r
-           NumberOfEntries * sizeof (EFI_UNICODE_STRING_TABLE)\r
-           );\r
-      }\r
-\r
-      //\r
-      // Allocate space for a copy of the Language specifier\r
-      //\r
-      NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language);\r
-      if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {\r
-        gBS->FreePool (NewUnicodeStringTable);\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-\r
-      //\r
-      // Compute the length of the Unicode String\r
-      //\r
-      for (UnicodeStringLength = 0; UnicodeString[UnicodeStringLength] != 0; UnicodeStringLength++)\r
-        ;\r
-\r
-      //\r
-      // Allocate space for a copy of the Unicode String\r
-      //\r
-      NewUnicodeStringTable[NumberOfEntries].UnicodeString = AllocateCopyPool (\r
-                                                              (UnicodeStringLength + 1) * sizeof (CHAR16),\r
-                                                              UnicodeString\r
-                                                              );\r
-      if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) {\r
-        gBS->FreePool (NewUnicodeStringTable[NumberOfEntries].Language);\r
-        gBS->FreePool (NewUnicodeStringTable);\r
-        return EFI_OUT_OF_RESOURCES;\r
-      }\r
-\r
-      //\r
-      // Mark the end of the Unicode String Table\r
-      //\r
-      NewUnicodeStringTable[NumberOfEntries + 1].Language       = NULL;\r
-      NewUnicodeStringTable[NumberOfEntries + 1].UnicodeString  = NULL;\r
-\r
-      //\r
-      // Free the old Unicode String Table\r
-      //\r
-      if (*UnicodeStringTable != NULL) {\r
-        gBS->FreePool (*UnicodeStringTable);\r
-      }\r
-\r
-      //\r
-      // Point UnicodeStringTable at the newly allocated Unicode String Table\r
-      //\r
-      *UnicodeStringTable = NewUnicodeStringTable;\r
-\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    SupportedLanguages += 3;\r
-  }\r
-\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
-  This function frees the table of Unicode strings in UnicodeStringTable.\r
-  If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
-  Otherwise, each language code, and each Unicode string in the Unicode string\r
-  table are freed, and EFI_SUCCESS is returned.\r
-\r
-  @param  UnicodeStringTable  A pointer to the table of Unicode strings.\r
-\r
-  @retval EFI_SUCCESS         The Unicode string table was freed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-FreeUnicodeStringTable (\r
-  IN EFI_UNICODE_STRING_TABLE  *UnicodeStringTable\r
-  )\r
-{\r
-  UINTN Index;\r
-\r
-  //\r
-  // If the Unicode String Table is NULL, then it is already freed\r
-  //\r
-  if (UnicodeStringTable == NULL) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Loop through the Unicode String Table until we reach the end of table marker\r
-  //\r
-  for (Index = 0; UnicodeStringTable[Index].Language != NULL; Index++) {\r
-\r
-    //\r
-    // Free the Language string from the Unicode String Table\r
-    //\r
-    gBS->FreePool (UnicodeStringTable[Index].Language);\r
-\r
-    //\r
-    // Free the Unicode String from the Unicode String Table\r
-    //\r
-    if (UnicodeStringTable[Index].UnicodeString != NULL) {\r
-      gBS->FreePool (UnicodeStringTable[Index].UnicodeString);\r
-    }\r
-  }\r
-\r
-  //\r
-  // Free the Unicode String Table itself\r
-  //\r
-  gBS->FreePool (UnicodeStringTable);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h
deleted file mode 100644 (file)
index 913b653..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-  Header file to include header files common to all source files in\r
-  UefiLibFramework.\r
-\r
-  Copyright (c) 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  UefiLibFramework.h\r
-\r
-**/\r
-\r
-#ifndef _UEFI_LIB_FRAMEWORK_H_\r
-#define _UEFI_LIB_FRAMEWORK_H_\r
-\r
-\r
-#include <FrameworkDxe.h>\r
-\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/ComponentName2.h>\r
-#include <Protocol/DriverConfiguration.h>\r
-#include <Protocol/DriverDiagnostics.h>\r
-#include <Protocol/DriverDiagnostics2.h>\r
-\r
-#include <Guid/EventGroup.h>\r
-#include <Guid/EventLegacyBios.h>\r
-#include <Guid/FrameworkDevicePath.h>\r
-\r
-#include <Library/UefiLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/PrintLib.h>\r
-\r
-#endif\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.inf b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.inf
deleted file mode 100644 (file)
index c5f227e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#/** @file\r
-# Component description file for the entry point to a EFIDXE Drivers\r
-#\r
-# Library to abstract Framework extensions that conflict with UEFI 2.0 Specification\r
-#\r
-#  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\r
-#  (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.\r
-# Copyright (c) 2006, Intel Corporation.\r
-#\r
-#  All rights reserved. This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution. The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = UefiLibFramework\r
-  FILE_GUID                      = B2F0D71A-A39F-4094-854B-0C6BA6910CCE\r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = UefiLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
-  EDK_RELEASE_VERSION            = 0x00020000\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
-\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources.common]\r
-  UefiLibPrint.c\r
-  UefiNotTiano.c\r
-  Console.c\r
-  UefiLib.c\r
-  UefiDriverModel.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  IntelFrameworkPkg/IntelFrameworkPkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  PrintLib\r
-  PcdLib\r
-  MemoryAllocationLib\r
-  DebugLib\r
-  BaseMemoryLib\r
-  BaseLib\r
-  UefiBootServicesTableLib\r
-\r
-[Protocols]\r
-  gEfiDriverBindingProtocolGuid                 # ALWAYS_CONSUMED\r
-  gEfiComponentNameProtocolGuid                 # SOMETIMES_CONSUMED\r
-  gEfiComponentName2ProtocolGuid                # SOMETIMES_CONSUMED\r
-  gEfiDriverConfigurationProtocolGuid           # SOMETIMES_CONSUMED\r
-  gEfiDriverDiagnosticsProtocolGuid             # SOMETIMES_CONSUMED\r
-  gEfiDriverDiagnostics2ProtocolGuid            # SOMETIMES_CONSUMED\r
-  gEfiFirmwareVolume2ProtocolGuid               # ALWAYS_CONSUMED\r
-\r
-[Guids]\r
-  gEfiFrameworkDevicePathGuid                   # ALWAYS_CONSUMED\r
-  gEfiEventReadyToBootGuid                      # ALWAYS_CONSUMED\r
-  gEfiEventLegacyBootGuid                       # ALWAYS_CONSUMED\r
-\r
-\r
-[Pcd.common]\r
-  gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize\r
-\r
-[FeaturePcd.common]\r
-  gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable\r
-  gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable\r
-  gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable\r
-  gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.msa b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.msa
deleted file mode 100644 (file)
index 4986616..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
-  <MsaHeader>\r
-    <ModuleName>UefiLib</ModuleName>\r
-    <ModuleType>DXE_DRIVER</ModuleType>\r
-    <GuidValue>B2F0D71A-A39F-4094-854B-0C6BA6910CCE</GuidValue>\r
-    <Version>1.0</Version>\r
-    <Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>\r
-    <Description>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.</Description>\r
-    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
-    <License>All rights reserved. This program and the accompanying materials
-      are licensed and made available under the terms and conditions of the BSD License
-      which accompanies this distribution.  The full text of the license may be found at
-      http://opensource.org/licenses/bsd-license.php
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
-    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
-  </MsaHeader>\r
-  <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
-    <BinaryModule>false</BinaryModule>\r
-    <OutputFileBasename>UefiLib</OutputFileBasename>\r
-  </ModuleDefinitions>\r
-  <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
-      <Keyword>UefiLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>UefiBootServicesTableLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>BaseLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>BaseMemoryLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>DebugLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>MemoryAllocationLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>PcdLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>PrintLib</Keyword>\r
-    </LibraryClass>\r
-  </LibraryClassDefinitions>\r
-  <SourceFiles>\r
-    <Filename>UefiLib.c</Filename>\r
-    <Filename>Console.c</Filename>\r
-    <Filename>UefiNotTiano.c</Filename>\r
-    <Filename>UefiLibPrint.c</Filename>\r
-  </SourceFiles>\r
-  <PackageDependencies>\r
-    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
-  </PackageDependencies>\r
-  <Guids>\r
-    <GuidCNames Usage="ALWAYS_CONSUMED">\r
-      <GuidCName>gEfiEventLegacyBootGuid</GuidCName>\r
-    </GuidCNames>\r
-    <GuidCNames Usage="ALWAYS_CONSUMED">\r
-      <GuidCName>gEfiEventReadyToBootGuid</GuidCName>\r
-    </GuidCNames>\r
-    <GuidCNames Usage="ALWAYS_CONSUMED">\r
-      <GuidCName>gEfiFrameworkDevicePathGuid</GuidCName>\r
-    </GuidCNames>\r
-  </Guids>\r
-  <Externs>\r
-    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
-    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
-  </Externs>\r
-  <PcdCoded>\r
-    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
-      <C_Name>PcdUefiLibMaxPrintBufferSize</C_Name>\r
-      <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
-      <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>\r
-    </PcdEntry>\r
-  </PcdCoded>\r
-</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c
deleted file mode 100644 (file)
index 9a7592e..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/** @file\r
-  Mde UEFI library API implemention.\r
-  Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
-\r
-  Copyright (c) 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "UefiLibFramework.h"\r
-\r
-/**\r
-  Internal function which prints a formatted Unicode string to the console output device\r
-  specified by Console\r
-\r
-  This function prints a formatted Unicode string to the console output device\r
-  specified by Console and returns the number of Unicode characters that printed\r
-  to it.  If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,\r
-  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
-\r
-  @param Format   Null-terminated Unicode format string.\r
-  @param Console  The output console.\r
-  @param Marker   VA_LIST marker for the variable argument list.\r
-\r
-  If Format is NULL, then ASSERT().\r
-  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-**/\r
-\r
-STATIC\r
-UINTN\r
-InternalPrint (\r
-  IN  CONST CHAR16                     *Format,\r
-  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Console,\r
-  IN  VA_LIST                          Marker\r
-  )\r
-{\r
-  UINTN   Return;\r
-  CHAR16  *Buffer;\r
-  UINTN   BufferSize;\r
-\r
-  ASSERT (Format != NULL);\r
-  ASSERT (((UINTN) Format & 0x01) == 0);\r
-\r
-  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
-\r
-  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
-  ASSERT (Buffer != NULL);\r
-\r
-  Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);\r
-\r
-  if (Console != NULL) {\r
-    //\r
-    // To be extra safe make sure Console has been initialized\r
-    //\r
-    Console->OutputString (Console, Buffer);\r
-  }\r
-\r
-  FreePool (Buffer);\r
-\r
-  return Return;\r
-}\r
-\r
-/**\r
-  Prints a formatted Unicode string to the console output device specified by\r
-  ConOut defined in the EFI_SYSTEM_TABLE.\r
-\r
-  This function prints a formatted Unicode string to the console output device\r
-  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode\r
-  characters that printed to ConOut.  If the length of the formatted Unicode\r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
-  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
-\r
-  @param Format   Null-terminated Unicode format string.\r
-  @param ...      VARARG list consumed to process Format.\r
-  If Format is NULL, then ASSERT().\r
-  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-Print (\r
-  IN CONST CHAR16  *Format,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST Marker;\r
-  UINTN   Return;\r
-\r
-  VA_START (Marker, Format);\r
-\r
-  Return = InternalPrint (Format, gST->ConOut, Marker);\r
-\r
-  VA_END (Marker);\r
-\r
-  return Return;\r
-}\r
-\r
-/**\r
-  Prints a formatted Unicode string to the console output device specified by\r
-  StdErr defined in the EFI_SYSTEM_TABLE.\r
-\r
-  This function prints a formatted Unicode string to the console output device\r
-  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode\r
-  characters that printed to StdErr.  If the length of the formatted Unicode\r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
-  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
-\r
-  @param Format   Null-terminated Unicode format string.\r
-  @param ...      VARARG list consumed to process Format.\r
-  If Format is NULL, then ASSERT().\r
-  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-**/\r
-\r
-UINTN\r
-EFIAPI\r
-ErrorPrint (\r
-  IN CONST CHAR16  *Format,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST Marker;\r
-  UINTN   Return;\r
-\r
-  VA_START (Marker, Format);\r
-\r
-  Return = InternalPrint( Format, gST->StdErr, Marker);\r
-\r
-  VA_END (Marker);\r
-\r
-  return Return;\r
-}\r
-\r
-\r
-/**\r
-  Internal function which prints a formatted ASCII string to the console output device\r
-  specified by Console\r
-\r
-  This function prints a formatted ASCII string to the console output device\r
-  specified by Console and returns the number of ASCII characters that printed\r
-  to it.  If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,\r
-  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
-\r
-  @param Format   Null-terminated ASCII format string.\r
-  @param Console  The output console.\r
-  @param Marker   VA_LIST marker for the variable argument list.\r
-\r
-  If Format is NULL, then ASSERT().\r
-\r
-**/\r
-\r
-STATIC\r
-UINTN\r
-AsciiInternalPrint (\r
-  IN  CONST CHAR8                      *Format,\r
-  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Console,\r
-  IN  VA_LIST                          Marker\r
-  )\r
-{\r
-  UINTN   Return;\r
-  CHAR16  *Buffer;\r
-  UINTN   BufferSize;\r
-\r
-  ASSERT (Format != NULL);\r
-\r
-  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
-\r
-  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
-  ASSERT (Buffer != NULL);\r
-\r
-  Return = UnicodeVSPrintAsciiFormat (Buffer, BufferSize, Format, Marker);\r
-\r
-  if (Console != NULL) {\r
-    //\r
-    // To be extra safe make sure Console has been initialized\r
-    //\r
-    Console->OutputString (Console, Buffer);\r
-  }\r
-\r
-  FreePool (Buffer);\r
-\r
-  return Return;\r
-}\r
-\r
-/**\r
-  Prints a formatted ASCII string to the console output device specified by\r
-  ConOut defined in the EFI_SYSTEM_TABLE.\r
-\r
-  This function prints a formatted ASCII string to the console output device\r
-  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII\r
-  characters that printed to ConOut.  If the length of the formatted ASCII\r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
-  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
-\r
-  @param Format   Null-terminated ASCII format string.\r
-  @param ...      VARARG list consumed to process Format.\r
-  If Format is NULL, then ASSERT().\r
-  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiPrint (\r
-  IN CONST CHAR8  *Format,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST Marker;\r
-  UINTN   Return;\r
-\r
-  VA_START (Marker, Format);\r
-\r
-  Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
-\r
-  VA_END (Marker);\r
-\r
-  return Return;\r
-}\r
-\r
-/**\r
-  Prints a formatted ASCII string to the console output device specified by\r
-  StdErr defined in the EFI_SYSTEM_TABLE.\r
-\r
-  This function prints a formatted ASCII string to the console output device\r
-  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII\r
-  characters that printed to StdErr.  If the length of the formatted ASCII\r
-  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
-  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
-\r
-  @param Format   Null-terminated ASCII format string.\r
-  @param ...      VARARG list consumed to process Format.\r
-  If Format is NULL, then ASSERT().\r
-  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-AsciiErrorPrint (\r
-  IN CONST CHAR8  *Format,\r
-  ...\r
-  )\r
-{\r
-  VA_LIST Marker;\r
-  UINTN   Return;\r
-\r
-  VA_START (Marker, Format);\r
-\r
-  Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
-\r
-  VA_END (Marker);\r
-\r
-  return Return;\r
-}\r
-\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c
deleted file mode 100644 (file)
index b920db0..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-/** @file\r
-  Library functions that abstract areas of conflict between Tiano an UEFI 2.1.\r
-\r
-  Help Port Framework/Tinao code that has conflicts with UEFI 2.1 by hiding the\r
-  oldconflicts with library functions and supporting implementations of the old\r
-  (EDK/EFI 1.10) and new (EDK II/UEFI 2.1) way. This module is a DXE driver as\r
-  it contains DXE enum extensions for EFI event services.\r
-\r
-Copyright (c) 2007, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "UefiLibFramework.h"\r
-\r
-/**\r
-  An empty function to pass error checking of CreateEventEx ().\r
-\r
-  This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error\r
-  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.\r
-\r
-**/\r
-STATIC\r
-VOID\r
-EFIAPI\r
-InternalEmptyFuntion (\r
-  IN EFI_EVENT                Event,\r
-  IN VOID                     *Context\r
-  )\r
-{\r
-  return;\r
-}\r
-\r
-/**\r
-  Create a Legacy Boot Event.\r
-\r
-  Tiano extended the CreateEvent Type enum to add a legacy boot event type.\r
-  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
-  added and now it's possible to not voilate the UEFI specification by\r
-  declaring a GUID for the legacy boot event class. This library supports\r
-  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
-  work both ways.\r
-\r
-  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
-\r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiCreateEventLegacyBoot (\r
-  OUT EFI_EVENT  *LegacyBootEvent\r
-  )\r
-{\r
-  return EfiCreateEventLegacyBootEx (\r
-           TPL_CALLBACK,\r
-           InternalEmptyFuntion,\r
-           NULL,\r
-           LegacyBootEvent\r
-           );\r
-}\r
-\r
-/**\r
-  Create an EFI event in the Legacy Boot Event Group and allows\r
-  the caller to specify a notification function.\r
-\r
-  This function abstracts the creation of the Legacy Boot Event.\r
-  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
-  This library abstracts the caller from how this event is created to prevent\r
-  to code form having to change with the version of the specification supported.\r
-  If LegacyBootEvent is NULL, then ASSERT().\r
-\r
-  @param  NotifyTpl         The task priority level of the event.\r
-  @param  NotifyFunction    The notification function to call when the event is signaled.\r
-  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
-  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
-\r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiCreateEventLegacyBootEx (\r
-  IN  EFI_TPL           NotifyTpl,\r
-  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
-  OUT EFI_EVENT         *LegacyBootEvent\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-\r
-  ASSERT (LegacyBootEvent != NULL);\r
-\r
-  if (gST->Hdr.Revision < 0x00020000) {\r
-    //\r
-    // prior to UEFI 2.0 use Tiano extension to EFI\r
-    //\r
-    Status = gBS->CreateEvent (\r
-                    EFI_EVENT_SIGNAL_LEGACY_BOOT | EVT_NOTIFY_SIGNAL,\r
-                    NotifyTpl,\r
-                    NotifyFunction,\r
-                    NotifyContext,\r
-                    LegacyBootEvent\r
-                    );\r
-  } else {\r
-    //\r
-    // For UEFI 2.0 and the future use an Event Group\r
-    //\r
-    Status = gBS->CreateEventEx (\r
-                    EVT_NOTIFY_SIGNAL,\r
-                    NotifyTpl,\r
-                    NotifyFunction,\r
-                    NotifyContext,\r
-                    &gEfiEventLegacyBootGuid,\r
-                    LegacyBootEvent\r
-                    );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Create a Read to Boot Event.\r
-\r
-  Tiano extended the CreateEvent Type enum to add a ready to boot event type.\r
-  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
-  added and now it's possible to not voilate the UEFI specification and use\r
-  the ready to boot event class defined in UEFI 2.0. This library supports\r
-  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
-  work both ways.\r
-\r
-  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
-\r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiCreateEventReadyToBoot (\r
-  OUT EFI_EVENT  *ReadyToBootEvent\r
-  )\r
-{\r
-  return EfiCreateEventReadyToBootEx (\r
-           TPL_CALLBACK,\r
-           InternalEmptyFuntion,\r
-           NULL,\r
-           ReadyToBootEvent\r
-           );\r
-}\r
-\r
-/**\r
-  Create an EFI event in the Ready To Boot Event Group and allows\r
-  the caller to specify a notification function.\r
-\r
-  This function abstracts the creation of the Ready to Boot Event.\r
-  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
-  This library abstracts the caller from how this event is created to prevent\r
-  to code form having to change with the version of the specification supported.\r
-  If ReadyToBootEvent is NULL, then ASSERT().\r
-\r
-  @param  NotifyTpl         The task priority level of the event.\r
-  @param  NotifyFunction    The notification function to call when the event is signaled.\r
-  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
-  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
-\r
-  @retval EFI_SUCCESS       Event was created.\r
-  @retval Other             Event was not created.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiCreateEventReadyToBootEx (\r
-  IN  EFI_TPL           NotifyTpl,\r
-  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
-  IN  VOID              *NotifyContext,  OPTIONAL\r
-  OUT EFI_EVENT         *ReadyToBootEvent\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-\r
-  ASSERT (ReadyToBootEvent != NULL);\r
-\r
-  if (gST->Hdr.Revision < 0x00020000) {\r
-    //\r
-    // prior to UEFI 2.0 use Tiano extension to EFI\r
-    //\r
-    Status = gBS->CreateEvent (\r
-                    EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,\r
-                    NotifyTpl,\r
-                    NotifyFunction,\r
-                    NotifyContext,\r
-                    ReadyToBootEvent\r
-                    );\r
-  } else {\r
-    //\r
-    // For UEFI 2.0 and the future use an Event Group\r
-    //\r
-    Status = gBS->CreateEventEx (\r
-                    EVT_NOTIFY_SIGNAL,\r
-                    NotifyTpl,\r
-                    NotifyFunction,\r
-                    NotifyContext,\r
-                    &gEfiEventReadyToBootGuid,\r
-                    ReadyToBootEvent\r
-                    );\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Signal a Ready to Boot Event.\r
-\r
-  Create a Ready to Boot Event. Signal it and close it. This causes other\r
-  events of the same event group to be signaled in other modules.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiSignalEventReadyToBoot (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-  EFI_EVENT     ReadyToBootEvent;\r
-\r
-  Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent);\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->SignalEvent (ReadyToBootEvent);\r
-    gBS->CloseEvent (ReadyToBootEvent);\r
-  }\r
-}\r
-\r
-/**\r
-  Signal a Legacy Boot Event.\r
-\r
-  Create a legacy Boot Event. Signal it and close it. This causes other\r
-  events of the same event group to be signaled in other modules.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiSignalEventLegacyBoot (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS    Status;\r
-  EFI_EVENT     LegacyBootEvent;\r
-\r
-  Status = EfiCreateEventLegacyBoot (&LegacyBootEvent);\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->SignalEvent (LegacyBootEvent);\r
-    gBS->CloseEvent (LegacyBootEvent);\r
-  }\r
-}\r
-\r
-\r
-/**\r
-  Check to see if the Firmware Volume (FV) Media Device Path is valid\r
-\r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
-  device path is defined for Tiano extensions of device path. If the code\r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability. The return value to this\r
-  function points to a location in FvDevicePathNode and it does not allocate\r
-  new memory for the GUID pointer that is returned.\r
-\r
-  @param  FvDevicePathNode  Pointer to FV device path to check.\r
-\r
-  @retval NULL              FvDevicePathNode is not valid.\r
-  @retval Other             FvDevicePathNode is valid and pointer to NameGuid was returned.\r
-\r
-**/\r
-EFI_GUID *\r
-EFIAPI\r
-EfiGetNameGuidFromFwVolDevicePathNode (\r
-  IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
-  )\r
-{\r
-  FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FrameworkFvDevicePathNode;\r
-\r
-  ASSERT (FvDevicePathNode != NULL);\r
-\r
-  FrameworkFvDevicePathNode = (FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *) FvDevicePathNode;\r
-  //\r
-  // Use the new Device path that does not conflict with the UEFI\r
-  //\r
-  if (DevicePathType (&FrameworkFvDevicePathNode->Tiano.Header) == MEDIA_DEVICE_PATH &&\r
-      DevicePathSubType (&FrameworkFvDevicePathNode->Tiano.Header) == MEDIA_VENDOR_DP) {\r
-    if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FrameworkFvDevicePathNode->Tiano.TianoSpecificDevicePath)) {\r
-      if (FrameworkFvDevicePathNode->Tiano.Type == TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) {\r
-        return (EFI_GUID *) &FrameworkFvDevicePathNode->NameGuid;\r
-      }\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-\r
-/**\r
-  Initialize a Firmware Volume (FV) Media Device Path node.\r
-\r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
-  device path is defined for Tiano extensions of device path. If the code\r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability.\r
-\r
-  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
-  @param  NameGuid          FV file name to use in FvDevicePathNode\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-EfiInitializeFwVolDevicepathNode (\r
-  IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode,\r
-  IN CONST EFI_GUID                         *NameGuid\r
-  )\r
-{\r
-  FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FrameworkFvDevicePathNode;\r
-\r
-  ASSERT (FvDevicePathNode  != NULL);\r
-  ASSERT (NameGuid          != NULL);\r
-\r
-  FrameworkFvDevicePathNode = (FRAMEWORK_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *) FvDevicePathNode;\r
-\r
-  //\r
-  // Use the new Device path that does not conflict with the UEFI\r
-  //\r
-  FrameworkFvDevicePathNode->Tiano.Header.Type     = MEDIA_DEVICE_PATH;\r
-  FrameworkFvDevicePathNode->Tiano.Header.SubType  = MEDIA_VENDOR_DP;\r
-  SetDevicePathNodeLength (&FrameworkFvDevicePathNode->Tiano.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
-\r
-  //\r
-  // Add the GUID for generic Tiano device paths\r
-  //\r
-  CopyGuid (&FrameworkFvDevicePathNode->Tiano.TianoSpecificDevicePath, &gEfiFrameworkDevicePathGuid);\r
-\r
-  //\r
-  // Add in the FW Vol File Path Tiano defined information\r
-  //\r
-  FrameworkFvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;\r
-\r
-  CopyGuid (&FrameworkFvDevicePathNode->NameGuid, NameGuid);\r
-}\r
-\r
index 5f3be975fcb57005c0b6debe095e7a80b7168d7f..6e62654feefcc03fffcf2d86c891430c9cd4f951 100644 (file)
   FvbServiceLib|MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
   FvbServiceLib|MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
   NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
   IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
   UsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
   NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
   IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf\r
index 115d237415831410e3cc1494ee1cd3981749852f..98780f704a2d41d114c0ccff18287998c5b8880c 100644 (file)
@@ -24,7 +24,7 @@ Revision History
 #define _GRAPHICS_CONSOLE_H\r
 \r
 #include <PiDxe.h>\r
 #define _GRAPHICS_CONSOLE_H\r
 \r
 #include <PiDxe.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkHii.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/UgaDraw.h>\r
@@ -32,7 +32,7 @@ Revision History
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
index 768e8cbcfa7211a98987fa618670b36d10ceb645..013bc183895e83751217126884254e9744d67c35 100644 (file)
@@ -52,7 +52,7 @@
   UefiLib\r
   UefiDriverEntryPoint\r
   DebugLib\r
   UefiLib\r
   UefiDriverEntryPoint\r
   DebugLib\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
 \r
 [Protocols]\r
   gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
 \r
 [Protocols]\r
   gEfiDevicePathProtocolGuid                    # PROTOCOL ALWAYS_CONSUMED\r
index b5399286079d43425bc00cf93d1069e370cb748a..54ab820a563459d586d2b7b4d0a29174646516bc 100644 (file)
@@ -26,14 +26,14 @@ Abstract:
 #include <FrameworkDxe.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DataHub.h>\r
 #include <FrameworkDxe.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DataHub.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkHii.h>\r
 #include <Guid/DataHubRecords.h>\r
 #include <Guid/DataHubProducer.h>\r
 #include <Protocol/CpuIo.h>\r
 #include <Protocol/WinNtIo.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Guid/DataHubRecords.h>\r
 #include <Guid/DataHubProducer.h>\r
 #include <Protocol/CpuIo.h>\r
 #include <Protocol/WinNtIo.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
index e16c9af8294c6bde4361aaf47192a978aeb75133..ee76efa60bd0601cf87532aa51e2ff3adbfe5e3b 100644 (file)
@@ -48,7 +48,7 @@
   MemoryAllocationLib\r
   BaseMemoryLib\r
   UefiDriverEntryPoint\r
   MemoryAllocationLib\r
   BaseMemoryLib\r
   UefiDriverEntryPoint\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
   DebugLib\r
 \r
 [Guids]\r
   DebugLib\r
 \r
 [Guids]\r
index 360407b9f4cb7fcc3ca65cc2cd832b853d704983..351e4cd74cc9172279690cb4c7b1ca0f9fb18d99 100644 (file)
@@ -23,7 +23,7 @@ Abstract:
 #define _BDS_LIB_H_\r
 \r
 #include <Protocol/SimpleTextOut.h>\r
 #define _BDS_LIB_H_\r
 \r
 #include <Protocol/SimpleTextOut.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkHii.h>\r
 \r
 extern EFI_HANDLE mBdsImageHandle;\r
 \r
 \r
 extern EFI_HANDLE mBdsImageHandle;\r
 \r
index f94809d2b2038e96a09c7837e17d4b6433163c4a..830e715e70d37329cbe4bd0b2d3611627f19eb5f 100644 (file)
@@ -28,7 +28,7 @@
 #include <Protocol/SimpleFileSystem.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/SimpleNetwork.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/SimpleNetwork.h>\r
-#include <Protocol/FormBrowserFramework.h>\r
+#include <Protocol/FrameworkFormBrowser.h>\r
 #include <Protocol/LegacyBios.h>\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/LoadFile.h>\r
 #include <Protocol/LegacyBios.h>\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/LoadFile.h>\r
index b0ccb41642c2e93222fb59cc041b1c4960fa9444..92a2ea438151aa4b01915681cd2c31f5b90ce7e3 100644 (file)
@@ -69,7 +69,7 @@
   BaseMemoryLib\r
   UefiDriverEntryPoint\r
   UefiLib\r
   BaseMemoryLib\r
   UefiDriverEntryPoint\r
   UefiLib\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
   DebugLib\r
   BaseLib\r
   PcdLib\r
   DebugLib\r
   BaseLib\r
   PcdLib\r
index 779d33063e7caa61345ca6acbc648875986ac2ec..dcc52c211a4629c5e02c6459c80b31e5ac36e1a2 100644 (file)
@@ -30,7 +30,7 @@ Abstract:
 #include <Protocol/WinNtIo.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Protocol/WinNtIo.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
index c0aed8cf20677e73104ce6846c1459e90b5ce23d..940e6f24a154fddacbbfd1690226262e9c1321f1 100644 (file)
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
   PciIncompatibleDeviceSupportLib|IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf\r
   CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
   PciIncompatibleDeviceSupportLib|IntelFrameworkModulePkg/Library/PciIncompatibleDeviceSupportLib/PciIncompatibleDeviceSupportLib.inf\r
   CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
-  IfrSupportLibFramework|IntelFrameworkPkg/Library/IfrSupportLibFramework/IfrSupportLib.inf\r
+  FrameworkIfrSupportLib|IntelFrameworkPkg/Library/FrameworkIfrSupportLib/IfrSupportLib.inf\r
   GraphicsLib|IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
   FvbServiceLib|MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
   GraphicsLib|IntelFrameworkModulePkg/Library/GraphicsLib/GraphicsLib.inf\r
   FvbServiceLib|MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
   UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
   RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
 \r
   S3Lib|MdeModulePkg/Library/PeiS3LibNull/PeiS3LibNull.inf\r
   RecoveryLib|MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf\r
 \r
@@ -99,7 +99,7 @@
 [LibraryClasses.common.DXE_SMM_DRIVER]\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 [LibraryClasses.common.DXE_SMM_DRIVER]\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   ScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf\r
-  HiiLibFramework|IntelFrameworkPkg/Library/HiiLibFramework/HiiLib.inf\r
+  FrameworkHiiLib|IntelFrameworkPkg/Library/FrameworkHiiLib/HiiLib.inf\r
   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
index 15f9c5f0950041860c11371f015ac74622038707..36e05cdb140c85627c84d7c3ef5ef6af53999d3c 100644 (file)
@@ -26,19 +26,19 @@ Revision History
 \r
 #include <PiDxe.h>\r
 #include <Common/MaxBbsEntries.h>\r
 \r
 #include <PiDxe.h>\r
 #include <Common/MaxBbsEntries.h>\r
-#include <Protocol/FormCallbackFramework.h>\r
+#include <Protocol/FrameworkFormCallback.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/LoadFile.h>\r
 #include <Protocol/CpuIo.h>\r
 #include <Protocol/Bds.h>\r
 #include <Protocol/DataHub.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/LoadFile.h>\r
 #include <Protocol/CpuIo.h>\r
 #include <Protocol/Bds.h>\r
 #include <Protocol/DataHub.h>\r
-#include <Protocol/FormBrowserFramework.h>\r
+#include <Protocol/FrameworkFormBrowser.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/ConsoleControl.h>\r
 #include <Protocol/GenericMemoryTest.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/ConsoleControl.h>\r
 #include <Protocol/GenericMemoryTest.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
-#include <Protocol/HiiFramework.h>\r
+#include <Protocol/FrameworkHii.h>\r
 #include <Protocol/SerialIo.h>\r
 #include <Protocol/LegacyBios.h>\r
 #include <Protocol/Performance.h>\r
 #include <Protocol/SerialIo.h>\r
 #include <Protocol/LegacyBios.h>\r
 #include <Protocol/Performance.h>\r
@@ -59,7 +59,7 @@ Revision History
 #include <Library/DxeServicesTableLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/DxeServicesTableLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PrintLib.h>\r
-#include <Library/IfrSupportLibFramework.h>\r
+#include <Library/FrameworkIfrSupportLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/EdkGenericBdsLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/EdkGenericBdsLib.h>\r
@@ -68,7 +68,7 @@ Revision History
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/DevicePathLib.h>\r
-#include <Library/HiiLibFramework.h>\r
+#include <Library/FrameworkHiiLib.h>\r
 #include <Library/PeCoffLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
 #include <Library/PeCoffLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
index 70e05596066bb1e7130c863a9d883eb81c1450ce..9d2b0b0cb5cadfbd4cf4fbbb7059571d7481f44e 100644 (file)
@@ -82,7 +82,7 @@
 \r
 [LibraryClasses]\r
   PeCoffLib\r
 \r
 [LibraryClasses]\r
   PeCoffLib\r
-  HiiLibFramework\r
+  FrameworkHiiLib\r
   DevicePathLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
   DevicePathLib\r
   UefiRuntimeServicesTableLib\r
   UefiBootServicesTableLib\r
@@ -91,7 +91,7 @@
   EdkGenericBdsLib\r
   HobLib\r
   ReportStatusCodeLib\r
   EdkGenericBdsLib\r
   HobLib\r
   ReportStatusCodeLib\r
-  IfrSupportLibFramework\r
+  FrameworkIfrSupportLib\r
   PrintLib\r
   PerformanceLib\r
   DxeServicesTableLib\r
   PrintLib\r
   PerformanceLib\r
   DxeServicesTableLib\r