From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: zhichao.gao@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Thu, 19 Sep 2019 22:50:23 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 22:50:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,527,1559545200"; d="scan'208";a="362750774" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 19 Sep 2019 22:50:22 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 22:50:22 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 22:50:21 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Fri, 20 Sep 2019 13:50:19 +0800 From: "Gao, Zhichao" To: "Bi, Dandan" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , "Ni, Ray" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH V3 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Thread-Topic: [edk2-devel] [PATCH V3 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Thread-Index: AQHVbeKxzOktRenqakOcJPZLphvTN6cz4bcwgAAGQFA= Date: Fri, 20 Sep 2019 05:50:18 +0000 Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B83C658@SHSMSX101.ccr.corp.intel.com> References: <20190918053355.19892-1-zhichao.gao@intel.com> <20190918053355.19892-4-zhichao.gao@intel.com> <3C0D5C461C9E904E8F62152F6274C0BB40C5DFFA@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <3C0D5C461C9E904E8F62152F6274C0BB40C5DFFA@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGRjNDcwMWItYWVhNC00MTY1LTlmYTUtMGQ3MWJhYjIwYTU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC82a3FDNWt1bFJET2kwV1M0Y0FHRm5Fd2dtdXh2RGhcL3pxaGNadEFJXC9sTElcLzNVbUU2dlIwR0dqWmhtNTJuWFMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhichao.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Bi, Dandan > Sent: Friday, September 20, 2019 11:05 AM > To: devel@edk2.groups.io; Gao, Zhichao > Cc: Wang, Jian J ; Wu, Hao A = ; > Ni, Ray ; Gao, Liming > Subject: RE: [edk2-devel] [PATCH V3 3/3] MdeModulePkg/BM_UI: Add the > new terminal types to related menu >=20 > > -----Original Message----- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Gao, Zhichao > > Sent: Wednesday, September 18, 2019 1:34 PM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J ; Wu, Hao A > > ; Ni, Ray ; Gao, Liming > > > > Subject: [edk2-devel] [PATCH V3 3/3] MdeModulePkg/BM_UI: Add the > new > > terminal types to related menu > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2186 > > > > Add the new introduced terminal types to related setup menu to change > > the terminal type from setup. Most platforms would have its own > > configure setup menu and they need to change it to support these. > > The new introduced terminal types are Linux, XtermR6, VT400 and SCO. > > > > Cc: Jian J Wang > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Liming Gao > > Signed-off-by: Zhichao Gao > > --- > > .../BootMaintenanceManager.h | 12 ++++--- > > .../BootMaintenanceManagerStrings.uni | 10 +++++- > > .../ConsoleOption.c | 35 ++++++------------= - > > .../BootMaintenanceManagerUiLib/Data.c | 16 ++++++--- > > 4 files changed, 39 insertions(+), 34 deletions(-) > > > > diff --git > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManager.h > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManager.h > > index ea3cdce794..67847d8bf3 100644 > > --- > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManager.h > > +++ > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eMa > > +++ nager.h > > @@ -1,7 +1,7 @@ > > /** @file > > Header file for boot maintenance module. > > > > -Copyright (c) 2004 - 2018, Intel Corporation. All rights > > reserved.
> > +Copyright (c) 2004 - 2019, Intel Corporation. All rights > > +reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -92,7 +92,11 @@ typedef enum _TYPE_OF_TERMINAL { > > TerminalTypeVt100, > > TerminalTypeVt100Plus, > > TerminalTypeVtUtf8, > > - TerminalTypeTtyTerm > > + TerminalTypeTtyTerm, > > + TerminalTypeLinux, > > + TerminalTypeXtermR6, > > + TerminalTypeVt400, > > + TerminalTypeSCO > > } TYPE_OF_TERMINAL; > > > > // > > @@ -1301,12 +1305,12 @@ extern BM_MENU_OPTION ConsoleOutMenu; > > extern BM_MENU_OPTION ConsoleErrMenu; > > extern BM_MENU_OPTION DriverMenu; > > extern BM_MENU_OPTION TerminalMenu; > > -extern UINT16 TerminalType[5]; > > +extern UINT16 TerminalType[9]; > > extern COM_ATTR BaudRateList[19]; > > extern COM_ATTR DataBitsList[4]; > > extern COM_ATTR ParityList[5]; > > extern COM_ATTR StopBitsList[3]; > > -extern EFI_GUID TerminalTypeGuid[5]; > > +extern EFI_GUID TerminalTypeGuid[9]; > > extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[]; > > extern UINT16 mFlowControlType[2]; > > extern UINT32 mFlowControlValue[2]; > > diff --git > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManagerStrings.uni > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManagerStrings.uni > > index 2e67d27bd0..3d47473e6c 100644 > > --- > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eManagerStrings.uni > > +++ > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc > > eMa > > +++ nagerStrings.uni > > @@ -1,7 +1,7 @@ > > ///** @file > > // String definitions for Boot Maintenance Utility. > > // > > -// Copyright (c) 2004 - 2018, Intel Corporation. All rights > > reserved.
> > +// Copyright (c) 2004 - 2019, Intel Corporation. All rights > > +reserved.
> > // SPDX-License-Identifier: BSD-2-Clause-Patent // //**/ @@ -233,6 > > +233,14 @@ > > #language fr-FR "VT_UTF8" > > #string STR_COM_TYPE_4 #language en-US "TTY_TERM" > > #language fr-FR "TTY_TERM" > > +#string STR_COM_TYPE_5 #language en-US "LINUX" > > + #language fr-FR "LINUX" > > +#string STR_COM_TYPE_6 #language en-US "XTERM_R6" > > + #language fr-FR "XTERM_R6" > > +#string STR_COM_TYPE_7 #language en-US "VT_400" > > + #language fr-FR "VT_400" > > +#string STR_COM_TYPE_8 #language en-US "SCO" > > + #language fr-FR "SCO" > > #string STR_RESET #language en-US "Reset System= " > > #language fr-FR "Reset System= " > > #string STR_FORM_GOTO_MAIN #language en-US "Go Back To > Main > > Page" > > diff --git > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c > > index 7a53b58771..b0641c5ee9 100644 > > --- > > > a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c > > +++ > > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c > > @@ -897,6 +897,7 @@ IsTerminalDevicePath ( > > VENDOR_DEVICE_PATH *Vendor; > > UART_DEVICE_PATH *Uart; > > ACPI_HID_DEVICE_PATH *Acpi; > > + UINTN Index; > > > > IsTerminal =3D FALSE; > > > > @@ -929,37 +930,21 @@ IsTerminalDevicePath ( > > } > > > > // > > - // There are four kinds of Terminal types > > + // There are 9 kinds of Terminal types > > // check to see whether this devicepath > > // is one of that type > > // > > - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[0])) { > > - *Termi =3D TerminalTypePcAnsi; > > - IsTerminal =3D TRUE; > > - } else { > > - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[1])) { > > - *Termi =3D TerminalTypeVt100; > > - IsTerminal =3D TRUE; > > - } else { > > - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[2])) { > > - *Termi =3D TerminalTypeVt100Plus; > > - IsTerminal =3D TRUE; > > - } else { > > - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[3])) { > > - *Termi =3D TerminalTypeVtUtf8; > > - IsTerminal =3D TRUE; > > - } else { > > - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) { > > - *Termi =3D TerminalTypeTtyTerm; > > - IsTerminal =3D TRUE; > > - } else { > > - IsTerminal =3D FALSE; > > - } > > - } > > - } > > + for (Index =3D 0; Index < ARRAY_SIZE (TerminalTypeGuid); Index++) { > > + if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[Index])) { > > + *Termi =3D Index; > > + IsTerminal =3D TRUE; >=20 > Hi Zhichao, >=20 > Thanks for simplifying this code logic. > One comment here, I think you miss the "break" statement here, or the > Index will increase to 9 and then "if (Index =3D=3D ARRAY_SIZE > (TerminalTypeGuid))" will be always true and "IsTerminal" variable is al= ways > FALSE, this is not the expected behavior. Please double check the code l= ogic. Exactly right, I missed the "break". This lib is just an example for the t= erminal driver. Most platforms would have its own one. There is no example = of real open platform to use this library. Thanks, Zhichao >=20 > Thanks, > Dandan >=20 > > } > > } > > > > + if (Index =3D=3D ARRAY_SIZE (TerminalTypeGuid)) { > > + IsTerminal =3D FALSE; > > + } > > + > > if (!IsTerminal) { > > return FALSE; > > } > > diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c > > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c > > index b9d86b09d8..21c4ef3d55 100644 > > --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c > > +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c > > @@ -1,7 +1,7 @@ > > /** @file > > Define some data used for Boot Maint > > > > -Copyright (c) 2004 - 2015, Intel Corporation. All rights > > reserved.
> > +Copyright (c) 2004 - 2019, Intel Corporation. All rights > > +reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -16,12 +16,16 @@ EFI_IFR_GUID_LABEL *mEndLabel =3D NULL; /// /// > > Terminal type string token storage /// > > -UINT16 TerminalType[] =3D { > > +UINT16 TerminalType[9] =3D { > > STRING_TOKEN(STR_COM_TYPE_0), > > STRING_TOKEN(STR_COM_TYPE_1), > > STRING_TOKEN(STR_COM_TYPE_2), > > STRING_TOKEN(STR_COM_TYPE_3), > > STRING_TOKEN(STR_COM_TYPE_4), > > + STRING_TOKEN(STR_COM_TYPE_5), > > + STRING_TOKEN(STR_COM_TYPE_6), > > + STRING_TOKEN(STR_COM_TYPE_7), > > + STRING_TOKEN(STR_COM_TYPE_8), > > }; > > > > /// > > @@ -248,10 +252,14 @@ COM_ATTR StopBitsList[3] =3D { > > /// > > /// Guid for messaging path, used in Serial port setting. > > /// > > -EFI_GUID TerminalTypeGuid[] =3D { > > +EFI_GUID TerminalTypeGuid[9] =3D { > > DEVICE_PATH_MESSAGING_PC_ANSI, > > DEVICE_PATH_MESSAGING_VT_100, > > DEVICE_PATH_MESSAGING_VT_100_PLUS, > > DEVICE_PATH_MESSAGING_VT_UTF8, > > - EFI_TTY_TERM_GUID > > + EFI_TTY_TERM_GUID, > > + EDKII_LINUX_TERM_GUID, > > + EDKII_XTERM_R6_GUID, > > + EDKII_VT400_GUID, > > + EDKII_SCO_TERM_GUID > > }; > > -- > > 2.21.0.windows.1 > > > > > >=20