MdeModulePkg: Update UiApp to handle terminal type TtyTerm
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 19 Aug 2015 10:01:31 +0000 (10:01 +0000)
committerniruiyu <niruiyu@Edk2>
Wed, 19 Aug 2015 10:01:31 +0000 (10:01 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18236 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
MdeModulePkg/Application/UiApp/BootMaint/Data.c
MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c

index 8d9544d..a208127 100644 (file)
Binary files a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni and b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni differ
index 69cf760..e1ac307 100644 (file)
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Ui.h"\r
 #include "FormGuid.h"\r
 #include "FrontPage.h"\r
+#include <Guid/TtyTerm.h>\r
 \r
 //\r
 // Constants which are variable names used to access variables\r
@@ -81,7 +82,8 @@ typedef enum _TYPE_OF_TERMINAL {
   TerminalTypePcAnsi                             = 0,\r
   TerminalTypeVt100,\r
   TerminalTypeVt100Plus,\r
-  TerminalTypeVtUtf8\r
+  TerminalTypeVtUtf8,\r
+  TerminalTypeTtyTerm\r
 } TYPE_OF_TERMINAL;\r
 \r
 typedef enum _FILE_EXPLORER_STATE {\r
@@ -1452,12 +1454,12 @@ extern BM_MENU_OPTION             ConsoleErrMenu;
 extern BM_MENU_OPTION             DirectoryMenu;\r
 extern BM_MENU_OPTION             DriverMenu;\r
 extern BM_MENU_OPTION             TerminalMenu;\r
-extern UINT16                     TerminalType[];\r
+extern UINT16                     TerminalType[5];\r
 extern COM_ATTR                   BaudRateList[19];\r
 extern COM_ATTR                   DataBitsList[4];\r
 extern COM_ATTR                   ParityList[5];\r
 extern COM_ATTR                   StopBitsList[3];\r
-extern EFI_GUID                   TerminalTypeGuid[4];\r
+extern EFI_GUID                   TerminalTypeGuid[5];\r
 extern STRING_DEPOSITORY          *FileOptionStrDepository;\r
 extern STRING_DEPOSITORY          *ConsoleOptionStrDepository;\r
 extern STRING_DEPOSITORY          *BootOptionStrDepository;\r
index d86c733..f164db2 100644 (file)
@@ -564,7 +564,7 @@ LocateSerialIo (
     Vendor.Header.Type                = MESSAGING_DEVICE_PATH;\r
     Vendor.Header.SubType             = MSG_VENDOR_DP;\r
 \r
-    for (Index2 = 0; Index2 < 4; Index2++) {\r
+    for (Index2 = 0; Index2 < (sizeof (TerminalTypeGuid) / sizeof (TerminalTypeGuid[0])); Index2++) {\r
       CopyMem (&Vendor.Guid, &TerminalTypeGuid[Index2], sizeof (EFI_GUID));\r
       SetDevicePathNodeLength (&Vendor.Header, sizeof (VENDOR_DEVICE_PATH));\r
       NewDevicePath = AppendDevicePathNode (\r
@@ -940,7 +940,12 @@ IsTerminalDevicePath (
           *Termi      = TerminalTypeVtUtf8;\r
           IsTerminal  = TRUE;\r
         } else {\r
-          IsTerminal = FALSE;\r
+          if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) {\r
+            *Termi      = TerminalTypeTtyTerm;\r
+            IsTerminal  = TRUE;\r
+          } else {\r
+            IsTerminal = FALSE;\r
+          }\r
         }\r
       }\r
     }\r
index 7e86211..caf6c60 100644 (file)
@@ -35,6 +35,7 @@ UINT16              TerminalType[] = {
   STRING_TOKEN(STR_COM_TYPE_1),\r
   STRING_TOKEN(STR_COM_TYPE_2),\r
   STRING_TOKEN(STR_COM_TYPE_3),\r
+  STRING_TOKEN(STR_COM_TYPE_4),\r
 };\r
 \r
 ///\r
@@ -266,9 +267,10 @@ COM_ATTR            StopBitsList[3] = {
 ///\r
 /// Guid for messaging path, used in Serial port setting.\r
 ///\r
-EFI_GUID            TerminalTypeGuid[4] = {\r
+EFI_GUID            TerminalTypeGuid[] = {\r
   DEVICE_PATH_MESSAGING_PC_ANSI,\r
   DEVICE_PATH_MESSAGING_VT_100,\r
   DEVICE_PATH_MESSAGING_VT_100_PLUS,\r
-  DEVICE_PATH_MESSAGING_VT_UTF8\r
+  DEVICE_PATH_MESSAGING_VT_UTF8,\r
+  EFI_TTY_TERM_GUID\r
 };\r
index 0e85a83..9f1d20d 100644 (file)
@@ -1056,7 +1056,7 @@ UpdateTerminalPage (
   OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();\r
   ASSERT (OptionsOpCodeHandle != NULL);\r
 \r
-  for (Index = 0; Index < 4; Index++) {\r
+  for (Index = 0; Index < sizeof (TerminalType) / sizeof (TerminalType[0]); Index++) {\r
     CheckFlags = 0;\r
     if (NewTerminalContext->TerminalType == Index) {\r
       CheckFlags |= EFI_IFR_OPTION_DEFAULT;\r