Re: [edk2] [Patch] MdeModulePkg: Update UiApp to handle terminal type TtyTerm

2015-08-19 Thread Dong, Eric
Reviewed-by: Eric Dong eric.d...@intel.com

-Original Message-
From: Ni, Ruiyu 
Sent: Wednesday, August 19, 2015 5:35 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch] MdeModulePkg: Update UiApp to handle terminal type TtyTerm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni ruiyu...@intel.com
Cc: Eric Dong eric.d...@intel.com
---
 .../Application/UiApp/BootMaint/Bmstring.uni| Bin 41522 - 41794 bytes
 .../Application/UiApp/BootMaint/BootMaint.h |   8 +---
 .../Application/UiApp/BootMaint/ConsoleOption.c |   9 +++--
 MdeModulePkg/Application/UiApp/BootMaint/Data.c |   6 --
 .../Application/UiApp/BootMaint/UpdatePage.c|   2 +-
 5 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni 
b/MdeModulePkg/Application/UiApp/BootMaint/Bmstring.uni
index 
8d9544db450322835972597234a07d76207e1102..a208127ac6ea76ec5dde6824babf05583a1cfa8d
 100644 GIT binary patch delta 66
zcmdmVgz3;RrVSN6lLNYh7)T8vMEoVz^1|!Vtm`$q)}DT^WKHd?z0at#4)VKkE8
JT+yj6ad0a6I=iQ

delta 14
WcmX?fjA_#mrVSN6n%`Ui2?vQ4+l;F

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
index 69cf760..e1ac307 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.h
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include Ui.h
 #include FormGuid.h
 #include FrontPage.h
+#include Guid/TtyTerm.h
 
 //
 // Constants which are variable names used to access variables @@ -81,7 +82,8 
@@ typedef enum _TYPE_OF_TERMINAL {
   TerminalTypePcAnsi = 0,
   TerminalTypeVt100,
   TerminalTypeVt100Plus,
-  TerminalTypeVtUtf8
+  TerminalTypeVtUtf8,
+  TerminalTypeTtyTerm
 } TYPE_OF_TERMINAL;
 
 typedef enum _FILE_EXPLORER_STATE {
@@ -1452,12 +1454,12 @@ extern BM_MENU_OPTION ConsoleErrMenu;
 extern BM_MENU_OPTION DirectoryMenu;
 extern BM_MENU_OPTION DriverMenu;
 extern BM_MENU_OPTION TerminalMenu;
-extern UINT16 TerminalType[];
+extern UINT16 TerminalType[5];
 extern COM_ATTR   BaudRateList[19];
 extern COM_ATTR   DataBitsList[4];
 extern COM_ATTR   ParityList[5];
 extern COM_ATTR   StopBitsList[3];
-extern EFI_GUID   TerminalTypeGuid[4];
+extern EFI_GUID   TerminalTypeGuid[5];
 extern STRING_DEPOSITORY  *FileOptionStrDepository;
 extern STRING_DEPOSITORY  *ConsoleOptionStrDepository;
 extern STRING_DEPOSITORY  *BootOptionStrDepository;
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c 
b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
index d86c733..f164db2 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/ConsoleOption.c
@@ -564,7 +564,7 @@ LocateSerialIo (
 Vendor.Header.Type= MESSAGING_DEVICE_PATH;
 Vendor.Header.SubType = MSG_VENDOR_DP;
 
-for (Index2 = 0; Index2  4; Index2++) {
+for (Index2 = 0; Index2  (sizeof (TerminalTypeGuid) / sizeof 
+ (TerminalTypeGuid[0])); Index2++) {
   CopyMem (Vendor.Guid, TerminalTypeGuid[Index2], sizeof (EFI_GUID));
   SetDevicePathNodeLength (Vendor.Header, sizeof (VENDOR_DEVICE_PATH));
   NewDevicePath = AppendDevicePathNode ( @@ -940,7 +940,12 @@ 
IsTerminalDevicePath (
   *Termi  = TerminalTypeVtUtf8;
   IsTerminal  = TRUE;
 } else {
-  IsTerminal = FALSE;
+  if (CompareGuid (Vendor-Guid, TerminalTypeGuid[4])) {
+*Termi  = TerminalTypeTtyTerm;
+IsTerminal  = TRUE;
+  } else {
+IsTerminal = FALSE;
+  }
 }
   }
 }
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/Data.c 
b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
index 7e86211..caf6c60 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/Data.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/Data.c
@@ -35,6 +35,7 @@ UINT16  TerminalType[] = {
   STRING_TOKEN(STR_COM_TYPE_1),
   STRING_TOKEN(STR_COM_TYPE_2),
   STRING_TOKEN(STR_COM_TYPE_3),
+  STRING_TOKEN(STR_COM_TYPE_4),
 };
 
 ///
@@ -266,9 +267,10 @@ COM_ATTRStopBitsList[3] = {
 ///
 /// Guid for messaging path, used in Serial port setting.
 ///
-EFI_GUIDTerminalTypeGuid[4] = {
+EFI_GUIDTerminalTypeGuid[] = {
   DEVICE_PATH_MESSAGING_PC_ANSI,
   DEVICE_PATH_MESSAGING_VT_100,
   DEVICE_PATH_MESSAGING_VT_100_PLUS,
-  DEVICE_PATH_MESSAGING_VT_UTF8
+  DEVICE_PATH_MESSAGING_VT_UTF8,
+  EFI_TTY_TERM_GUID
 };
diff --git a/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c 
b/MdeModulePkg/Application/UiApp/BootMaint/UpdatePage.c
index

Re: [edk2] [patch] MdeModulePkg:Refine the code in HiiDatabaseDxe

2015-08-23 Thread Dong, Eric
Reviewed-by:  Eric Dong eric.d...@intel.com

-Original Message-
From: Bi, Dandan 
Sent: Monday, August 24, 2015 1:28 PM
To: Dong, Eric; Qiu, Shumin; edk2-devel@lists.01.org
Subject: [patch] MdeModulePkg:Refine the code in HiiDatabaseDxe

Check the local variable 'NameSpace' before use it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi dandan...@intel.com
---
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index eac7717..e88a0c4 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -2850,10 +2850,11 @@ EfiConfigKeywordHandlerSetData (
 Status = ExtractNameSpace (StringPtr, NameSpace, NextStringPtr);
 if (EFI_ERROR (Status)) {
   *ProgressErr = KEYWORD_HANDLER_MALFORMED_STRING;
   goto Done;
 }
+ASSERT (NameSpace != NULL);
 //
 // 1.1 Check whether the input namespace is valid.
 //
 if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen 
(UEFI_CONFIG_LANG)) != 0) {
   *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
@@ -3134,13 +3135,15 @@ EfiConfigKeywordHandlerGetData (
 return Status;
   }
   //
   // 1.1 Check whether the input namespace is valid.
   //
-  if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen 
(UEFI_CONFIG_LANG)) != 0) {
-*ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
-return EFI_INVALID_PARAMETER;
+  if (NameSpace != NULL){
+if (AsciiStrnCmp(NameSpace, UEFI_CONFIG_LANG, AsciiStrLen 
(UEFI_CONFIG_LANG)) != 0) {
+  *ProgressErr = KEYWORD_HANDLER_UNDEFINED_PROCESSING_ERROR;
+  return EFI_INVALID_PARAMETER;
+}
   }
   
   if (KeywordString != NULL) {
 //
 // Use temp string to avoid changing input string buffer.
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch 2/2] MdeModulePkg:Refine the code comments in UiApp

2015-08-03 Thread Dong, Eric
Reviewed-by: Eric Dong eric.d...@intel.com

-Original Message-
From: Bi, Dandan 
Sent: Tuesday, August 04, 2015 12:51 PM
To: Dong, Eric; Qiu, Shumin; edk2-devel@lists.01.org
Subject: [patch 2/2] MdeModulePkg:Refine the code comments in UiApp

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi dandan...@intel.com
---
 .../Application/UiApp/BootMaint/BootMaint.c|  1 -
 .../Application/UiApp/DeviceMngr/DeviceManager.h   |  4 +-
 MdeModulePkg/Application/UiApp/FrontPage.c |  4 ++
 MdeModulePkg/Application/UiApp/String.c|  4 ++
 MdeModulePkg/Application/UiApp/String.h|  4 ++
 MdeModulePkg/Application/UiApp/UiApp.inf   | 55 --
 .../Include/Guid/HiiBootMaintenanceFormset.h   |  1 -
 7 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c 
b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
index 4f46ed6..91af489 100644
--- a/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
+++ b/MdeModulePkg/Application/UiApp/BootMaint/BootMaint.c
@@ -1358,11 +1358,10 @@ InitBootMaintenance(
 
 /**
   Remove the installed BootMaint and FileExplorer HiiPackages.
 
 **/
-
 VOID
 FreeBMPackage(
   VOID
   )
 {
diff --git a/MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h 
b/MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
index 7fb68a3..057fc47 100644
--- a/MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
+++ b/MdeModulePkg/Application/UiApp/DeviceMngr/DeviceManager.h
@@ -137,19 +137,19 @@ InitializeDeviceManager (
 
 **/
 VOID
 FreeDeviceManager(
   VOID
-);
+  );
 
 /**
   Dynamic create Hii information for Device Manager.
 
   @param   NextShowFormId The FormId which need to be show.
 
 **/
 VOID
 CreateDeviceManagerForm(
   IN EFI_FORM_ID  NextShowFormId
-);
+  );
 
 #endif
diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c 
b/MdeModulePkg/Application/UiApp/FrontPage.c
index 7d1cf2a..d30935b 100644
--- a/MdeModulePkg/Application/UiApp/FrontPage.c
+++ b/MdeModulePkg/Application/UiApp/FrontPage.c
@@ -596,10 +596,14 @@ CallFrontPage (
   }
 
   return Status;
 }
 
+/**
+  Remove the installed packages from the HiiDatabase.
+
+**/
 VOID
 FreeFrontPage(
   VOID
   )
 {
diff --git a/MdeModulePkg/Application/UiApp/String.c 
b/MdeModulePkg/Application/UiApp/String.c
index ad3ba57..b93b8ac 100644
--- a/MdeModulePkg/Application/UiApp/String.c
+++ b/MdeModulePkg/Application/UiApp/String.c
@@ -38,10 +38,14 @@ InitializeStringSupport (
  NULL
  );
   ASSERT (gStringPackHandle != NULL);
 }
 
+/**
+  Remove the string package.
+
+**/
 VOID
 UninitializeStringSupport (
   VOID
   )
 {
diff --git a/MdeModulePkg/Application/UiApp/String.h 
b/MdeModulePkg/Application/UiApp/String.h
index 1a06366..1aac6e8 100644
--- a/MdeModulePkg/Application/UiApp/String.h
+++ b/MdeModulePkg/Application/UiApp/String.h
@@ -54,10 +54,14 @@ GetStringById (
 VOID
 InitializeStringSupport (
   VOID
   );
 
+/**
+  Remove the string package.
+
+**/
 VOID
 UninitializeStringSupport (
   VOID
   );
 
diff --git a/MdeModulePkg/Application/UiApp/UiApp.inf 
b/MdeModulePkg/Application/UiApp/UiApp.inf
index 626f558..26c6b1b 100644
--- a/MdeModulePkg/Application/UiApp/UiApp.inf
+++ b/MdeModulePkg/Application/UiApp/UiApp.inf
@@ -57,10 +57,11 @@
   FrontPage.c
   String.c
   String.h
   Language.c
   Language.h
+  FormsetGuid.h
 
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
@@ -104,36 +105,42 @@
   gEfiIfrTianoGuid  ## CONSUMES ## GUID (Extended 
IFR Guid Opcode)
   gEfiHiiDriverHealthFormsetGuid## CONSUMES ## GUID (Indicate 
the Driver Health formset class guid to be displayed)
   gEfiIfrBootMaintenanceGuid## CONSUMES ## GUID
   
 [Protocols]
-  gEfiSimpleFileSystemProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiLoadFileProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiSmbiosProtocolGuid## PROTOCOL CONSUMES
-  gEfiGenericMemTestProtocolGuid## PROTOCOL CONSUMES
-  gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## PROTOCOL SOMETIMES_CONSUMES
-  gEfiBlockIoProtocolGuid   ## PROTOCOL CONSUMES
-  gEfiGraphicsOutputProtocolGuid## PROTOCOL SOMETIMES_CONSUMES
-  gEfiSimpleTextInputExProtocolGuid ## PROTOCOL CONSUMES
-  gEfiHiiConfigAccessProtocolGuid   ## PROTOCOL CONSUMES
-  gEfiFormBrowser2ProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiSerialIoProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiDevicePathProtocolGuid## PROTOCOL CONSUMES
-  gEfiPciIoProtocolGuid ## PROTOCOL CONSUMES
-  gEfiDevicePathToTextProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiBootLogoProtocolGuid  ## PROTOCOL CONSUMES
+  gEfiSimpleFileSystemProtocolGuid

Re: [edk2] [patch] MdeModulePkg:Fix the issue that refresh the question fail in DriverSample

2015-08-03 Thread Dong, Eric
Reviewed-by: Eric Dong eric.d...@intel.com

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan Bi
Sent: Tuesday, August 04, 2015 1:16 PM
To: Dong, Eric; Gao, Liming; edk2-devel@lists.01.org
Subject: [edk2] [patch] MdeModulePkg:Fix the issue that refresh the question 
fail in DriverSample

Once the question is refreshed,the processing should happen in the callback 
function of EFI_BROWSER_ACTION_RETRIEVE case,rather than 
EFI_BROWSER_ACTION_CHANGING in DriverSample.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi dandan...@intel.com
---
 .../Universal/DriverSampleDxe/DriverSample.c   | 165 ++---
 1 file changed, 82 insertions(+), 83 deletions(-)

diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c 
b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index a21f58a..2f77d39 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -1373,18 +1373,94 @@ DriverCallback (
 }
 break;
 
   case EFI_BROWSER_ACTION_RETRIEVE:
 {
-  if (QuestionId == 0x1248) {
-{
-  if (Type != EFI_IFR_TYPE_REF) {
-return EFI_INVALID_PARAMETER;
+  switch (QuestionId ) {
+  case 0x1248:
+if (Type != EFI_IFR_TYPE_REF) {
+  return EFI_INVALID_PARAMETER;
+}
+Value-ref.FormId = 0x3;
+break;
+
+  case 0x5678:
+  case 0x1247:
+//
+// We will reach here once the Question is refreshed
+//
+
+//
+// Initialize the container for dynamic opcodes
+//
+StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ASSERT (StartOpCodeHandle != NULL);
+
+//
+// Create Hii Extend Label OpCode as the start opcode
+//
+StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode 
(StartOpCodeHandle, gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
+StartLabel-ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+if (QuestionId == 0x5678) {
+  StartLabel-Number   = LABEL_UPDATE2;
+  FormId   = 0x03;
+  PrivateData-Configuration.DynamicRefresh++;
+} else if (QuestionId == 0x1247 ) {
+  StartLabel-Number   = LABEL_UPDATE3;
+  FormId   = 0x06;
+  PrivateData-Configuration.RefreshGuidCount++;
+}
+
+HiiCreateActionOpCode (
+  StartOpCodeHandle,// Container for dynamic created 
opcodes
+  0x1237,   // Question ID
+  STRING_TOKEN(STR_EXIT_TEXT),  // Prompt text
+  STRING_TOKEN(STR_EXIT_TEXT),  // Help text
+  EFI_IFR_FLAG_CALLBACK,// Question flag
+  0 // Action String ID
+);
+  
+HiiUpdateForm (
+  PrivateData-HiiHandle[0],// HII handle
+  gDriverSampleFormSetGuid,// Formset GUID
+  FormId,   // Form ID
+  StartOpCodeHandle,// Label for where to insert 
opcodes
+  NULL  // Insert data
+);
+
+HiiFreeOpCodeHandle (StartOpCodeHandle);
+
+//
+// Refresh the Question value
+//
+Status = gRT-SetVariable(
+VariableName,
+gDriverSampleFormSetGuid,
+EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS,
+sizeof (DRIVER_SAMPLE_CONFIGURATION),
+PrivateData-Configuration
+);
+
+if (QuestionId == 0x5678) {
+  //
+  // Update uncommitted data of Browser
+  //
+  EfiData = AllocateZeroPool (sizeof (MY_EFI_VARSTORE_DATA));
+  ASSERT (EfiData != NULL);
+  if (HiiGetBrowserData (gDriverSampleFormSetGuid, MyEfiVar, sizeof 
(MY_EFI_VARSTORE_DATA), (UINT8 *) EfiData)) {
+EfiData-Field8 = 111;
+HiiSetBrowserData (
+  gDriverSampleFormSetGuid,
+  MyEfiVar,
+  sizeof (MY_EFI_VARSTORE_DATA),
+  (UINT8 *) EfiData,
+  NULL
+);
   }
-
-  Value-ref.FormId = 0x3;
+  FreePool (EfiData);
 }
+break;
   }
 }
 break;
 
   case EFI_BROWSER_ACTION_DEFAULT_STANDARD:
@@ -1594,87 +1670,10 @@ DriverCallback (
   HiiFreeOpCodeHandle (StartOpCodeHandle);
   HiiFreeOpCodeHandle (OptionsOpCodeHandle);
   HiiFreeOpCodeHandle (EndOpCodeHandle);
   break;
 
-case 0x5678:
-case 0x1247:
-  //
-  // We will reach here once the Question is refreshed
-  //
-
-  //
-  // Initialize the container for dynamic opcodes
-  //
-  StartOpCodeHandle = HiiAllocateOpCodeHandle ();
-  ASSERT

Re: [edk2] [Patch 2/2] Update copyright info, use BDS license.

2015-07-30 Thread Dong, Eric
Daryl and Ard,

Sorry for the incorrect description. This file is new created and  changed from 
an old existed file, so the old copyright is error kept. 
I have update the copyright info. Because this is new added file, so I only 
kept the 2015 copyright.

Thanks,
Eric

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Daryl 
McDaniel
Sent: Friday, July 31, 2015 2:32 AM
To: 'Ard Biesheuvel'; Dong, Eric
Cc: Ni, Ruiyu; edk2-devel@lists.01.org; Gao, Liming
Subject: Re: [edk2] [Patch 2/2] Update copyright info, use BDS license.

The copyright information was incorrectly updated.
The correct copyright is:

Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.BR

Previous copyrights must be maintained.

This patch should be rejected and a new one submitted with the corrected 
copyright notice and subject line.

Daryl McDaniel


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ard 
Biesheuvel
Sent: Thursday, July 30, 2015 12:27 AM
To: Eric Dong eric.d...@intel.com
Cc: Ruiyu Ni ruiyu...@intel.com; edk2-devel@lists.01.org; Gao, Liming 
liming@intel.com
Subject: Re: [edk2] [Patch 2/2] Update copyright info, use BDS license.

On 29 July 2015 at 10:59, Eric Dong eric.d...@intel.com wrote:
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Eric Dong eric.d...@intel.com

The license is called 'BSD' not 'BDS'

Could you fix up the commit titles please?

--
Ard.

 ---
  .../Include/Guid/HiiBootMaintenanceFormset.h   | 28
++
  1 file changed, 12 insertions(+), 16 deletions(-)

 diff --git a/MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
 b/MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
 index 7c809f4..393cc95 100644
 --- a/MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
 +++ b/MdeModulePkg/Include/Guid/HiiBootMaintenanceFormset.h
 @@ -1,25 +1,21 @@
  //
 -// This file contains 'Framework Code' and is licensed as such -// 
 under the terms of your license agreement with Intel or your -// 
 vendor.  This file may not be modified, except as allowed by -// 
 additional terms of your license agreement.
 -//
 -/**@file
 -Constants and declarations that are common accross PEI and DXE.
 -
 -Copyright (c) 2011, Intel Corporation. All rights reserved.BR -This 
 software and associated documentation (if any) is furnished -under a 
 license and may only be used or copied in accordance -with the terms 
 of the license. Except as permitted by such -license, no part of this 
 software or documentation may be -reproduced, stored in a retrieval 
 system, or transmitted in any -form or by any means without the 
 express written consent of -Intel Corporation.
 +/** @file
 +  Guid definition for Boot Maintainence Formset.
 +
 +Copyright (c) 2015, Intel Corporation. All rights reserved.BR 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.

  **/

 +
  #ifndef __HII_BOOT_MAINTENANCE_FORMSET_H__
  #define __HII_BOOT_MAINTENANCE_FORMSET_H__

  ///
  /// Guid define to group the item show on the Boot Menaintenance 
 Manager
Menu.
 --
 1.9.5.msysgit.1

 ___
 edk2-devel mailing list
 edk2-devel@lists.01.org
 https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
//
/** @file
  Guid definition for Boot Maintainence Formset.

Copyright (c) 2015, Intel Corporation. All rights reserved.BR
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.

**/


#ifndef __HII_BOOT_MAINTENANCE_FORMSET_H__
#define __HII_BOOT_MAINTENANCE_FORMSET_H__

///
/// Guid define to group the item show on the Boot Menaintenance Manager Menu.
///
#define EFI_IFR_BOOT_MAINTENANCE_GUID \
  { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 
} }


extern EFI_GUID gEfiIfrBootMaintenanceGuid;

#endif
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg: Enhance PciBusDxe to handle high 32bit of MEM64 BAR returns 0

2015-07-29 Thread Dong, Eric
Reviewed-by: Eric Dong eric.d...@intel.com

-Original Message-
From: Ni, Ruiyu 
Sent: Thursday, July 30, 2015 11:11 AM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch] MdeModulePkg: Enhance PciBusDxe to handle high 32bit of MEM64 
BAR returns 0

According to the PCI spec, when software writes all-one to BAR for size 
probing, the value read back should be 0b1...10...0 after masking the BAR type 
bits.
But in real world, it's possible that certain device returns 0b0...01...10...0 
for MEM64 BAR size probing: some bits in the high 32bit may be 0.
PciBus driver has the code to handle such case. However, it doesn't handle the 
case that the high 32bit is totally 0. The patch is to handle the special case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni ruiyu...@intel.com
Cc: Eric Dong eric.d...@intel.com
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c 
b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 9e7ac74..f46025e 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1,7 +1,7 @@
 /** @file
   PCI emumeration support functions implementation for PCI Bus module.
 
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.BR
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.BR
 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 @@ -1770,14 
+1770,19 @@ PciParseBar (
   // some device implement MMIO bar with 0 length, need to treat it as 
no-bar
   //
   PciIoDevice-PciBar[BarIndex].BarType = PciBarTypeUnknown;
+  return Offset + 4;
 }
-return Offset + 4;
   }
 
   //
   // Fix the length to support some spefic 64 bit BAR
   //
-  Value |= ((UINT32)(-1)  HighBitSet32 (Value));
+  if (Value == 0) {
+DEBUG ((EFI_D_INFO, [PciBus]BAR probing for upper 32bit of MEM64 BAR 
returns 0, change to 0x.\n));
+Value = (UINT32) -1;
+  } else {
+Value |= ((UINT32)(-1)  HighBitSet32 (Value));
+  }
 
   //
   // Calculate the size of 64bit bar
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Configuration Menu

2015-10-22 Thread Dong, Eric
Hi Foster,

Do you use goto opcode to create "System Setup" menu? Can you help to attach 
the source code for your menu? I think it must be some error in the goto opcode 
caused this issue.

Thanks,
Eric

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Foster, 
Matthew I
Sent: Friday, October 23, 2015 1:33 AM
To: edk2-devel@lists.01.org
Subject: [edk2] Configuration Menu

I am looking into an issue where the BIOS configuration menu does not appear 
after selecting it. For example say I selected a menu item "System Setup",  I 
select it and it just goes back to the original menu screen where I made the 
slection.

I know the .vfi that is supposed to load exists and to make things a bit more 
complicated it appears to be intermittent. I am just seeing if anyone has any 
general ideas or has seen a similar scenario before. Thanks for any ideas.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2 5/5] Nt32Pkg: Use LogoLib for LOGO and progress bar drawing.

2015-11-11 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Ni, Ruiyu 
Sent: Monday, November 09, 2015 1:24 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch V2 5/5] Nt32Pkg: Use LogoLib for LOGO and progress bar drawing.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
---
 .../Library/PlatformBootManagerLib/MemoryTest.c| 833 +
 .../PlatformBootManagerLib/PlatformBootManager.c   |   6 +-
 .../PlatformBootManagerLib/PlatformBootManager.h   |   6 +-
 .../PlatformBootManagerLib.inf |   2 +-
 Nt32Pkg/Nt32Pkg.dsc|   7 +-
 5 files changed, 14 insertions(+), 840 deletions(-)

diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c 
b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
index 9f57466..93ecc7d 100644
--- a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
+++ b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
@@ -23,179 +23,6 @@ EFI_GUID   mPlatformBootManagerStringPackGuid = {
 //
 // BDS Platform Functions
 //
-/**
-
-  Show progress bar with title above it. It only works in Graphics mode.
-
-
-  @param TitleForeground Foreground color for Title.
-  @param TitleBackground Background color for Title.
-  @param Title   Title above progress bar.
-  @param ProgressColor   Progress bar color.
-  @param ProgressProgress (0-100)
-  @param PreviousValue   The previous value of the progress.
-
-  @retval  EFI_STATUS   Success update the progress bar
-
-**/
-EFI_STATUS
-PlatformBootManagerShowProgress (
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
-  IN CHAR16*Title,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
-  IN UINTN Progress,
-  IN UINTN PreviousValue
-  )
-{
-  EFI_STATUS Status;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL  *UgaDraw;
-  UINT32 SizeOfX;
-  UINT32 SizeOfY;
-  UINT32 ColorDepth;
-  UINT32 RefreshRate;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Color;
-  UINTN  BlockHeight;
-  UINTN  BlockWidth;
-  UINTN  BlockNum;
-  UINTN  PosX;
-  UINTN  PosY;
-  UINTN  Index;
-
-  if (Progress > 100) {
-return EFI_INVALID_PARAMETER;
-  }
-
-  UgaDraw = NULL;
-  Status = gBS->HandleProtocol (
-  gST->ConsoleOutHandle,
-  ,
-  (VOID **) 
-  );
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-GraphicsOutput = NULL;
-
-Status = gBS->HandleProtocol (
-gST->ConsoleOutHandle,
-,
-(VOID **) 
-);
-  }
-  if (EFI_ERROR (Status)) {
-return EFI_UNSUPPORTED;
-  }
-
-  SizeOfX = 0;
-  SizeOfY = 0;
-  if (GraphicsOutput != NULL) {
-SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
-SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else if (UgaDraw != NULL) {
-Status = UgaDraw->GetMode (
-UgaDraw,
-,
-,
-,
-
-);
-if (EFI_ERROR (Status)) {
-  return EFI_UNSUPPORTED;
-}
-  } else {
-return EFI_UNSUPPORTED;
-  }
-
-  BlockWidth  = SizeOfX / 100;
-  BlockHeight = SizeOfY / 50;
-
-  BlockNum= Progress;
-
-  PosX= 0;
-  PosY= SizeOfY * 48 / 50;
-
-  if (BlockNum == 0) {
-//
-// Clear progress area
-//
-SetMem (, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
-
-if (GraphicsOutput != NULL) {
-  Status = GraphicsOutput->Blt (
-  GraphicsOutput,
-  ,
-  EfiBltVideoFill,
-  0,
-  0,
-  0,
-  PosY - EFI_GLYPH_HEIGHT - 1,
-  SizeOfX,
-  SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
-  SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-  );
-} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-  Status = UgaDraw->Blt (
-  UgaDraw,
-  (EFI_UGA_PIXEL *) ,
-  EfiUgaVideoFill,
-  0,
-  0,
-  0,
-  PosY - EFI_GLYPH_HEIGHT - 1,
-  SizeOf

Re: [edk2] [Patch V3 2/2] MdeModulePkg FileExplorerDxe: Create file explorer Protocol.

2015-11-10 Thread Dong, Eric
Yes, will update when check in the code.

-Original Message-
From: af...@apple.com [mailto:af...@apple.com] 
Sent: Wednesday, November 11, 2015 1:41 PM
To: Dong, Eric
Cc: edk2-devel@lists.01.org; cecil.sh...@hpe.com; samer.el-haj-mahm...@hpe.com; 
Gao, Liming
Subject: Re: [edk2] [Patch V3 2/2] MdeModulePkg FileExplorerDxe: Create file 
explorer Protocol.


> On Nov 10, 2015, at 9:34 PM, Eric Dong <eric.d...@intel.com> wrote:
> 
> This driver produces file explorer protocol layered on top of the 
> FileExplorerLib.
> 
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Eric Dong <eric.d...@intel.com>
> ---
> MdeModulePkg/Include/Protocol/FileExplorer.h   |  75 +
> .../Library/FileExplorerLib/FileExplorerLib.inf|   3 +-
> MdeModulePkg/MdeModulePkg.dec  |   3 +
> MdeModulePkg/MdeModulePkg.dsc  |   2 +
> .../Universal/FileExplorerDxe/FileExplorerDxe.c|  58 
> .../Universal/FileExplorerDxe/FileExplorerDxe.inf  |  53 
> +++ .../Universal/FileExplorerDxe/FileExplorerDxe.uni  | Bin 0 -> 
> 2038 bytes
> .../FileExplorerDxe/FileExplorerDxeExtra.uni   | Bin 0 -> 1362 bytes
> 8 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 
> MdeModulePkg/Include/Protocol/FileExplorer.h
> create mode 100644 
> MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.c
> create mode 100644 
> MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.inf
> create mode 100644 
> MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxe.uni
> create mode 100644 
> MdeModulePkg/Universal/FileExplorerDxe/FileExplorerDxeExtra.uni
> 
> diff --git a/MdeModulePkg/Include/Protocol/FileExplorer.h 
> b/MdeModulePkg/Include/Protocol/FileExplorer.h
> new file mode 100644
> index 000..7f6cbd9
> --- /dev/null
> +++ b/MdeModulePkg/Include/Protocol/FileExplorer.h
> @@ -0,0 +1,75 @@
> +/** @file
> +
> +  This file explorer protocol defines defines a set of interfaces for  
> + how to do file explorer.
> +
> +Copyright (c) 2006 - 2010, Intel Corporation. All rights 
> +reserved.

Should this be 2015?

Thanks,

Andrew Fish

> +This program and the accompanying materials are licensed and made 
> +available under the terms and conditions of the BSD License that 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.
> +
> +**/
> +
> +#ifndef __FILE_EXPLORER_H__
> +#define __FILE_EXPLORER_H__
> +
> +#define EFI_FILE_EXPLORER_PROTOCOL_GUID  \
> +  { 0x2C03C536, 0x4594, 0x4515, { 0x9E, 0x7A, 0xD3, 0xD2, 0x04, 0xFE, 
> +0x13, 0x63 } }
> +
> +//
> +// Forward reference for pure ANSI compatability // typedef struct 
> +_EFI_FILE_EXPLORER_PROTOCOL  EFI_FILE_EXPLORER_PROTOCOL;
> +
> +/**
> +  Prototype for the next process after user chosed one file.
> +
> +  @param[in] FilePath The device path of the find file.
> +
> +  @retvalTRUE Need exit file explorer after do the extra task.
> +  @retvalFALSENot need to exit file explorer after do the extra 
> task.
> +
> +**/
> +typedef
> +BOOLEAN
> +(EFIAPI *CHOOSE_HANDLER)(
> +  IN EFI_DEVICE_PATH_PROTOCOL  *FilePath
> +  );
> +
> +/**
> +  Choose a file in the specified directory. 
> +
> +  If user input NULL for the RootDirectory, will choose file in the system.
> +
> +  If user input *File != NULL, function will return the allocate 
> + device path  info for the choosed file, caller has to free the memory after 
> use it.
> +
> +  @param  RootDirectoryPointer to the root directory.
> +  @param  FileType The file type need to choose.
> +  @param  ChooseHandlerFunction pointer to the extra task need to do
> +   after choose one file.
> +  @param  File Return the device path for the last time chosed 
> file.
> +
> +  @retval EFI_SUCESS   Choose the file success.
> +  @retval Other errors Choose the file failed.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI   *CHOOSE_FILE) (
> +  IN  EFI_DEVICE_PATH_PROTOCOL  *RootDirectory,
> +  IN  CHAR16*FileType,  OPTIONAL
> +  IN  CHOOSE_HANDLERChooseHandler,  OPTIONAL
> +  OUT EFI_DEVICE_PATH_PROTOCOL  **File  OPTIONAL
> +  );
> +
> +struct _EFI_FILE_EXPLORER_PROTOCOL {
> +  CHOOSE_FILE 

Re: [edk2] [Patch 1/2] BaseTools VfrCompiler: In order to keep consistent, add an optional "; " for condition op-code.

2015-10-14 Thread Dong, Eric
Leif,

Got it, I will update the format to follow the BaseTools/Contributions.txt. 
Thanks for your comments.

Thanks,
Eric
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif 
Lindholm
Sent: Wednesday, October 14, 2015 10:32 PM
To: Dong, Eric
Cc: edk2-devel@lists.01.org; Gao, Liming
Subject: Re: [edk2] [Patch 1/2] BaseTools VfrCompiler: In order to keep 
consistent, add an optional "; " for condition op-code.

On Wed, Oct 14, 2015 at 04:29:27PM +0800, Eric Dong wrote:
> In current implementation, the "endif" opcode for suppressif has an end ";" 
> for the statement opcode, but not for the option opcode. This is not a user 
> friendly grammar. So this patch fixed this issue. Add an optional ";" end for 
> option opcode to keep consistent with existed code. The same case also 
> existed for grayoutif/disableif/inconsistentif/nosubmitif/warningif.

Can we have line breaks inserted in the commit message as appropriate to 
conform with BaseTools/Contributions.txt?

Regards,

Leif

> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Eric Dong <eric.d...@intel.com>
> ---
>  BaseTools/Source/C/VfrCompile/VfrSyntax.g | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g 
> b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
> index ad839b2..d74fec8 100644
> --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
> +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
> @@ -3256,39 +3256,39 @@ vfrStatementInconsistentIf :
><< CIfrInconsistentIf IIObj; >>
>L:InconsistentIf << 
> IIObj.SetLineNo(L->getLine()); >>
>Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << IIObj.SetError 
> (_STOSID(S->getText(), S->getLine())); >>
>{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
>vfrStatementExpression[0]
> -  E:EndIf  << CRT_END_OP (E); >>
> +  E:EndIf {";"}<< CRT_END_OP (E); >>
>;
>  
>  vfrStatementNoSubmitIf :
><< CIfrNoSubmitIf NSIObj; >>
>L:NoSubmitIf << 
> NSIObj.SetLineNo(L->getLine()); >>
>Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << NSIObj.SetError 
> (_STOSID(S->getText(), S->getLine())); >>
>{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
>vfrStatementExpression[0]
> -  E:EndIf  << CRT_END_OP (E); >>
> +  E:EndIf {";"}<< CRT_END_OP (E); >>
>;
>  
>  vfrStatementWarningIf :
><< CIfrWarningIf WIObj; >>
>L:WarningIf  << 
> WIObj.SetLineNo(L->getLine()); >>
>Prompt "=" "STRING_TOKEN" "\(" S:Number "\)" "," << WIObj.SetWarning 
> (_STOSID(S->getText(), S->getLine())); >>
>{Timeout "=" T:Number ","<< WIObj.SetTimeOut 
> (_STOU8(T->getText(), T->getLine())); >>}
>vfrStatementExpression[0]
> -  E:EndIf  << CRT_END_OP (E); >>
> +  E:EndIf {";"}<< CRT_END_OP (E); >>
>;
>  
>  vfrStatementDisableIfQuest :
><< 
>  CIfrDisableIf DIObj; 
>>>
>L:DisableIf  << 
> DIObj.SetLineNo(L->getLine()); >>
>vfrStatementExpression[0] ";"
>vfrStatementQuestionOptionList
> -  E:EndIf  << CRT_END_OP (E); >>
> +  E:EndIf {";"}<< CRT_END_OP (E); >>
>;
>  
>  vfrStatementRefresh :
><< CIfrRefresh RObj; >>
>L:Refresh<< 
> RObj.SetLineNo(L->getLine()); >>
> @@ -3314,20 +3314,20 @@ vfrStatementSuppressIfQuest :
><< CIfrSuppressIf SIObj; >>
>L:SuppressIf << 
> SIObj.SetLineNo(L->getLine()); >>
>{ FLAGS "=" flagsField ( "\|" flagsField )* "," }
> 

Re: [edk2] [PATCH] MdeModulePkg: Remove unused variables from both UefiBootManagerLib and BdsDxe to fix GCC build.

2015-08-27 Thread Dong, Eric
Checked in code at r18350

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dong, 
Eric
Sent: Friday, August 28, 2015 12:54 PM
To: Wang, Sunny (HPS SW); edk2-devel@lists.01.org
Cc: El-Haj-Mahmoud, Samer; Shifflett, Joseph
Subject: Re: [edk2] [PATCH] MdeModulePkg: Remove unused variables from both 
UefiBootManagerLib and BdsDxe to fix GCC build.

Reviewed-by: Eric Dong eric.d...@intel.com

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Wang, 
Sunny (HPS SW)
Sent: Friday, August 28, 2015 12:40 PM
To: edk2-devel@lists.01.org
Cc: El-Haj-Mahmoud, Samer; Shifflett, Joseph
Subject: [edk2] [PATCH] MdeModulePkg: Remove unused variables from both 
UefiBootManagerLib and BdsDxe to fix GCC build.

Dear MdeModulePkg maintainers,

Please find the attached patch that removes unused variables from both 
UefiBootManagerLib and BdsDxe to fix GCC build.

MdeModulePkg: Remove unused variables from both UefiBootManagerLib and BdsDxe 
to fix GCC build.

Cc: Samer El-Haj-Mahmoud  el...@hp.commailto:el...@hp.com

Cc: Joseph Shifflett joseph.shiffl...@hp.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang sunnyw...@hpe.com
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +--
MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c | 3 +--
MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index f68c25e..8f14cf6 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1,6 +1,7 @@
/** @file
   Library functions which relates with booting.
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.BR
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.BR This 
program and the accompanying materials are licensed and made available under 
the terms and conditions of the BSD License @@ -956,7 +957,6 @@ BmFindUsbDevice 
(
   EFI_DEVICE_PATH_PROTOCOL  *UsbIoDevicePath;
   EFI_USB_IO_PROTOCOL   *UsbIo;
   UINTN Index;
-  UINTN UsbIoDevicePathSize;
   BOOLEAN   Matched;
   ASSERT (UsbIoHandleCount != NULL);
@@ -988,7 +988,6 @@ BmFindUsbDevice (
 UsbIoDevicePath = DevicePathFromHandle (UsbIoHandles[Index]);
 Matched = FALSE;
 if (!EFI_ERROR (Status)  (UsbIoDevicePath != NULL)) {
-  UsbIoDevicePathSize = GetDevicePathSize (UsbIoDevicePath) - 
END_DEVICE_PATH_LENGTH;
   //
   // Compare starting part of UsbIoHandle's device path with 
ParentDevicePath.
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
index d197816..8f4b691 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmDriverHealth.c
@@ -1,6 +1,7 @@
/** @file
   Library functions which relates with driver health.
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.BR
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.BR This 
program and the accompanying materials are licensed and made available under 
the terms and conditions of the BSD License @@ -295,7 +296,6 @@ 
EfiBootManagerGetDriverHealthInfo (
   EFI_STATUS Status;
   UINTN  NumHandles;
   EFI_HANDLE *DriverHealthHandles;
-  EFI_DRIVER_HEALTH_STATUS   HealthStatus;
   UINTN  DriverHealthIndex;
   EFI_HANDLE *Handles;
   UINTN  HandleCount;
@@ -313,7 +313,6 @@ EfiBootManagerGetDriverHealthInfo (
   NumHandles  = 0;
   HandleCount = 0;
-  HealthStatus = EfiDriverHealthStatusHealthy;
   Status = gBS-LocateHandleBuffer (
   ByProtocol,
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 6ffb667..c889892 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -5,6 +5,7 @@
   After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid-BdsEntry will be 
invoked
   to enter BDS phase.
+(C) Copyright 2015 Hewlett-Packard Development Company, L.P.BR
Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.BR This 
program and the accompanying materials are licensed and made available under 
the terms and conditions of the BSD License @@ -144,7 +145,6 @@ 
BdsEnumerateBootOptions ( {
   EFI_STATUSStatus;
   EFI_BOOT_MANAGER_LOAD_OPTION  *BootOptions;
-  UINT16NonBlockNumber;
   UINTN HandleCount;
   EFI_HANDLE*Handles;
   EFI_BLOCK_IO_PROTOCOL *BlkIo;
@@ -220,7 +220,6 @@ BdsEnumerateBootOptions

Re: [edk2] [patch] CryptoPkg: Replace string wrapper functions with safe string functions

2015-09-01 Thread Dong, Eric
Reviewed-by:  Eric Dong <eric.d...@intel.com>

-Original Message-
From: Long, Qin 
Sent: Tuesday, September 01, 2015 4:55 PM
To: Ye, Ting; Dong, Eric
Cc: edk2-devel@lists.01.org
Subject: [patch] CryptoPkg: Replace string wrapper functions with safe string 
functions

EDKII core suggest retire unsafe string functions. This patch is to replace 
string wrapper functions with new-added safe string functions for consistence.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.l...@intel.com>
---
 CryptoPkg/Include/OpenSslSupport.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/CryptoPkg/Include/OpenSslSupport.h 
b/CryptoPkg/Include/OpenSslSupport.h
index b5a8b58..2c6e23c 100644
--- a/CryptoPkg/Include/OpenSslSupport.h
+++ b/CryptoPkg/Include/OpenSslSupport.h
@@ -21,6 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include   #include 
 
+#define MAX_STRING_SIZE  0x1000
+
 //
 // File operations are not required for building Open SSL,  // so FILE is 
mapped to VOID * to pass build @@ -236,10 +238,10 @@ extern FILE  *stdout;
 #define memmove(dest,source,count)CopyMem(dest,source,(UINTN)(count))
 #define strcmpAsciiStrCmp
 #define strncmp(string1,string2,count)
(int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
-#define strcpy(strDest,strSource) AsciiStrCpy(strDest,strSource)
-#define strncpy(strDest,strSource,count)  
AsciiStrnCpy(strDest,strSource,(UINTN)count)
-#define strlen(str)   (size_t)(AsciiStrLen(str))
-#define strcat(strDest,strSource) AsciiStrCat(strDest,strSource)
+#define strcpy(strDest,strSource) 
AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
+#define strncpy(strDest,strSource,count)  
AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
+#define strlen(str)   
(size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
+#define strcat(strDest,strSource) 
AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
 #define strchr(str,ch)ScanMem8((VOID 
*)(str),AsciiStrSize(str),(UINT8)ch)
 #define abort()   ASSERT (FALSE)
 #define assert(expression)
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg:Refine the code comments in RegularExpressionDxe.

2015-09-13 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Friday, September 11, 2015 2:29 PM
To: Dong, Eric; Qiu, Shumin; edk2-devel@lists.01.org
Subject: [patch] MdeModulePkg:Refine the code comments in RegularExpressionDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 .../RegularExpressionDxe/RegularExpressionDxe.c| 146 +
 .../RegularExpressionDxe/RegularExpressionDxe.h| 108 +++
 .../RegularExpressionDxe/RegularExpressionDxe.inf  |  10 +-
 3 files changed, 151 insertions(+), 113 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
index 6c62957..a341a2b 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
@@ -1,7 +1,6 @@
-/**
-  @file
+/** @file
 
   EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
 
   Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.
 
@@ -10,10 +9,11 @@
   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.
+
 **/
 
 #include "RegularExpressionDxe.h"
 
 STATIC
@@ -34,13 +34,45 @@ EFI_REGULAR_EXPRESSION_PROTOCOL mProtocolInstance = {
 
 /**
   Call the Oniguruma regex match API.
 
   Same parameters as RegularExpressionMatch, except SyntaxType is required.
+  
+  @param String A pointer to a NULL terminated string to match against 
the
+regular expression string specified by Pattern.
+
+  @param PatternA pointer to a NULL terminated string that represents 
the
+regular expression.
+  @param SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies 
the
+regular expression syntax type to use. May be NULL in 
which
+case the function will use its default regular 
expression
+syntax type.
+
+  @param Result On return, points to TRUE if String fully matches 
against
+the regular expression Pattern using the regular 
expression
+SyntaxType. Otherwise, points to FALSE.
+
+  @param Captures   A Pointer to an array of EFI_REGEX_CAPTURE objects to 
receive
+the captured groups in the event of a match. The full
+sub-string match is put in Captures[0], and the 
results of N
+capturing groups are put in Captures[1:N]. If Captures 
is
+NULL, then this function doesn't allocate the memory 
for the
+array and does not build up the elements. It only 
returns the
+number of matching patterns in CapturesCount. If 
Captures is
+not NULL, this function returns a pointer to an array 
and
+builds up the elements in the array. CapturesCount is 
also
+updated to the number of matching patterns found. It 
is the
+caller's responsibility to free the memory pool in 
Captures
+and in each CapturePtr in the array elements.
+
+  @param CapturesCount  On output, CapturesCount is the number of matching 
patterns
+found in String. Zero means no matching patterns were 
found
+in the string.
+
+  @retval  EFI_SUCCESS   Regex compilation and match completed 
successfully.
+  @retval  EFI_DEVICE_ERROR  Regex compilation failed.
 
-  @retval EFI_SUCCESS   Regex compilation and match completed successfully.
-  @retval EFI_DEVICE_ERROR  Regex compilation failed.
 **/
 STATIC
 EFI_STATUS
 OnigurumaMatch (
   IN  CHAR16*String,
@@ -142,27 +174,27 @@ OnigurumaMatch (
 
 /**
   Returns information about the regular expression syntax types supported
   by the implementation.
 
-  This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL
-   instance.
+  @param This  A pointer to the 
EFI_REGULAR_EXPRESSION_PROTOCOL
+   instance.
 
-  RegExSyntaxTypeListSize  On input, the size in bytes of RegExSyntaxTypeList.
-   On output with a return code of EFI_SUCCESS, the
-   size in bytes of the data returned in
-   RegExSyntaxTypeList. On output with a return code
-   of EFI_BUFFER_TOO_SMALL, the size of
-   RegExSyntaxTypeList required to obtain the list.
+  @param  RegExSyntaxTypeListS

Re: [edk2] [patch] MdeModulePkg:Fix the bug the incorrect change of StrCpyS function

2015-09-16 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Wednesday, September 16, 2015 5:14 PM
To: Dong, Eric; Qiu, Shumin; edk2-devel@lists.01.org
Subject: [patch] MdeModulePkg:Fix the bug the incorrect change of StrCpyS 
function

The pointer to the destination string changed,the max length also 
changed.Previous change neglect this point.
And base on the code logic,we can use StrCatS to replace StrCpyS.Now this patch 
is to fix this bug.

Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c   |  4 +-
 .../HiiDatabaseDxe/ConfigKeywordHandler.c  | 65 +++---
 2 files changed, 23 insertions(+), 46 deletions(-)

diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 
b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index bee5e0d..66d72ac 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -660,11 +660,11 @@ HiiConstructConfigHdr (
   }
   
   //
   // Append L"="
   //
-  StrCpyS (String, MaxLen, L"=");
+  StrCatS (ReturnString, MaxLen, L"=");
   String += StrLen (String);
 
   if (Name != NULL) {
 //
 // Append Name converted to NameLength @@ -675,11 +675,11 @@ 
HiiConstructConfigHdr (
   }
 
   //
   // Append L"="
   //
-  StrCpyS (String, MaxLen, L"=");
+  StrCatS (ReturnString, MaxLen, L"=");
   String += StrLen (String);
 
   //
   // Append the device path associated with DriverHandle converted to 
DevicePathSize
   //
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index e88a0c4..a93d4ef 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -1757,11 +1757,11 @@ ConstructConfigHdr (
   }
   
   //
   // Append L"="
   //
-  StrCpyS (String, MaxLen, L"=");
+  StrCatS (ReturnString, MaxLen, L"=");
   String += StrLen (String);
 
   if (Name != NULL) {
 //
 // Append Name converted to NameLength @@ -1772,11 +1772,11 @@ 
ConstructConfigHdr (
   }
 
   //
   // Append L"="
   //
-  StrCpyS (String, MaxLen, L"=");
+  StrCatS (ReturnString, MaxLen, L"=");
   String += StrLen (String);
 
   //
   // Append the device path associated with DriverHandle converted to 
DevicePathSize
   //
@@ -2043,18 +2043,14 @@ ExtractConfigRequest (
 return EFI_OUT_OF_RESOURCES;
   }
   StringPtr = *ConfigRequest;
 
   StrCpyS (StringPtr, MaxLen, ConfigHdr);
-  StringPtr += StrLen (StringPtr);
 
-  *StringPtr = L'&';
-  StringPtr++;
+  StrCatS (StringPtr, MaxLen, L"&");
 
-  StrCpyS (StringPtr, MaxLen, RequestElement);
-  StringPtr += StrLen (StringPtr);
-  *StringPtr = L'\0';
+  StrCatS (StringPtr, MaxLen, RequestElement);
 
   FreePool (ConfigHdr);
   FreePool (RequestElement);
 
   return EFI_SUCCESS;
@@ -2151,27 +2147,21 @@ ExtractConfigResp (
 return EFI_OUT_OF_RESOURCES;
   }
   StringPtr = *ConfigResp;
 
   StrCpyS (StringPtr, MaxLen, ConfigHdr);
-  StringPtr += StrLen (StringPtr);
 
-  *StringPtr = L'&';
-  StringPtr++;
+  StrCatS (StringPtr, MaxLen, L"&");
 
-  StrCpyS (StringPtr, MaxLen, RequestElement);
-  StringPtr += StrLen (StringPtr);
-  
-  *StringPtr = L'&';
-  StringPtr++;
 
-  StrCpyS (StringPtr, MaxLen, L"VALUE=");
-  StringPtr += StrLen (StringPtr);
+  StrCatS (StringPtr, MaxLen, RequestElement);
+
+  StrCatS (StringPtr, MaxLen, L"&");
+
+  StrCatS (StringPtr, MaxLen, L"VALUE=");
 
-  StrCpyS (StringPtr, MaxLen, ValueElement);
-  StringPtr += StrLen (StringPtr);
-  *StringPtr = L'\0';
+  StrCatS (StringPtr, MaxLen, ValueElement);
 
   FreePool (ConfigHdr);
   FreePool (RequestElement);
 
   return EFI_SUCCESS;
@@ -2451,47 +2441,37 @@ GenerateKeywordResp (
 
   //
   // 2.1 Copy NameSpaceId section.
   //
   StrCpyS (RespStr, RespStrLen, L"NAMESPACE=");
-  RespStr += StrLen (RespStr);
-  StrCpyS (RespStr, RespStrLen, UnicodeNameSpace);
-  RespStr += StrLen (RespStr);
+
+  StrCatS (RespStr, RespStrLen, UnicodeNameSpace);
 
   //
   // 2.2 Copy PathHdr section.
   //
-  StrCpyS (RespStr, RespStrLen, PathHdr);
-  RespStr += StrLen (RespStr);
+  StrCatS (RespStr, RespStrLen, PathHdr);
 
   //
   // 2.3 Copy Keyword section.
   //
-  StrCpyS (RespStr, RespStrLen, L"KEYWORD=");
-  RespStr += StrLen (RespStr);
-  StrCpyS (RespStr, RespStrLen, KeywordData);
-  RespStr += StrLen (RespStr);
+  StrCatS (RespStr, RespStrLen, L"KEYWORD=");
+
+  StrCatS (RespStr, RespStrLen, KeywordData);
 
   //
   // 2.4 Copy the Value section.
   //
-  StrCpyS (RespStr, RespStrLen

Re: [edk2] [Patch] DxeTpmMeasureBootLib: Change global variable name to avoid name conflict.

2015-12-16 Thread Dong, Eric
Add more description for it: GCC49 has enhance the global variable name 
conflict check. If different module share the same global name, it will report 
link error. This patch fixed one case reported for DxeTpmMeasureBootLib and 
DxeImageVerificationLib.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric Dong
Sent: Thursday, December 17, 2015 3:55 PM
To: edk2-devel@lists.01.org; Gao, Liming
Subject: [edk2] [Patch] DxeTpmMeasureBootLib: Change global variable name to 
avoid name conflict.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong 
---
 .../Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c| 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c 
b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
index cd48a1a..25788b8 100644
--- a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
+++ b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
@@ -51,11 +51,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 // Flag to check GPT partition. It only need be measured once.
 //
 BOOLEAN   mMeasureGptTableFlag = FALSE;
 UINTN mMeasureGptCount = 0;
 VOID  *mFileBuffer;
-UINTN mImageSize;
+UINTN mTpmImageSize;
 //
 // Measured FV handle cache
 //
 EFI_HANDLEmCacheMeasuredHandle  = NULL;
 MEASURED_HOB_DATA *mMeasuredHobData = NULL;
@@ -93,15 +93,15 @@ DxeTpmMeasureBootLibImageRead (
   if (MAX_ADDRESS - FileOffset < *ReadSize) {
 return EFI_INVALID_PARAMETER;
   }
 
   EndPosition = FileOffset + *ReadSize;
-  if (EndPosition > mImageSize) {
-*ReadSize = (UINT32)(mImageSize - FileOffset);
+  if (EndPosition > mTpmImageSize) {
+*ReadSize = (UINT32)(mTpmImageSize - FileOffset);
   }
 
-  if (FileOffset >= mImageSize) {
+  if (FileOffset >= mTpmImageSize) {
 *ReadSize = 0;
   }
 
   CopyMem (Buffer, (UINT8 *)((UINTN) FileHandle + FileOffset), *ReadSize);
 
@@ -906,11 +906,11 @@ DxeTpmMeasureBootHandler (
   if (FileBuffer == NULL) {
 Status = EFI_SECURITY_VIOLATION;
 goto Finish;
   }
 
-  mImageSize  = FileSize;
+  mTpmImageSize  = FileSize;
   mFileBuffer = FileBuffer;
 
   //
   // Measure PE Image
   //
-- 
2.6.4.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg: Improved SetupBrowser handling to failed GOTO callback.

2015-12-14 Thread Dong, Eric
Hi Cecil,

Why not also use mCurrentFormSetGuid and mCurrentHiiHandle for the guid and 
HiiHandle info?

Thanks,
Eric
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
Sheng
Sent: Monday, December 14, 2015 1:38 PM
To: edk2-devel@lists.01.org
Cc: Cecil Sheng
Subject: [edk2] [PATCH] MdeModulePkg: Improved SetupBrowser handling to failed 
GOTO callback.

On a failed REF_OP callback, all changed fields in the Selection should be 
restored.

Signed-off-by: Cecil Sheng 
---
 MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 356cd9c..4301285 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -2,6 +2,7 @@
 Utility functions for UI presentation.
 
 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP
 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 @@ -2505,10 
+2506,13 @@ SetupBrowser (
   //
   if (EFI_ERROR (Status)) {
 //
-// Cross reference will not be taken
+// Cross reference will not be taken, restore all essential 
+ field
 //
-Selection->FormId = Selection->Form->FormId;
+Selection->FormId = mCurrentFormId;
 Selection->QuestionId = 0;
+Selection->Handle = Selection->FormSet->HiiHandle;
+Selection->Action = UI_ACTION_REFRESH_FORM;
+CopyMem (>FormSetGuid, , 
+ sizeof (EFI_GUID));
   }
 }
 
--
2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg: Convert HiiDatabaseDxe ConfigRouting ASSERT to return an error

2015-12-10 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

Checked in code at r19219
Thanks,
Eric

-Original Message-
From: Cohen, Eugene [mailto:eug...@hp.com] 
Sent: Friday, December 04, 2015 9:33 PM
To: edk2-devel@lists.01.org; Dong, Eric; Gao, Liming
Subject: [PATCH] MdeModulePkg: Convert HiiDatabaseDxe ConfigRouting ASSERT to 
return an error

This should just return an error and not assert.  We hit this when testing with 
a client that was trying to access the old IP4_CONFIG on firmware implementing 
IP4_CONFIG2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eug...@hp.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index b618903..9037924 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -3873,7 +3873,9 @@ HiiConfigRoutingExtractConfig (
   ,
   (VOID **) 
   );
-  ASSERT_EFI_ERROR (Status);
+  if (EFI_ERROR(Status)) {
+goto Done;
+  }
 
   Status = ConfigAccess->ExtractConfig (
ConfigAccess,
-- 
1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg: DeleteLoadOptionVariable() removes Boot####

2016-01-07 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Ni, Ruiyu 
Sent: Thursday, January 07, 2016 6:15 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch] MdeModulePkg: DeleteLoadOptionVariable() removes Boot

Change EfiBootManagerDeleteLoadOptionVariable() to not just remove  from 
BootOrder but also remove Boot variable.

The old behavior tries to do less for performance but it leaves unreferenced 
Boot which cannot be reclaimed in variable reclaim operation though the 
Boot will be eventually be overwritten by 
EfiBootManagerAddLoadOptionVariable().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
---
 .../Library/UefiBootManagerLib/BmLoadOption.c  | 46 ++
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 999647c..696e995 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -1,7 +1,7 @@
 /** @file
   Load option library functions which relate with creating and processing load 
options.
 
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP  This program 
and the accompanying materials  are licensed and made available under the terms 
and conditions of the BSD License @@ -564,7 +564,6 @@ 
EfiBootManagerDeleteLoadOptionVariable (  {
   UINT16*OptionOrder;
   UINTN OptionOrderSize;
-  EFI_STATUSStatus;
   UINTN Index;
   CHAR16OptionName[BM_OPTION_NAME_LEN];
 
@@ -572,11 +571,10 @@ EfiBootManagerDeleteLoadOptionVariable (
 return EFI_INVALID_PARAMETER;
   }
 
-  Status = EFI_NOT_FOUND;
-
   if (OptionType == LoadOptionTypeDriver || OptionType == 
LoadOptionTypeSysPrep || OptionType == LoadOptionTypeBoot) {
 //
-// If the associated *Order exists, just remove the reference in *Order.
+// If the associated *Order exists, firstly remove the reference in *Order 
for
+//  Driver, SysPrep and Boot.
 //
 GetEfiGlobalVariable2 (mBmLoadOptionOrderName[OptionType], (VOID **) 
, );
 ASSERT ((OptionOrder != NULL && OptionOrderSize != 0) || (OptionOrder == 
NULL && OptionOrderSize == 0)); @@ -585,34 +583,32 @@ 
EfiBootManagerDeleteLoadOptionVariable (
   if (OptionOrder[Index] == OptionNumber) {
 OptionOrderSize -= sizeof (UINT16);
 CopyMem ([Index], [Index + 1], OptionOrderSize 
- Index * sizeof (UINT16));
-Status = gRT->SetVariable (
-  mBmLoadOptionOrderName[OptionType],
-  ,
-  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_NON_VOLATILE,
-  OptionOrderSize,
-  OptionOrder
-  );
+gRT->SetVariable (
+   mBmLoadOptionOrderName[OptionType],
+   ,
+   EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | 
EFI_VARIABLE_NON_VOLATILE,
+   OptionOrderSize,
+   OptionOrder
+   );
 break;
   }
 }
 if (OptionOrder != NULL) {
   FreePool (OptionOrder);
 }
-  } else if (OptionType == LoadOptionTypePlatformRecovery) {
-//
-// PlatformRecovery doesn't have assiciated PlatformRecoveryOrder, 
remove the PlatformRecovery itself.
-//
-UnicodeSPrint (OptionName, sizeof (OptionName), L"%s%04x", 
mBmLoadOptionName[OptionType], OptionNumber);
-Status = gRT->SetVariable (
-OptionName,
-,
-0,
-0,
-NULL
-);
   }
 
-  return Status;
+  //
+  // Remove the Driver, SysPrep, Boot or PlatformRecovery 
itself.
+  //
+  UnicodeSPrint (OptionName, sizeof (OptionName), L"%s%04x", 
+ mBmLoadOptionName[OptionType], OptionNumber);  return gRT->SetVariable (
+OptionName,
+,
+0,
+0,
+NULL
+);
 }
 
 /**
--
2.6.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings available to OS runtime

2015-12-22 Thread Dong, Eric
Aaron,

This patch just follow UEFI spec 2.5 chapter 31.2.11.1 description to enable 
this feature. I think in OS environment, OS utility can just partial change the 
configuration data. We can't export config access protocol to OS environment.

Thanks,
Eric
From: aaron@congatec.com [mailto:aaron@congatec.com]
Sent: Wednesday, December 23, 2015 2:27 AM
To: Dong, Eric
Cc: Bi, Dandan; edk2-devel@lists.01.org; edk2-devel; Gao, Liming; 
El-Haj-Mahmoud, Samer
Subject: Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings 
available to OS runtime

I have a question about this.   Making the Hii Configuration data available to 
the OS at run time only exports the data from the Hii database.  It does not 
make the Hii Configuration Access protocols (or their callback functions) 
available to the OS?  So if a 3rd party OpRom was making using of their own Hii 
Configuration Access protocols and using callbacks to prevent specific 
combinations of configurations, then that would not be caught by an OS based 
setup browser?  Additionally, shouldn't an OS based setup browser have the 
problem of retrieving the current configuration data since it would need to use 
the config access protocols?

Best Regards,
Aaron



From:"Dong, Eric" <eric.d...@intel.com<mailto:eric.d...@intel.com>>
To:"El-Haj-Mahmoud, Samer" 
<samer.el-haj-mahm...@hpe.com<mailto:samer.el-haj-mahm...@hpe.com>>, "Bi, 
Dandan" <dandan...@intel.com<mailto:dandan...@intel.com>>, 
"edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>" 
<edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>>,
Cc:"Gao, Liming" <liming@intel.com<mailto:liming@intel.com>>
Date:12/21/2015 05:29 PM
Subject:Re: [edk2] [patch] MdeModulePkg:Make HIIconfiguration   
 settingsavailable to OS runtime
Sent by:"edk2-devel" 
<edk2-devel-boun...@lists.01.org<mailto:edk2-devel-boun...@lists.01.org>>




Yes, all the Hii database data will be export. Also the ConfigResp string for 
all HII drivers.

-Original Message-
From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
Sent: Tuesday, December 22, 2015 9:25 AM
To: Dong, Eric; Bi, Dandan; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Gao, Liming
Subject: RE: [edk2] [patch] MdeModulePkg:Make HII configuration settings 
available to OS runtime

Does this also export all string packages?

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dong, 
Eric
Sent: Monday, December 21, 2015 8:22 PM
To: Bi, Dandan <dandan...@intel.com<mailto:dandan...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Gao, Liming <liming@intel.com<mailto:liming@intel.com>>
Subject: Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings 
available to OS runtime

Reviewed-by: Eric Dong <eric.d...@intel.com<mailto:eric.d...@intel.com>>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan Bi
Sent: Monday, December 21, 2015 4:45 PM
To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Dong, Eric; Gao, Liming
Subject: [edk2] [patch] MdeModulePkg:Make HII configuration settings available 
to OS runtime

This feature is aimed to allow OS make use of the HII database during runtime.
In this case, the contents of the HII Database is exported to a buffer.
The pointer to the buffer is placed in the EFI System Configuration Table, 
where it can be retrieved by an OS application.

Cc: Liming Gao <liming@intel.com<mailto:liming@intel.com>>
Cc: Eric Dong <eric.d...@intel.com<mailto:eric.d...@intel.com>>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com<mailto:dandan...@intel.com>>
---
MdeModulePkg/Universal/HiiDatabaseDxe/Database.c   | 102 -
.../Universal/HiiDatabaseDxe/HiiDatabase.h |   5 +
.../Universal/HiiDatabaseDxe/HiiDatabaseEntry.c|  51 +++
3 files changed, 157 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index ec56795..011e712 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -2773,10 +2773,96 @@ ExportPackageList (
  *UsedSize += ResultSize + sizeof (EFI_HII_PACKAGE_HEADER);

  return EFI_SUCCESS;
}

+/**
+This is an internal function,mainly use to get and update configuration 
settings information.
+
+@param  ThisA pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+@param  NewPackage  Indaicate whether add the packages in the package list 
to th

Re: [edk2] [Patch 3/8] MdeModulePkg: Add the missing library uni files of UI instances

2015-12-23 Thread Dong, Eric
Reviewed-by: Eric Dong 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
Gao
Sent: Wednesday, December 23, 2015 5:57 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch 3/8] MdeModulePkg: Add the missing library uni files of 
UI instances

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao 
---
 .../BootMaintenanceManagerLib.inf  |  1 +
 .../BootMaintenanceManagerLib.uni  | 26 ++
 .../Library/BootManagerLib/BootManagerLib.inf  |  1 +
 .../Library/BootManagerLib/BootManagerLib.uni  | 26 ++
 .../Library/DeviceManagerLib/DeviceManagerLib.inf  |  1 +  
.../Library/DeviceManagerLib/DeviceManagerLib.uni  | 26 ++
 .../Library/FileExplorerLib/FileExplorerLib.inf|  1 +
 .../Library/FileExplorerLib/FileExplorerLib.uni| 26 ++
 8 files changed, 108 insertions(+)
 create mode 100644 
MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.uni
 create mode 100644 MdeModulePkg/Library/BootManagerLib/BootManagerLib.uni
 create mode 100644 MdeModulePkg/Library/DeviceManagerLib/DeviceManagerLib.uni
 create mode 100644 MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.uni

diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf 
b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
index 7db201d..302cb90 100644
--- 
a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMana
+++ gerLib.inf
@@ -14,6 +14,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = BootMaintenanceManagerLib
+  MODULE_UNI_FILE= BootMaintenanceManagerLib.uni
   FILE_GUID  = CA9E4824-4198-4715-AA22-E2935E703A07
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.uni 
b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.uni
new file mode 100644
index 000..44411c8
--- /dev/null
+++ b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMana
+++ gerLib.uni
@@ -0,0 +1,26 @@
+// /** @file
+// Boot Maintenance Manager Library used by UiApp.
+//
+// Boot Maintenance Manager Library used by UiApp.
+//
+// Copyright (c) 2015, Intel Corporation. All rights reserved. // 
+// This program and the accompanying materials are licensed and made 
+available under // the terms and conditions of the BSD License that 
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.
+//
+// **/
+
+#string STR_MODULE_ABSTRACT
+#language en-US
+"Boot Maintenance Manager Library used by UiApp."
+
+#string STR_MODULE_DESCRIPTION
+#language en-US
+"Boot Maintenance Manager Library used by UiApp."
+
+
diff --git a/MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf 
b/MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf
index ff19516..8930414 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf
+++ b/MdeModulePkg/Library/BootManagerLib/BootManagerLib.inf
@@ -14,6 +14,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = BootManagerLib
+  MODULE_UNI_FILE= BootManagerLib.uni
   FILE_GUID  = CCB2DCE1-4FC8-41CB-88C5-D349E134C9FC
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
diff --git a/MdeModulePkg/Library/BootManagerLib/BootManagerLib.uni 
b/MdeModulePkg/Library/BootManagerLib/BootManagerLib.uni
new file mode 100644
index 000..5ffa9de
--- /dev/null
+++ b/MdeModulePkg/Library/BootManagerLib/BootManagerLib.uni
@@ -0,0 +1,26 @@
+// /** @file
+// Boot Manager Library used by UiApp.
+//
+// Boot Manager Library used by UiApp.
+//
+// Copyright (c) 2015, Intel Corporation. All rights reserved. // 
+// This program and the accompanying materials are licensed and made 
+available under // the terms and conditions of the BSD License that 
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.
+//
+// **/
+
+#string STR_MODULE_ABSTRACT
+#language en-US
+"Boot Manager Library used by UiApp."
+
+#string STR_MODULE_DESCRIPTION
+#language en-US
+"Boot Manager Library used by UiApp."
+
+
diff --git 

Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings available to OS runtime

2015-12-21 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan Bi
Sent: Monday, December 21, 2015 4:45 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric; Gao, Liming
Subject: [edk2] [patch] MdeModulePkg:Make HII configuration settings available 
to OS runtime

This feature is aimed to allow OS make use of the HII database during runtime.
In this case, the contents of the HII Database is exported to a buffer.
The pointer to the buffer is placed in the EFI System Configuration Table, 
where it can be retrieved by an OS application.

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c   | 102 -
 .../Universal/HiiDatabaseDxe/HiiDatabase.h |   5 +
 .../Universal/HiiDatabaseDxe/HiiDatabaseEntry.c|  51 +++
 3 files changed, 157 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index ec56795..011e712 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -2773,10 +2773,96 @@ ExportPackageList (
   *UsedSize += ResultSize + sizeof (EFI_HII_PACKAGE_HEADER);
 
   return EFI_SUCCESS;
 }
 
+/**
+This is an internal function,mainly use to get and update configuration 
settings information.
+
+@param  ThisA pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+@param  NewPackage  Indaicate whether add the packages in the package list 
to the database.
+
+@retval EFI_SUCCESS Get the information successfully.
+
+**/
+EFI_STATUS
+HiiGetConfigurationSetting(
+  IN CONST EFI_HII_DATABASE_PROTOCOL*This,
+  IN BOOLEANNewPackage
+  )
+{
+  EFI_STATUS  Status;
+  HII_DATABASE_PRIVATE_DATA   *Private;
+  EFI_HII_PACKAGE_LIST_HEADER *DatabaseInfo;
+  EFI_STRING  ConfigAltResp;
+  UINTN   DatabaseInfoSize;
+  UINTN   ConfigLen;
+  
+  DatabaseInfo = NULL;
+  ConfigAltResp= NULL;
+  DatabaseInfoSize = 0;
+  ConfigLen= 0;
+
+  Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
+
+  //
+  // Get the length of the buffer that is required for the exported data.
+  //
+
+  Status = HiiExportPackageLists(This, NULL, , 
+ DatabaseInfo);  if (Status == EFI_BUFFER_TOO_SMALL) {
+if (gRTDatabaseInfoBuffer == NULL){
+  gRTDatabaseInfoBuffer = AllocateRuntimePool (DatabaseInfoSize);
+} else if (DatabaseInfoSize != gDatabaseInfoSize ) {
+  if (NewPackage){
+gBS->InstallConfigurationTable (, NULL);
+  }
+  gRTDatabaseInfoBuffer = 
ReallocateRuntimePool(gDatabaseInfoSize,DatabaseInfoSize,gRTDatabaseInfoBuffer);
+}
+ASSERT (gRTDatabaseInfoBuffer != NULL);
+
+gDatabaseInfoSize = DatabaseInfoSize;
+
+//
+//install it to configuration table.
+//
+if (NewPackage){
+  gBS->InstallConfigurationTable (, 
gRTDatabaseInfoBuffer);
+}
+  }
+
+  //
+  // Get ConfigResp string
+  //
+  Status = 
+ HiiConfigRoutingExportConfig(>ConfigRouting,);
+  if (!EFI_ERROR (Status)){
+ConfigLen = StrLen(ConfigAltResp);
+if (gRTConfigRespBuffer == NULL){
+  gRTConfigRespBuffer = AllocateRuntimePool ((ConfigLen + 1) * sizeof 
(CHAR16));
+} else if (ConfigLen != gConfigLen ){
+  if (NewPackage){
+gBS->InstallConfigurationTable (, 
NULL);
+  }
+  gRTConfigRespBuffer = ReallocateRuntimePool((gConfigLen + 1) * sizeof 
(CHAR16),(ConfigLen + 1) * sizeof (CHAR16),gRTConfigRespBuffer);
+}
+ASSERT (gRTConfigRespBuffer != NULL);
+
+gConfigLen = ConfigLen;
+
+//
+//install it to configuration table.
+//
+if (NewPackage){
+  gBS->InstallConfigurationTable (, 
gRTConfigRespBuffer);
+}
+
+FreePool(ConfigAltResp);
+  }
+
+  return EFI_SUCCESS;
+
+}
 
 /**
   This function adds the packages in the package list to the database and 
returns a handle. If there is a
   EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then this 
function will
   create a package of type EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the 
package list.
@@ -2865,10 +2951,18 @@ HiiNewPackageList (
 Status = AddDevicePathPackage (Private, EFI_HII_DATABASE_NOTIFY_NEW_PACK, 
DevicePath, DatabaseRecord);
 ASSERT_EFI_ERROR (Status);
   }
 
   *Handle = DatabaseRecord->Handle;
+
+  //
+  // Get the configuration setting info.
+  // And install it to configuration table.
+  //
+
+  HiiGetConfigurationSetting(This,TRUE);
+
   return EFI_SUCCESS;
 }
 
 
 /**
@@ -3077,11 +3171,17 @@ HiiUpdatePackageList (
   }
 
   //
   // Add all o

Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings available to OS runtime

2015-12-21 Thread Dong, Eric
Yes, all the Hii database data will be export. Also the ConfigResp string for 
all HII drivers. 

-Original Message-
From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com] 
Sent: Tuesday, December 22, 2015 9:25 AM
To: Dong, Eric; Bi, Dandan; edk2-devel@lists.01.org
Cc: Gao, Liming
Subject: RE: [edk2] [patch] MdeModulePkg:Make HII configuration settings 
available to OS runtime

Does this also export all string packages?

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dong, 
Eric
Sent: Monday, December 21, 2015 8:22 PM
To: Bi, Dandan <dandan...@intel.com>; edk2-devel@lists.01.org
Cc: Gao, Liming <liming@intel.com>
Subject: Re: [edk2] [patch] MdeModulePkg:Make HII configuration settings 
available to OS runtime

Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan Bi
Sent: Monday, December 21, 2015 4:45 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric; Gao, Liming
Subject: [edk2] [patch] MdeModulePkg:Make HII configuration settings available 
to OS runtime

This feature is aimed to allow OS make use of the HII database during runtime.
In this case, the contents of the HII Database is exported to a buffer.
The pointer to the buffer is placed in the EFI System Configuration Table, 
where it can be retrieved by an OS application.

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c   | 102 -
 .../Universal/HiiDatabaseDxe/HiiDatabase.h |   5 +
 .../Universal/HiiDatabaseDxe/HiiDatabaseEntry.c|  51 +++
 3 files changed, 157 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index ec56795..011e712 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -2773,10 +2773,96 @@ ExportPackageList (
   *UsedSize += ResultSize + sizeof (EFI_HII_PACKAGE_HEADER);
 
   return EFI_SUCCESS;
 }
 
+/**
+This is an internal function,mainly use to get and update configuration 
settings information.
+
+@param  ThisA pointer to the EFI_HII_DATABASE_PROTOCOL instance.
+@param  NewPackage  Indaicate whether add the packages in the package list 
to the database.
+
+@retval EFI_SUCCESS Get the information successfully.
+
+**/
+EFI_STATUS
+HiiGetConfigurationSetting(
+  IN CONST EFI_HII_DATABASE_PROTOCOL*This,
+  IN BOOLEANNewPackage
+  )
+{
+  EFI_STATUS  Status;
+  HII_DATABASE_PRIVATE_DATA   *Private;
+  EFI_HII_PACKAGE_LIST_HEADER *DatabaseInfo;
+  EFI_STRING  ConfigAltResp;
+  UINTN   DatabaseInfoSize;
+  UINTN   ConfigLen;
+  
+  DatabaseInfo = NULL;
+  ConfigAltResp= NULL;
+  DatabaseInfoSize = 0;
+  ConfigLen= 0;
+
+  Private = HII_DATABASE_DATABASE_PRIVATE_DATA_FROM_THIS (This);
+
+  //
+  // Get the length of the buffer that is required for the exported data.
+  //
+
+  Status = HiiExportPackageLists(This, NULL, , 
+ DatabaseInfo);  if (Status == EFI_BUFFER_TOO_SMALL) {
+if (gRTDatabaseInfoBuffer == NULL){
+  gRTDatabaseInfoBuffer = AllocateRuntimePool (DatabaseInfoSize);
+} else if (DatabaseInfoSize != gDatabaseInfoSize ) {
+  if (NewPackage){
+gBS->InstallConfigurationTable (, NULL);
+  }
+  gRTDatabaseInfoBuffer = 
ReallocateRuntimePool(gDatabaseInfoSize,DatabaseInfoSize,gRTDatabaseInfoBuffer);
+}
+ASSERT (gRTDatabaseInfoBuffer != NULL);
+
+gDatabaseInfoSize = DatabaseInfoSize;
+
+//
+//install it to configuration table.
+//
+if (NewPackage){
+  gBS->InstallConfigurationTable (, 
gRTDatabaseInfoBuffer);
+}
+  }
+
+  //
+  // Get ConfigResp string
+  //
+  Status =
+ HiiConfigRoutingExportConfig(>ConfigRouting,);
+  if (!EFI_ERROR (Status)){
+ConfigLen = StrLen(ConfigAltResp);
+if (gRTConfigRespBuffer == NULL){
+  gRTConfigRespBuffer = AllocateRuntimePool ((ConfigLen + 1) * sizeof 
(CHAR16));
+} else if (ConfigLen != gConfigLen ){
+  if (NewPackage){
+gBS->InstallConfigurationTable (, 
NULL);
+  }
+  gRTConfigRespBuffer = ReallocateRuntimePool((gConfigLen + 1) * sizeof 
(CHAR16),(ConfigLen + 1) * sizeof (CHAR16),gRTConfigRespBuffer);
+}
+ASSERT (gRTConfigRespBuffer != NULL);
+
+gConfigLen = ConfigLen;
+
+//
+//install it to configuration table.
+//
+if (NewPackage){
+  gBS->InstallConfigurationTable (, 
gRTConfigRespBuffer);
+}
+
+FreePool(ConfigAltResp);
+  }
+
+  return EFI_SUCC

Re: [edk2] [Patch] MdeModulePkg/BootManagerMenu: Fix bug that boots to undesired option

2015-12-24 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu Ni
Sent: Thursday, December 24, 2015 3:50 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [edk2] [Patch] MdeModulePkg/BootManagerMenu: Fix bug that boots to 
undesired option

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
---
 .../BootManagerMenuApp/BootManagerMenu.c   | 68 ++
 1 file changed, 45 insertions(+), 23 deletions(-)

diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c 
b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
index a8d5c03..9547c7e 100644
--- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
+++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
@@ -242,7 +242,48 @@ IsBootManagerMenu (
 
   return (BOOLEAN) (!EFI_ERROR (Status) && (BootOption->OptionNumber == 
BootManagerMenu.OptionNumber));  }
- 
+
+/**
+  Return whether to ignore the boot option.
+
+  @param BootOption  Pointer to EFI_BOOT_MANAGER_LOAD_OPTION to check.
+
+  @retval TRUE  Ignore the boot optin.
+  @retval FALSE Do not ignore the boot option.
+**/
+BOOLEAN
+IgnoreBootOption (
+  IN   EFI_BOOT_MANAGER_LOAD_OPTION  *BootOption
+  )
+{
+  EFI_STATUSStatus;
+  EFI_DEVICE_PATH_PROTOCOL  *ImageDevicePath;
+
+  //
+  // Ignore myself.
+  //
+  Status = gBS->HandleProtocol (gImageHandle, 
+ , (VOID **) );  
+ ASSERT_EFI_ERROR (Status);  if (CompareMem (BootOption->FilePath, 
ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {
+return TRUE;
+  }
+
+  //
+  // Do not ignore Boot Manager Menu.
+  //
+  if (IsBootManagerMenu (BootOption)) {
+return FALSE;
+  }
+
+  //
+  // Ignore the hidden/inactive boot option.
+  //
+  if (((BootOption->Attributes & LOAD_OPTION_HIDDEN) != 0) || 
((BootOption->Attributes & LOAD_OPTION_ACTIVE) == 0)) {
+return TRUE;
+  }
+
+  return FALSE;
+}
 
 /**
   This funciton uses to initialize boot menu data @@ -262,18 +303,13 @@ 
InitializeBootMenuData (
   OUT  BOOT_MENU_POPUP_DATA  *BootMenuData
   )
 {
-  EFI_STATUSStatus;
   UINTN Index;
   UINTN StrIndex;
-  EFI_DEVICE_PATH_PROTOCOL  *ImageDevicePath;
   
   if (BootOption == NULL || BootMenuData == NULL) {
 return EFI_INVALID_PARAMETER;
   }
 
-  Status = gBS->HandleProtocol (gImageHandle, 
, (VOID **) );
-  ASSERT_EFI_ERROR (Status);
-
   BootMenuData->TitleToken[0] = STRING_TOKEN 
(STR_BOOT_POPUP_MENU_TITLE_STRING);
   BootMenuData->PtrTokens = AllocateZeroPool (BootOptionCount * sizeof 
(EFI_STRING_ID));
   ASSERT (BootMenuData->PtrTokens != NULL); @@ -282,18 +318,7 @@ 
InitializeBootMenuData (
   // Skip boot option which created by BootNext Variable
   //
   for (StrIndex = 0, Index = 0; Index < BootOptionCount; Index++) {
-//
-// Don't display the hidden/inactive boot option except setup application.
-//
-if BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || 
((BootOption[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) &&
-!IsBootManagerMenu ([Index])) {  
-  continue;
-}
-
-//
-// Don't display myself
-//
-if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, 
GetDevicePathSize (ImageDevicePath)) == 0) {
+if (IgnoreBootOption ([Index])) {
   continue;
 }
 
@@ -640,13 +665,10 @@ BootFromSelectOption (
   ASSERT (BootOptions != NULL);
 
   for (ItemNum = 0, Index = 0; Index < BootOptionCount; Index++) {
-//
-// Don't display the hidden/inactive boot option except setup application.
-//
-if BootOptions[Index].Attributes & LOAD_OPTION_HIDDEN) != 0) || 
((BootOptions[Index].Attributes & LOAD_OPTION_ACTIVE) == 0)) &&
-!IsBootManagerMenu ([Index])) {  
+if (IgnoreBootOption ([Index])) {
   continue;
 }
+
 if (ItemNum++ == SelectItem) {
   EfiBootManagerBoot ([Index]);
   break;
--
2.6.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg:Update Boot Manager form when enter it.

2015-12-17 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Thursday, December 17, 2015 5:52 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming; Dong, Eric
Subject: [patch] MdeModulePkg:Update Boot Manager form when enter it.

Currently BootManager is an independent library,used by UiApp.It only load boot 
option when enter UiApp.So when add boot option through boot maintenance 
manager, it will not display in boot manager. In order to fix this issue,now we 
update the boot manager form every time we enter it.

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Library/BootManagerLib/BootManager.c  | 16 
 MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr | 11 +++
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c 
b/MdeModulePkg/Library/BootManagerLib/BootManager.c
index cfeedeb..a38f18a 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManager.c
+++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c
@@ -676,10 +676,22 @@ BootManagerCallback (
   )
 {
   EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
   UINTNBootOptionCount;
   EFI_INPUT_KEYKey;
+
+  if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+//
+//Means enter the boot manager form.
+//Update the boot manage page,because the boot option may changed.
+//
+if (QuestionId == 0x1212){
+  UpdateBootManager();
+}
+return EFI_SUCCESS;
+  }
+
   if (Action != EFI_BROWSER_ACTION_CHANGED) {
 //
 // Do nothing for other UEFI Action. Only do call back when data is 
changed.
 //
 return EFI_UNSUPPORTED;
@@ -754,14 +766,10 @@ BootManagerLibConstructor (
 BootManagerLibStrings,
 NULL
 );
   ASSERT (gBootManagerPrivate.HiiHandle != NULL);
 
-  //
-  // Update boot manager page
-  //
-  UpdateBootManager ();
 
   return EFI_SUCCESS;
 }
 
 /**
diff --git a/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr 
b/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr
index d3281f5..14c1f8f 100644
--- a/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr
+++ b/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr
@@ -31,10 +31,21 @@ formset
 subtitle text = STRING_TOKEN(STR_LAST_STRING);
 subtitle text = STRING_TOKEN(STR_BOOT_OPTION_BANNER);
 subtitle text = STRING_TOKEN(STR_LAST_STRING);
 
 //
+//Add this invisable text in order to indicate enter Boot Manager form.
+//
+suppressif TRUE;
+  text
+  help  = STRING_TOKEN(STR_LAST_STRING ),
+  text  = STRING_TOKEN(STR_LAST_STRING ),
+  flags = INTERACTIVE,
+  key   = 0x1212;
+ endif;
+
+//
 // This is where we will dynamically add choices for the Boot Manager
 //
 label LABEL_BOOT_OPTION;
 label LABEL_BOOT_OPTION_END;
 
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg:Refine the comments in INF files

2015-11-25 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Wednesday, November 25, 2015 4:55 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming; Dong, Eric
Subject: [patch] MdeModulePkg:Refine the comments in INF files

Add comments in INF file in BootMaintenanceManagerLib.inf.
Refine the comments in INF file in FileExplorerLib.inf

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 .../BootMaintenanceManagerLib.inf  | 14 +++---
 MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf   | 10 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf 
b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
index c2e1bd8..ebb888f 100644
--- 
a/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
+++ 
b/MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceManagerLib.inf
@@ -89,12 +89,12 @@
   gEfiDevicePathToTextProtocolGuid  ## CONSUMES
 
 [FeaturePcd]
 
 [Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
-  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
-  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn   ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutRow ## CONSUMES
\ No newline at end of file
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
index a2be614..e3a8a7c 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
@@ -51,10 +51,10 @@
 [Guids]
   gEfiFileSystemVolumeLabelInfoIdGuid   ## CONSUMES ## GUID (Indicate 
the information type is volume)
   gEfiIfrTianoGuid  ## CONSUMES ## GUID (Extended 
IFR Guid Opcode)
  
 [Protocols]
-  gEfiSimpleFileSystemProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiLoadFileProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiHiiConfigAccessProtocolGuid   ## PROTOCOL CONSUMES
-  gEfiFormBrowser2ProtocolGuid  ## PROTOCOL CONSUMES
-  gEfiDevicePathToTextProtocolGuid  ## PROTOCOL CONSUMES
\ No newline at end of file
+  gEfiSimpleFileSystemProtocolGuid  ## CONSUMES
+  gEfiLoadFileProtocolGuid  ## CONSUMES
+  gEfiHiiConfigAccessProtocolGuid   ## CONSUMES
+  gEfiFormBrowser2ProtocolGuid  ## CONSUMES
+  gEfiDevicePathToTextProtocolGuid  ## CONSUMES
\ No newline at end of file
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg/BDS: Do not pass unnecessary option to boot option

2015-11-24 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Ni, Ruiyu 
Sent: Tuesday, November 24, 2015 3:22 PM
To: edk2-devel@lists.01.org
Cc: Ni, Ruiyu; Dong, Eric
Subject: [Patch] MdeModulePkg/BDS: Do not pass unnecessary option to boot option

BDS puts a special GUID in boot option optional data for auto-discovered boot 
option. But when launching that boot option, the BDS core unconditionally pass 
the special GUID to the executable.

A good written application/OS loader can ignore the unexpected parameters, but 
BDS core should still avoid passing the unnecessary GUID.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 32 
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index e963458..7297a1d 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -53,6 +53,28 @@ EfiBootManagerRegisterLegacyBootSupport (  }
 
 /**
+  Return TRUE when the boot option is auto-created instead of manually added.
+
+  @param BootOption Pointer to the boot option to check.
+
+  @retval TRUE  The boot option is auto-created.
+  @retval FALSE The boot option is manually added.
+**/
+BOOLEAN
+BmIsAutoCreateBootOption (
+  EFI_BOOT_MANAGER_LOAD_OPTION*BootOption
+  )
+{
+  if ((BootOption->OptionalDataSize == sizeof (EFI_GUID)) &&
+  CompareGuid ((EFI_GUID *) BootOption->OptionalData, 
)
+  ) {
+return TRUE;
+  } else {
+return FALSE;
+  }
+}
+
+/**
   For a bootable Device path, return its boot type.
 
   @param  DevicePath   The bootable device Path to check
@@ -1814,8 +1836,10 @@ EfiBootManagerBoot (
   Status = gBS->HandleProtocol (ImageHandle, , 
(VOID **) );
   ASSERT_EFI_ERROR (Status);
 
-  ImageInfo->LoadOptionsSize  = BootOption->OptionalDataSize;
-  ImageInfo->LoadOptions  = BootOption->OptionalData;
+  if (!BmIsAutoCreateBootOption (BootOption)) {
+ImageInfo->LoadOptionsSize = BootOption->OptionalDataSize;
+ImageInfo->LoadOptions = BootOption->OptionalData;
+  }
 
   //
   // Clean to NULL because the image is loaded directly from the firmwares 
boot manager.
@@ -2231,9 +2255,7 @@ EfiBootManagerRefreshAllBootOption (
   for (Index = 0; Index < NvBootOptionCount; Index++) {
 if (((DevicePathType (NvBootOptions[Index].FilePath) != BBS_DEVICE_PATH) 
|| 
  (DevicePathSubType (NvBootOptions[Index].FilePath) != BBS_BBS_DP)
-) &&
-(NvBootOptions[Index].OptionalDataSize == sizeof (EFI_GUID)) &&
-CompareGuid ((EFI_GUID *) NvBootOptions[Index].OptionalData, 
)
+) && BmIsAutoCreateBootOption ([Index])
) {
   //
   // Only check those added by BDS
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg:Correct the file name in UiApp.inf

2015-11-24 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Wednesday, November 25, 2015 12:43 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming; Dong, Eric
Subject: [patch] MdeModulePkg:Correct the file name in UiApp.inf

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Application/UiApp/UiApp.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Application/UiApp/UiApp.inf 
b/MdeModulePkg/Application/UiApp/UiApp.inf
index d3f4ea6..95c2d08 100644
--- a/MdeModulePkg/Application/UiApp/UiApp.inf
+++ b/MdeModulePkg/Application/UiApp/UiApp.inf
@@ -80,6 +80,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution  ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString   ## CONSUMES
 
 [UserExtensions.TianoCore."ExtraFiles"]
-  UiFrontPageAppExtra.uni
+  UiAppExtra.uni
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch 1/8] MdeModulePkg:Rename BootMaintenanceManagerLib to BootMaintenanceManagerUiLib

2016-01-12 Thread Dong, Eric
Jaben,

These modules are just checked in and don't release them before, so we think it 
does not have true impact for this name change action.

Thanks,
Eric

-Original Message-
From: Carsey, Jaben 
Sent: Wednesday, January 13, 2016 2:20 AM
To: Bi, Dandan; edk2-devel@lists.01.org
Cc: Dong, Eric; Gao, Liming; Carsey, Jaben
Subject: RE: [edk2] [patch 1/8] MdeModulePkg:Rename BootMaintenanceManagerLib 
to BootMaintenanceManagerUiLib

Bi,

As removing a module from a package is non-backwards compatible, do you plan to 
change the GUID/revision of the DEC file?


-Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Dandan Bi
> Sent: Tuesday, January 12, 2016 1:52 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.d...@intel.com>; Gao, Liming <liming@intel.com>
> Subject: [edk2] [patch 1/8] MdeModulePkg:Rename
> BootMaintenanceManagerLib to BootMaintenanceManagerUiLib
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> Reviewed-by: Eric Dong <eric.d...@intel.com>
> ---
>  .../Library/BootMaintenanceManagerLib/BmLib.c  |   89 --
>  .../BootMaintenanceManagerLib/BootMaintenance.c| 1518 
> 
>  .../BootMaintenanceManager.h   | 1388 --
>  .../BootMaintenanceManager.vfr |  440 --
>  .../BootMaintenanceManagerLib.inf  |  100 --
>  .../BootMaintenanceManagerLib.uni  |   26 -
>  .../BootMaintenanceManagerStrings.uni  |  286 
>  .../Library/BootMaintenanceManagerLib/BootOption.c |  984 -
>  .../BootMaintenanceManagerLib/ConsoleOption.c  | 1162 ---
>  .../Library/BootMaintenanceManagerLib/Data.c   |  263 
>  .../Library/BootMaintenanceManagerLib/FormGuid.h   |  209 ---
>  .../Library/BootMaintenanceManagerLib/UpdatePage.c | 1272 
>  .../Library/BootMaintenanceManagerLib/Variable.c   | 1051 --
>  .../Library/BootMaintenanceManagerUiLib/BmLib.c|   89 ++
>  .../BootMaintenanceManagerUiLib/BootMaintenance.c  | 1518
> 
>  .../BootMaintenanceManager.h   | 1388 ++
>  .../BootMaintenanceManager.vfr |  440 ++
>  .../BootMaintenanceManagerStrings.uni  |  286 
>  .../BootMaintenanceManagerUiLib.inf|  100 ++
>  .../BootMaintenanceManagerUiLib.uni|   26 +
>  .../BootMaintenanceManagerUiLib/BootOption.c   |  984 +
>  .../BootMaintenanceManagerUiLib/ConsoleOption.c| 1162
> +++
>  .../Library/BootMaintenanceManagerUiLib/Data.c |  263 
>  .../Library/BootMaintenanceManagerUiLib/FormGuid.h |  209 +++
>  .../BootMaintenanceManagerUiLib/UpdatePage.c   | 1272
> 
>  .../Library/BootMaintenanceManagerUiLib/Variable.c | 1051
> ++
>  26 files changed, 8788 insertions(+), 8788 deletions(-)
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BmLib.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenance.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMan
> ager.h
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMan
> ager.vfr
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMan
> agerLib.inf
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMan
> agerLib.uni
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootMaintenanceMan
> agerStrings.uni
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/BootOption.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/ConsoleOption.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/Data.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/FormGuid.h
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/UpdatePage.c
>  delete mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerLib/Variable.c
>  create mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BmLib.c
>  create mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
>  create mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceM
> anager.h
>  create mode 100644
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceM
> anager.vfr
>  create mode 100644

Re: [edk2] [Patch v2] UefiCpuPkg/MtrrLib: Fixed bug if length is less than Fixed-MTRR range

2016-06-06 Thread Dong, Eric
Reviewed_by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Fan, Jeff
> Sent: Monday, June 06, 2016 2:00 PM
> To: edk2-de...@ml01.01.org
> Cc: Dong, Eric; Tian, Feng; Kinney, Michael D
> Subject: [Patch v2] UefiCpuPkg/MtrrLib: Fixed bug if length is less than 
> Fixed-MTRR range
> 
> Currently, if the memory length to be programmed is less than the remaining 
> size
> of one Fixed-MTRR supported, RETURN_UNSUPPORTED returned. This is not correct.
> This is one regression at 07e889209034ba94bfac9e765b8a50ef344daef2 when we
> updated ProgramFixedMtrr() to remove the loop of calculating Fixed-MTRR Mask.
> 
> This fix will calculate Right offset in Fixed-MTRR beside left offset. It
> supports small length (less than remaining size supported by Fixed-MTRR) to be
> programmed.
> 
> v2:
>  1) Remove unnecessary local variable OrMaskTemplate.
>  2) Exchange LeftByteShift and RightByteShift programm order and correct the
> comments.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Feng Tian <feng.t...@intel.com>
> Cc: Michael Kinney <michael.d.kin...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jeff Fan <jeff@intel.com>
> ---
>  UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 71 
> 
>  1 file changed, 48 insertions(+), 23 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c 
> b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> index c4a39b5..6a6bf76 100644
> --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> @@ -20,8 +20,8 @@
>  #include 
>  #include 
> 
> -#define OR_SEED  0x01010101
> -#define CLEAR_SEED   0x
> +#define OR_SEED  0x0101010101010101ull
> +#define CLEAR_SEED   0xull
> 
>  //
>  // Context to save and restore when MTRRs are programmed
> @@ -462,14 +462,15 @@ ProgramFixedMtrr (
>)
>  {
>UINT32  MsrNum;
> -  UINT32  ByteShift;
> -  UINT32  OrMask[2];
> -  UINT32  ClearMask[2];
> +  UINT32  LeftByteShift;
> +  UINT32  RightByteShift;
> +  UINT64  OrMask;
> +  UINT64  ClearMask;
>UINT64  SubLength;
> 
> -  *(UINT64 *)OrMask= 0;
> -  *(UINT64 *)ClearMask = 0;
> -
> +  //
> +  // Find the fixed MTRR index to be programmed
> +  //
>for (MsrNum = *LastMsrNum + 1; MsrNum < MTRR_NUMBER_OF_FIXED_MTRR; 
> MsrNum++) {
>  if ((*Base >= mMtrrLibFixedMtrrTable[MsrNum].BaseAddress) &&
>  (*Base <
> @@ -488,36 +489,60 @@ ProgramFixedMtrr (
>}
> 
>//
> -  // We found the fixed MTRR to be programmed
> +  // Find the begin offset in fixed MTRR and calculate byte offset of left 
> shift
>//
> -  ByteShift = ((UINT32)*Base - mMtrrLibFixedMtrrTable[MsrNum].BaseAddress)
> +  LeftByteShift = ((UINT32)*Base - 
> mMtrrLibFixedMtrrTable[MsrNum].BaseAddress)
> / mMtrrLibFixedMtrrTable[MsrNum].Length;
> 
> -  if (ByteShift >= 8) {
> +  if (LeftByteShift >= 8) {
>  return RETURN_UNSUPPORTED;
>}
> 
> -  if (ByteShift < 4) {
> -OrMask[0]= OR_SEED * (UINT32)MemoryCacheType;
> -ClearMask[0] = CLEAR_SEED;
> -OrMask[1]= (OR_SEED * (UINT32)MemoryCacheType) >> ((4 - ByteShift) * 
> 8);
> -ClearMask[1] = CLEAR_SEED >> ((4 - ByteShift) * 8);
> +  //
> +  // Find the end offset in fixed MTRR and calculate byte offset of right 
> shift
> +  //
> +  SubLength = mMtrrLibFixedMtrrTable[MsrNum].Length * (8 - LeftByteShift);
> +  if (*Length >= SubLength) {
> +RightByteShift = 0;
>} else {
> -OrMask[0]= (OR_SEED * (UINT32)MemoryCacheType) >> ((8 - ByteShift) * 
> 8);
> -ClearMask[0] = CLEAR_SEED >> ((8 - ByteShift) * 8);
> +RightByteShift = 8 - LeftByteShift -
> +(UINT32)(*Length) / mMtrrLibFixedMtrrTable[MsrNum].Length;
> +if ((LeftByteShift >= 8) ||
> +(((UINT32)(*Length) % mMtrrLibFixedMtrrTable[MsrNum].Length) != 0)
> +) {
> +  return RETURN_UNSUPPORTED;
> +}
> +//
> +// Update SubLength by actual length
> +//
> +SubLength = *Length;
>}
> 
> -  SubLength = mMtrrLibFixedMtrrTable[MsrNum].Length * (8 - ByteShift);
> -  if (*Length < SubLength) {
> -return RETURN_UNSUPPORTED;
> +  ClearMask = CLEAR_SEED;
> +  OrMask= MultU64x32 (OR_SEED, (UINT32)MemoryCacheType);
> +
> +  if (LeftByteShift != 0) {
> +//
> +// Clear the low bits by LeftByteShift
> +//
> +ClearMask &= LShiftU64 (ClearMask, LeftByteShift * 8);
> +OrMask&= LShiftU64 (OrMask, LeftByteShift * 8);
> +  }
> +
> +  

Re: [edk2] [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage

2016-06-12 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, June 08, 2016 3:39 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline 
> in FontPackage
> 
> When adding font package, there exits the case that only have the
> EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT glyph block
> and use the default cell info in font package fixed header. In this
> case, we can't get the correct baseline now. This patch is to fix this
> issue by recalculating the baseline when the glyph block type is
> EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> index 5ecd6bd..7e5d3bd 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> @@ -837,10 +837,18 @@ FindGlyphBlock (
>  case EFI_HII_GIBT_GLYPH_DEFAULT:
>Status = GetCell (CharCurrent, >GlyphInfoList, 
> );
>if (EFI_ERROR (Status)) {
>  return Status;
>}
> +  if (CharValue == (CHAR16) (-1)) {
> +if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {
> +  BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);
> +}
> +if (MinOffsetY > DefaultCell.OffsetY) {
> +  MinOffsetY = DefaultCell.OffsetY;
> +}
> +  }
>BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);
> 
>if (CharCurrent == CharValue) {
>  return WriteOutputParam (
>   BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK),
> @@ -859,10 +867,18 @@ FindGlyphBlock (
>CopyMem (, BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK), sizeof 
> (UINT16));
>Status = GetCell (CharCurrent, >GlyphInfoList, 
> );
>if (EFI_ERROR (Status)) {
>  return Status;
>}
> +  if (CharValue == (CHAR16) (-1)) {
> +if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {
> +  BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);
> +}
> +if (MinOffsetY > DefaultCell.OffsetY) {
> +  MinOffsetY = DefaultCell.OffsetY;
> +}
> +  }
>BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);
>BlockPtr += sizeof (EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK) - sizeof 
> (UINT8);
>for (Index = 0; Index < Length16; Index++) {
>  if (CharCurrent + Index == CharValue) {
>return WriteOutputParam (
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/UiApp: Fix the incorrect use of the HiiHandle

2016-06-12 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Monday, June 13, 2016 9:42 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [patch] MdeModulePkg/UiApp: Fix the incorrect use of the HiiHandle
> 
> In current code, when adding string package, it will return
> 'gStringPackHandle'. But the code use the 'gHiiHandle' to get
> string. It is incorrect. This patch is to fix this issue.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> index dfb37ec..dc5d1c6 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> @@ -53,11 +53,11 @@ typedef struct {
>  } UI_HII_DRIVER_INSTANCE;
> 
>  CHAR8*gLanguageString;
>  EFI_STRING_ID*gLanguageToken;
>  UI_HII_DRIVER_INSTANCE   *gHiiDriverList;
> -EFI_HII_HANDLE   gHiiHandle;
> +extern EFI_HII_HANDLEgStringPackHandle;
> 
> 
>  /**
>Get next language from language code list (with separator ';').
> 
> @@ -587,11 +587,11 @@ UiListThirdPartyDrivers (
>continue;
>  }
> 
>  String = HiiGetString (HiiHandles[Index], Token, NULL);
>  if (String == NULL) {
> -  String = HiiGetString (gHiiHandle, STRING_TOKEN (STR_MISSING_STRING), 
> NULL);
> +  String = HiiGetString (gStringPackHandle, STRING_TOKEN 
> (STR_MISSING_STRING), NULL);
>ASSERT (String != NULL);
>  } else if (SpecialHandlerFn != NULL) {
>//
>// Check whether need to rename the driver name.
>//
> @@ -605,11 +605,11 @@ UiListThirdPartyDrivers (
>  DriverListPtr[Count].PromptId = HiiSetString (HiiHandle, 0, String, 
> NULL);
>  FreePool (String);
> 
>  String = HiiGetString (HiiHandles[Index], TokenHelp, NULL);
>  if (String == NULL) {
> -  String = HiiGetString (gHiiHandle, STRING_TOKEN (STR_MISSING_STRING), 
> NULL);
> +  String = HiiGetString (gStringPackHandle, STRING_TOKEN 
> (STR_MISSING_STRING), NULL);
>ASSERT (String != NULL);
>  }
>  DriverListPtr[Count].HelpId = HiiSetString (HiiHandle, 0, String, NULL);
>  FreePool (String);
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/5] Get SIO data from SIO interface

2016-06-12 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ruiyu 
> Ni
> Sent: Sunday, June 12, 2016 5:24 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 0/5] Get SIO data from SIO interface
> 
> LegacyBios driver originally only fills the SIO data from IsaIo interface.
> When the system doesn't have IsaIo interface but only SIO interface,
> the code which gets the SIO data needs to be updated to handle the new case.
> 
> Ruiyu Ni (5):
>   IntelFrameworkModulePkg/LegacyBios: Get SIO data in separate function
>   IntelFrameworkModulePkg/LegacyBios: return NotFound when IsaIo absent
>   IntelFrameworkModulePkg/LegacyBios: Rename local variables
>   IntelFrameworkModulePkg/LegacyBios: Get COM base from SerialIo parent
>   IntelFrameworkModulePkg/LegacyBios: Get SIO data from SIO interface
> 
>  .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf|   4 +-
>  .../Csm/LegacyBiosDxe/LegacyBiosInterface.h|   5 +-
>  .../Csm/LegacyBiosDxe/LegacySio.c  | 358 
> +
>  3 files changed, 311 insertions(+), 56 deletions(-)
> 
> --
> 2.8.3.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/Bds: Do not boot to UI again when BootNext points to UI

2016-06-22 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Ni, Ruiyu
> Sent: Wednesday, June 22, 2016 3:26 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Chan, Amy
> Subject: [PATCH] MdeModulePkg/Bds: Do not boot to UI again when BootNext 
> points to UI
> 
> Per UEFI spec the successful returning of boot option triggers boot
> to UI. But when the BootNext just points to UI, it causes confusing.
> So the patch avoids booting to UI again when the BootNext points to
> UI.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Amy Chan <amy.c...@intel.com>
> ---
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> index 3734ff9..741ddc3 100644
> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> @@ -6,7 +6,7 @@
>to enter BDS phase.
> 
>  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> @@ -923,9 +923,10 @@ BdsEntry (
>if (!EFI_ERROR (Status)) {
>  EfiBootManagerBoot ();
>  EfiBootManagerFreeLoadOption ();
> -if (LoadOption.Status == EFI_SUCCESS) {
> +if ((LoadOption.Status == EFI_SUCCESS) && (LoadOption.OptionNumber 
> != BootManagerMenu.OptionNumber)) {
>//
>// Boot to Boot Manager Menu upon EFI_SUCCESS
> +  // Exception: Do not boot again when the BootNext points to Boot 
> Manager Menu.
>//
>EfiBootManagerBoot ();
>  }
> --
> 2.8.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V2] SecurityPkg: SecureBootConfigDxe: Move Secure Boot string update location

2016-01-14 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Zhang, Chao B 
Sent: Thursday, January 14, 2016 4:43 PM
To: edk2-de...@ml01.01.org
Cc: Dong, Eric; Fu, Siyuan; Zhang, Chao B
Subject: [PATCH V2] SecurityPkg: SecureBootConfigDxe: Move Secure Boot string 
update location

ExtractConfig is called many times, so it's not efficient to update Secure Boot 
STR_SECURE_BOOT_STATE_CONTENT, STR_CUR_SECURE_BOOT_MODE_CONTENT string in 
ExtractConfig. As these 2 strings are displayed on one form, so always update 
them when opening the form.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zh...@intel.com>
Reviewed-by: Fu Siyuan <siyuan...@intel.com>
---
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 97 +-
 1 file changed, 56 insertions(+), 41 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index a685b40..d281a09 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfigImpl.c
@@ -3061,6 +3061,58 @@ ExtractSecureBootModeFromVariable(
 }
 
 /**
+
+  Update SecureBoot strings based on new Secure Boot Mode State. String 
+ includes STR_SECURE_BOOT_STATE_CONTENT and STR_CUR_SECURE_BOOT_MODE_CONTENT.
+
+  @param[in]PrivateData Module's private data.
+
+  @return EFI_SUCCESS  Update secure boot strings successfully.
+  @return other  Fail to update secure boot strings.
+
+**/
+EFI_STATUS
+UpdateSecureBootString(
+  IN SECUREBOOT_CONFIG_PRIVATE_DATA  *Private
+  ) {
+  EFI_STATUS  Status;
+  UINT8   CurSecureBootMode;
+  UINT8   *SecureBoot;
+
+  //
+  // Get current secure boot state.
+  //
+  Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, 
+ , (VOID**), NULL);  if (EFI_ERROR(Status)) {
+return Status;
+  }
+
+  if (*SecureBoot == SECURE_BOOT_MODE_ENABLE) {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_SECURE_BOOT_STATE_CONTENT), L"Enabled", NULL);  } else {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_SECURE_BOOT_STATE_CONTENT), L"Disabled", NULL);  }  //  // Get 
+ current secure boot mode.
+  //
+  ExtractSecureBootModeFromVariable();
+  
+  if (CurSecureBootMode == SECURE_BOOT_MODE_USER_MODE) {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_CUR_SECURE_BOOT_MODE_CONTENT), L"UserMode", NULL);  } else if 
(CurSecureBootMode == SECURE_BOOT_MODE_SETUP_MODE) {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_CUR_SECURE_BOOT_MODE_CONTENT), L"SetupMode", NULL);  } else if 
(CurSecureBootMode == SECURE_BOOT_MODE_AUDIT_MODE) {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_CUR_SECURE_BOOT_MODE_CONTENT), L"AuditMode", NULL);  } else if 
(CurSecureBootMode == SECURE_BOOT_MODE_DEPLOYED_MODE) {
+HiiSetString (Private->HiiHandle, STRING_TOKEN 
+ (STR_CUR_SECURE_BOOT_MODE_CONTENT), L"DeployedMode", NULL);  }
+
+  FreePool(SecureBoot);
+
+  return EFI_SUCCESS;
+}
+
+/**
   This function extracts configuration from variable.
 
   @param[in, out]  ConfigData   Point to SecureBoot configuration private data.
@@ -3191,7 +3243,6 @@ SecureBootExtractConfig (
   EFI_STRINGConfigRequestHdr;
   SECUREBOOT_CONFIG_PRIVATE_DATA*PrivateData;
   BOOLEAN   AllocatedRequest;
-  UINT8 *SecureBoot;
 
   if (Progress == NULL || Results == NULL) {
 return EFI_INVALID_PARAMETER;
@@ -3201,7 +3252,6 @@ SecureBootExtractConfig (
   ConfigRequestHdr = NULL;
   ConfigRequest= NULL;
   Size = 0;
-  SecureBoot   = NULL;
 
   ZeroMem (, sizeof (Configuration));
   PrivateData  = SECUREBOOT_CONFIG_PRIVATE_FROM_THIS (This);
@@ -3216,31 +3266,6 @@ SecureBootExtractConfig (
   //
   SecureBootExtractConfigFromVariable ();
 
-  //
-  // Get current secure boot state.
-  //
-  GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, , 
(VOID**), NULL);
-
-  if (SecureBoot != NULL && *SecureBoot == SECURE_BOOT_MODE_ENABLE) {
-HiiSetString (PrivateData->HiiHandle, STRING_TOKEN 
(STR_SECURE_BOOT_STATE_CONTENT), L"Enabled", NULL);
-  } else {
-HiiSetString (PrivateData->HiiHandle, STRING_TOKEN 
(STR_SECURE_BOOT_STATE_CONTENT), L"Disabled", NULL);
-  }
-
-  //
-  // Get current secure boot mode
-  //
-  DEBUG((EFI_D_INFO, "Configuration.CurSecureBootMode %d\n", 
Configuration.CurSecureBootMode));
-  if (Configuration.CurSecureBootMode == SECURE_BOOT_MODE_USER_MODE) {
-HiiSetString (PrivateData->HiiHandle, STRING_TOKEN 
(STR_CUR_SECURE_BOOT_MODE_CONTENT), L"UserMode", NULL);
-  } else if (Configuration.CurSecureBootMode == S

Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings available to OS runtime

2016-02-22 Thread Dong, Eric
Hi Brian,

Thanks for your comments, we need internal discussion for your raised issues, 
will reply later this week. 

Thanks,
Eric
> -Original Message-
> From: Brian J. Johnson [mailto:bjohn...@sgi.com]
> Sent: Friday, February 19, 2016 5:18 AM
> To: Andrew Fish; Dong, Eric
> Cc: El-Haj-Mahmoud, Samer; Bi, Dandan; edk2-devel@lists.01.org; Gao, Liming; 
> Rothman, Michael A; Hale, Robert P; Kinney, Michael D
> Subject: Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> available to OS runtime
> 
> On 02/17/2016 10:25 PM, Andrew Fish wrote:
> >
> >> On Feb 17, 2016, at 6:50 PM, Dong, Eric <eric.d...@intel.com> wrote:
> >>
> >> Hi All,
> >>
> >> Thanks for your comments. I add my explanation below:
> >>
> >> Only hook ReadyToBoot event is not enough. Different drivers may hook this 
> >> event and some may update string package in their
> callback function. The order to call these callback functions is random, so 
> only hook this event may miss some changes.
> >>
> 
> Eric,
> 
> Could you enable your HII exporting callbacks in a ReadyToBoot event?
> Then you wouldn't needlessly pay the export cost each time a HII element
> is added or changed as drivers are loaded.
> 
> >> This feature is described in UEFI spec 2.6 chapter 31.2.11.1. It required 
> >> to export all HiiDatabae data and current configuration data.
> >
> > I don't see any language in that section that makes it required. It seems 
> > to just describe how to do it.
> >
> 
> Agreed.  And section 31.2.1.10 says:
> 
> =
> When it is desired that the forms data be used in the presence of an
> O/S, this specification describes
> a means by which to support this capability. By being able to
> encapsulate the data and export it
> through standard means such that an O/S agent (e.g. forms
> browser/processor) can retrieve it, O/S-
> present usage models can be made available for further value-add
> implementations.
> =
> 
> The wording implies that exporting is not always desired, and that
> O/S-present usage of forms data is a value-add feature, which a platform
> may choose to support or not.
> 
> >> We add this feature because we strongly encourage the export of config 
> >> data to support manageability of platform config both for pre-
> OS and OS runtime operations.
> >>
> >
> > Generally the UEFI spec and the edk2 don't try to force platform policy. 
> > For example exposing some configuration information could be
> considered a security vulnerability on some platforms, so it should not be 
> forced on a platform.
> >
> > Thanks,
> >
> > Andrew Fish
> >
> >> Also we collect the performance data from our reference platform(Detail 
> >> see below). The boot performance is small and we can
> ignore it. This feature cost extra 869KB, but we think the size cost is not 
> care because current we use 16M size of bios flash.
> >>
> >> HiiDatabase driver data size cost(This feature add in HiiDatabase driver):
> >>Without this feature:
> >>Used data size: 151KB
> >>With this feature
> >>Used data size: 1020 KB
> >>PS: This extra size cost mainly depend on how much Hii packages in your 
> >> platform.
> >>
> >> Boot Time cost:
> >>Without this feature:
> >>Boot Time cost:1st:3.353s   2nd: 3.035s
> >>With this feature:
> >>Boot Time cost:1st: 3.125s  2nd: 3.126s
> >>
> >> Base on the above analysis, we provide this design and prefer to always 
> >> enable this feature instead of use a PCD to control it.
> >>
> >> Thanks,
> >> Eric
> >>
> 
> My particular concern involves a simulator (far slower than hardware)
> for an extremely large, complex server platform with a large amount of
> HII data.  On this platform, we end up disabling the largest but least
> used setup screens when running on the simulator, simply to avoid the
> time overhead of processing the HII data.  This saves many minutes of
> execution time.
> 
> >>> -Original Message-
> >>> From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
> >>> Sent: Wednesday, February 17, 2016 2:14 AM
> >>> To: Andrew Fish; Brian J. Johnson
> >>> Cc: Bi, Dandan; edk2-devel@lists.01.org; Dong, Eric; Gao, Liming
> >>> Subject: RE: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> >>> available to OS runtime
> >>&

[edk2] FW: [PATCH] MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.

2016-02-22 Thread Dong, Eric
Reviewed-by: Eric Dong 


Feng & Star, 

Can you help to check in this patch?

Thanks,
Eric
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cinnamon 
Shia
Sent: Monday, February 22, 2016 10:53 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] MdeModulePkg/HiiDatabaseDxe: Fix a variable is 
uninitialized.

The StringSize variable in the FindStringBlock function is a IN OUT
parameter of the GetUnicodeStringTextOrSize function.
Thought the GetUnicodeStringTextOrSize function changes the value of
the StringSize variable, it is better to initialize the StringSize
variable before passing it to the GetUnicodeStringTextOrSize function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/String.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index 2d04be4..756f19c 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -3,6 +3,7 @@ Implementation for EFI_HII_STRING_PROTOCOL.
 
 
 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP
 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
@@ -295,6 +296,7 @@ FindStringBlock (
   ASSERT (StringPackage->Signature == HII_STRING_PACKAGE_SIGNATURE);
 
   CurrentStringId = 1;
+  StringSize = 0;
 
   if (StringId != (EFI_STRING_ID) (-1) && StringId != 0) {
 ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset 
!= NULL);
-- 
2.7.0.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings available to OS runtime

2016-02-22 Thread Dong, Eric
> >>
> >> Hi All,
> >>
> >> Thanks for your comments. I add my explanation below:
> >>
> >> Only hook ReadyToBoot event is not enough. Different drivers may hook this 
> >> event and some may update string package in their
> callback function. The order to call these callback functions is random, so 
> only hook this event may miss some changes.
> >>
> 
> Eric,
> 
> Could you enable your HII exporting callbacks in a ReadyToBoot event?
> Then you wouldn't needlessly pay the export cost each time a HII element
> is added or changed as drivers are loaded.
 
Brian,

Do you mean we first export HII data at ReadyToBoot event. After it, we also 
hook all HII Database changes action (include add package/ remove package/ 
update packages/ HiiSetString)? 
If only export HII data at ReadyToBoot event, it is not enough, because the HII 
data maybe changed later(Through add package/ remove package )? 

Thanks,
Eric
> 
> >> This feature is described in UEFI spec 2.6 chapter 31.2.11.1. It required 
> >> to export all HiiDatabae data and current configuration data.
> >
> > I don't see any language in that section that makes it required. It seems 
> > to just describe how to do it.
> >
> 
> Agreed.  And section 31.2.1.10 says:
> 
> =
> When it is desired that the forms data be used in the presence of an
> O/S, this specification describes
> a means by which to support this capability. By being able to
> encapsulate the data and export it
> through standard means such that an O/S agent (e.g. forms
> browser/processor) can retrieve it, O/S-
> present usage models can be made available for further value-add
> implementations.
> =
> 
> The wording implies that exporting is not always desired, and that
> O/S-present usage of forms data is a value-add feature, which a platform
> may choose to support or not.
> 
> >> We add this feature because we strongly encourage the export of config 
> >> data to support manageability of platform config both for pre-
> OS and OS runtime operations.
> >>
> >
> > Generally the UEFI spec and the edk2 don't try to force platform policy. 
> > For example exposing some configuration information could be
> considered a security vulnerability on some platforms, so it should not be 
> forced on a platform.
> >
> > Thanks,
> >
> > Andrew Fish
> >
> >> Also we collect the performance data from our reference platform(Detail 
> >> see below). The boot performance is small and we can
> ignore it. This feature cost extra 869KB, but we think the size cost is not 
> care because current we use 16M size of bios flash.
> >>
> >> HiiDatabase driver data size cost(This feature add in HiiDatabase driver):
> >>Without this feature:
> >>Used data size: 151KB
> >>With this feature
> >>Used data size: 1020 KB
> >>PS: This extra size cost mainly depend on how much Hii packages in your 
> >> platform.
> >>
> >> Boot Time cost:
> >>Without this feature:
> >>Boot Time cost:1st:3.353s   2nd: 3.035s
> >>With this feature:
> >>Boot Time cost:1st: 3.125s  2nd: 3.126s
> >>
> >> Base on the above analysis, we provide this design and prefer to always 
> >> enable this feature instead of use a PCD to control it.
> >>
> >> Thanks,
> >> Eric
> >>
> 
> My particular concern involves a simulator (far slower than hardware)
> for an extremely large, complex server platform with a large amount of
> HII data.  On this platform, we end up disabling the largest but least
> used setup screens when running on the simulator, simply to avoid the
> time overhead of processing the HII data.  This saves many minutes of
> execution time.
> 
> >>> -Original Message-
> >>> From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
> >>> Sent: Wednesday, February 17, 2016 2:14 AM
> >>> To: Andrew Fish; Brian J. Johnson
> >>> Cc: Bi, Dandan; edk2-devel@lists.01.org; Dong, Eric; Gao, Liming
> >>> Subject: RE: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> >>> available to OS runtime
> >>>
> >>> +1
> >>>
> >>> I also would add there may be some HII strings that are hidden from user 
> >>> interfaces, and reflect settings for field service or
> >>> troubleshooting, and that a mass export to the OS may expose these 
> >>> settings to OS runtime code and p

Re: [edk2] [patch 0/2] Refine function comments in Keyword Handler Protocol

2016-02-15 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan Bi
Sent: Monday, February 15, 2016 2:56 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric; Gao, Liming
Subject: [edk2] [patch 0/2] Refine function comments in Keyword Handler Protocol

The follow two patches mainly to refine the function comments in EFI 
Configuration Keyword Handler Protocol.

Cc: Liming Gao <liming@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>

Dandan Bi (2):
  MdeModulePkg: Refine function comments in Keyword Handler Protocol
  MdePkg: Refine the function comments in Keyword Handler Protocol

 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 12 +++-
 MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h  | 12 +++-
 MdePkg/Include/Protocol/HiiConfigKeyword.h   | 12 +++-
 3 files changed, 21 insertions(+), 15 deletions(-)

--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch 0/2] Add new HII action type EFI_BROWSER_ACTION_SUBMITTED

2016-02-17 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, February 16, 2016 7:55 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch 0/2] Add new HII action type 
> EFI_BROWSER_ACTION_SUBMITTED
> 
> The following two patches mainly add the new HII action
> type EFI_BROWSER_ACTION_SUBMITTED to notify HII driver
> when its question values are submitted.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> 
> Dandan Bi (2):
>   MdePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
>   MdeModulePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
> 
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 170 
> -
>  MdePkg/Include/Protocol/HiiConfigAccess.h  |   3 +-
>  2 files changed, 138 insertions(+), 35 deletions(-)
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings available to OS runtime

2016-02-17 Thread Dong, Eric
Hi All,

Thanks for your comments. I add my explanation below:

Only hook ReadyToBoot event is not enough. Different drivers may hook this 
event and some may update string package in their callback function. The order 
to call these callback functions is random, so only hook this event may miss 
some changes.

This feature is described in UEFI spec 2.6 chapter 31.2.11.1. It required to 
export all HiiDatabae data and current configuration data. We add this feature 
because we strongly encourage the export of config data to support 
manageability of platform config both for pre-OS and OS runtime operations. 

Also we collect the performance data from our reference platform(Detail see 
below). The boot performance is small and we can ignore it. This feature cost 
extra 869KB, but we think the size cost is not care because current we use 16M 
size of bios flash.  

HiiDatabase driver data size cost(This feature add in HiiDatabase driver):
Without this feature: 
Used data size: 151KB
With this feature
Used data size: 1020 KB   
PS: This extra size cost mainly depend on how much Hii packages in your 
platform.

Boot Time cost:
Without this feature:
Boot Time cost:1st:3.353s   2nd: 3.035s
With this feature:
Boot Time cost:1st: 3.125s  2nd: 3.126s

Base on the above analysis, we provide this design and prefer to always enable 
this feature instead of use a PCD to control it.

Thanks,
Eric

> -Original Message-
> From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Wednesday, February 17, 2016 2:14 AM
> To: Andrew Fish; Brian J. Johnson
> Cc: Bi, Dandan; edk2-devel@lists.01.org; Dong, Eric; Gao, Liming
> Subject: RE: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> available to OS runtime
> 
> +1
> 
> I also would add there may be some HII strings that are hidden from user 
> interfaces, and reflect settings for field service or
> troubleshooting, and that a mass export to the OS may expose these settings 
> to OS runtime code and possibly applications.
> 
> 
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Andrew 
> Fish
> Sent: Tuesday, February 16, 2016 10:37 AM
> To: Brian J. Johnson <bjohn...@sgi.com>
> Cc: Dandan Bi <dandan...@intel.com>; edk2-devel@lists.01.org; Eric Dong 
> <eric.d...@intel.com>; Liming Gao <liming@intel.com>
> Subject: Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> available to OS runtime
> 
> 
> > On Feb 16, 2016, at 8:33 AM, Brian J. Johnson <bjohn...@sgi.com> wrote:
> >
> > On 02/16/2016 12:58 AM, Dandan Bi wrote:
> >> This feature is aimed to allow OS make use of the HII database during
> >> runtime. In this case, the contents of the HII Database is exported
> >> to a buffer. The pointer to the buffer is placed in the EFI System
> >> Configuration Table, where it can be retrieved by an OS application.
> >>
> >> Export the configuration data and contents of HiiDatabase when driver
> >> add package, update package and remove package.
> >> For string and image may also need to update the contents of
> >> HiiDatabase when NewString/SetString, NewImage/SetImage.
> >>
> >> Cc: Liming Gao <liming@intel.com>
> >> Cc: Eric Dong <eric.d...@intel.com>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Dandan Bi <dandan...@intel.com> ...
> >
> > Please make this behavior selectable via a PCD.  HII operations are very 
> > expensive, especially on simulators.  I don't want to pay the
> export time every time a package is added or string is changed.  Also, 
> platforms should be able to decide if they want to offer this data to
> the OS.
> >
> 
> +1
> 
> I would want to opt out to NOT take the memory away from the OS if the 
> platform did not care about the feature.
> 
> Thanks,
> 
> Andrew Fish
> 
> > Why not just export the data once, using a "ready to boot" event hook?
> >
> > Thanks,
> > --
> >
> > Brian J. Johnson
> >
> > 
> >
> >  My statements are my own, are not authorized by SGI, and do not
> > necessarily represent SGI's positions.
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings available to OS runtime

2016-02-17 Thread Dong, Eric
Correct one error in former mail, the extra data size cost is the runtime 
memory cost instead of bios flash data cost.

Thanks,
Eric

> -Original Message-
> From: Dong, Eric
> Sent: Thursday, February 18, 2016 10:51 AM
> To: El-Haj-Mahmoud, Samer; Andrew Fish; Brian J. Johnson
> Cc: Bi, Dandan; edk2-devel@lists.01.org; Gao, Liming; Dong, Eric; Rothman, 
> Michael A; Hale, Robert P; Kinney, Michael D
> Subject: RE: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> available to OS runtime
> 
> Hi All,
> 
> Thanks for your comments. I add my explanation below:
> 
> Only hook ReadyToBoot event is not enough. Different drivers may hook this 
> event and some may update string package in their callback
> function. The order to call these callback functions is random, so only hook 
> this event may miss some changes.
> 
> This feature is described in UEFI spec 2.6 chapter 31.2.11.1. It required to 
> export all HiiDatabae data and current configuration data. We
> add this feature because we strongly encourage the export of config data to 
> support manageability of platform config both for pre-OS and
> OS runtime operations.
> 
> Also we collect the performance data from our reference platform(Detail see 
> below). The boot performance is small and we can ignore it.
> This feature cost extra 869KB, but we think the size cost is not care because 
> current we use 16M size of bios flash.
> 
> HiiDatabase driver data size cost(This feature add in HiiDatabase driver):
>   Without this feature:
>   Used data size: 151KB
>   With this feature
>   Used data size: 1020 KB
>   PS: This extra size cost mainly depend on how much Hii packages in your 
> platform.
> 
> Boot Time cost:
>   Without this feature:
>   Boot Time cost:1st:3.353s   2nd: 3.035s
>   With this feature:
>   Boot Time cost:1st: 3.125s  2nd: 3.126s
> 
> Base on the above analysis, we provide this design and prefer to always 
> enable this feature instead of use a PCD to control it.
> 
> Thanks,
> Eric
> 
> > -Original Message-
> > From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
> > Sent: Wednesday, February 17, 2016 2:14 AM
> > To: Andrew Fish; Brian J. Johnson
> > Cc: Bi, Dandan; edk2-devel@lists.01.org; Dong, Eric; Gao, Liming
> > Subject: RE: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> > available to OS runtime
> >
> > +1
> >
> > I also would add there may be some HII strings that are hidden from user 
> > interfaces, and reflect settings for field service or
> > troubleshooting, and that a mass export to the OS may expose these settings 
> > to OS runtime code and possibly applications.
> >
> >
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> > Andrew Fish
> > Sent: Tuesday, February 16, 2016 10:37 AM
> > To: Brian J. Johnson <bjohn...@sgi.com>
> > Cc: Dandan Bi <dandan...@intel.com>; edk2-devel@lists.01.org; Eric Dong 
> > <eric.d...@intel.com>; Liming Gao <liming@intel.com>
> > Subject: Re: [edk2] [patch] MdeModulePkg: Make HII configuration settings 
> > available to OS runtime
> >
> >
> > > On Feb 16, 2016, at 8:33 AM, Brian J. Johnson <bjohn...@sgi.com> wrote:
> > >
> > > On 02/16/2016 12:58 AM, Dandan Bi wrote:
> > >> This feature is aimed to allow OS make use of the HII database during
> > >> runtime. In this case, the contents of the HII Database is exported
> > >> to a buffer. The pointer to the buffer is placed in the EFI System
> > >> Configuration Table, where it can be retrieved by an OS application.
> > >>
> > >> Export the configuration data and contents of HiiDatabase when driver
> > >> add package, update package and remove package.
> > >> For string and image may also need to update the contents of
> > >> HiiDatabase when NewString/SetString, NewImage/SetImage.
> > >>
> > >> Cc: Liming Gao <liming@intel.com>
> > >> Cc: Eric Dong <eric.d...@intel.com>
> > >> Contributed-under: TianoCore Contribution Agreement 1.0
> > >> Signed-off-by: Dandan Bi <dandan...@intel.com> ...
> > >
> > > Please make this behavior selectable via a PCD.  HII operations are very 
> > > expensive, especially on simulators.  I don't want to pay the
> > export time every time a package is added or string is changed.  Also, 
> > platf

Re: [edk2] [patch] MdeModulePkg: Refine the code in BootMaintenanceManagerUiLib

2016-02-18 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, February 17, 2016 6:15 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg: Refine the code in BootMaintenanceManagerUiLib
> 
> Refine the code in function Var_UpdateDriverOption and Var_UpdateBootOption,
> use the existed API(EfiBootManagerInitializeLoadOption and
> EfiBootManagerAddLoadOptionVariable) supplied by UefiBootManagerLib
> to replace the same logic in the two functions. And remove the useless
> code.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../BootMaintenanceManager.h   |  11 +-
>  .../BootMaintenanceManagerUiLib/BootOption.c   |  21 +-
>  .../Library/BootMaintenanceManagerUiLib/Variable.c | 226 
> ++---
>  3 files changed, 71 insertions(+), 187 deletions(-)
> 
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> index 24526e1..b482bf2 100644
> --- 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> +++ 
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> @@ -1,9 +1,9 @@
>  /** @file
>  Header file for boot maintenance module.
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -266,28 +266,19 @@ typedef struct {
>EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
>  } BM_TERMINAL_CONTEXT;
> 
>  typedef struct {
>BOOLEAN   IsBootNext;
> -  BOOLEAN   LoadOptionModified;
>BOOLEAN   Deleted;
> 
>BOOLEAN   IsLegacy;
> -  BOOLEAN   IsActive;
> -  BOOLEAN   ForceReconnect;
> -  UINTN OptionalDataSize;
> -
> -  UINTN LoadOptionSize;
> -  UINT8 *LoadOption;
> 
>UINT32Attributes;
>UINT16FilePathListLength;
>UINT16*Description;
>EFI_DEVICE_PATH_PROTOCOL  *FilePathList;
>UINT8 *OptionalData;
> -
> -  UINT16BbsIndex;
>  } BM_LOAD_CONTEXT;
> 
>  typedef struct {
> 
>BOOLEAN   IsActive;
> diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> index a375d61..5665d04 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> @@ -3,11 +3,11 @@
> 
>Include file system navigation, system handle selection
> 
>Boot option manipulation
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -114,11 +114,10 @@ BOpt_DestroyMenuEntry (
>//
>switch (MenuEntry->ContextSelection) {
>case BM_LOAD_CONTEXT_SELECT:
>  LoadContext = (BM_LOAD_CONTEXT *) MenuEntry->VariableContext;
>  FreePool (LoadContext->FilePathList);
> -FreePool (LoadContext->LoadOption);
>  if (LoadContext->OptionalData != NULL) {
>FreePool (LoadContext->OptionalData);
>  }
>  FreePool (LoadContext);
>  break;
> @@ -334,11 +333,10 @@ BOpt_GetBootOptions (
> 
>  LoadOptionPtr   = LoadOption;
>  LoadOptionEnd   = LoadOption + BootOptionSize;
> 
>  NewMenuEntry->OptionNumber  = BootOrderList[Index];
> -NewLoadContext->LoadOptionModified  = FALSE;
>  NewLoadContext->Deleted = FALSE;
>  NewLoadContext->IsBootNext  = BootNextFlag;
> 
>  //
>  // Is a Legacy Device?
> @@ -372,17 +370

Re: [edk2] [patch] MdeModulePkg: Add ASSERT to make sure pointers are not NULL

2016-03-01 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, March 01, 2016 10:52 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin; Dong, Eric
> Subject: [edk2] [patch] MdeModulePkg: Add ASSERT to make sure pointers are 
> not NULL
> 
> Cc: Qiu Shumin <shumin@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
> b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> index 9714dbc..f985b44 100644
> --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> @@ -578,10 +578,11 @@ LibIsSupportedFileType (
>if (InputFileType == NULL) {
>  return TRUE;
>}
> 
>TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
> +  ASSERT(TmpStr != NULL);
>LibToLowerString(TmpStr);
> 
>IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? 
> FALSE : TRUE);
> 
>FreePool (TmpStr);
> @@ -1355,10 +1356,11 @@ ChooseFile (
> 
>gFileExplorerPrivate.RetDevicePath = NULL;
>gFileExplorerPrivate.ChooseHandler = ChooseHandler;
>if (FileType != NULL) {
>  gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), 
> FileType);
> +ASSERT(gFileExplorerPrivate.FileType != NULL);
>  LibToLowerString(gFileExplorerPrivate.FileType);
>} else {
>  gFileExplorerPrivate.FileType = NULL;
>}
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: FileExplorerLib: Modify the EFI_FILE_EXPLORE_FORMSET_GUID

2016-03-01 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, March 01, 2016 2:58 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeModulePkg: FileExplorerLib: Modify the 
> EFI_FILE_EXPLORE_FORMSET_GUID
> 
> Currently the EFI_FILE_EXPLORE_FORMSET_GUID value in BdsDxe in
> IntelFrameworkModulePkg is same with the GUID VALUE in FileExplorerLib.
> This patch is to modify the EFI_FILE_EXPLORE_FORMSET_GUID in
> FileExplorerLib to avoid potential issue.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Library/FileExplorerLib/FormGuid.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/FileExplorerLib/FormGuid.h 
> b/MdeModulePkg/Library/FileExplorerLib/FormGuid.h
> index 011ae22..d0a43a9 100644
> --- a/MdeModulePkg/Library/FileExplorerLib/FormGuid.h
> +++ b/MdeModulePkg/Library/FileExplorerLib/FormGuid.h
> @@ -1,9 +1,9 @@
>  /** @file
>  Formset guids, form id and VarStore data structure for File explorer library.
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
>  This program and the accompanying materials are licensed and made available 
> under
>  the terms and conditions of the BSD License that accompanies this 
> distribution.
>  The full text of the license may be found at
>  http://opensource.org/licenses/bsd-license.php.
> 
> @@ -17,11 +17,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #define _FILE_EXPLORER_FORM_GUID_H_
> 
> 
>  #define EFI_FILE_EXPLORE_FORMSET_GUID \
>{ \
> -  0x1f2d63e1, 0xfebd, 0x4dc7, {0x9c, 0xc5, 0xba, 0x2b, 0x1c, 0xef, 0x9c, 
> 0x5b} \
> +  0xfe561596, 0xe6bf, 0x41a6, {0x83, 0x76, 0xc7, 0x2b, 0x71, 0x98, 0x74, 
> 0xd0} \
>}
> 
>  #define FORM_FILE_EXPLORER_ID0x1000
>  #define LABEL_END0x
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [MdeModulePkg] Do we support redefinition of typedefs?

2016-03-15 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Andrew 
> Fish
> Sent: Wednesday, March 16, 2016 2:06 AM
> To: edk2-devel
> Subject: [edk2] [MdeModulePkg] Do we support redefinition of typedefs?
> 
> Xcode clang seems unhappy with both FileExplorerLib.h and 
> Protocol/FileExplorer.h both defining CHOOSE_HANDLER
> 
> /Users/andrewfish/work/src/edk2/MdeModulePkg/Include/Library/FileExplorerLib.h:30:10:
>  error: redefinition of typedef
> 'CHOOSE_HANDLER' is a C11 feature [-Werror,-Wtypedef-redefinition]
> (EFIAPI *CHOOSE_HANDLER)(
>  ^
> /Users/andrewfish/work/src/edk2/MdeModulePkg/Include/Protocol/FileExplorer.h:39:10:
>  note: previous definition is here
> (EFIAPI *CHOOSE_HANDLER)(
>  ^
> 1 error generated.
> 
> Should Library/FileExplorerLib.h include Protocol/FileExplorer.h to get the 
> definition of CHOOSE_HANDLER?
> 
> diff --git a/MdeModulePkg/Include/Library/FileExplorerLib.h 
> b/MdeModulePkg/Include/Library/FileExplorerLib.h
> index afb0dc8..2ae8ec6 100644
> --- a/MdeModulePkg/Include/Library/FileExplorerLib.h
> +++ b/MdeModulePkg/Include/Library/FileExplorerLib.h
> @@ -16,20 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #ifndef __FILE_EXPLORER_LIB_H__
>  #define __FILE_EXPLORER_LIB_H__
> 
> -/**
> -  Prototype for the next process after user chosed one file.
> -
> -  @param[in] FilePath The device path of the find file.
> -
> -  @retvalTRUE Need exit file explorer after do the extra task.
> -  @retvalFALSENot need to exit file explorer after do the extra 
> task.
> -
> -**/
> -typedef
> -BOOLEAN
> -(EFIAPI *CHOOSE_HANDLER)(
> -  IN EFI_DEVICE_PATH_PROTOCOL  *FilePath
> -  );
> +#include 
> 
>  /**
>Choose a file in the specified directory.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> 
> Thanks,
> 
> Andrew Fish
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg: Fixed incorrect Regular expression protocol MatchString return value.

2016-03-15 Thread Dong, Eric
Reviewed-by:  Eric Dong 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sheng, 
> Cecil (HPS SW)
> Sent: Tuesday, March 15, 2016 10:39 AM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; Zeng, Star
> Subject: Re: [edk2] [PATCH] MdeModulePkg: Fixed incorrect Regular expression 
> protocol MatchString return value.
> 
> 
> Loop maintainers.
> 
> 
> Sincerely,
> 
> Cecil Sheng
> ISS Firmware Development
> HPE Servers
> 
> 
> -Original Message-
> From: Sheng, Cecil (HPS SW)
> Sent: Tuesday, March 1, 2016 1:17 PM
> To: edk2-devel@lists.01.org
> Cc: El-Haj-Mahmoud, Samer; Sheng, Cecil (HPS SW)
> Subject: [PATCH] MdeModulePkg: Fixed incorrect Regular expression protocol 
> MatchString return value.
> 
> According to UEFI2.6, CapturePtr in the Captures array returned by 
> MatchString() should be separatedly allocated so that they can be
> freed by the caller.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> ---
>  .../RegularExpressionDxe/RegularExpressionDxe.c| 32 
> ++
>  1 file changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git 
> a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
> b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
> index cffbcb8..c6354b6 100644
> --- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
> +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
> @@ -2,7 +2,7 @@
> 
>EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
> 
> -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
> 
>This program and the accompanying materials are licensed and made available
>under the terms and conditions of the BSD License that accompanies this @@ 
> -91,6 +91,8 @@ OnigurumaMatch (
>CHAR8   ErrorMessage[ONIG_MAX_ERROR_MESSAGE_LEN];
>UINT32  Index;
>OnigUChar   *Start;
> +  EFI_STATUS  Status;
> +
> 
>//
>// Detemine the internal syntax type
> @@ -102,7 +104,7 @@ OnigurumaMatch (
>  OnigSyntax = ONIG_SYNTAX_PERL;
>} else {
>  DEBUG ((DEBUG_ERROR, "Unsupported regex syntax - using default\n"));
> -ASSERT (FALSE);
> +return EFI_UNSUPPORTED;
>}
> 
>//
> @@ -143,6 +145,8 @@ OnigurumaMatch (
>   Region,
>   ONIG_OPTION_NONE
>   );
> +
> +  Status = EFI_SUCCESS;
>if (OnigResult >= 0) {
>  *Result = TRUE;
>} else {
> @@ -150,6 +154,9 @@ OnigurumaMatch (
>  if (OnigResult != ONIG_MISMATCH) {
>onig_error_code_to_str (ErrorMessage, OnigResult);
>DEBUG ((DEBUG_ERROR, "Regex match failed: %a\n", ErrorMessage));
> +  onig_region_free (Region, 1);
> +  onig_free (OnigRegex);
> +  return EFI_DEVICE_ERROR;
>  }
>}
> 
> @@ -158,14 +165,29 @@ OnigurumaMatch (
>//
>if (*Result && Captures != NULL) {
>  *CapturesCount = Region->num_regs;
> -*Captures = AllocatePool (*CapturesCount * sizeof(**Captures));
> +*Captures = AllocateZeroPool (*CapturesCount * sizeof(**Captures));
>  if (*Captures != NULL) {
>for (Index = 0; Index < *CapturesCount; ++Index) {
>  //
>  // Region beg/end values represent bytes, not characters
>  //
> -(*Captures)[Index].CapturePtr = (CHAR16*)((UINTN)String + 
> Region->beg[Index]);
>  (*Captures)[Index].Length = (Region->end[Index] - 
> Region->beg[Index]) / sizeof(CHAR16);
> +(*Captures)[Index].CapturePtr = AllocateCopyPool (
> +  ((*Captures)[Index].Length) * 
> sizeof (CHAR16),
> +  (CHAR16*)((UINTN)String + 
> Region->beg[Index])
> +  );
> +if ((*Captures)[Index].CapturePtr == NULL) {
> +  Status = EFI_OUT_OF_RESOURCES;
> +  break;
> +}
> +  }
> +
> +  if (EFI_ERROR (Status)) {
> +for (Index = 0; Index < *CapturesCount; ++Index) {
> +  if ((*Captures)[Index].CapturePtr != NULL) {
> +FreePool ((CHAR16*)(*Captures)[Index].CapturePtr);
> +  }
> +}
>}
>  }
>}
> @@ -173,7 +195,7 @@ OnigurumaMatch (
>onig_region_free (Region, 1);
>onig_free (OnigRegex);
> 
> -  return EFI_SUCCESS;
> +  return Status;
>  }
> 
>  /**
> --
> 2.6.3.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: Refine the UI code

2016-03-14 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Monday, March 14, 2016 3:24 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg: Refine the UI code
> 
> Remove the ASSERT in UI code that may be triggered,
> and clean up the useless code.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPage.c |  7 ++-
>  .../BootMaintenanceManagerUiLib/BootMaintenance.c  | 15 --
>  .../BootMaintenanceManager.h   | 10 
>  .../Library/BootMaintenanceManagerUiLib/Variable.c | 56 
> --
>  4 files changed, 17 insertions(+), 71 deletions(-)
> 
> diff --git a/MdeModulePkg/Application/UiApp/FrontPage.c 
> b/MdeModulePkg/Application/UiApp/FrontPage.c
> index 5c67a3f..9cc877b 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPage.c
> +++ b/MdeModulePkg/Application/UiApp/FrontPage.c
> @@ -1,9 +1,9 @@
>  /** @file
>FrontPage routines to handle the callbacks and browser calls
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -418,11 +418,14 @@ FrontPageCallback (
>  ,
>  EFI_VARIABLE_NON_VOLATILE | 
> EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
>  AsciiStrSize (Lang),
>  Lang
>  );
> -ASSERT_EFI_ERROR(Status);
> +if (EFI_ERROR (Status)) {
> +  FreePool (Lang);
> +  return EFI_DEVICE_ERROR;
> +}
>} else {
>  ASSERT (FALSE);
>}
>FreePool (Lang);
>//
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> index 8189bd1..3864996 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> @@ -1,9 +1,9 @@
>  /** @file
>  The functions for Boot Maintainence Main menu.
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -665,12 +665,21 @@ BootMaintRouteConfig (
>  ,
>  EFI_VARIABLE_BOOTSERVICE_ACCESS | 
> EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
>  sizeof(UINT16),
>  &(NewBmmData->BootTimeOut)
>  );
> -ASSERT_EFI_ERROR(Status);
> -
> +if (EFI_ERROR (Status)) {
> +  //
> +  // If set variable fail, and don't have the appropriate error status 
> for RouteConfig fuction to return,
> +  // just return the EFI_NOT_FOUND.
> +  //
> +  if (Status == EFI_OUT_OF_RESOURCES) {
> +return Status;
> +  } else {
> +return EFI_NOT_FOUND;
> +  }
> +}
>  Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
>}
> 
>//
>// Check data which located in Driver Options Menu and save the settings 
> if need
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> index b482bf2..2c93446 100644
> --- 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> +++ 
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> @@ -762,20 +762,10 @@ EFI_STATUS
>  Var_UpdateOutOfBandOption (
>IN  UINT16   MenuIndex
>);
> 
>  /**
> -  Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new 
> BaudRate, Data Bits,
> -  parity and stop Bits set.
> -
> -**/
> -VOID
> -Var_Upda

Re: [edk2] [patch] IntelFrameworkModulePkg/LegacyBootMaintUiLib: Refine the code

2016-03-14 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Monday, March 14, 2016 3:24 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] IntelFrameworkModulePkg/LegacyBootMaintUiLib: Refine 
> the code
> 
> Remove the ASSERT code that may be triggered in LegacyBootMaintUiLib.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../LegacyBootMaintUiLib/LegacyBootMaintUi.c   | 30 
> ++
>  1 file changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git 
> a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c
> b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c
> index 65d617c..c9d6ee4 100644
> --- a/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c
> +++ b/IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUi.c
> @@ -1,9 +1,9 @@
>  /** @file
>Legacy Boot Maintainence UI implementation.
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -107,12 +107,15 @@ HII_VENDOR_DEVICE_PATH  
> mLegacyBootOptionHiiVendorDevicePath = {
>@param DevOrderCount  Count of the BBS Index
>@param EnBootOption   Callee allocated buffer containing the enabled 
> Boot Option Numbers
>@param EnBootOptionCount  Count of the enabled Boot Option Numbers
>@param DisBootOption  Callee allocated buffer containing the disabled 
> Boot Option Numbers
>@param DisBootOptionCount Count of the disabled Boot Option Numbers
> +
> +  @return EFI_SUCCESS   The function completed successfully.
> +  @retval other Contain some error, details see  the status 
> return by gRT->SetVariable.
>  **/
> -VOID
> +EFI_STATUS
>  OrderLegacyBootOption4SameType (
>UINT16   *DevOrder,
>UINTNDevOrderCount,
>UINT16   **EnBootOption,
>UINTN*EnBootOptionCount,
> @@ -141,10 +144,11 @@ OrderLegacyBootOption4SameType (
>*EnBootOption   = AllocatePool (BootOrderSize);
>*DisBootOption  = AllocatePool (BootOrderSize);
>*DisBootOptionCount = 0;
>*EnBootOptionCount  = 0;
>Index   = 0;
> +  Status  = EFI_SUCCESS;
> 
>ASSERT (BbsIndexArray != NULL);
>ASSERT (DeviceTypeArray != NULL);
>ASSERT (*EnBootOption != NULL);
>ASSERT (*DisBootOption != NULL);
> @@ -205,27 +209,29 @@ OrderLegacyBootOption4SameType (
>,
>VAR_FLAG,
>BootOrderSize,
>BootOrder
>);
> -  ASSERT_EFI_ERROR (Status);
> 
>FreePool (NewBootOption);
>FreePool (DeviceTypeArray);
>FreePool (BbsIndexArray);
> +
> +  return Status;
>  }
> 
>  /**
>Update the legacy BBS boot option. L"LegacyDevOrder" and 
> gEfiLegacyDevOrderVariableGuid EFI Variable
>is udpated with the new Legacy Boot order. The EFI Variable of "Boot" 
> and gEfiGlobalVariableGuid
>is also updated.
> 
>@param NVMapData   The data for egacy BBS boot.
> 
>@return EFI_SUCCESS   The function completed successfully.
> -  @retval EFI_NOT_FOUND If L"LegacyDevOrder" and 
> gEfiLegacyDevOrderVariableGuid EFI Variable can be found.
> +  @retval EFI_NOT_FOUND If L"LegacyDevOrder" and 
> gEfiLegacyDevOrderVariableGuid EFI Variable can not be found.
>@retval EFI_OUT_OF_RESOURCES  Fail to allocate memory resource
> +  @retval other Contain some error, details see  the status 
> return by gRT->SetVariable.
>  **/
>  EFI_STATUS
>  UpdateBBSOption (
>IN LEGACY_BOOT_NV_DATA*NVMapData
>)
> @@ -258,10 +264,12 @@ UpdateBBSOption (
> 
> 
>DisMap  = NULL;
>NewOrder= NULL;
>CurrentType = 0;
> +  EnBootOption= NULL;
> +  DisBootOption   = NULL;
> 
> 
>DisMap  = mLegacyBootOptionPrivate->MaintainMapData->Disa

Re: [edk2] [PATCH v6] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder protocol definition.

2016-03-08 Thread Dong, Eric
Reviewed-by: Eric Dong 


Feng,

Please help to check in this code.

Thanks,
Eric

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
> Sheng
> Sent: Tuesday, March 08, 2016 3:56 PM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng
> Subject: [edk2] [PATCH v6] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder 
> protocol definition.
> 
> Add the definition for the new UEFI 2.6 EFI_HII_IMAGE_EX_PROTOCOL and 
> EFI_IMAGE_DECODER_PROTOCOL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> Reviewed-by: Abner Chang 
> ---
>  MdePkg/Include/Protocol/HiiImageEx.h   | 245 
> +
>  MdePkg/Include/Protocol/ImageDecoder.h | 192 ++
>  MdePkg/MdePkg.dec  |  14 ++
>  3 files changed, 451 insertions(+)
>  create mode 100644 MdePkg/Include/Protocol/HiiImageEx.h
>  create mode 100644 MdePkg/Include/Protocol/ImageDecoder.h
> 
> diff --git a/MdePkg/Include/Protocol/HiiImageEx.h 
> b/MdePkg/Include/Protocol/HiiImageEx.h
> new file mode 100644
> index 000..9393a53
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/HiiImageEx.h
> @@ -0,0 +1,245 @@
> +/** @file
> +  Protocol which allows access to the images in the images database.
> +
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
> +This program and the accompanying materials are licensed and made available 
> under
> +the terms and conditions of the BSD License that 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.
> +
> +**/
> +
> +#ifndef EFI_HII_IMAGE_EX_H
> +#define EFI_HII_IMAGE_EX_H
> +
> +#include 
> +
> +//
> +// Global ID for the Hii Image Ex Protocol.
> +//
> +#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
> +  {0x1a1241e6, 0x8f19, 0x41a9,  { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 
> 0x46 }}
> +
> +typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;
> +
> +/**
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.NewImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.NewImage().This protocol invokes
> +EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be added.
> +  @param  ImageIdOn return, contains the new image id, which 
> is
> + unique within PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was added successfully.
> +  @retval EFI_NOT_FOUND  The specified PackageList could not be 
> found in
> + database.
> +  @retval EFI_OUT_OF_RESOURCES   Could not add the image due to lack of 
> resources.
> +  @retval EFI_INVALID_PARAMETER  Image is NULL or ImageId is NULL.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_NEW_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL  *This,
> +  INEFI_HII_HANDLE  PackageList,
> +  OUT   EFI_IMAGE_ID*ImageId,
> +  IN CONST  EFI_IMAGE_INPUT *Image
> +  );
> +
> +/**
> +  Return the information about the image, associated with the package list.
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.GetImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes 
> EFI_HII_IMAGE_PROTOCOL.SetImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be searched.
> +  @param  ImageIdThe image's id,, which is unique within
> + PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was returned successfully.
> +  @retval EFI_NOT_FOUND  The image specified by ImageId is not in the
> + database. The specified PackageList is not 
> in
> + the database.
> +  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
> small to
> + hold the image.
> +  @retval EFI_INVALID_PARAMETER  The Image or ImageSize was NULL.
> +  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because 
> there
> + was not enough memory.
> +
> 

Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-03-30 Thread Dong, Eric
We have a sample driver in MdeModulePkg/Universal/DriverSampleDxe. It also use 
a Name/Value varstore. You can reference that driver about how to implement the 
EFI Config Access Protocol.

> -Original Message-
> From: Michael Brown [mailto:mc...@ipxe.org]
> Sent: Wednesday, March 30, 2016 11:42 PM
> To: Dong, Eric; Laszlo Ersek; Bi, Dandan
> Cc: edk2-devel-01; Justen, Jordan L; Ard Biesheuvel
> Subject: Re: HII incompatibility between edk2 and iPXE?
> 
> On 30/03/16 16:09, Dong, Eric wrote:
> > This error is caused by iPXE driver not return the correct string in 
> > EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig() function. Base on
> the spec requirement, if the function return success, the Results string 
> should follow format. But the data returned
> by iPXE driver is not follow this rule, so the ASSERT raised. Detail can 
> check UEFI spec 2.6 chapter 33.2.1.5 and 33.5.
> 
> Those sections of the UEFI spec are so badly written that I cannot begin
> to guess what might count as either correct or incorrect.
> 
> Could you please give a concrete example of what you think iPXE should
> be returning here?
> 
> Thanks,
> 
> Michael
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-03-30 Thread Dong, Eric
Yes, we can also enhance Hiidatabase to not assert.

From: Ni, Ruiyu
Sent: Thursday, March 31, 2016 8:57 AM
To: Dong, Eric; Laszlo Ersek; Bi, Dandan; Michael Brown
Cc: Justen, Jordan L; edk2-devel-01; Ard Biesheuvel
Subject: RE: HII incompatibility between edk2 and iPXE?

Eric,
Shall we also fix the core driver to not assert when the string is incorrect?

Regards,
Ray

From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dong, 
Eric
Sent: Wednesday, March 30, 2016 11:09 PM
To: Laszlo Ersek <ler...@redhat.com<mailto:ler...@redhat.com>>; Bi, Dandan 
<dandan...@intel.com<mailto:dandan...@intel.com>>; Michael Brown 
<mc...@ipxe.org<mailto:mc...@ipxe.org>>
Cc: Justen, Jordan L 
<jordan.l.jus...@intel.com<mailto:jordan.l.jus...@intel.com>>; edk2-devel-01 
<edk2-de...@ml01.01.org<mailto:edk2-de...@ml01.01.org>>; Ard Biesheuvel 
<ard.biesheu...@linaro.org<mailto:ard.biesheu...@linaro.org>>
Subject: Re: [edk2] HII incompatibility between edk2 and iPXE?

This error is caused by iPXE driver not return the correct string in 
EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig() function. Base on the spec 
requirement, if the function return success, the Results string should follow 
format. But the data returned by iPXE driver is not follow 
this rule, so the ASSERT raised. Detail can check UEFI spec 2.6 chapter 
33.2.1.5 and 33.5.

Thanks,
Eric
-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: Tuesday, March 29, 2016 11:21 PM
To: Bi, Dandan; Dong, Eric; Michael Brown
Cc: edk2-devel-01; Justen, Jordan L; Ard Biesheuvel
Subject: HII incompatibility between edk2 and iPXE?

Hi,

recent edk2 commit 8a45f80edad4 ("MdeModulePkg: Make HII configuration settings 
available to OS runtime") seems to trigger an issue between edk2 and iPXE.

(Note: I'm not saying that 8a45f80edad4 causes the issue, just that it exposes 
it.)

Namely, when you boot a brand new QEMU VM with OVMF (and iPXE presented in the 
NIC's option ROM), then an HII ASSERT() fails. I've come across the issue 
report in 
<https://www.redhat.com/archives/vfio-users/2016-March/msg00153.html>, 
reproduced it, and collected some data to assist with the analysis.

The failed assertion is:

> ASSERT MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c(1256): 
> TmpRequest != ((void *) 0)

Here's the edk2 stack dump:

> #0  0x7fda4070 in CpuDeadLoop ()
> at MdePkg/Library/BaseLib/CpuDeadLoop.c:37
> #1  0x7fda30d5 in DebugAssert (
> FileName=0x7fda47d8 
> "MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c", LineNumber=1256, 
> Description=0x7fda4a20 "TmpRequest != ((void *) 0)")
> at OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c:153
> #2  0x7fd8166f in GetElementsFromRequest (ConfigRequest=0x7898)
> at MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c:1256
> #3  0x7fd8629c in HiiConfigRoutingExportConfig (This=0x7fda9190, 
> Results=0x7ff5e9f0)
> at MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c:4242
> #4  0x7fd90e02 in HiiGetConfigurationSetting (This=0x7fda9138)
> at MdeModulePkg/Universal/HiiDatabaseDxe/Database.c:2815
> #5  0x7fd7c7ae in OnReadyToBoot (Event=0x7f645098, Context=0x0)
> at MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c:147
> #6  0x7ff7c785 in CoreDispatchEventNotifies (Priority=8)
> at MdeModulePkg/Core/Dxe/Event/Event.c:200
> #7  0x7ff7bdda in CoreRestoreTpl (NewTpl=4)
> at MdeModulePkg/Core/Dxe/Event/Tpl.c:131
> #8  0x7ff6a030 in CoreReleaseLock (Lock=0x7ff9ac70)
> at MdeModulePkg/Core/Dxe/Library/Library.c:102
> #9  0x7ff7c560 in CoreReleaseEventLock ()
> at MdeModulePkg/Core/Dxe/Event/Event.c:119
> #10 0x7ff7c9cc in CoreNotifySignalList (EventGroup=0x7eeed8d0)
> at MdeModulePkg/Core/Dxe/Event/Event.c:276
> #11 0x7ff7ce60 in CoreSignalEvent (UserEvent=0x7eeed898)
> at MdeModulePkg/Core/Dxe/Event/Event.c:564
> #12 0x7ebe610c in EfiSignalEventReadyToBoot ()
> at MdePkg/Library/UefiLib/UefiNotTiano.c:235
> #13 0x7ebde969 in BdsLibBootViaBootOption (Option=0x7eeecd18, 
> DevicePath=0x7eeeb958,
> ExitDataSize=0x7ff5ed38, ExitData=0x7ff5ed30)
> at IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:2279
> #14 0x7ebaf0a3 in BdsBootDeviceSelect ()
> at IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:286
> #15 0x7ebafc1a in BdsEntry (This=0x7ebfbec0)
> at IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:659
> #16 0x7ff6096a in DxeMain (HobStart=0x7fd14018)
> at MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:517
> #17 0x7ff5f71d in ProcessModuleEntryPointList (HobStart=0x7bfde000)
> at 
> Build/OvmfX64/DEBUG_GCC48/X64/Mde

Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-04-12 Thread Dong, Eric
> On 05/04/16 03:10, Dong, Eric wrote:
> >> On a separate but related note: The ConfigHdr portion of Request and
> >> Response seems to contain absolutely zero information by the time it
> >> reaches EFI_HII_CONFIG_ACCESS_PROTOCOL.  As far as I can tell, it is
> >> meaningful only to EFI_HII_CONFIG_ROUTING_PROTOCOL and a sensible API
> >> design would never have exposed it to EFI_HII_CONFIG_ACCESS_PROTOCOL
> >> instances.
> >>
> >> Does the ConfigHdr have any meaning for EFI_HII_CONFIG_ACCESS_PROTOCOL,
> >> or is it just a pointless blob of noise?
> >
> > The GUID/NAME value in the ConfigHdr is get from the storage used in this 
> > driver. If one driver has more than one storage, the Guid +
> Name specify which storage info will be return.
> 
> Surely the EFI_HII_CONFIG_ACCESS_PROTOCOL's *This pointer already
> uniquely identifies the storage.
> 
> (If not, then why not?)

The Config Access Protocol supports more than one storages in this protocol at 
one time.  Just like examples in DriverSampleDxe, it has three storages in this 
driver:
  //
  // Define a Buffer Storage (EFI_IFR_VARSTORE)
  //
  varstore DRIVER_SAMPLE_CONFIGURATION, // This is the data structure type
varid = CONFIGURATION_VARSTORE_ID,  // Optional VarStore ID
name  = MyIfrNVData,// Define referenced name in vfr
guid  = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this buffer storage

  //
  // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI)
  //
  efivarstore MY_EFI_VARSTORE_DATA,
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,  
// EFI variable attribures  
name  = MyEfiVar,
guid  = DRIVER_SAMPLE_FORMSET_GUID;

  //
  // Define a Name/Value Storage (EFI_IFR_VARSTORE_NAME_VALUE)
  //
  namevaluevarstore MyNameValueVar,// Define storage 
reference name in vfr
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME0), // Define Name list of this 
storage, refer it by MyNameValueVar[0]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME1), // Define Name list of this 
storage, refer it by MyNameValueVar[1]
name = STRING_TOKEN(STR_NAME_VALUE_VAR_NAME2), // Define Name list of this 
storage, refer it by MyNameValueVar[2]
guid = DRIVER_SAMPLE_FORMSET_GUID; // GUID of this Name/Value 
storage


The ConfigHdr string includes the Name + Guid + DevicePath info.  The name +  
guid is got from the storage definition. So in EFI_HII_CONFIG_ACCESS_PROTOCOL's 
ExtractCofig function, it base on the input Name + guid info to know which 
storage data need to be return. It's not meaningless. 

Because we almost add all examples related to HII to DriverSampleDxe, this 
driver may seems a little big. But I think these codes are valuable for the 
newbie of Hii if he can spend some time to learn it.

> 
> Thanks,
> 
> Michael
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] SecurityPkg OpalPasswordDxe: Clean up debug message.

2016-04-07 Thread Dong, Eric
Yes, I checked all files. 

> -Original Message-
> From: Tian, Feng
> Sent: Friday, April 08, 2016 10:15 AM
> To: Dong, Eric; edk2-devel@lists.01.org
> Cc: Tian, Feng
> Subject: RE: [Patch] SecurityPkg OpalPasswordDxe: Clean up debug message.
> 
> Do you check all files for unnecessary debug message? If not, please update 
> your commit title to show up  this change is only for Opalhii.c
> 
> Reviewed-by: Feng Tian <feng.t...@intel.com>
> 
> Thanks
> Feng
> 
> 
> -Original Message-
> From: Dong, Eric
> Sent: Thursday, April 7, 2016 9:27 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng <feng.t...@intel.com>
> Subject: [Patch] SecurityPkg OpalPasswordDxe: Clean up debug message.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Eric Dong <eric.d...@intel.com>
> Cc: Feng Tian <feng.t...@intel.com>
> ---
>  SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 13 -
>  1 file changed, 13 deletions(-)
> 
> diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c 
> b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> index 94dce6c..75ff9fc 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> @@ -102,7 +102,6 @@ HiiSetCurrentConfiguration(
>,
>
>);
> -  DEBUG ((DEBUG_INFO, "GetVariable for OpalExtraInfo @ 
> HiiSetCurrentConfiguration, Status: %r\n", Status));
>if (!EFI_ERROR (Status)) {
>  gHiiConfiguration.EnableBlockSid = OpalExtraInfo.EnableBlockSid;
>}
> @@ -1110,8 +1109,6 @@ HiiPasswordEntered(
>UnicodeStrToAsciiStr(UniStr, Password);
>gBS->FreePool(UniStr);
> 
> -  DEBUG ((DEBUG_INFO, "Password: '%s'\n", Password));
> -
>if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_UNLOCK) {
>  Status = HiiUnlock (OpalDisk, Password, PassLength);
>} else if (gHiiConfiguration.SelectedAction == 
> HII_KEY_ID_GOTO_SECURE_ERASE) { @@ -1150,8 +1147,6 @@ HiiSetBlockSid (
> 
>Status = EFI_SUCCESS;
> 
> -  DEBUG ((DEBUG_INFO, "HiiSetBlockSid(enable: %x)\n", Enable));
> -
>OpalExtraInfo.EnableBlockSid = Enable;
>DataSize = sizeof (OPAL_EXTRA_INFO_VAR);
>Status = gRT->SetVariable (
> @@ -1161,7 +1156,6 @@ HiiSetBlockSid (
>   DataSize,
>   
>   );
> -  DEBUG ((DEBUG_INFO, "SetVariable, Status: %r\n", Status));
> 
>return Status;
>  }
> @@ -1192,7 +1186,6 @@ RouteConfig(
>EFI_STRING  *Progress
>)
>  {
> -  DEBUG ((DEBUG_INFO,  "RouteConfig( )\n"));
>if (Configuration == NULL || Progress == NULL) {
>  return (EFI_INVALID_PARAMETER);
>}
> @@ -1237,8 +1230,6 @@ ExtractConfig(
>  {
>EFI_STATUS  Status;
> 
> -  DEBUG ((DEBUG_INFO,  "ExtractConfig( )\n"));
> -
>//
>// Check for valid parameters
>//
> @@ -1272,7 +1263,6 @@ OpalHiiSetBrowserData (
>VOID
>)
>  {
> -  DEBUG ((DEBUG_INFO,  "OpalHiiSetBrowserData( )\n"));
>HiiSetBrowserData(
>,
>(CHAR16*)L"OpalHiiConfig",
> @@ -1293,7 +1283,6 @@ OpalHiiGetBrowserData (
>VOID
>)
>  {
> -  DEBUG ((DEBUG_INFO,  "OpalHiiGetBrowserData( )\n"));
>HiiGetBrowserData(
>,
>(CHAR16*)L"OpalHiiConfig",
> @@ -1322,8 +1311,6 @@ HiiSetFormString(
>UINT32UniSize;
>CHAR16*   UniStr;
> 
> -  DEBUG ((DEBUG_INFO,  "HiiSetFormString( )\n"));
> -
>//
>// Determine the Length of the sting
>//
> --
> 2.6.4.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support

2016-03-21 Thread Dong, Eric
If the driver provides menus in setup, it only need to install the HII packages 
through HiiAddPackages and provide Config Access Protocol to let setup browser 
extract/route data from/to the driver. setup browser don't care any other 
information in the driver.  RAM disk driver already provide them, so I think it 
can be supported by setup browser.

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Paulo 
> Alcantara
> Sent: Tuesday, March 22, 2016 8:14 AM
> To: Justen, Jordan L
> Cc: edk2-devel@lists.01.org; Laszlo Ersek
> Subject: Re: [edk2] [PATCH] OvmfPkg: Add RAM disk support
> 
> Hi Jordan,
> 
> On Mon, Mar 21, 2016 at 8:24 PM, Jordan Justen
>  wrote:
> > On 2016-03-21 01:02:53, Laszlo Ersek wrote:
> >> On 03/20/16 17:58, Paulo Alcantara wrote:
> >> > This patch adds RamDiskDxe driver to OVMF through a new introduced flag
> >> > "RAMDISK_SUPPORT_ENABLE" which is disabled by default and may be enabled
> >> > with -DRAMDISK_SUPPORT_ENABLE=TRUE at build time.
> >> >
> >> > Cc: Jordan Justen 
> >> > Cc: Laszlo Ersek 
> >> > Contributed-under: TianoCore Contribution Agreement 1.0
> >> > Signed-off-by: Paulo Alcantara 
> >> > ---
> >> >  OvmfPkg/OvmfPkgIa32.dsc| 6 +-
> >> >  OvmfPkg/OvmfPkgIa32.fdf| 3 +++
> >> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 
> >> >  OvmfPkg/OvmfPkgIa32X64.fdf | 3 +++
> >> >  OvmfPkg/OvmfPkgX64.dsc | 6 +-
> >> >  OvmfPkg/OvmfPkgX64.fdf | 3 +++
> >> >  6 files changed, 23 insertions(+), 2 deletions(-)
> >>
> >> I think it should be fine to enable this unconditionally. Jordan, what
> >> do you think?
> >>
> >
> > So, this driver won't really take much action until the setup browser
> > is used to configure a ram disk?
> >
> > If so, it seems reasonable to include it by default.
> >
> > Does the setup browser actually have support for EFI_RAM_DISK_PROTOCOL
> > yet? (git grep EFI_RAM_DISK_PROTOCOL is a bit sparse)
> 
> I actually don't know whether the setup browser supports it or not,
> but the RAM disk support is useful in many contexts -- either it's
> being used by an application or driver. I added a flag to it because
> it seems like an optional feature to me rather than something required
> to boot a platform. Yet, it's working perfectly fine and solving my
> problems :-)
> 
> Paulo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg: Fix HII related problem in HTTP boot driver.

2016-03-23 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu 
> Siyuan
> Sent: Wednesday, March 23, 2016 3:39 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin; Dong, Eric
> Subject: [edk2] [Patch] NetworkPkg: Fix HII related problem in HTTP boot 
> driver.
> 
> According to UEFI spec, HII_Config_Access.RouteConfig() should return success
> if the required configuration has been processed. Current HTTP boot driver
> may return error code in some situation, which failed the UEFI SCT test.
> This patch fix this issue by removing the returned error status code and 
> adding
> extra check point in the Callback() function, which will pop up a message box
> if user input an unsupported URI string.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan...@intel.com>
> Cc: Dong Eric <eric.d...@intel.com>
> Cc: Wu Jiaxin <jiaxin...@intel.com>
> ---
>  NetworkPkg/HttpBootDxe/HttpBootConfig.c| 77 
> +++---
>  NetworkPkg/HttpBootDxe/HttpBootConfigNVDataStruc.h | 19 --
>  NetworkPkg/HttpBootDxe/HttpBootConfigVfr.vfr   |  6 +-
>  3 files changed, 85 insertions(+), 17 deletions(-)
> 
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootConfig.c 
> b/NetworkPkg/HttpBootDxe/HttpBootConfig.c
> index 0c1ff43..e7dd5db 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootConfig.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootConfig.c
> @@ -351,6 +351,7 @@ HttpBootFormExtractConfig (
>//
>BufferSize = sizeof (HTTP_BOOT_CONFIG_IFR_NVDATA);
>ZeroMem (>HttpBootNvData, BufferSize);
> +  StrCpyS (CallbackInfo->HttpBootNvData.Description, 
> DESCRIPTION_STR_MAX_SIZE / sizeof (CHAR16),
> HTTP_BOOT_DEFAULT_DESCRIPTION_STR);
> 
>ConfigRequest = Request;
>if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {
> @@ -376,7 +377,6 @@ HttpBootFormExtractConfig (
>  Results,
>  Progress
>  );
> -  ASSERT_EFI_ERROR (Status);
> 
>//
>// Free the allocated config request string.
> @@ -487,14 +487,14 @@ HttpBootFormRouteConfig (
>//
>// Create a new boot option according to the configuration data.
>//
> -  Status = HttpBootAddBootOption (
> - Private,
> - (CallbackInfo->HttpBootNvData.IpVersion == 
> HTTP_BOOT_IP_VERSION_6) ? TRUE : FALSE,
> - CallbackInfo->HttpBootNvData.Description,
> - CallbackInfo->HttpBootNvData.Uri
> - );
> +  HttpBootAddBootOption (
> +Private,
> +(CallbackInfo->HttpBootNvData.IpVersion == HTTP_BOOT_IP_VERSION_6) ? 
> TRUE : FALSE,
> +CallbackInfo->HttpBootNvData.Description,
> +CallbackInfo->HttpBootNvData.Uri
> +);
> 
> -  return Status;
> +  return EFI_SUCCESS;
>  }
> 
>  /**
> @@ -533,7 +533,66 @@ HttpBootFormCallback (
>OUT   EFI_BROWSER_ACTION_REQUEST   *ActionRequest
>)
>  {
> -  return EFI_UNSUPPORTED;
> +  EFI_INPUT_KEY   Key;
> +  UINTN   Index;
> +  CHAR16  *Uri;
> +  HTTP_BOOT_FORM_CALLBACK_INFO*CallbackInfo;
> +
> +  if (This == NULL || Value == NULL) {
> +return EFI_INVALID_PARAMETER;
> +  }
> +
> +  CallbackInfo = HTTP_BOOT_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS (This);
> +
> +  if (Action != EFI_BROWSER_ACTION_CHANGING) {
> +return EFI_UNSUPPORTED;
> +  }
> +
> +  switch (QuestionId) {
> +  case KEY_INITIATOR_URI:
> +//
> +// Get user input URI string
> +//
> +Uri = HiiGetString (CallbackInfo->RegisteredHandle, Value->string, NULL);
> +
> +//
> +// Convert the scheme to all lower case.
> +//
> +for (Index = 0; Index < StrLen (Uri); Index++) {
> +  if (Uri[Index] == L':') {
> +break;
> +  }
> +  if (Uri[Index] >= L'A' && Uri[Index] <= L'Z') {
> +Uri[Index] -= (CHAR16)(L'A' - L'a');
> +  }
> +}
> +
> +//
> +// Set the converted URI string back
> +//
> +HiiSetString (CallbackInfo->RegisteredHandle, Value->string, Uri, NULL);
> +
> +//
> +// We only accept http and https, pop up a message box for unsupported 
> URI.
> +//
> +if ((StrnCmp (Uri, L"http://;, 7) != 0) && (StrnCmp (Uri, L"https://;, 
> 7) != 0)) {
> +  CreatePopUp (
> +EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
> +,
> +L"ERROR: Unsupported URI!",
> +L&q

Re: [edk2] [PATCH 15/35] MdeModulePkg: BootMaintenanceManagerUiLib: remove set but unused variables

2016-03-24 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Thursday, March 24, 2016 6:37 PM
> To: edk2-devel-01
> Cc: Ni, Ruiyu; Tian, Feng; Zeng, Star
> Subject: [edk2] [PATCH 15/35] MdeModulePkg: BootMaintenanceManagerUiLib: 
> remove set but unused variables
> 
> Cc: Feng Tian 
> Cc: Star Zeng 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
>  MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c | 6 --
>  MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c  | 2 --
>  2 files changed, 8 deletions(-)
> 
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> index a34ac8504695..564a228b7c67 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> @@ -867,9 +867,6 @@ BootMaintCallback (
>BMM_CALLBACK_DATA *Private;
>BM_MENU_ENTRY *NewMenuEntry;
>BMM_FAKE_NV_DATA  *CurrentFakeNVMap;
> -  UINTN OldValue;
> -  UINTN NewValue;
> -  UINTN Number;
>UINTN Index;
>EFI_DEVICE_PATH_PROTOCOL * File;
> 
> @@ -879,9 +876,6 @@ BootMaintCallback (
>  //
>  return EFI_UNSUPPORTED;
>}
> -  OldValue   = 0;
> -  NewValue   = 0;
> -  Number = 0;
> 
>Private= BMM_CALLBACK_DATA_FROM_THIS (This);
>//
> diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
> index cd1756aa588a..484f1acda10b 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c
> @@ -581,7 +581,6 @@ UpdateOrderPage (
>UINT16Index;
>UINT16OptionIndex;
>VOID  *OptionsOpCodeHandle;
> -  BM_LOAD_CONTEXT   *NewLoadContext;
>BOOLEAN   BootOptionFound;
>UINT32*OptionOrder;
>EFI_QUESTION_ID   QuestionId;
> @@ -619,7 +618,6 @@ UpdateOrderPage (
>  BootOptionFound = FALSE;
>  for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
>NewMenuEntry   = BOpt_GetMenuEntry (OptionMenu, Index);
> -  NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
>if ((UINT32) (NewMenuEntry->OptionNumber + 1) == 
> OptionOrder[OptionIndex]) {
>  BootOptionFound = TRUE;
>  break;
> --
> 1.8.3.1
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 16/35] MdeModulePkg: DeviceManagerUiLib: remove set but unused variables

2016-03-24 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo 
> Ersek
> Sent: Thursday, March 24, 2016 6:37 PM
> To: edk2-devel-01
> Cc: Ni, Ruiyu; Tian, Feng; Zeng, Star
> Subject: [edk2] [PATCH 16/35] MdeModulePkg: DeviceManagerUiLib: remove set 
> but unused variables
> 
> Cc: Feng Tian 
> Cc: Star Zeng 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
>  MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> index bfab83ac867e..0de4e3c0c587 100644
> --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> @@ -347,7 +347,6 @@ IsNeedAddNetworkMenu (
>EFI_STATUS Status;
>UINTN  EntryCount;
>UINTN  Index;
> -  EFI_HII_HANDLE HiiDeviceManagerHandle;
>EFI_HANDLE DriverHandle;
>EFI_HANDLE ControllerHandle;
>EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
> @@ -356,7 +355,6 @@ IsNeedAddNetworkMenu (
>EFI_OPEN_PROTOCOL_INFORMATION_ENTRY   *OpenInfoBuffer;
>BOOLEANIsNeedAdd;
> 
> -  HiiDeviceManagerHandle = gDeviceManagerPrivate.HiiHandle;
>IsNeedAdd  = FALSE;
>OpenInfoBuffer = NULL;
>if ((Handle == NULL) || (ItemCount == NULL)) {
> --
> 1.8.3.1
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v5] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder protocol definition.

2016-03-07 Thread Dong, Eric
Hi Cecil,

The gEfiImageDecoderProtocolGuid value in the .h file is not consistent with 
the value in the dec file. Please correct it.

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
> Sheng
> Sent: Tuesday, March 08, 2016 10:33 AM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng
> Subject: [edk2] [PATCH v5] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder 
> protocol definition.
> 
> Add the definition for the new UEFI 2.6 EFI_HII_IMAGE_EX_PROTOCOL and 
> EFI_IMAGE_DECODER_PROTOCOL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> Reviewed-by: Abner Chang 
> ---
>  MdePkg/Include/Protocol/HiiImageEx.h   | 245 
> +
>  MdePkg/Include/Protocol/ImageDecoder.h | 192 ++
>  MdePkg/MdePkg.dec  |  13 ++
>  3 files changed, 450 insertions(+)
>  create mode 100644 MdePkg/Include/Protocol/HiiImageEx.h
>  create mode 100644 MdePkg/Include/Protocol/ImageDecoder.h
> 
> diff --git a/MdePkg/Include/Protocol/HiiImageEx.h 
> b/MdePkg/Include/Protocol/HiiImageEx.h
> new file mode 100644
> index 000..9393a53
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/HiiImageEx.h
> @@ -0,0 +1,245 @@
> +/** @file
> +  Protocol which allows access to the images in the images database.
> +
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
> +This program and the accompanying materials are licensed and made available 
> under
> +the terms and conditions of the BSD License that 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.
> +
> +**/
> +
> +#ifndef EFI_HII_IMAGE_EX_H
> +#define EFI_HII_IMAGE_EX_H
> +
> +#include 
> +
> +//
> +// Global ID for the Hii Image Ex Protocol.
> +//
> +#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
> +  {0x1a1241e6, 0x8f19, 0x41a9,  { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 
> 0x46 }}
> +
> +typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;
> +
> +/**
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.NewImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.NewImage().This protocol invokes
> +EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be added.
> +  @param  ImageIdOn return, contains the new image id, which 
> is
> + unique within PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was added successfully.
> +  @retval EFI_NOT_FOUND  The specified PackageList could not be 
> found in
> + database.
> +  @retval EFI_OUT_OF_RESOURCES   Could not add the image due to lack of 
> resources.
> +  @retval EFI_INVALID_PARAMETER  Image is NULL or ImageId is NULL.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_NEW_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL  *This,
> +  INEFI_HII_HANDLE  PackageList,
> +  OUT   EFI_IMAGE_ID*ImageId,
> +  IN CONST  EFI_IMAGE_INPUT *Image
> +  );
> +
> +/**
> +  Return the information about the image, associated with the package list.
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.GetImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes 
> EFI_HII_IMAGE_PROTOCOL.SetImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be searched.
> +  @param  ImageIdThe image's id,, which is unique within
> + PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was returned successfully.
> +  @retval EFI_NOT_FOUND  The image specified by ImageId is not in the
> + database. The specified PackageList is not 
> in
> + the database.
> +  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
> small to
> + hold the image.
> +  @retval EFI_INVALID_PARAMETER  The Image or ImageSize was NULL.
> +  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because 
> there
> +

Re: [edk2] [patch] MdeModulePkg/DisplayEngineDxe: Refine the coding style

2016-03-03 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Thursday, March 03, 2016 4:54 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin; Dong, Eric
> Subject: [patch] MdeModulePkg/DisplayEngineDxe: Refine the coding style
> 
> Remove the empty line to conform with current coding style.
> 
> Cc: Qiu Shumin <shumin@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c 
> b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> index 37cfcc5..8531d0e 100644
> --- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> +++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
> @@ -3729,11 +3729,10 @@ UiDisplayMenu (
>Free the UI Menu Option structure data.
> 
>@param   MenuOptionList Point to the menu option list which need 
> to be free.
> 
>  **/
> -
>  VOID
>  FreeMenuOptionData(
>LIST_ENTRY   *MenuOptionList
>)
>  {
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder protocol definition.

2016-03-06 Thread Dong, Eric
Reviewed-by: Eric Dong 


Hi Feng,

Please help to check in the code.


Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
> Sheng
> Sent: Wednesday, March 02, 2016 10:56 AM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng
> Subject: [edk2] [PATCH v2] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder 
> protocol definition.
> 
> Add the definition for the new UEFI 2.6 EFI_HII_IMAGE_EX_PROTOCOL and 
> EFI_IMAGE_DECODER_PROTOCOL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> Reviewed-by: Abner Chang 
> ---
>  MdePkg/Include/Protocol/HiiImageEx.h   | 234 
> +
>  MdePkg/Include/Protocol/ImageDecoder.h | 164 +++
>  MdePkg/MdePkg.dec  |  13 ++
>  3 files changed, 411 insertions(+)
>  create mode 100644 MdePkg/Include/Protocol/HiiImageEx.h
>  create mode 100644 MdePkg/Include/Protocol/ImageDecoder.h
> 
> diff --git a/MdePkg/Include/Protocol/HiiImageEx.h 
> b/MdePkg/Include/Protocol/HiiImageEx.h
> new file mode 100644
> index 000..3353c97
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/HiiImageEx.h
> @@ -0,0 +1,234 @@
> +/** @file
> +  Protocol which allows access to the images in the images database.
> +
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
> +This program and the accompanying materials are licensed and made available 
> under
> +the terms and conditions of the BSD License that 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.
> +
> +**/
> +
> +#ifndef EFI_HII_IMAGE_EX_H
> +#define EFI_HII_IMAGE_EX_H
> +
> +#include 
> +
> +//
> +// Global ID for the Hii Image Ex Protocol.
> +//
> +#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
> +  {0x1a1241e6, 0x8f19, 0x41a9,  { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 
> 0x46 }}
> +
> +typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;
> +
> +/**
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.NewImage().
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be added.
> +  @param  ImageIdOn return, contains the new image id, which 
> is
> + unique within PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was added successfully.
> +  @retval EFI_NOT_FOUND  The specified PackageList could not be 
> found in
> + database.
> +  @retval EFI_OUT_OF_RESOURCES   Could not add the image due to lack of 
> resources.
> +  @retval EFI_INVALID_PARAMETER  Image is NULL or ImageId is NULL.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_NEW_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL  *This,
> +  INEFI_HII_HANDLE  PackageList,
> +  OUT   EFI_IMAGE_ID*ImageId,
> +  IN CONST  EFI_IMAGE_INPUT *Image
> +  );
> +
> +/**
> +  Return the information about the image, associated with the package list.
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.GetImage().
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be searched.
> +  @param  ImageIdThe image's id,, which is unique within
> + PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was returned successfully.
> +  @retval EFI_NOT_FOUND  The image specified by ImageId is not in the
> + database. The specified PackageList is not 
> in
> + the database.
> +  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
> small to
> + hold the image.
> +  @retval EFI_INVALID_PARAMETER  The Image or ImageSize was NULL.
> +  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because 
> there
> + was not enough memory.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_GET_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL   *This,
> +  INEFI_HII_HANDLE  PackageList,
> +  INEFI_IMAGE_IDImageId,
> +  

Re: [edk2] [PATCH v4] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder protocol definition.

2016-03-06 Thread Dong, Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
> Sheng
> Sent: Monday, March 07, 2016 2:07 PM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng
> Subject: [edk2] [PATCH v4] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder 
> protocol definition.
> 
> Add the definition for the new UEFI 2.6 EFI_HII_IMAGE_EX_PROTOCOL and 
> EFI_IMAGE_DECODER_PROTOCOL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> Reviewed-by: Abner Chang 
> ---
>  MdePkg/Include/Protocol/HiiImageEx.h   | 245 
> +
>  MdePkg/Include/Protocol/ImageDecoder.h | 192 ++
>  MdePkg/MdePkg.dec  |  13 ++
>  3 files changed, 450 insertions(+)
>  create mode 100644 MdePkg/Include/Protocol/HiiImageEx.h
>  create mode 100644 MdePkg/Include/Protocol/ImageDecoder.h
> 
> diff --git a/MdePkg/Include/Protocol/HiiImageEx.h 
> b/MdePkg/Include/Protocol/HiiImageEx.h
> new file mode 100644
> index 000..9393a53
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/HiiImageEx.h
> @@ -0,0 +1,245 @@
> +/** @file
> +  Protocol which allows access to the images in the images database.
> +
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
> +This program and the accompanying materials are licensed and made available 
> under
> +the terms and conditions of the BSD License that 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.
> +
> +**/
> +
> +#ifndef EFI_HII_IMAGE_EX_H
> +#define EFI_HII_IMAGE_EX_H
> +
> +#include 
> +
> +//
> +// Global ID for the Hii Image Ex Protocol.
> +//
> +#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
> +  {0x1a1241e6, 0x8f19, 0x41a9,  { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 
> 0x46 }}
> +
> +typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;
> +
> +/**
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.NewImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.NewImage().This protocol invokes
> +EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be added.
> +  @param  ImageIdOn return, contains the new image id, which 
> is
> + unique within PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was added successfully.
> +  @retval EFI_NOT_FOUND  The specified PackageList could not be 
> found in
> + database.
> +  @retval EFI_OUT_OF_RESOURCES   Could not add the image due to lack of 
> resources.
> +  @retval EFI_INVALID_PARAMETER  Image is NULL or ImageId is NULL.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_NEW_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL  *This,
> +  INEFI_HII_HANDLE  PackageList,
> +  OUT   EFI_IMAGE_ID*ImageId,
> +  IN CONST  EFI_IMAGE_INPUT *Image
> +  );
> +
> +/**
> +  Return the information about the image, associated with the package list.
> +  The prototype of this extension function is the same with 
> EFI_HII_IMAGE_PROTOCOL.GetImage().
> +  Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes 
> EFI_HII_IMAGE_PROTOCOL.SetImage() implicitly.
> +
> +  @param  This   A pointer to the EFI_HII_IMAGE_EX_PROTOCOL 
> instance.
> +  @param  PackageListHandle of the package list where this image 
> will
> + be searched.
> +  @param  ImageIdThe image's id,, which is unique within
> + PackageList.
> +  @param  Image  Points to the image.
> +
> +  @retval EFI_SUCCESSThe new image was returned successfully.
> +  @retval EFI_NOT_FOUND  The image specified by ImageId is not in the
> + database. The specified PackageList is not 
> in
> + the database.
> +  @retval EFI_BUFFER_TOO_SMALL   The buffer specified by ImageSize is too 
> small to
> + hold the image.
> +  @retval EFI_INVALID_PARAMETER  The Image or ImageSize was NULL.
> +  @retval EFI_OUT_OF_RESOURCES   The bitmap could not be retrieved because 
> there
> + was not enough memory.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_GET_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL

Re: [edk2] [PATCH] MdePkg: Add UEFI2.6 HII Image Ex and Image Decoder protocol definition.

2016-03-06 Thread Dong, Eric
Hi Cecil,

We found the V2 patch still has some issues need to be fixed before checking in 
the code.

ImageDecoder.h
1.  EFI_HII_IMAGE_DECODER_PROTOCOL_GUID  should be defined in ImageDecoder.h.
Like EFI_HII_IMAGE_EX_PROTOCOL_GUID in HiiImageEx.h
//
  // Global ID for the Hii Image Ex Protocol.
  //
  #define EFI_HII_IMAGE_EX_PROTOCOL_GUID \
{0x1a1241e6, 0x8f19, 0x41a9,  { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 
0x65, 0x46 }}
2.  The type of SizeOfImage is different in the spec and code.
 Code:
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_IMAGE_DECODER_GET_IMAGE_INFO)(
+  IN  EFI_HII_IMAGE_DECODER_PROTOCOL   *This,
+  IN  VOID  *Image,
+  IN  UINT32SizeOfImage,
+  IN OUT  EFI_HII_IMAGE_DECODER_IMAGE_INFO_HEADER  **ImageInfo
+  );
Spec:
typedef
EFI_STATUS
(EFIAPI *EFI_HII_IMAGE_DECODER_GET_IMAGE_INFO)(
IN CONST EFI_HII_IMAGE_DECODER_PROTOCOL *This,
IN VOID *Image,
IN UINTN SizeOfImage,
IN OUT EFI_HII_IMAGE_DECODER_IMAGE_INFO **ImageInfo
);
3. the type of BitMap  is EFI_IMAGE_OUTPUT in spec but EFI_IMAGE_INPUT in code.
  Code:
  +typedef
  +EFI_STATUS
  +(EFIAPI *EFI_HII_IMAGE_DECODER_DECODE)(
  +  IN  EFI_HII_IMAGE_DECODER_PROTOCOL   *This,
  +  IN  VOID  *Image,
  +  IN  UINTN ImageRawDataSize,
  +  IN OUT  EFI_IMAGE_INPUT   **BitMap OPTIONAL,
  +  IN  BOOLEAN   Transparent
  +  );

Spec:
  typedef
  EFI_STATUS
  (EFIAPI *EFI_HII_IMAGE_DECODER_DECODE)(
  IN CONST EFI_HII_IMAGE_DECODER_PROTOCOL *This,
  IN VOID *Image,
  IN UINTN ImageRawDataSize,
  IN OUT EFI_IMAGE_OUTPUT **Bitmap OPTIONAL,
  IN BOOLEAN Transparent
  );

HiiImageEx.h
1.  Missing "extern EFI_GUID gEfiHiiImageExProtocolGuid;" in the HiiImageEx.h 
file.


Thanks,
Eric
> -Original Message-
> From: Sheng, Cecil (HPS SW) [mailto:cecil.sh...@hpe.com]
> Sent: Friday, March 04, 2016 9:36 AM
> To: Bi, Dandan; edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming; Chang, Abner (HPS SW/FW Technologist)
> Subject: RE: [edk2] [PATCH] MdePkg: Add UEFI2.6 HII Image Ex and Image 
> Decoder protocol definition.
>
> Hi Dandan,
>
> I've corrected two places in the EFI_HII_IMAGE_DECODER_PROTOCOL.
>   1. NumberOfDecoderName in GetImageDecoderName() should be a pointer 
> because it's an OUT parameter.
>   2. the typedef for Decode() are not consistent between the protocol 
> definition and the function definition.
>
> There's an ECR to correct the second one but not the first one. However, they 
> are both incorrect in 2.6.
>
>
>
>
> Sincerely,
>
> Cecil Sheng
> ISS Firmware Development
> HPE Servers
>
> -Original Message-
> From: Bi, Dandan [mailto:dandan...@intel.com]
> Sent: Thursday, March 3, 2016 11:05 AM
> To: Sheng, Cecil (HPS SW); 
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Dong, Eric; Gao, Liming
> Subject: RE: [edk2] [PATCH] MdePkg: Add UEFI2.6 HII Image Ex and Image 
> Decoder protocol definition.
>
> Hi Cecil,
>
>  I still find that the function description are not consistent with the spec 
> in the V2 patch, you use the Summary part not the Description
> part in the spec.
> You can refer  to the definition of other protocol to double check.
> And there are two same return status  (EFI_INVALID_PARAMETER )in 
> EFI_HII_DRAW_IMAGE_EX.
> +  @retval EFI_SUCCESSThe image was successfully drawn.
> +  @retval EFI_OUT_OF_RESOURCES   Unable to allocate an output buffer for Blt.
> +  @retval EFI_INVALID_PARAMETER  The Image or Blt was NULL.
> +  @retval EFI_INVALID_PARAMETER  Any combination of Flags is invalid.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EFI_HII_DRAW_IMAGE_EX)(
> +  IN CONST  EFI_HII_IMAGE_EX_PROTOCOL   *This,
> +  INEFI_HII_DRAW_FLAGS  Flags,
> +  IN CONST  EFI_IMAGE_INPUT *Image,
> +  IN OUTEFI_IMAGE_OUTPUT**Blt,
> +  INUINTN   BltX,
> +  INUINTN   BltY
> +  );
>
> And could  you point out  the errors in the EFI_HII_IMAGE_DECODER_PROTOCOL 
> protocol definition in the spec?
> Since we don't know the issues in spec, it may has an effect on the review.
>
>
> Thanks,
> Dandan
>
>
>
>
> -Original Message-----
> From: Sheng, Cecil (HPS SW) [mailto:cecil.sh...@hpe.com]
> Sent: Wednesday, March 2, 2016 10:58 AM
> To: Bi, Dandan <dandan...@intel.com<mailto:dandan...@intel.com>>; 
> edk2-devel@l

Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-04-04 Thread Dong, Eric
> -Original Message-
> From: Michael Brown [mailto:mc...@ipxe.org]
> Sent: Saturday, April 02, 2016 12:50 AM
> To: Laszlo Ersek; Dong, Eric; Bi, Dandan
> Cc: Justen, Jordan L; edk2-devel-01; Ard Biesheuvel
> Subject: Re: [edk2] HII incompatibility between edk2 and iPXE?
> 
> On 31/03/16 14:37, Michael Brown wrote:
> >> In a nutshell, I think iPXE should:
> >> - reflect the GUID / NAME / PATH triplet from the input to the output
> >> verbatim,
> >> - for each config knob  requested, respond with
> >> =.
> >>
> >> (See also: "if a ConfigHdr is passed in with no request elements, all
> >> of the settings being abstracted for that particular ConfigHdr
> >> reference will be returned in the Results Field" -- but I think the
> >> iPXE code already handles that.)
> 
> It turns out that iPXE already does exactly what you describe as the
> correct behaviour here.  :)  We do reflect {GUID,NAME,PATH} verbatim.
> The ASSERT() happens only when EDK2 passes in a NULL Request.  iPXE
> currently returns the full list of settings being abstracted (as per the
> spec) but without any ConfigHdr, since we have no GUID, NAME or PATH to
> reflect back.
> 
> I note that OvmfPkg/PlatformDxe/Platform.c's ExtractConfig() handles a
> NULL Request by returning EFI_INVALID_PARAMETER.  This originates from
> HiiBlockToConfig(), which does:
> 
>if (Block == NULL || ConfigRequest == NULL) {
>  *Progress = ConfigRequest;
>  return EFI_INVALID_PARAMETER;
>}
> 
> This code in OvmfPkg/PlatformDxe/Platform.c seems to violate the spec,
> but seems to cause the rest of EDK2 to behave sensibly.  If I patch iPXE
> to violate the spec in the same way, by adding:
> 
> if ( ! ( request && request[0] ) ) {
> DBGC ( snpdev, "SNPDEV %p ExtractConfig ignoring malformed "
>"request\n", snpdev );
> return EFI_INVALID_PARAMETER;
> }
> 
> then I no longer get an ASSERT() from EDK2.
> 
> Should I apply the above patch to iPXE, to cause it to match the
> spec-violating (but non-crashing) behaviour of
> OvmfPkg/PlatformDxe/Platform.c?
> 
> 
> 
> On a separate but related note: The ConfigHdr portion of Request and
> Response seems to contain absolutely zero information by the time it
> reaches EFI_HII_CONFIG_ACCESS_PROTOCOL.  As far as I can tell, it is
> meaningful only to EFI_HII_CONFIG_ROUTING_PROTOCOL and a sensible API
> design would never have exposed it to EFI_HII_CONFIG_ACCESS_PROTOCOL
> instances.
> 
> Does the ConfigHdr have any meaning for EFI_HII_CONFIG_ACCESS_PROTOCOL,
> or is it just a pointless blob of noise?

The GUID/NAME value in the ConfigHdr is get from the storage used in this 
driver. If one driver has more than one storage, the Guid + Name specify which 
storage info will be return.

> 
> Michael
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/8] MdePkg: Add definition for TCG Storage Core and Opal specs.

2016-03-28 Thread Dong, Eric
Got it, I will update the code before I check in the code.

> -Original Message-
> From: Yao, Jiewen
> Sent: Tuesday, March 29, 2016 9:52 AM
> To: Tian, Feng; Dong, Eric; edk2-devel@lists.01.org
> Cc: Tian, Feng
> Subject: RE: [Patch 1/8] MdePkg: Add definition for TCG Storage Core and Opal 
> specs.
> 
> Hi
> Can we add TCG prefix for all data structure to avoid namespace conflict?
> 
> For example:
> 
>  +typedef struct {
>  +  UINT8   Data : 6;
>  +  UINT8   Sign : 1;
>  +  UINT8   IsZero : 1;
>  +} TINY_ATOM_BITS;
> 
> 
>  +// Security Protocol IDs
>  +#define SECURITY_PROTOCOL_INFO   0x00
>  +#define OPAL_SECURITY_PROTOCOL_1 0x01
>  +#define OPAL_SECURITY_PROTOCOL_2 0x02
>  +#define SECURITY_PROTOCOL_TCG3   0x03
>  +#define SECURITY_PROTOCOL_TCG4   0x04
>  +#define SECURITY_PROTOCOL_TCG5   0x05
>  +#define SECURITY_PROTOCOL_TCG6   0x06
>  +#define SECURITY_PROTOCOL_CBCS   0x07
>  +#define SECURITY_PROTOCOL_TAPE_DATA  0x20
>  +#define SECURITY_PROTOCOL_DATA_ENCRYPT_CONFIG0x21
>  +#define SECURITY_PROTOCOL_SA_CREATION_CAPS   0x40
>  +#define SECURITY_PROTOCOL_IKEV2_SCSI 0x41
>  +#define SECURITY_PROTOCOL_JEDEC_UFS  0xEC
>  +#define SECURITY_PROTOCOL_SDCARD_SECURITY0xED
>  +#define SECURITY_PROTOCOL_IEEE_1667  0xEE
>  +#define SECURITY_PROTOCOL_ATA_DEVICE_SERVER_PASS 0xEF
> 
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Tian, Feng
> > Sent: Tuesday, March 29, 2016 9:42 AM
> > To: Dong, Eric <eric.d...@intel.com>; edk2-devel@lists.01.org
> > Cc: Tian, Feng <feng.t...@intel.com>
> > Subject: Re: [edk2] [Patch 1/8] MdePkg: Add definition for TCG Storage Core
> > and Opal specs.
> >
> > Series reviewed-by: Feng Tian <feng.t...@intel.com>
> >
> > Thanks
> > Feng
> >
> > -Original Message-
> > From: Dong, Eric
> > Sent: Monday, March 21, 2016 11:17 AM
> > To: edk2-devel@lists.01.org
> > Cc: Tian, Feng <feng.t...@intel.com>
> > Subject: [Patch 1/8] MdePkg: Add definition for TCG Storage Core and Opal
> > specs.
> >
> > These definition is defined in the TCG storage core spec and TCG storage
> > Opal spec.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Eric Dong <eric.d...@intel.com>
> > Cc: Feng Tian <feng.t...@intel.com>
> > ---
> >  MdePkg/Include/IndustryStandard/TcgStorageCore.h | 378
> > +++
> > MdePkg/Include/IndustryStandard/TcgStorageOpal.h | 180 +++
> >  2 files changed, 558 insertions(+)
> >  create mode 100644 MdePkg/Include/IndustryStandard/TcgStorageCore.h
> >  create mode 100644 MdePkg/Include/IndustryStandard/TcgStorageOpal.h
> >
> > diff --git a/MdePkg/Include/IndustryStandard/TcgStorageCore.h
> > b/MdePkg/Include/IndustryStandard/TcgStorageCore.h
> > new file mode 100644
> > index 000..9ecd7fa
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/TcgStorageCore.h
> > @@ -0,0 +1,378 @@
> > +/** @file
> > +  TCG defined values and structures.
> > +
> > +Copyright (c) 2016, Intel Corporation. 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.
> > +
> > +**/
> > +
> > +#ifndef _TCG_STORAGE_CORE_H_
> > +#define _TCG_STORAGE_CORE_H_
> > +
> > +#include 
> > +
> > +#pragma pack(1)
> > +
> > +/// UID in host native byte order
> > +typedef UINT64 TCG_UID;
> > +
> > +#define TCG_TO_UID(b0, b1, b2, b3, b4, b5, b6, b7) (TCG_UID)( \
> > +  (UINT64)(b0) | \
> > +  ((UINT64)(b1) << 8)  | \
> > +  ((UINT64)(b2) << 16) | \
> > +  ((UINT64)(b3) << 24) | \
> > +  ((UINT64)(b4) << 32) | \
> > +  ((UINT64)(b5) << 40) | \
> > +  ((UINT64)(b6) << 48) | \
> > +  ((UINT64)(b7) << 56))
> > +
> > +typedef struct {
> > +  UINT32 ReservedBE;
> > +  UINT16   

Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-03-30 Thread Dong, Eric
This error is caused by iPXE driver not return the correct string in 
EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig() function. Base on the spec 
requirement, if the function return success, the Results string should follow 
format. But the data returned by iPXE driver is not follow 
this rule, so the ASSERT raised. Detail can check UEFI spec 2.6 chapter 
33.2.1.5 and 33.5.

Thanks,
Eric
-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: Tuesday, March 29, 2016 11:21 PM
To: Bi, Dandan; Dong, Eric; Michael Brown
Cc: edk2-devel-01; Justen, Jordan L; Ard Biesheuvel
Subject: HII incompatibility between edk2 and iPXE?

Hi,

recent edk2 commit 8a45f80edad4 ("MdeModulePkg: Make HII configuration settings 
available to OS runtime") seems to trigger an issue between edk2 and iPXE.

(Note: I'm not saying that 8a45f80edad4 causes the issue, just that it exposes 
it.)

Namely, when you boot a brand new QEMU VM with OVMF (and iPXE presented in the 
NIC's option ROM), then an HII ASSERT() fails. I've come across the issue 
report in 
<https://www.redhat.com/archives/vfio-users/2016-March/msg00153.html>, 
reproduced it, and collected some data to assist with the analysis.

The failed assertion is:

> ASSERT MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c(1256): 
> TmpRequest != ((void *) 0)

Here's the edk2 stack dump:

> #0  0x7fda4070 in CpuDeadLoop ()
> at MdePkg/Library/BaseLib/CpuDeadLoop.c:37
> #1  0x7fda30d5 in DebugAssert (
> FileName=0x7fda47d8 
> "MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c", LineNumber=1256, 
> Description=0x7fda4a20 "TmpRequest != ((void *) 0)")
> at OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c:153
> #2  0x7fd8166f in GetElementsFromRequest (ConfigRequest=0x7898)
> at MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c:1256
> #3  0x7fd8629c in HiiConfigRoutingExportConfig (This=0x7fda9190, 
> Results=0x7ff5e9f0)
> at MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c:4242
> #4  0x7fd90e02 in HiiGetConfigurationSetting (This=0x7fda9138)
> at MdeModulePkg/Universal/HiiDatabaseDxe/Database.c:2815
> #5  0x7fd7c7ae in OnReadyToBoot (Event=0x7f645098, Context=0x0)
> at MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c:147
> #6  0x7ff7c785 in CoreDispatchEventNotifies (Priority=8)
> at MdeModulePkg/Core/Dxe/Event/Event.c:200
> #7  0x7ff7bdda in CoreRestoreTpl (NewTpl=4)
> at MdeModulePkg/Core/Dxe/Event/Tpl.c:131
> #8  0x7ff6a030 in CoreReleaseLock (Lock=0x7ff9ac70)
> at MdeModulePkg/Core/Dxe/Library/Library.c:102
> #9  0x7ff7c560 in CoreReleaseEventLock ()
> at MdeModulePkg/Core/Dxe/Event/Event.c:119
> #10 0x7ff7c9cc in CoreNotifySignalList (EventGroup=0x7eeed8d0)
> at MdeModulePkg/Core/Dxe/Event/Event.c:276
> #11 0x7ff7ce60 in CoreSignalEvent (UserEvent=0x7eeed898)
> at MdeModulePkg/Core/Dxe/Event/Event.c:564
> #12 0x7ebe610c in EfiSignalEventReadyToBoot ()
> at MdePkg/Library/UefiLib/UefiNotTiano.c:235
> #13 0x7ebde969 in BdsLibBootViaBootOption (Option=0x7eeecd18, 
> DevicePath=0x7eeeb958,
> ExitDataSize=0x7ff5ed38, ExitData=0x7ff5ed30)
> at IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:2279
> #14 0x7ebaf0a3 in BdsBootDeviceSelect ()
> at IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:286
> #15 0x7ebafc1a in BdsEntry (This=0x7ebfbec0)
> at IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c:659
> #16 0x7ff6096a in DxeMain (HobStart=0x7fd14018)
> at MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c:517
> #17 0x7ff5f71d in ProcessModuleEntryPointList (HobStart=0x7bfde000)
> at 
> Build/OvmfX64/DEBUG_GCC48/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/AutoGen.c:423
> #18 0x7ff5f26d in _ModuleEntryPoint (HobStart=0x7bfde000)
> at MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.c:54
> #19 0x in ?? ()

According to my (superficial) tracing, the following happens (see stack frame 
#3 above): the HiiConfigRoutingExportConfig() function in 
"MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c" repeatedly calls 
EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig(), on drivers / handles that 
export that protocol. Subsequently, each serialized configuration (in the 
output parameter called "AccessResults") is passed to GetElementsFromRequest(), 
in the same C source file.

The GetElementsFromRequest() function asserts that the "PATH=" substring is 
present in the AccessResults string. This assertion breaks down when iPXE 
returns the following result string to HiiConfigRoutingExportConfig():

> gateway==

Note that my only reason for pointing at iPXE is this result str

Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-03-30 Thread Dong, Eric
> On 29/03/16 16:20, Laszlo Ersek wrote:
> > recent edk2 commit 8a45f80edad4 ("MdeModulePkg: Make HII
> configuration settings available to OS runtime") seems to trigger an issue
> between edk2 and iPXE.
> 
> Thanks for debugging this!
> 
> Is iPXE misbehaving here?  At the time that I implemented our HII support,
> the HII_CONFIG_ROUTING_PROTOCOL in EDK2 was so badly broken that I
> couldn't even begin testing with it.  (Any attempt to use it, with or without
> iPXE present, would immediately crash with a NULL pointer dereference, and
> the relevant EDK2 code was so confused that I couldn't even start to guess
> what it was trying to do.)

Yes, where the error is you can check my former mail for this list.

> 
> >>
> gateway===
> =
> >>
> -path==&
> usern
> >> ame
> >
> > Note that my only reason for pointing at iPXE is this result string 
> > precisely.
> Namely, I grepped the edk2 source for various tokens in the above (like
> "scriptlet" and "skip-san-boot"), and came up empty. Then I grepped iPXE for
> the same tokens, and I found them (in "src/usr/autoboot.c"). I think the
> function that actually formats the response string in iPXE is
> efi_snp_hii_extract_config() [src/interface/efi/efi_snp_hii.c].
> 
> Yes, that's where we generate it, and that result string is very plausible 
> for an
> unconfigured iPXE SNP instance.
> 
>  From reading the spec, I can't tell whether what iPXE is doing is correct or
> not.  Any input appreciated.
> 

I download the iPXE code and check the hii related code. I'm very confused why 
you dynamic generate the ifr data? Why not use vfr file to descript the form 
data? Use vfr file is much easy than dynamic generate it. Also I found you use 
name/value store to save the data, maybe it’s a good choice for your case, but 
it's cost much more effort when implement the EFI Config Access Protocol.

> Thanks,
> 
> Michael
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] * MdePkg: Add UEFI2.6 HII Font protocol definitions.

2016-03-29 Thread Dong, Eric
Hi Cecil,

Two comments for this patch:
1. The patch is out of date, I can't apply this patch with latest code base. 
Can you help to regenerate it base on latest code base?
2. Two much useless changes in UefiInternalFormRepresentation.h (just like 
below changes), please update the patch to remove all the use less changes.

> -/// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 
pixels, which is large enough
> +/// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 
pixels, which is large enough
...
> -  /// The Unicode representation of the glyph. The term weight is the
> +  /// The Unicode representation of the glyph. The term weight is the

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cecil 
> Sheng
> Sent: Tuesday, March 29, 2016 2:30 PM
> To: edk2-devel@lists.01.org
> Cc: el...@hpe.com; Cecil Sheng; Gao, Liming
> Subject: [edk2] [PATCH] * MdePkg: Add UEFI2.6 HII Font protocol definitions.
> 
> Add the definition for the new UEFI 2.6 EFI_HII_FONT_EX_PROTOCOL and
> EFI_HII_FONT_GLYPH_GENERATOR_PROTOCOL.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> Reviewed-by: Samer El-Haj-Mahmoud 
> Reviewed-by: Abner Chang 
> ---
>  MdePkg/Include/Protocol/HiiFontEx.h| 313 
> +
>  MdePkg/Include/Protocol/HiiFontGlyphGenerator.h| 102 +++
>  .../Include/Uefi/UefiInternalFormRepresentation.h  | 158 ++-
>  MdePkg/MdePkg.dec  |   6 +
>  4 files changed, 509 insertions(+), 70 deletions(-)
>  create mode 100644 MdePkg/Include/Protocol/HiiFontEx.h
>  create mode 100644 MdePkg/Include/Protocol/HiiFontGlyphGenerator.h
> 
> diff --git a/MdePkg/Include/Protocol/HiiFontEx.h 
> b/MdePkg/Include/Protocol/HiiFontEx.h
> new file mode 100644
> index 000..9fe3f77
> --- /dev/null
> +++ b/MdePkg/Include/Protocol/HiiFontEx.h
> @@ -0,0 +1,313 @@
> +/** @file
> +The EFI HII Font Ex protocol defines an extension to the EFI HII Font 
> protocol
> +which enables various new capabilities.
> +
> +(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
> +This program and the accompanying materials are licensed and made available 
> under
> +the terms and conditions of the BSD License that 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.
> +
> +**/
> +#ifndef HII_FONT_EX_H
> +#define HII_FONT_EX_H
> +
> +#include 
> +
> +typedef struct _EFI_HII_FONT_EX_PROTOCOL EFI_HII_FONT_EX_PROTOCOL;
> +
> +#define EFI_HII_FONT_EX_PROTOCOL_GUID \
> +{ 0x849e6875, 0xdb35, 0x4df8, 0xb4, \
> +{0x1e, 0xc8, 0xf3, 0x37, 0x18, 0x7, 0x3f }}
> +
> +/**
> +  Render a string to a bitmap or to the display.
> +
> +  This function is similar to EFI_HII_FONT_PROTOCOL.StringToImage(). The 
> difference
> +  is that this function will locate all EFI_HII_FONT_GLYPH_GENERATOR_PROTOCOL
> +  instances that are installed in the system when the glyph in the string 
> with
> +  the given font information is not found in the current HII glyph database. 
> The
> +  function will attempt to generate the glyph information and the bitmap 
> using the
> +  first EFI_HII_FONT_GLYPH_GENERATOR_PROTOCOL instance that supports the 
> requested
> +  font information in the EFI_FONT_DISPLAY_INFO.
> +
> +  @param  ThisA pointer to the EFI_HII_FONT_EX_PROTOCOL 
> instance.
> +  @param  Flags   Describes how the string is to be drawn.
> +  @param  String  Points to the null-terminated string to be
> +  displayed.
> +  @param  StringInfo  Points to the string output information,
> +  including the color and font.  If NULL, 
> then the
> +  string will be output in the default 
> system font
> +  and color.
> +  @param  Blt If this points to a non-NULL on entry, this
> +  points to the image, which is Width pixels 
>   wide
> +  and Height pixels high. The string will be 
> drawn
> +  onto this image and
> +  EFI_HII_OUT_FLAG_CLIP is implied. If this 
> points
> +  to a NULL on entry, then a  
> buffer
> +  will be allocated to hold the generated 
> image and
> +  the pointer updated on exit. It is the 
> caller's
> +  responsibility to free this 

Re: [edk2] [patch 1/2] MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for ChooseFile handler

2016-03-23 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Tuesday, March 22, 2016 11:37 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch 1/2] MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for 
> ChooseFile handler
> 
> The BootMaintenanceManagerUiLib use ChooseFile() from FileExplorerLib
> to select files. And the third parameter in ChooseFile() is CHOOSE_HANDLER,
> per the definition of CHOOSE_HANDLER, it must use EFIAPI as the calling
> convention. But the calling convention was not specified for following
> handlers: CreateBootOptionFromFile, CreateDriverOptionFromFile,
> BootFromFile. Now specifies the calling convention for those functions.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h   | 3 
> +++
>  MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c  | 3 
> +++
>  2 files changed, 6 insertions(+)
> 
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> index 2c93446..d607314 100644
> --- 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> +++ 
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> @@ -1303,10 +1303,11 @@ BootMaintCallback (
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
> 
>  **/
>  BOOLEAN
> +EFIAPI
>  CreateBootOptionFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>);
> 
>  /**
> @@ -1316,10 +1317,11 @@ CreateBootOptionFromFile (
> 
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
>  **/
>  BOOLEAN
> +EFIAPI
>  CreateDriverOptionFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>);
> 
>  /**
> @@ -1330,10 +1332,11 @@ CreateDriverOptionFromFile (
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
> 
>  **/
>  BOOLEAN
> +EFIAPI
>  BootFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>);
> 
>  //
> diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> index 0bd3170..7a014c9 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
> @@ -855,10 +855,11 @@ GetDriverOrder (
> 
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
>  **/
>  BOOLEAN
> +EFIAPI
>  BootFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>)
>  {
>EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
> @@ -927,10 +928,11 @@ ReSendForm(
> 
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
>  **/
>  BOOLEAN
> +EFIAPI
>  CreateBootOptionFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>)
>  {
>return ReSendForm(FilePath, FORM_BOOT_ADD_ID);
> @@ -944,10 +946,11 @@ CreateBootOptionFromFile (
>@retval TRUE   Exit caller function.
>@retval FALSE  Not exit caller function.
> 
>  **/
>  BOOLEAN
> +EFIAPI
>  CreateDriverOptionFromFile (
>IN EFI_DEVICE_PATH_PROTOCOL*FilePath
>)
>  {
>return ReSendForm(FilePath, FORM_DRV_ADD_FILE_ID);
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] HII incompatibility between edk2 and iPXE?

2016-03-31 Thread Dong, Eric
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, March 31, 2016 6:14 PM
> To: Michael Brown; Dong, Eric; Bi, Dandan
> Cc: edk2-devel-01; Justen, Jordan L; Ard Biesheuvel
> Subject: Re: HII incompatibility between edk2 and iPXE?
>
> On 03/31/16 06:43, Michael Brown wrote:
> > On 31/03/16 02:17, Dong, Eric wrote:
> >>> Those sections of the UEFI spec are so badly written that I cannot
> >>> begin to guess what might count as either correct or incorrect.
> >>>
> >>> Could you please give a concrete example of what you think iPXE
> >>> should be returning here?
> >>>
> >> We have a sample driver in MdeModulePkg/Universal/DriverSampleDxe.
> It
> >> also use a Name/Value varstore. You can reference that driver about
> >> how to implement the EFI Config Access Protocol.
> >
> > That doesn't answer my question.  The answer I'm looking for is the
> > actual string that you expect iPXE to be returning.  This should be a
> > one-line answer in the form of a string.
> >
> > Solid examples such as this are sorely lacking from both this part of
> > the UEFI specification and the EDK2 codebase.
> >
> > Could you please give a concrete example of what you think iPXE should
> > be returning here?
>
> I can't give you a concrete example, but I think the format can be deduced
> from the BNF in 33.2.1 "String Syntax", and from the documentation of
> EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig().
>
> iPXE's ExtractConfig() protocol member function is called with a
> -formatted input string, and it is expected to return a
> -formatted output string.
>
> Let's try to apply the grammar's rules for the input:
>
>
> -> 
>*
> -> ’&’
>’&’
>
>*
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>*
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>*
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>(‘&’ | ‘&’)*
>
> Since -- I think -- you don't generate a form (IFR) that implies varstore- /
> block-based representation, I *think* that in the input (= request) string 
> that
> you get, the second branch of the alternative visible above will be used 
> (i.e.,
> "Label"). In short, you should be getting a string like
>
> GUID=== represented as hex number>&&&...&
>
> where the s should correspond to the configuration knobs that the
> iPXE driver exports (i.e., they come from the IFR -- see your
> efi_snp_hii_questions() function).
>
> ... You seem to have a DBGC for the request string in place already (in
> efi_snp_hii_extract_config()), so the above should be easy to confirm.
>
> In response, I think the following grammar substitutions should apply:
>
>
> -> 
>[‘&’ ]*
> -> 
> -> 
>
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>*
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>(‘&’ | ‘&’)*
>
> Similarly to the request, the second branch of the alternative should be
> employed, I think. So, substituting the  rule:
>
> -> ‘GUID=’’&’
>‘NAME=’’&’
>‘PATH=’
>(‘&’ (’=’ | ’=’))*
>
> Which translates to the following response string:
>
> GUID=== represented as hex
> number>&=&=&...&= >
>
> In a nutshell, I think iPXE should:
> - reflect the GUID / NAME / PATH triplet from the input to the output
> verbatim,
> - for each config knob  requested, respond with
> =.
>
> (See also: "if a ConfigHdr is passed in with no request elements, all of the
> settings being abstracted for that particular ConfigHdr reference will be
> returned in the Results Field" -- but I think the iPXE code already handles
> that.)
>
> ... I suspect iPXE's ExtractConfig() logic is almost complete, except it 
> doesn't
> reflect GUID / NAME / PATH (= the "routing information") in the output.
> Shouldn't be hard to try out.

From former debug info, I think driver code should enhanced like below:
1.  Enhance the Results string for ExtractConfig function like below:
Request = “GUID===&…”
Results = “GUIDValue1=Value2=Value3…”
PS: Red string you can get from the input Request string. Blue string is the 
true value for each knob in your driver.
 EFI_STATUS
 (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG ) (
 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
 IN CONST EFI_STRING  Request,
 OUT EFI_STRING *Progress,
 OUT EFI_STRING  *Results
 );

Also I think maybe you need to enhance the RouteConfig function. The input 
Configuration string is like below. you need to get the value filed for each 
knob and set it to your driver. This value is updated by end user and press 
save button to save it.
Configuration = “GUIDValue1=Value2=Value3…”

 EFI_STATUS
 (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG ) (
 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
 IN CONST EFI_STRING  Configuration,
 OUT EFI_STRING *Progress
 );

>
> Thanks,
> Laszlo

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] Save the Boot mode info for later use.

2016-05-18 Thread Dong, Eric
Please help to check in the code.

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, May 19, 2016 9:25 AM
> To: Dong, Eric; edk2-devel@lists.01.org
> Subject: RE: [edk2] [Patch 0/2] Save the Boot mode info for later use.
> 
> Reviewed-by: Liming Gao <liming@intel.com>
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric 
> Dong
> Sent: Wednesday, May 18, 2016 1:13 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch 0/2] Save the Boot mode info for later use.
> 
> In current code, we use different output modes for boot phase
> and setup phase. When split BootManagerUiLib/BootMaintenanceMangerUiLib
> from UiApp code, we not add logic to save the boot phase mode
> info which will be used later. This change add this logic.
> 
> Eric Dong (2):
>   MdeModulePkg BootManagerUiLib: Save mode info for later use.
>   BootMaintenanceMangerUiLib: Save mode info for later use.
> 
>  .../BootMaintenanceManagerUiLib/BootMaintenance.c  | 75 
> ++
>  .../BootMaintenanceManagerUiLib.inf|  4 +-
>  .../Library/BootManagerUiLib/BootManager.c | 74 +
>  .../Library/BootManagerUiLib/BootManagerUiLib.inf  |  5 +-
>  4 files changed, 156 insertions(+), 2 deletions(-)
> 
> --
> 2.6.4.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 0/2] Change code for easy customization.

2016-05-12 Thread Dong, Eric
Extra Notes for this change:

It will do some small  changes for the current front page and 
BootMaintenanceManager(BMM) page menus. Detail see below pic. Left is the 
current UI and right is the new UI.

[cid:image014.jpg@01D1AC5A.DA2643F0][cid:image016.jpg@01D1AC5A.DA2643F0]

[cid:image018.jpg@01D1AC5A.DA2643F0][cid:image020.jpg@01D1AC5A.DA2643F0]



About the changes for "Boot Next" and "Time Out" menus in BMM page, just move 
the menus from the nest form to the BMM form for easy use.



Thanks,

Eric





> -Original Message-

> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric 
> Dong

> Sent: Thursday, May 12, 2016 4:32 PM

> To: edk2-devel@lists.01.org

> Subject: [edk2] [Patch 0/2] Change code for easy customization.

>

> Base on the former changes, we change code in front page and

> BMM page to make they easy to be customzied.

>

> Eric Dong (2):

>   BootMaintenanceManagerUiLib: change code for customization.

>   MdeModulePkg UiApp: change code for easy customization.

>

>  MdeModulePkg/Application/UiApp/FrontPage.c | 662 
> +

>  MdeModulePkg/Application/UiApp/FrontPage.h |   7 +-

>  .../Application/UiApp/FrontPageCustomizedUi.c  | 132 

>  .../Application/UiApp/FrontPageCustomizedUi.h  |  88 +++

>  .../UiApp/FrontPageCustomizedUiSupport.c   | 659 

>  .../UiApp/FrontPageCustomizedUiSupport.h   | 144 +

>  .../Application/UiApp/FrontPageStrings.uni |  22 +-

>  MdeModulePkg/Application/UiApp/FrontPageVfr.Vfr|  64 +-

>  MdeModulePkg/Application/UiApp/Language.c  | 309 --

>  MdeModulePkg/Application/UiApp/Language.h  |  48 --

>  MdeModulePkg/Application/UiApp/String.c| 253 +++-

>  MdeModulePkg/Application/UiApp/String.h|   9 +

>  MdeModulePkg/Application/UiApp/UiApp.inf   |   6 +-

>  .../BootMaintenanceManagerUiLib/BootMaintenance.c  | 153 +

>  .../BootMaintenanceManager.h   |  21 +-

>  .../BootMaintenanceManager.vfr |  97 +--

>  .../BootMaintenanceManagerCustomizedUi.c   |  99 +++

>  .../BootMaintenanceManagerCustomizedUi.h   |  60 ++

>  .../BootMaintenanceManagerCustomizedUiSupport.c| 471 +++

>  .../BootMaintenanceManagerCustomizedUiSupport.h| 146 +

>  .../BootMaintenanceManagerStrings.uni  |   4 -

>  .../BootMaintenanceManagerUiLib.inf|   4 +

>  .../Library/BootMaintenanceManagerUiLib/FormGuid.h |   6 +-

>  .../BootMaintenanceManagerUiLib/UpdatePage.c   | 132 

>  24 files changed, 2296 insertions(+), 1300 deletions(-)

>  create mode 100644 MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c

>  create mode 100644 MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.h

>  create mode 100644 
> MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c

>  create mode 100644 
> MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.h

>  delete mode 100644 MdeModulePkg/Application/UiApp/Language.c

>  delete mode 100644 MdeModulePkg/Application/UiApp/Language.h

>  create mode 100644 
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUi.c

>  create mode 100644 
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUi.h

>  create mode 100644 
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c

>  create mode 100644 
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.h

>

> --

> 2.6.4.windows.1

>

> ___

> edk2-devel mailing list

> edk2-devel@lists.01.org

> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/2] Fix GCC build failures introduced with a85be3ae48a8

2016-05-15 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, May 13, 2016 5:51 PM
> To: edk2-devel-01
> Cc: Ard Biesheuvel; Dong, Eric; Gerd Hoffmann; Gao, Liming
> Subject: [PATCH 0/2] Fix GCC build failures introduced with a85be3ae48a8
> 
> ... namely "BootMaintenanceManagerUiLib: change code for customization."
> 
> The first patch fixes a trivial issue.
> 
> The second patch fixes a genuine bug.
> 
> I'm CC'ing Ard on the blurb and the second patch only so he can see his
> work pay off; I'm not expecting a review from him.
> 
> The build failures were reported by Gerd's Jenkins CI.
> 
> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Gerd Hoffmann <kra...@redhat.com>
> Cc: Liming Gao <liming@intel.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (2):
>   MdeModulePkg/BootMaintenanceManagerUiLib: remove unused but set
> variable
>   MdeModulePkg/BootMaintenanceManagerUiLib: hide library-internal symbol
> 
>  
> MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
>  | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> --
> 1.8.3.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/SetupBrowser: Should free ConfigResp when it no longer be used

2016-05-12 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, May 11, 2016 3:17 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [patch] MdeModulePkg/SetupBrowser: Should free ConfigResp when it no 
> longer be used
> 
> When submit form fail, the progress point to the first fail part
> in ConfigResp, so should free the ConfigResp after Progrss has
> been processed.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c 
> b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> index 23094f8..f649e04 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> @@ -3226,22 +3226,23 @@ SubmitForForm (
>  Status = mHiiConfigRouting->RouteConfig (
>mHiiConfigRouting,
>ConfigResp,
>
>);
> -FreePool (ConfigResp);
> 
>  if (EFI_ERROR (Status)) {
>//
>// Submit fail, to get the RestoreConfigRequest and SyncConfigRequest.
>//
>SubmitFormFail = TRUE;
>GetSyncRestoreConfigRequest (ConfigInfo->Storage, 
> ConfigInfo->ConfigRequest, Progress, >RestoreConfigRequest,
> >SyncConfigRequest);
>InsertTailList (, 
> >SaveFailLink);
> +  FreePool (ConfigResp);
>continue;
>  }
> 
> +FreePool (ConfigResp);
>  //
>  // 3. Config success, update storage shadow Buffer, only update the data 
> belong to this form.
>  //
>  SynchronizeStorage (ConfigInfo->Storage, ConfigInfo->ConfigRequest, 
> TRUE);
>}
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/HiiDatabaseDxe: Fix the VS2010/VS2012 build fail

2016-04-20 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Thursday, April 21, 2016 10:07 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg/HiiDatabaseDxe: Fix the VS2010/VS2012 build fail
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> index 5e778fa..24b6b24 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> @@ -872,10 +872,12 @@ CompareAndMergeDefaultString (
>BlockPtr = NULL;
>AltConfigHdrPtrNext  = NULL;
>StringPtrNext= NULL;
>ConfigAltResp= NULL;
>AltCfgRespBackup = NULL;
> +  TempChar = L'\0';
> +  TempCharA= L'\0';
>ConfigAltRespChanged = FALSE;
> 
>//
>//To find the  with AltConfigHdr in DefaultAltCfgResp, ignore 
> other  which follow it.
>//
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v2] SecurityPkg OpalPasswordDxe: Error handling enhance when input password.

2016-05-09 Thread Dong, Eric
Clarify V2 patch include below changes:
"unkown" -> "unknown"

"continue boot?." -> "continue boot?"

"Press Esc" -> "Press ESC"

L"Confirm: Not unlock device and continue boot?.",   ->  L"Confirm: keep lock 
status and continue boot?",



Also refine the patch comments.

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Eric 
> Dong
> Sent: Tuesday, May 10, 2016 8:35 AM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng
> Subject: [edk2] [Patch v2] SecurityPkg OpalPasswordDxe: Error handling 
> enhance when input password.
> 
> Enhance the error handling:
> 1. When device in unlock status and user input ESC, force shutdown.
> 2. When user reach max retry count, force shutdown.
> 
> Cc: Feng Tian 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Eric Dong 
> ---
>  SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c | 69 
> +++
>  1 file changed, 47 insertions(+), 22 deletions(-)
> 
> diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c 
> b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c
> index 7c6deb8..68ec9dc 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c
> @@ -263,6 +263,7 @@ OpalDriverRequestPassword (
>EFI_INPUT_KEY   Key;
>OPAL_SESSIONSession;
>BOOLEAN PressEsc;
> +  BOOLEAN Locked;
> 
>if (Dev == NULL) {
>  return;
> @@ -277,33 +278,56 @@ OpalDriverRequestPassword (
>  Session.MediaId = Dev->OpalDisk.MediaId;
>  Session.OpalBaseComId = Dev->OpalDisk.OpalBaseComId;
> 
> +Locked = OpalDeviceLocked (>OpalDisk.SupportedAttributes, 
> >OpalDisk.LockingFeature);
> +
>  while (Count < MAX_PASSWORD_TRY_COUNT) {
>Password = OpalDriverPopUpHddPassword (Dev, );
>if (PressEsc) {
> -//
> -// User not input password and press ESC, keep device in lock status 
> and continue boot.
> -//
> -do {
> -  CreatePopUp (
> -  EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
> -  ,
> -  L"Confirm: Not unlock device and continue boot?.",
> -  L"Press ENTER to confirm, Press Esc to input password",
> -  NULL
> -  );
> -} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != 
> CHAR_CARRIAGE_RETURN));
> -
> -if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
> -  gST->ConOut->ClearScreen(gST->ConOut);
> +if (Locked) {
>//
> -  // Keep lock and continue boot.
> +  // Current device in the lock status and
> +  // User not input password and press ESC,
> +  // keep device in lock status and continue boot.
>//
> -  return;
> +  do {
> +CreatePopUp (
> +EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
> +,
> +L"Confirm: keep lock status and continue boot?",
> +L"Press ENTER to confirm, Press ESC to input password",
> +NULL
> +);
> +  } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != 
> CHAR_CARRIAGE_RETURN));
> +
> +  if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
> +gST->ConOut->ClearScreen(gST->ConOut);
> +//
> +// Keep lock and continue boot.
> +//
> +return;
> +  } else {
> +//
> +// Let user input password again.
> +//
> +continue;
> +  }
>  } else {
>//
> -  // Let user input password again.
> +  // Current device in the unlock status and
> +  // User not input password and press ESC,
> +  // Shutdown the device.
>//
> -  continue;
> +  do {
> +CreatePopUp (
> +EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
> +,
> +L"Warning: system in unknown status, must shutdown!",
> +L"Press ENTER to shutdown.",
> +NULL
> +);
> +  } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
> +
> +  gRT->ResetSystem (EfiResetShutdown, EFI_SUCCESS, 0, NULL);
>  }
>}
> 
> @@ -313,7 +337,7 @@ OpalDriverRequestPassword (
>}
>PasswordLen = (UINT32) AsciiStrLen(Password);
> 
> -  if (OpalDeviceLocked (>OpalDisk.SupportedAttributes, 
> >OpalDisk.LockingFeature)) {
> +  if (Locked) {
>  Ret = OpalSupportUnlock(, Password, PasswordLen, 
> Dev->OpalDevicePath);
>} else {
>  Ret = OpalSupportLock(, Password, PasswordLen, 
> Dev->OpalDevicePath);
> @@ -349,12 +373,13 @@ OpalDriverRequestPassword (
>  CreatePopUp (
>  EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,

Re: [edk2] [PATCH v2] Security/OpalPasswordDxe: Enhance the logic in RouteConfig/ExtractConfig

2016-05-09 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Tuesday, May 10, 2016 10:52 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [edk2] [PATCH v2] Security/OpalPasswordDxe: Enhance the logic in 
> RouteConfig/ExtractConfig
> 
> Make the implementation of RouteConfig/ExtractConfig function
> follow the UEFI spec.
> 
> Notes:
>   v1->v2:
>   - Correct the storage name.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c 
> b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> index 3fb3553..33f74dd 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c
> @@ -28,10 +28,12 @@ extern UINT8  OpalPasswordFormBin[];
>  // This Data array is ready to be used as input of HiiAddPackages() to
>  // create a packagelist (which contains Form packages, String packages, etc).
>  //
>  extern UINT8  OpalPasswordDxeStrings[];
> 
> +CHAR16  OpalPasswordStorageName[] = L"OpalHiiConfig";
> +
>  EFI_HII_CONFIG_ACCESS_PROTOCOL gHiiConfigAccessProtocol;
> 
>  //
>  // Handle to the list of HII packages (forms and strings) for this driver
>  //
> @@ -1143,10 +1145,17 @@ RouteConfig(
>  {
>if (Configuration == NULL || Progress == NULL) {
>  return (EFI_INVALID_PARAMETER);
>}
> 
> +  *Progress = Configuration;
> +  if (!HiiIsConfigHdrMatch (Configuration, , 
> OpalPasswordStorageName)) {
> +return EFI_NOT_FOUND;
> +  }
> +
> +  *Progress = Configuration + StrLen (Configuration);
> +
>return EFI_SUCCESS;
>  }
> 
>  /**
>This function allows a caller to extract the current configuration for one
> @@ -1190,10 +1199,16 @@ ExtractConfig(
>//
>if (Progress == NULL || Results == NULL) {
>  return (EFI_INVALID_PARAMETER);
>}
> 
> +  *Progress = Request;
> +  if ((Request != NULL) &&
> +!HiiIsConfigHdrMatch (Request, , 
> OpalPasswordStorageName)) {
> +return EFI_NOT_FOUND;
> +  }
> +
>//
>// Convert Buffer Data to  by helper function BlockToConfig( )
>//
>Status = gHiiConfigRouting->BlockToConfig(
> gHiiConfigRouting,
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] MdeModulePkg/DisplayEngine: Fix memory leak issues in DisplayEngine

2016-05-25 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Friday, May 20, 2016 10:12 AM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng; Qiu, Shumin; Dong, Eric
> Subject: [PATCH v2] MdeModulePkg/DisplayEngine: Fix memory leak issues in 
> DisplayEngine
> 
> The following codes are useless and cause memory leak issues.
> So now remove them.
> 
> Cc: Cecil Sheng <cecil.sh...@hpe.com>
> Cc: Qiu Shumin <shumin@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c   |  5 +
>  MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c | 12 +---
>  2 files changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c 
> b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> index 732dd2f..8e7b735 100644
> --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> @@ -1,9 +1,9 @@
>  /** @file
>  Implementation for handling user input from the User Interfaces.
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -1297,13 +1297,10 @@ GetSelectionInputPopUp (
>ValueType = 0;
>CurrentOption = NULL;
>ShowDownArrow = FALSE;
>ShowUpArrow   = FALSE;
> 
> -  StringPtr = AllocateZeroPool ((gOptionBlockWidth + 1) * 2);
> -  ASSERT (StringPtr);
> -
>ZeroMem (, sizeof (EFI_HII_VALUE));
> 
>Question = MenuOption->ThisTag;
>if (Question->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
>  Link = GetFirstNode (>OptionListHead);
> diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
> b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
> index bb2faf3..c61a395 100644
> --- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
> +++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
> @@ -1,10 +1,10 @@
>  /** @file
>  Implementation for handling the User Interface option processing.
> 
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2016, Intel Corporation. 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
> 
> @@ -883,22 +883,12 @@ PasswordProcess (
>if (StrCmp (StringPtr, TempString) == 0) {
>  gUserInput->InputValue.Buffer = AllocateCopyPool 
> (Question->CurrentValue.BufferLen, StringPtr);
>  gUserInput->InputValue.BufferLen = Question->CurrentValue.BufferLen;
>  gUserInput->InputValue.Type = Question->CurrentValue.Type;
>  gUserInput->InputValue.Value.string = HiiSetString(gFormData->HiiHandle, 
> gUserInput->InputValue.Value.string, StringPtr, NULL);
> -FreePool (StringPtr);
> 
>  Status = EFI_SUCCESS;
> -
> -if (EFI_ERROR (Status)) {
> -  //
> -  // Reset state machine for password
> -  //
> -  Question->PasswordCheck (gFormData, Question, NULL);
> -}
> -
> -return Status;
>} else {
>  //
>  // Reset state machine for password
>  //
>  Question->PasswordCheck (gFormData, Question, NULL);
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] PcAtChipsetPkg/PcRtc: Fix a stack corruption issue

2016-07-26 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Ni, Ruiyu
> Sent: Tuesday, July 26, 2016 9:12 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [PATCH 1/2] PcAtChipsetPkg/PcRtc: Fix a stack corruption issue
> 
> In 32bit environment, ScanTableInSDT() incorrectly copies 8 bytes
> of data to 4-byte pointer Table, which causes the stack corruption.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> ---
>  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c 
> b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> index b86c1f4..40d2e49 100644
> --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
> @@ -1271,7 +1271,7 @@ GetCenturyRtcAddress (
>Fadt = NULL;
>if (Rsdp->Revision >= 
> EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) {
>  Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress;
> -Fadt = ScanTableInSDT (Xsdt, 
> EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, sizeof (UINT64));
> +Fadt = ScanTableInSDT (Xsdt, 
> EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, sizeof (UINTN));
>}
> 
>if (Fadt == NULL) {
> --
> 2.9.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] BaseTool/VfrCompile: Remove reset button opcode in CheckQuestionOpCode

2016-08-11 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, August 10, 2016 4:54 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] BaseTool/VfrCompile: Remove reset button opcode in 
> CheckQuestionOpCode
> 
> "EFI_IFR_RESET_BUTTON_OP" is a statement, not a question,
> so remove it from function CheckQuestionOpCode.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 
> b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
> index db1e4bd..0b7b8b1 100644
> --- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
> +++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
> @@ -1199,11 +1199,10 @@ CIfrRecordInfoDB::CheckQuestionOpCode (
>case EFI_IFR_STRING_OP:
>case EFI_IFR_DATE_OP:
>case EFI_IFR_TIME_OP:
>case EFI_IFR_ORDERED_LIST_OP:
>case EFI_IFR_REF_OP:
> -  case EFI_IFR_RESET_BUTTON_OP:
>  return TRUE;
>default:
>  return FALSE;
>}
>  }
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver

2016-08-11 Thread Dong, Eric
Reviewed-by:  Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Zhang, Lubo
> Sent: Thursday, August 11, 2016 3:19 PM
> To: Dong, Eric
> Cc: Ye, Ting; Fu, Siyuan; edk2-devel@lists.01.org
> Subject: RE: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver
> 
> Hi Eric
> Do you have any comments for this patch.
> 
> Best regards
> Lubo
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang 
> Lubo
> Sent: Thursday, August 11, 2016 10:28 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting...@intel.com>; Fu, Siyuan <siyuan...@intel.com>; Dong, 
> Eric <eric.d...@intel.com>
> Subject: [edk2] [patch] MdeModulePkg: Refine codes of iSCSI driver
> 
> The RSDT is only used when the bios need to support ACPI 1.0 version. When 
> change PcdAcpiExposedTableVersions to 0x3C, it will not
> support ACPI 1.0. The default is 0x3E.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zh...@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ye Ting <ting...@intel.com>
> Cc: Fu Siyuan <siyuan...@intel.com>
> ---
>  .../Universal/Network/IScsiDxe/IScsiIbft.c | 35 
> --
>  1 file changed, 20 insertions(+), 15 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c 
> b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
> index e5f685f..45d89a6 100644
> --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
> +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
> @@ -434,42 +434,42 @@ IScsiPublishIbft (
>EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER *Table;
>UINTN HandleCount;
>EFI_HANDLE*HandleBuffer;
>UINT8 *Heap;
>UINT8 Checksum;
> -  UINTN Index;
>EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *Rsdp;
>EFI_ACPI_DESCRIPTION_HEADER   *Rsdt;
> +  EFI_ACPI_DESCRIPTION_HEADER   *Xsdt;
> +
> +  Rsdt = NULL;
> +  Xsdt = NULL;
> 
>Status = gBS->LocateProtocol (, NULL, (VOID 
> **));
>if (EFI_ERROR (Status)) {
>  return ;
>}
> 
> 
>//
>// Find ACPI table RSD_PTR from system table
>//
> -  for (Index = 0, Rsdp = NULL; Index < gST->NumberOfTableEntries; Index++) {
> -if (CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), 
> ) ||
> -  CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), 
> ) ||
> -  CompareGuid (&(gST->ConfigurationTable[Index].VendorGuid), 
> )
> -  ) {
> -  //
> -  // A match was found.
> -  //
> -  Rsdp = (EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *) 
> gST->ConfigurationTable[Index].VendorTable;
> -  break;
> -}
> +  Status = EfiGetSystemConfigurationTable (, (VOID
> + **) );  if (EFI_ERROR (Status)) {
> +Status = EfiGetSystemConfigurationTable (,
> + (VOID **) );
>}
> 
> -  if (Rsdp == NULL) {
> +  if (EFI_ERROR (Status) || (Rsdp == NULL)) {
>  return ;
> -  } else {
> +  } else if (Rsdp->Revision >= 
> EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION && Rsdp->XsdtAddress != 
> 0) {
> +Xsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->XsdtAddress;
> + } else if (Rsdp->RsdtAddress != 0) {
>  Rsdt = (EFI_ACPI_DESCRIPTION_HEADER *) (UINTN) Rsdp->RsdtAddress;
>}
> 
> +  if ((Xsdt == NULL) && (Rsdt == NULL)) {
> +return ;
> +  }
> 
>if (mIbftInstalled) {
>  Status = AcpiTableProtocol->UninstallAcpiTable (
>AcpiTableProtocol,
>mTableKey @@ -504,11 +504,16 @@ 
> IScsiPublishIbft (
>Heap = (UINT8 *) Table + IBFT_HEAP_OFFSET;
> 
>//
>// Fill in the various section of the iSCSI Boot Firmware Table.
>//
> -  IScsiInitIbfTableHeader (Table, Rsdt->OemId, >OemTableId);
> +  if (Rsdp->Revision >= 
> EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) {
> +IScsiInitIbfTableHeader (Table, Xsdt->OemId, >OemTableId);  }
> + else {
> +IScsiInitIbfTableHeader (Table, Rsdt->OemId, >OemTableId);  }
> +
>IScsiInitControlSection (Table, HandleCount);
>IScsiFillInitiatorSection (Table, , HandleBuffer[0]);
>IScsiFillNICAndTargetSections (Table, , HandleCount, HandleBuffer);
> 
>Checksum = CalculateCheckSum8((UINT8 *)Table, Table->Length);
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe

2017-01-24 Thread Dong, Eric
Xiaofeng,

Thanks, we will follow up to fix it.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of wang 
> xiaofeng
> Sent: Wednesday, January 25, 2017 10:49 AM
> To: Dong, Eric
> Cc: edk2-devel@lists.01.org; Gao, Liming
> Subject: Re: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe
> 
> Hi Eric and Liming,
>Bug 358 is submitted for this issue.
> 
> 
> 
> 
> 
> 
> 
> 
> At 2017-01-25 10:29:52, "Dong, Eric" <eric.d...@intel.com> wrote:
> >Xiaofeng,
> >
> >BugZillar link is: https://bugzilla.tianocore.org/
> >
> >Thanks,
> >Eric
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> >> wang xiaofeng
> >> Sent: Wednesday, January 25, 2017 10:22 AM
> >> To: Gao, Liming
> >> Cc: edk2-devel@lists.01.org; Dong, Eric
> >> Subject: Re: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe
> >>
> >> Hi Liming,
> >> Where is the BugZillar link? I will try if I can submit it. But not 
> >> sure where I can quickly apply for an account.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> At 2017-01-25 08:54:47, "Gao, Liming" <liming@intel.com> wrote:
> >> >Xiaofeng:
> >> >   Yes. This is a potential issue. This API should be updated with 
> >> > original Buffer Size. Could you help submit this issue in BugZillar?
> >> >
> >> >Thanks
> >> >Liming
> >> >>-Original Message-
> >> >>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> >>wang xiaofeng
> >> >>Sent: Tuesday, January 24, 2017 3:56 PM
> >> >>To: edk2-devel@lists.01.org; Dong, Eric <eric.d...@intel.com>
> >> >>Subject: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe
> >> >>
> >> >>Hi DisplayEngineDxe  Owner,
> >> >>   SetUnicodeMem seems unsafe  since the buffer may overflow if the input
> >> >>Size is bigger than buffer size.Do we think about improve the function
> >> >>
> >> >>
> >> >>/**
> >> >>  Set Buffer to Value for Size bytes.
> >> >>
> >> >>
> >> >>  @param  Buffer Memory to set.
> >> >>  @param  Size   Number of bytes to set
> >> >>  @param  Value  Value of the set operation.
> >> >>
> >> >>
> >> >>**/
> >> >>VOID
> >> >>SetUnicodeMem (
> >> >>  IN VOID   *Buffer,
> >> >>  IN UINTN  Size,
> >> >>  IN CHAR16 Value
> >> >>  )
> >> >>{
> >> >>  CHAR16  *Ptr;
> >> >>
> >> >>
> >> >>  Ptr = Buffer;
> >> >>  while ((Size--)  != 0) {
> >> >>*(Ptr++) = Value;
> >> >>  }
> >> >>}
> >> >>
> >> >>   The problem I meet is liking the following screen. Year in main page 
> >> >> shows
> >> >>incorrect char randomly.
> >> >>
> >> >>   If I turn off GetNumericInput optimize with #pragma optimize( "", off 
> >> >> ) in
> >> >>InputHandler.c , or swtich to use StrCpyS like this. The problem 
> >> >>disappear. This
> >> >>issue cannot be seen in OVMF ,but it can be reproduced in our own 
> >> >>platform
> >> >>with a rate of 30%.
> >> >>
> >> >>
> >> >>
> >> >>___
> >> >>edk2-devel mailing list
> >> >>edk2-devel@lists.01.org
> >> >>https://lists.01.org/mailman/listinfo/edk2-devel
> >> >___
> >> >edk2-devel mailing list
> >> >edk2-devel@lists.01.org
> >> >https://lists.01.org/mailman/listinfo/edk2-devel
> >> ___
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >___
> >edk2-devel mailing list
> >edk2-devel@lists.01.org
> >https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe

2017-01-24 Thread Dong, Eric
Xiaofeng,

BugZillar link is: https://bugzilla.tianocore.org/

Thanks,
Eric
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of wang 
> xiaofeng
> Sent: Wednesday, January 25, 2017 10:22 AM
> To: Gao, Liming
> Cc: edk2-devel@lists.01.org; Dong, Eric
> Subject: Re: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe
> 
> Hi Liming,
> Where is the BugZillar link? I will try if I can submit it. But not sure 
> where I can quickly apply for an account.
> 
> 
> 
> 
> 
> 
> 
> 
> At 2017-01-25 08:54:47, "Gao, Liming" <liming@intel.com> wrote:
> >Xiaofeng:
> >   Yes. This is a potential issue. This API should be updated with original 
> > Buffer Size. Could you help submit this issue in BugZillar?
> >
> >Thanks
> >Liming
> >>-Original Message-
> >>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >>wang xiaofeng
> >>Sent: Tuesday, January 24, 2017 3:56 PM
> >>To: edk2-devel@lists.01.org; Dong, Eric <eric.d...@intel.com>
> >>Subject: [edk2] SetUnicodeMem in DisplayEngineDxe seems unsafe
> >>
> >>Hi DisplayEngineDxe  Owner,
> >>   SetUnicodeMem seems unsafe  since the buffer may overflow if the input
> >>Size is bigger than buffer size.Do we think about improve the function
> >>
> >>
> >>/**
> >>  Set Buffer to Value for Size bytes.
> >>
> >>
> >>  @param  Buffer Memory to set.
> >>  @param  Size   Number of bytes to set
> >>  @param  Value  Value of the set operation.
> >>
> >>
> >>**/
> >>VOID
> >>SetUnicodeMem (
> >>  IN VOID   *Buffer,
> >>  IN UINTN  Size,
> >>  IN CHAR16 Value
> >>  )
> >>{
> >>  CHAR16  *Ptr;
> >>
> >>
> >>  Ptr = Buffer;
> >>  while ((Size--)  != 0) {
> >>*(Ptr++) = Value;
> >>  }
> >>}
> >>
> >>   The problem I meet is liking the following screen. Year in main page 
> >> shows
> >>incorrect char randomly.
> >>
> >>   If I turn off GetNumericInput optimize with #pragma optimize( "", off ) 
> >> in
> >>InputHandler.c , or swtich to use StrCpyS like this. The problem disappear. 
> >>This
> >>issue cannot be seen in OVMF ,but it can be reproduced in our own platform
> >>with a rate of 30%.
> >>
> >>
> >>
> >>___
> >>edk2-devel mailing list
> >>edk2-devel@lists.01.org
> >>https://lists.01.org/mailman/listinfo/edk2-devel
> >___
> >edk2-devel mailing list
> >edk2-devel@lists.01.org
> >https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeMoudlePkg/DisplayEngine: Fix incorrect index used in array "InputText"

2017-02-20 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Friday, February 10, 2017 10:26 AM
> To: edk2-devel@lists.01.org
> Cc: Wang Cloud; Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeMoudlePkg/DisplayEngine: Fix incorrect index used 
> in array "InputText"
> 
> When set value to the array "InputText", the index was used incorrectly.
> And the array "InputText" is not initialized. These will cause some value
> in the array is random, so it will be shown incorrectly sometimes.
> This patch is to fix this issue.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=358
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Cc: Wang Cloud <winggundu...@163.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../Universal/DisplayEngineDxe/InputHandler.c  | 33 
> --
>  1 file changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c 
> b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> index 400b934..d02c0bf 100644
> --- a/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> +++ b/MdeModulePkg/Universal/DisplayEngineDxe/InputHandler.c
> @@ -1,9 +1,9 @@
>  /** @file
>  Implementation for handling user input from the User Interfaces.
> 
> -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2017, Intel Corporation. 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
> 
> @@ -522,10 +522,11 @@ GetNumericInput (
>Negative  = FALSE;
>ValidateFail  = FALSE;
> 
>Question  = MenuOption->ThisTag;
>QuestionValue = >CurrentValue;
> +  ZeroMem (InputText, MAX_NUMERIC_INPUT_WIDTH * sizeof (CHAR16));
> 
>//
>// Only two case, user can enter to this function: Enter and +/- case.
>// In Enter case, gDirection = 0; in +/- case, gDirection = 
> SCAN_LEFT/SCAN_WRIGHT
>//
> @@ -688,20 +689,21 @@ GetNumericInput (
>}
> 
>if (MenuOption->Sequence == 0) {
>  InputText[0] = LEFT_NUMERIC_DELIMITER;
>  SetUnicodeMem (InputText + 1, InputWidth, L' ');
> -  } else {
> +InputText[InputWidth + 1] = DATE_SEPARATOR;
> +InputText[InputWidth + 2] = L'\0';
> +  } else  if (MenuOption->Sequence == 1){
>  SetUnicodeMem (InputText, InputWidth, L' ');
> -  }
> -
> -  if (MenuOption->Sequence == 2) {
> -InputText[InputWidth + 1] = RIGHT_NUMERIC_DELIMITER;
> +InputText[InputWidth] = DATE_SEPARATOR;
> +InputText[InputWidth + 1] = L'\0';
>} else {
> -InputText[InputWidth + 1] = DATE_SEPARATOR;
> +SetUnicodeMem (InputText, InputWidth, L' ');
> +InputText[InputWidth] = RIGHT_NUMERIC_DELIMITER;
> +InputText[InputWidth + 1] = L'\0';
>}
> -  InputText[InputWidth + 2] = L'\0';
> 
>PrintStringAt (Column, Row, InputText);
>if (MenuOption->Sequence == 0) {
>  Column++;
>}
> @@ -711,20 +713,21 @@ GetNumericInput (
>InputWidth = 2;
> 
>if (MenuOption->Sequence == 0) {
>  InputText[0] = LEFT_NUMERIC_DELIMITER;
>  SetUnicodeMem (InputText + 1, InputWidth, L' ');
> -  } else {
> +InputText[InputWidth + 1] = TIME_SEPARATOR;
> +InputText[InputWidth + 2] = L'\0';
> +  } else if (MenuOption->Sequence == 1){
>  SetUnicodeMem (InputText, InputWidth, L' ');
> -  }
> -
> -  if (MenuOption->Sequence == 2) {
> -InputText[InputWidth + 1] = RIGHT_NUMERIC_DELIMITER;
> +InputText[InputWidth] = TIME_SEPARATOR;
> +InputText[InputWidth + 1] = L'\0';
>} else {
> -InputText[InputWidth + 1] = TIME_SEPARATOR;
> +SetUnicodeMem (InputText, InputWidth, L' ');
> +InputText[InputWidth] = RIGHT_NUMERIC_DELIMITER;
> +InputText[InputWidth + 1] = L'\0';
>}
> -  InputText[InputWidth + 2] = L'\0';
> 
>PrintStringAt (Column, Row, InputText);
>if (MenuOption->Sequence == 0) {
>  Column++;
>}
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/BMMUiLib: Remove old useless data before new save action

2017-02-20 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Monday, February 20, 2017 1:06 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeModulePkg/BMMUiLib: Remove old useless data before 
> new save action
> 
> There exits the case that when saving changes in form A,
> the old saved data in form B are not cleaned, will be saved
> again with the new save. Thus incorrect UI behavior will be
> shown. This patch is to remove some useless data.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=385
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../BootMaintenanceManagerUiLib/BootMaintenance.c  | 35 
> +-
>  .../BootMaintenanceManager.h   | 14 -
>  2 files changed, 47 insertions(+), 2 deletions(-)
> 
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> index e49ab98..3ff23a5 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> @@ -1,9 +1,9 @@
>  /** @file
>  The functions for Boot Maintainence Main menu.
> 
> -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2017, Intel Corporation. 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
> 
> @@ -1212,13 +1212,15 @@ BootMaintCallback (
>  if ((Value == NULL) || (ActionRequest == NULL)) {
>return EFI_INVALID_PARAMETER;
>  }
> 
>  if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT) {
> +  CleanUselessBeforeSubmit (Private);
>CurrentFakeNVMap->BootOptionChanged = FALSE;
>*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
>  } else if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
> +  CleanUselessBeforeSubmit (Private);
>CurrentFakeNVMap->DriverOptionChanged = FALSE;
>*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
>  } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER) {
>//
>// Discard changes and exit formset
> @@ -1267,10 +1269,11 @@ BootMaintCallback (
>  } else {
>switch (QuestionId) {
>case KEY_VALUE_SAVE_AND_EXIT:
>case KEY_VALUE_NO_SAVE_AND_EXIT:
>  if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
> +  CleanUselessBeforeSubmit (Private);
>*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
>  } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
>DiscardChangeHandler (Private, CurrentFakeNVMap);
>*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
>  }
> @@ -1369,10 +1372,40 @@ DiscardChangeHandler (
>  break;
>}
>  }
> 
>  /**
> +  This function is to clean some useless data before submit changes.
> +
> +  @param PrivateThe BMM context data.
> +
> +**/
> +VOID
> +CleanUselessBeforeSubmit (
> +  IN  BMM_CALLBACK_DATA   *Private
> +  )
> +{
> +  UINT16  Index;
> +  if (Private->BmmPreviousPageId != FORM_BOOT_DEL_ID) {
> +for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
> +  if (Private->BmmFakeNvData.BootOptionDel[Index] && 
> !Private->BmmFakeNvData.BootOptionDelMark[Index]) {
> +Private->BmmFakeNvData.BootOptionDel[Index] = FALSE;
> +Private->BmmOldFakeNVData.BootOptionDel[Index] = FALSE;
> +  }
> +}
> +  }
> +  if (Private->BmmPreviousPageId != FORM_DRV_DEL_ID) {
> +for (Index = 0; Index < DriverOptionMenu.MenuNumber; Index++) {
> +  if (Private->BmmFakeNvData.DriverOptionDel[Index] && 
> !Private->BmmFakeNvData.DriverOptionDelMark[Index]) {
> +Private->BmmFakeNvData.DriverOptionDel[Index] = FALSE;
> +Private->BmmOldFakeNVData.DriverOptionDel[Index] = FALSE;
> +  }
> +}
> +  }
> +}
> +
> +/**
> 
>Update the menus in the BMM page.
> 
>  **/
>  VOID
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
> b/MdeModulePkg/

Re: [edk2] [patch] MdeModulePkg/HiiDatabase: clean the value before setting default string

2017-02-20 Thread Dong, Eric
Dandan,

You need to also add check to avoid string size exceed the width.

Thanks,
Eric

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Monday, February 20, 2017 1:06 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeModulePkg/HiiDatabase: clean the value before 
> setting default string
> 
> For string op-code, the default string may not exceed the
> maximum size, so when generating  string, we should
> clean the value before setting the default string.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=375
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> index d547f42..1878106 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> @@ -1,9 +1,9 @@
>  /** @file
>  Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.
> 
> -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2017, Intel Corporation. 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
> 
> @@ -3696,21 +3696,29 @@ GenerateAltConfigResp (
>  // Convert Value to a hex string in "%x" format
>  // NOTE: This is in the opposite byte that GUID and PATH use
>  //
>  if (BlockData->OpCode == EFI_IFR_STRING_OP){
>DefaultString   = InternalGetString(HiiHandle, 
> DefaultValueData->Value.string);
> -  TmpBuffer = (UINT8 *) DefaultString;
> +  TmpBuffer = AllocateZeroPool (Width);
> +  ASSERT (TmpBuffer != NULL);
> +  if (DefaultString != NULL) {
> +CopyMem (TmpBuffer, (UINT8 *) DefaultString, 
> StrLen(DefaultString)* sizeof (CHAR16));
> +  }
>  } else {
>TmpBuffer = (UINT8 *) &(DefaultValueData->Value);
>  }
>  for (; Width > 0 && (TmpBuffer != NULL); Width--) {
>StringPtr += UnicodeValueToString (StringPtr, PREFIX_ZERO | 
> RADIX_HEX, TmpBuffer[Width - 1], 2);
>  }
>  if (DefaultString != NULL){
>FreePool(DefaultString);
>DefaultString = NULL;
>  }
> +if (BlockData->OpCode == EFI_IFR_STRING_OP && TmpBuffer != NULL) {
> +  FreePool(TmpBuffer);
> +  TmpBuffer  = NULL;
> +}
>}
>  }
>}
> 
>HiiToLower (*DefaultAltCfgResp);
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2] MdeModulePkg/HiiDatabase: clean the value before setting default string

2017-02-21 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Tuesday, February 21, 2017 10:26 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [PATCH v2] MdeModulePkg/HiiDatabase: clean the value before setting 
> default string
> 
> For string op-code, the default string may not reach the
> maximum size, so when generating  string, we should
> clean the value before setting the default string.
> 
> V2: Add check for default string size.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 17 +++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> index d547f42..ccf4b5a 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
> @@ -1,9 +1,9 @@
>  /** @file
>  Implementation of interfaces function for EFI_HII_CONFIG_ROUTING_PROTOCOL.
> 
> -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2017, Intel Corporation. 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
> 
> @@ -3579,10 +3579,11 @@ GenerateAltConfigResp (
>IFR_DEFAULT_DATA  *DefaultId;
>IFR_DEFAULT_DATA  *DefaultValueData;
>UINTN Width;
>UINT8 *TmpBuffer;
>CHAR16*DefaultString;
> +  UINTN StrSize;
> 
>BlockData = NULL;
>DataExist = FALSE;
>DefaultString = NULL;
>//
> @@ -3696,21 +3697,33 @@ GenerateAltConfigResp (
>  // Convert Value to a hex string in "%x" format
>  // NOTE: This is in the opposite byte that GUID and PATH use
>  //
>  if (BlockData->OpCode == EFI_IFR_STRING_OP){
>DefaultString   = InternalGetString(HiiHandle, 
> DefaultValueData->Value.string);
> -  TmpBuffer = (UINT8 *) DefaultString;
> +  TmpBuffer = AllocateZeroPool (Width);
> +  ASSERT (TmpBuffer != NULL);
> +  if (DefaultString != NULL) {
> +StrSize = StrLen(DefaultString)* sizeof (CHAR16);
> +if (StrSize > Width) {
> +  StrSize = Width;
> +}
> +CopyMem (TmpBuffer, (UINT8 *) DefaultString, StrSize);
> +  }
>  } else {
>TmpBuffer = (UINT8 *) &(DefaultValueData->Value);
>  }
>  for (; Width > 0 && (TmpBuffer != NULL); Width--) {
>StringPtr += UnicodeValueToString (StringPtr, PREFIX_ZERO | 
> RADIX_HEX, TmpBuffer[Width - 1], 2);
>  }
>  if (DefaultString != NULL){
>FreePool(DefaultString);
>DefaultString = NULL;
>  }
> +if (BlockData->OpCode == EFI_IFR_STRING_OP && TmpBuffer != NULL) {
> +  FreePool(TmpBuffer);
> +  TmpBuffer  = NULL;
> +}
>}
>  }
>}
> 
>HiiToLower (*DefaultAltCfgResp);
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch 3/3] MdeModulePkg/FileExplorer: Enable functionality of creating new file/folder

2017-01-17 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Monday, January 16, 2017 1:57 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric <eric.d...@intel.com>; Gao, Liming <liming@intel.com>; Yao, 
Jiewen <jiewen@intel.com>
Subject: [patch 3/3] MdeModulePkg/FileExplorer: Enable functionality of 
creating new file/folder

https://bugzilla.tianocore.org/show_bug.cgi?id=324

Enhance the FileExplorerlib so that user can create a new file/folder through 
the UI page.

Cc: Eric Dong <eric.d...@intel.com>
Cc: Liming Gao <liming@intel.com>
Cc: Jiewen Yao <jiewen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 .../Library/FileExplorerLib/FileExplorer.c | 170 -
 .../Library/FileExplorerLib/FileExplorer.h |   4 +
 .../Library/FileExplorerLib/FileExplorerString.uni |  32 +++-
 .../Library/FileExplorerLib/FileExplorerVfr.vfr|  56 ++-
 MdeModulePkg/Library/FileExplorerLib/FormGuid.h|  11 +-
 5 files changed, 267 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 315868a..5eedad7 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -71,10 +71,28 @@ HII_VENDOR_DEVICE_PATH  FeHiiVendorDevicePath = {
 VOID*mLibStartOpCodeHandle = NULL;
 VOID*mLibEndOpCodeHandle = NULL;
 EFI_IFR_GUID_LABEL  *mLibStartLabel = NULL;  EFI_IFR_GUID_LABEL  *mLibEndLabel 
= NULL;
 UINT16  mQuestionIdUpdate;
+CHAR16  mNewFileName[MAX_FILE_NAME_LEN];
+CHAR16  mNewFolderName[MAX_FOLDER_NAME_LEN];
+UINTN  mNewFileQuestionId= NEW_FILE_QUESTION_ID_BASE;
+UINTN  mNewFolderQuestionId  = NEW_FOLDER_QUESTION_ID_BASE;
+
+/**
+  Create a new file or folder in current directory.
+
+  @param FileName  Point to the fileNmae or folder.
+  @param CreateFileCreateFile== TRUE  means create a new file.
+   CreateFile== FALSE means create a new Folder.
+
+**/
+EFI_STATUS
+LibCreateNewFile (
+  IN CHAR16 *FileName,
+  IN BOOLEANCreateFile
+  );
 
 /**
   This function allows a caller to extract the current configuration for one
   or more named elements from the target driver.
 
@@ -173,13 +191,17 @@ LibCallback (
   OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
   )
 {
   EFI_STATUSStatus;
   BOOLEAN   NeedExit;
+  CHAR16*NewFileName;
+  CHAR16*NewFolderName;
 
   NeedExit = TRUE;
-  
+  NewFileName   = NULL;
+  NewFolderName = NULL;
+
   if (Action != EFI_BROWSER_ACTION_CHANGING && Action != 
EFI_BROWSER_ACTION_CHANGED) {
 //
 // Do nothing for other UEFI Action. Only do call back when data is 
changed.
 //
 return EFI_UNSUPPORTED;
@@ -187,11 +209,59 @@ LibCallback (
 
   if (Action == EFI_BROWSER_ACTION_CHANGED) {
 if ((Value == NULL) || (ActionRequest == NULL)) {
   return EFI_INVALID_PARAMETER;
 }
-
+
+if (QuestionId == KEY_VALUE_CREATE_FILE_AND_EXIT) {
+  *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+  if (!IsZeroBuffer (mNewFileName, sizeof (mNewFileName))) {
+Status = LibCreateNewFile (mNewFileName,TRUE);
+ZeroMem (mNewFileName,sizeof (mNewFileName));
+  }
+}
+
+if (QuestionId == KEY_VALUE_NO_CREATE_FILE_AND_EXIT) {
+  ZeroMem (mNewFileName,sizeof (mNewFileName));
+  *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+}
+
+if (QuestionId == KEY_VALUE_CREATE_FOLDER_AND_EXIT) {
+  *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+  if (!IsZeroBuffer (mNewFolderName, sizeof (mNewFolderName))) {
+Status = LibCreateNewFile (mNewFolderName, FALSE);
+ZeroMem (mNewFolderName,sizeof (mNewFolderName));
+  }
+}
+
+if (QuestionId == KEY_VALUE_NO_CREATE_FOLDER_AND_EXIT) {
+  ZeroMem (mNewFolderName,sizeof (mNewFolderName));
+  *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+}
+
+if (QuestionId == NEW_FILE_NAME_ID) {
+  NewFileName = HiiGetString (gFileExplorerPrivate.FeHiiHandle, 
Value->string, NULL);
+  if (NewFileName != NULL) {
+StrCpyS (mNewFileName, MAX_FILE_NAME_LEN, NewFileName);
+FreePool (NewFileName);
+NewFileName = NULL;
+  } else {
+return EFI_INVALID_PARAMETER;
+  }
+}
+
+if (QuestionId == NEW_FOLDER_NAME_ID) {
+  NewFolderName = HiiGetString (gFileExplorerPrivate.FeHiiHandle, 
Value->string, NULL);
+  if (NewFolderName != NULL) {
+StrCpyS (mNewFolderName, MAX_FOLDER_NAME_LEN, NewFolderName);
+FreePool (NewFolderName);
+NewFolderName = NULL;
+  } else {
+return EFI_INVALID_PARAMETER;
+  }
+}
+
 if (QuestionId >= FILE_OPTION_OFFSET) {
   LibGetDevic

Re: [edk2] [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching load file protocol

2017-01-17 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Monday, January 16, 2017 1:57 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric <eric.d...@intel.com>; Gao, Liming <liming@intel.com>; Yao, 
Jiewen <jiewen@intel.com>
Subject: [patch 1/3] MdeModulePkg/FileExplorer: Remove the codes of searching 
load file protocol

https://bugzilla.tianocore.org/show_bug.cgi?id=323

FileExplorer no need to search load file protocol to show files.
Now remove the codes.

Cc: Eric Dong <eric.d...@intel.com>
Cc: Liming Gao <liming@intel.com>
Cc: Jiewen Yao <jiewen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 .../Library/FileExplorerLib/FileExplorer.c | 56 +-
 .../Library/FileExplorerLib/FileExplorer.h |  3 +-
 .../Library/FileExplorerLib/FileExplorerLib.inf|  3 +-
 3 files changed, 3 insertions(+), 59 deletions(-)

diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 41a22aa..9cd366d 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -1,9 +1,9 @@
 /** @file
 File explorer related functions.
 
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials are licensed and made available 
under  the terms and conditions of the BSD License that accompanies this 
distribution.
 The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php.
 
@@ -697,23 +697,20 @@ EFI_STATUS
 LibFindFileSystem (
   VOID
   )
 {
   UINTNNoSimpleFsHandles;
-  UINTNNoLoadFileHandles;
   EFI_HANDLE   *SimpleFsHandle;
-  EFI_HANDLE   *LoadFileHandle;
   UINT16   *VolumeLabel;
   UINTNIndex;
   EFI_STATUS   Status;
   MENU_ENTRY   *MenuEntry;
   FILE_CONTEXT *FileContext;
   UINTNOptionNumber;
   EFI_FILE_SYSTEM_VOLUME_LABEL *Info;
 
   NoSimpleFsHandles = 0;
-  NoLoadFileHandles = 0;
   OptionNumber  = 0;
 
   //
   // Locate Handles that support Simple File System protocol
   //
@@ -794,61 +791,10 @@ LibFindFileSystem (
 
   if (NoSimpleFsHandles != 0) {
 FreePool (SimpleFsHandle);
   }
 
-  //
-  // Searching for handles that support Load File protocol
-  //
-  Status = gBS->LocateHandleBuffer (
-  ByProtocol,
-  ,
-  NULL,
-  ,
-  
-  );
-
-  if (!EFI_ERROR (Status)) {
-for (Index = 0; Index < NoLoadFileHandles; Index++) {
-  MenuEntry = LibCreateMenuEntry ();
-  if (NULL == MenuEntry) {
-FreePool (LoadFileHandle);
-return EFI_OUT_OF_RESOURCES;
-  }
-
-  FileContext = (FILE_CONTEXT *) MenuEntry->VariableContext;
-  FileContext->DeviceHandle = LoadFileHandle[Index];
-  FileContext->IsRoot = TRUE;
-
-  FileContext->DevicePath = DevicePathFromHandle 
(FileContext->DeviceHandle);
-  FileContext->FileName = LibDevicePathToStr (FileContext->DevicePath);
-
-  MenuEntry->HelpString = LibDevicePathToStr (FileContext->DevicePath);
-  MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
-  ASSERT (MenuEntry->DisplayString != NULL);
-  UnicodeSPrint (
-MenuEntry->DisplayString,
-MAX_CHAR,
-L"Load File [%s]",
-MenuEntry->HelpString
-);
-  MenuEntry->DisplayStringToken = HiiSetString (
-   gFileExplorerPrivate.FeHiiHandle,
-   0,
-   MenuEntry->DisplayString,
-   NULL
-   );
-
-  OptionNumber++;
-  InsertTailList (>Head, 
>Link);
-}
-  }
-
-  if (NoLoadFileHandles != 0) {
-FreePool (LoadFileHandle);
-  }
-
   gFileExplorerPrivate.FsOptionMenu->MenuNumber = OptionNumber;
 
   return EFI_SUCCESS;
 }
 
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
index fab2052..4b5f601 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
@@ -1,9 +1,9 @@
 /** @file
File explorer lib.
 
-Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
 This program and the accompanying materials  
 are licensed and made available under the terms and con

Re: [edk2] [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form

2017-01-17 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Bi, Dandan 
Sent: Monday, January 16, 2017 1:57 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric <eric.d...@intel.com>; Gao, Liming <liming@intel.com>; Yao, 
Jiewen <jiewen@intel.com>
Subject: [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating 
FileExplore form

https://bugzilla.tianocore.org/show_bug.cgi?id=342

When user select and enter a directory, File Explorer will update the form 
based on the new folders and files in the directory. But when creating question 
opcodes, the question id is same with previous one and this will cause browser 
to show the highlight menu incorrectly.

Cc: Eric Dong <eric.d...@intel.com>
Cc: Liming Gao <liming@intel.com>
Cc: Jiewen Yao <jiewen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
---
 MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 12   
MdeModulePkg/Library/FileExplorerLib/FileExplorer.h |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 9cd366d..315868a 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -70,10 +70,11 @@ HII_VENDOR_DEVICE_PATH  FeHiiVendorDevicePath = {
 
 VOID*mLibStartOpCodeHandle = NULL;
 VOID*mLibEndOpCodeHandle = NULL;
 EFI_IFR_GUID_LABEL  *mLibStartLabel = NULL;  EFI_IFR_GUID_LABEL  *mLibEndLabel 
= NULL;
+UINT16  mQuestionIdUpdate;
 
 /**
   This function allows a caller to extract the current configuration for one
   or more named elements from the target driver.
 
@@ -1181,21 +1182,23 @@ LibUpdateFileExplorePage (
   NewFileContext  = NULL;
 
   LibRefreshUpdateData ();
   MenuOption = gFileExplorerPrivate.FsOptionMenu;
 
+  mQuestionIdUpdate += QUESTION_ID_UPDATE_STEP;
+
   for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
 NewMenuEntry= LibGetMenuEntry (MenuOption, Index);
 NewFileContext  = (FILE_CONTEXT *) NewMenuEntry->VariableContext;
 
 if (!NewFileContext->IsDir) {
   //
   // Create Text opcode for directory, also create Text opcode for file in 
FileExplorerStateBootFromFile.
   //
   HiiCreateActionOpCode (
 mLibStartOpCodeHandle,
-(UINT16) (FILE_OPTION_OFFSET + Index),
+(UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate),
 NewMenuEntry->DisplayStringToken,
 STRING_TOKEN (STR_NULL_STRING),
 EFI_IFR_FLAG_CALLBACK,
 0
 );
@@ -1207,11 +1210,11 @@ LibUpdateFileExplorePage (
 mLibStartOpCodeHandle,
 FORM_FILE_EXPLORER_ID,
 NewMenuEntry->DisplayStringToken,
 STRING_TOKEN (STR_NULL_STRING),
 EFI_IFR_FLAG_CALLBACK,
-(UINT16) (FILE_OPTION_OFFSET + Index)
+(UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate)
 );
 }
   }
 
   HiiUpdateForm (
@@ -1242,11 +1245,11 @@ LibUpdateFileExplorer (
   FILE_CONTEXT*NewFileContext;
   EFI_STATUS  Status;
   EFI_FILE_HANDLE FileHandle;
 
   Status = EFI_SUCCESS;
-  FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue);
+  FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue) - 
+ mQuestionIdUpdate;
   NewMenuEntry   = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, 
FileOptionMask);
   NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext;
 
   if (NewFileContext->IsDir) {
 RemoveEntryList (>Link); @@ -1277,11 +1280,11 @@ 
LibGetDevicePath (  {
   UINT16  FileOptionMask;
   MENU_ENTRY  *NewMenuEntry;
   FILE_CONTEXT*NewFileContext;
 
-  FileOptionMask= (UINT16) (FILE_OPTION_MASK & KeyValue);
+  FileOptionMask= (UINT16) (FILE_OPTION_MASK & KeyValue) - 
mQuestionIdUpdate;
 
   NewMenuEntry = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, 
FileOptionMask);
 
   NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext;
 
@@ -1326,10 +1329,11 @@ ChooseFile (
 
   if ((ChooseHandler == NULL) && (File == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
 
+  mQuestionIdUpdate = 0;
   FileName = NULL;
 
   gFileExplorerPrivate.RetDevicePath = NULL;
   gFileExplorerPrivate.ChooseHandler = ChooseHandler;
   if (FileType != NULL) {
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
index 4b5f601..ea0ad3d 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h
@@ -111,11 +111,11 @@ extern UINT8FileExplorerVfrBin[];
 /// Define the maximum characters that will be accepted.
 ///
 #define MAX_CHAR480
 #define FILE_OPTION_OFFSET  0x8000
 #define FILE_OPTION_MASK

Re: [edk2] [patch] MdeModulePkg/BMMUiLib: Replace same logic with API in UefiBootManagerLib

2017-02-28 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

-Original Message-
From: Ni, Ruiyu 
Sent: Monday, February 27, 2017 3:19 PM
To: Bi, Dandan; edk2-devel@lists.01.org
Cc: Dong, Eric; Zeng, Star
Subject: RE: [patch] MdeModulePkg/BMMUiLib: Replace same logic with API in 
UefiBootManagerLib

Reviewed-by: Ruiyu Ni <ruiyu...@intel.com>

Thanks/Ray

> -Original Message-
> From: Bi, Dandan
> Sent: Monday, February 27, 2017 3:15 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.d...@intel.com>; Ni, Ruiyu <ruiyu...@intel.com>; 
> Zeng, Star <star.z...@intel.com>
> Subject: [patch] MdeModulePkg/BMMUiLib: Replace same logic with API in 
> UefiBootManagerLib
> 
> Use the API EfiBootManagerDeleteLoadOptionVariable in 
> UefiBootManagerLib to replace the same logic in function 
> Var_DelBootOption/Var_DelDriverOption.
> This can make code clean and prevent potential bugs.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=391
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Star Zeng <star.z...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../BootMaintenanceManager.h   |  37 +---
>  .../Library/BootMaintenanceManagerUiLib/Variable.c | 202 
> +---
> -
>  2 files changed, 11 insertions(+), 228 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> index 532b75b..a8d7a0f 100644
> ---
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> +++
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eMa
> +++ nager.h
> @@ -631,12 +631,10 @@ Var_UpdateBootOption (
>IN  BMM_CALLBACK_DATA   *CallbackData
>);
> 
>  /**
>Delete Boot Option that represent a Deleted state in BootOptionMenu.
> -  After deleting this boot option, call Var_ChangeBootOrder to
> -  make sure BootOrder is in valid state.
> 
>@retval EFI_SUCCESS   If all boot load option EFI Variables corresponding 
> to
>  BM_LOAD_CONTEXT marked for deletion is deleted
>@return OthersIf failed to update the "BootOrder" variable after
> deletion.
> 
> @@ -645,25 +643,10 @@ EFI_STATUS
>  Var_DelBootOption (
>VOID
>);
> 
>  /**
> -  After any operation on Boot, there will be a discrepancy in BootOrder.
> -  Since some are missing but in BootOrder, while some are present but 
> are
> -  not reflected by BootOrder. Then a function rebuild BootOrder from
> -  scratch by content from BootOptionMenu is needed.
> -
> -  @retval  EFI_SUCCESS  The boot order is updated successfully.
> -  @return  other than EFI_SUCCESS if failed to change the "BootOrder" 
> EFI Variable.
> -
> -**/
> -EFI_STATUS
> -Var_ChangeBootOrder (
> -  VOID
> -  );
> -
> -/**
>This function create a currently loaded Drive Option from
>the BMM. It then appends this Driver Option to the end of
>the "DriverOrder" list. It append this Driver Opotion to the end
>of DriverOptionMenu.
> 
> @@ -685,13 +668,11 @@ Var_UpdateDriverOption (
>IN  UINT16*OptionalData,
>IN  UINT8 ForceReconnect
>);
> 
>  /**
> -  Delete Load Option that represent a Deleted state in BootOptionMenu.
> -  After deleting this Driver option, call Var_ChangeDriverOrder to
> -  make sure DriverOrder is in valid state.
> +  Delete Load Option that represent a Deleted state in DriverOptionMenu.
> 
>@retval EFI_SUCCESS Load Option is successfully updated.
>@return Other value than EFI_SUCCESS if failed to update "Driver Order"
> EFI
>Variable.
> 
> @@ -700,26 +681,10 @@ EFI_STATUS
>  Var_DelDriverOption (
>VOID
>);
> 
>  /**
> -  After any operation on Driver, there will be a discrepancy in
> -  DriverOrder. Since some are missing but in DriverOrder, while some
> -  are present but are not reflected by DriverOrder. Then a function
> -  rebuild DriverOrder from scratch by content from DriverOptionMenu 
> is
> -  needed.
> -
> -  @retval  EFI_SUCCESS  The driver order is updated successfully.
> -  @return  other than EFI_SUCCESS if failed to set the "DriverOrder" 
> EFI Variable.
> -
> -**/
> -EFI_STATUS
> -Var_ChangeDriverOrder (
> -  VOID
> -  );
> -
> -/**
>This function delete and build multi-instance device path ConIn
>console device.
> 
> 

Re: [edk2] [patch] Nt32Pkg: Fix VS2010/VS2012 build failure

2016-09-05 Thread Dong, Eric
Reviewed-by:  Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Tuesday, September 06, 2016 1:30 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [patch] Nt32Pkg: Fix VS2010/VS2012 build failure
> 
> Initialize the variable "OptionNumber".
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index dd67dab..76d926b 100644
> --- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> @@ -272,10 +272,12 @@ GetBootManagerMenuAppOption (
>UINTNBootOptionCount;
>EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
>UINTNIndex;
>UINTNOptionNumber;
> 
> +  OptionNumber = 0;
> +
>BootOptions = EfiBootManagerGetLoadOptions (, 
> LoadOptionTypeBoot);
> 
>for (Index = 0; Index < BootOptionCount; Index++) {
>  if (IsBootManagerMenuAppFilePath (BootOptions[Index].FilePath)) {
>OptionNumber = BootOptions[Index].OptionNumber;
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/UiApp: Fix incorrect question id

2016-09-08 Thread Dong, Eric
Reviewed-by:  Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg/UiApp: Fix incorrect question id
> 
> For a question, its question id can not be zero.
> This patch is to fix the issue that using zero as question id.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> index 93f6e4e..1505ef9 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c
> @@ -41,10 +41,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #define UI_HII_DRIVER_LIST_SIZE   0x8
> 
>  #define FRONT_PAGE_KEY_CONTINUE   0x1000
>  #define FRONT_PAGE_KEY_RESET  0x1001
>  #define FRONT_PAGE_KEY_LANGUAGE   0x1002
> +#define FRONT_PAGE_KEY_DRIVER 0x2000
> 
>  typedef struct {
>EFI_STRING_ID   PromptId;
>EFI_STRING_ID   HelpId;
>EFI_STRING_ID   DevicePathId;
> @@ -654,11 +655,11 @@ UiListThirdPartyDrivers (
>StartOpCodeHandle,
>0,
>gHiiDriverList[Index].PromptId,
>gHiiDriverList[Index].HelpId,
>0,
> -  0,
> +  (EFI_QUESTION_ID) (Index + FRONT_PAGE_KEY_DRIVER),
>0,
>[Index].FormSetGuid,
>gHiiDriverList[Index].DevicePathId
>  );
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "" tag in correctly

2016-09-08 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Dandan 
> Bi
> Sent: Thursday, September 08, 2016 5:10 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Gao, Liming
> Subject: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "" tag in 
>  correctly
> 
> This patch is to fix the incorrect logic when handling the "" tag
> in .
> 1. In UEFI spec, the "" tag is in upper case, but using the lower
> case in current codes by mistake.
> 2. The logic in checking the ReadOnly flag is not correct. Whether having
> "" tag must be consistent with the result of
> "ExtractReadOnlyFromOpCode" function.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 17 
> +
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> index 6682319..10a901f 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> @@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData (
>goto Done;
>  }
>  StringPtr = NextStringPtr;
> 
>  //
> -// 5. Find ReadOnly filter.
> +// 5. Find READONLY tag.
>  //
> -if ((StringPtr != NULL) && StrnCmp (StringPtr, L"", StrLen 
> (L"")) == 0) {
> +if ((StringPtr != NULL) && StrnCmp (StringPtr, L"", StrLen 
> (L"")) == 0) {
>ReadOnly = TRUE;
> -  StringPtr += StrLen (L"");
> +  StringPtr += StrLen (L"");
>  } else {
>ReadOnly = FALSE;
>  }
> 
>  //
> @@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData (
> 
>  //
>  // 8. Check the readonly flag.
>  //
>  if (ExtractReadOnlyFromOpCode (OpCode) != ReadOnly) {
> +  //
> +  // Extracting readonly flag form opcode and extracting "READONLY" tag 
> form KeywordString should have the same results.
> +  // If not, the input KeywordString must be incorrect, return the error 
> status to caller.
> +  //
> +  *ProgressErr = KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED;
> +  Status = EFI_INVALID_PARAMETER;
> +  goto Done;
> +}
> +if (ReadOnly) {
>*ProgressErr = KEYWORD_HANDLER_ACCESS_NOT_PERMITTED;
>Status = EFI_ACCESS_DENIED;
> -  goto Done;
> +  goto Done;
>  }
> 
>  //
>  // 9. Merge to the MultiKeywordResp string.
>  //
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] MdeModulePkg FormBrowserEx: Change its structure name with EDKII_ prefix

2016-09-21 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, September 22, 2016 10:05 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Tian, Feng
> Subject: [Patch] MdeModulePkg FormBrowserEx: Change its structure name with 
> EDKII_ prefix
> 
> EDKII implementation protocol should be with EDKII_ prefix.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Feng Tian <feng.t...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming@intel.com>
> ---
>  MdeModulePkg/Include/Protocol/FormBrowserEx.h | 11 ---
>  MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c |  2 +-
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.h|  2 +-
>  3 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Protocol/FormBrowserEx.h 
> b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
> index ef3e8cb..06ca50b 100644
> --- a/MdeModulePkg/Include/Protocol/FormBrowserEx.h
> +++ b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
> @@ -2,7 +2,7 @@
>Extension Form Browser Protocol provides the services that can be used to
>register the different hot keys for the standard Browser actions described 
> in UEFI specification.
> 
> -Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
> +Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
>  This program and the accompanying materials are licensed and made available 
> under
>  the terms and conditions of the BSD License that accompanies this 
> distribution.
>  The full text of the license may be found at
> @@ -19,7 +19,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #define FORM_BROWSER_EXTENSION_PROTOCOL_GUID  \
>{ 0x1f73b18d, 0x4630, 0x43c1, { 0xa1, 0xde, 0x6f, 0x80, 0x85, 0x5d, 0x7d, 
> 0xa4 } }
> 
> -typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL   
> EFI_FORM_BROWSER_EXTENSION_PROTOCOL;
> +typedef struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL   
> EDKII_FORM_BROWSER_EXTENSION_PROTOCOL;
> +
> +//
> +// To be compatible, keep EFI_FORM_BROWSER_EXTENSION_PROTOCOL definition
> +//
> +typedef EDKII_FORM_BROWSER_EXTENSION_PROTOCOL   
> EFI_FORM_BROWSER_EXTENSION_PROTOCOL;
> 
>  //
>  // Return value of SAVE_REMINDER() that describes whether the changed data 
> is saved or discarded.
> @@ -137,7 +142,7 @@ UINT32
>VOID
>);
> 
> -struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL {
> +struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL {
>SET_SCOPE  SetScope;
>REGISTER_HOT_KEY   RegisterHotKey;
>REGISTER_EXIT_HANDLER  RegiserExitHandler;
> diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c 
> b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> index ea6b124..a52c577 100644
> --- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> +++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
> @@ -1952,7 +1952,7 @@ DriverSampleInit (
>EFI_STRING  NameRequestHdr;
>MY_EFI_VARSTORE_DATA*VarStoreConfig;
>EFI_INPUT_KEY   HotKey;
> -  EFI_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;
> +  EDKII_FORM_BROWSER_EXTENSION_PROTOCOL *FormBrowserEx;
> 
>//
>// Initialize the local variables.
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h 
> b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
> index cbc5401..cc9f431 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
> @@ -90,7 +90,7 @@ typedef struct {
>// Produced protocol
>//
>EFI_FORM_BROWSER2_PROTOCOLFormBrowser2;
> -  EFI_FORM_BROWSER_EXTENSION_PROTOCOL   FormBrowserEx;
> +  EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;
> 
>EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2;
> 
> --
> 2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/3] MdeModulePkg HiiDatabaseDxe: Ignore new EFI_HII_IIBT_IMAGE_PNG type Image

2016-09-20 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Gao, Liming
> Sent: Wednesday, September 21, 2016 10:39 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Bi, Dandan
> Subject: [Patch 2/3] MdeModulePkg HiiDatabaseDxe: Ignore new 
> EFI_HII_IIBT_IMAGE_PNG type Image
> 
> HiiImage protocol implementation doesn't support EFI_HII_IIBT_IMAGE_PNG.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Dandan Bi <dandan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/Image.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
> index 612d57a..07b3ba0 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
> @@ -142,8 +142,9 @@ GetImageIdOrAddress (
>break;
> 
>  case EFI_HII_IIBT_IMAGE_JPEG:
> +case EFI_HII_IIBT_IMAGE_PNG:
>CopyMem (, ImageBlock + sizeof (EFI_HII_IMAGE_BLOCK), sizeof 
> (UINT32));
> -  ImageBlock += Length32;
> +  ImageBlock += OFFSET_OF (EFI_HII_IIBT_JPEG_BLOCK, Data) + Length32;
>ImageIdCurrent++;
>break;
> 
> @@ -895,6 +896,7 @@ HiiGetImage (
> 
>switch (BlockType) {
>case EFI_HII_IIBT_IMAGE_JPEG:
> +  case EFI_HII_IIBT_IMAGE_PNG:
>  //
>  // BUGBUG: need to be supported as soon as image tool is designed.
>  //
> @@ -1096,6 +1098,7 @@ HiiSetImage (
>//
>switch (BlockType) {
>case EFI_HII_IIBT_IMAGE_JPEG:
> +  case EFI_HII_IIBT_IMAGE_PNG:
>  //
>  // BUGBUG: need to be supported as soon as image tool is designed.
>  //
> @@ -1497,6 +1500,7 @@ HiiDrawImageId (
>//
>// Get the specified Image.
>//
> +  ZeroMem (, sizeof (Image));
>Status = HiiGetImage (This, PackageList, ImageId, );
>if (EFI_ERROR (Status)) {
>  return Status;
> --
> 2.8.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 1/3] MdePkg UefiHii: Add IMAGE_TOKEN macro to access image resource in C and VFR

2016-09-20 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming 
> Gao
> Sent: Wednesday, September 21, 2016 10:39 AM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan; Dong, Eric
> Subject: [edk2] [Patch 1/3] MdePkg UefiHii: Add IMAGE_TOKEN macro to access 
> image resource in C and VFR
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Dandan Bi <dandan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming@intel.com>
> ---
>  MdePkg/Include/Uefi/UefiInternalFormRepresentation.h | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h 
> b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
> index 4ac..ae5602f 100644
> --- a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
> +++ b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
> @@ -3,7 +3,7 @@
>IFR is primarily consumed by the EFI presentation engine, and produced by 
> EFI
>internal application and drivers as well as all add-in card option-ROM 
> drivers
> 
> -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
>  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  This program and the accompanying materials are licensed and made available 
> under
>  the terms and conditions of the BSD License that accompanies this 
> distribution.
> @@ -2126,4 +2126,10 @@ typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
>  ///
>  #define STRING_TOKEN(t) t
> 
> +///
> +/// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
> +/// here for the easy access by C files and VFR source files.
> +///
> +#define IMAGE_TOKEN(t) t
> +
>  #endif
> --
> 2.8.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in FrontPage.

2016-10-09 Thread Dong, Eric
Jiewen,

For below code, the Banner is IN/OUT type. If the old value is not NULL, you 
should free the old buffer before point to new one.

> +if (TestKeyForRecovery && TestKeyForFirmwareUpdate) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle,
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL);
> +}
> +else if (TestKeyForRecovery) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, 
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY), NULL);
> +}
> +else if (TestKeyForFirmwareUpdate) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, 
> STRING_TOKEN(STR_TEST_KEY_USED_FIRMWARE_UPDATE), NULL);
> +}

Thanks,
Eric

> -Original Message-
> From: Yao, Jiewen
> Sent: Sunday, October 09, 2016 7:59 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Ni, Ruiyu; Tian, Feng; Zeng, Star; Kinney, Michael D; Gao, 
> Liming
> Subject: [PATCH 2/4] MdeModulePkg/UiApp: Show test key warning info in 
> FrontPage.
> 
> The UiApp is updated to consume PcdTestKeyUsed to know if there is any
> test key used in current BIOS, such as recovery key,
> or capsule update key.
> Then UiApp show warning information in front page.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Feng Tian <feng.t...@intel.com>
> Cc: Star Zeng <star.z...@intel.com>
> Cc: Michael D Kinney <michael.d.kin...@intel.com>
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiewen Yao <jiewen@intel.com>
> ---
>  MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c | 34 
> 
>  MdeModulePkg/Application/UiApp/FrontPageStrings.uni|  8 -
>  MdeModulePkg/Application/UiApp/UiApp.inf   |  3 +-
>  3 files changed, 43 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c 
> b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c
> index 6e4f7b5..4070cd5 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c
> +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c
> @@ -16,8 +16,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR IMPLIED.
>  #include 
>  #include 
>  #include 
> +#include "FrontPage.h"
>  #include "FrontPageCustomizedUiSupport.h"
> 
> +#define TEST_KEY_USED_RECOVERY (BIT0 + BIT32)
> +#define TEST_KEY_USED_FIRMWARE_UPDATE  (BIT1 + BIT33)
> +
> +extern FRONT_PAGE_CALLBACK_DATA  gFrontPagePrivate;
> +
>  /**
>Customize menus in the page.
> 
> @@ -129,4 +135,32 @@ UiCustomizeFrontPageBanner (
>IN OUT EFI_STRING *BannerStr
>)
>  {
> +  UINT64  TestKeyUsed;
> +  BOOLEAN TestKeyForRecovery;
> +  BOOLEAN TestKeyForFirmwareUpdate;
> +
> +  if ((LineIndex == 5) && LeftOrRight) {
> +// Update STR_CUSTOMIZE_BANNER_LINE5_LEFT
> +TestKeyUsed = PcdGet64(PcdTestKeyUsed);
> +if ((TestKeyUsed & TEST_KEY_USED_RECOVERY) == TEST_KEY_USED_RECOVERY) {
> +  TestKeyForRecovery = TRUE;
> +} else {
> +  TestKeyForRecovery = FALSE;
> +}
> +if ((TestKeyUsed & TEST_KEY_USED_FIRMWARE_UPDATE) == 
> TEST_KEY_USED_FIRMWARE_UPDATE) {
> +  TestKeyForFirmwareUpdate = TRUE;
> +} else {
> +  TestKeyForFirmwareUpdate = FALSE;
> +}
> +if (TestKeyForRecovery && TestKeyForFirmwareUpdate) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle,
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY_AND_FIRMWARE_UPDATE), NULL);
> +}
> +else if (TestKeyForRecovery) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, 
> STRING_TOKEN(STR_TEST_KEY_USED_RECOVERY), NULL);
> +}
> +else if (TestKeyForFirmwareUpdate) {
> +  *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, 
> STRING_TOKEN(STR_TEST_KEY_USED_FIRMWARE_UPDATE), NULL);
> +}
> +  }
> +  return;
>  }
> diff --git a/MdeModulePkg/Application/UiApp/FrontPageStrings.uni 
> b/MdeModulePkg/Application/UiApp/FrontPageStrings.uni
> index 71cb788..8ba19dc 100644
> --- a/MdeModulePkg/Application/UiApp/FrontPageStrings.uni
> +++ b/MdeModulePkg/Application/UiApp/FrontPageStrings.uni
> @@ -2,7 +2,7 @@
>  //
>  //  String definitions for BdsPlatform formset.
>  //
> -//  Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
> +//  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
>  //  This program and the accompanying materials
>  //  are licensed and made available under the terms and conditions of the 
> BSD 

Re: [edk2] [PATCH v2 9/9] Nt32Pkg/PlatformBds: Dispatch deferred images after EndOfDxe

2016-11-08 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Ni, Ruiyu
> Sent: Tuesday, November 08, 2016 8:29 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [PATCH v2 9/9] Nt32Pkg/PlatformBds: Dispatch deferred images after 
> EndOfDxe
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu...@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> ---
>  Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index 7a840d0..99f30f9 100644
> --- a/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++ b/Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> @@ -124,6 +124,11 @@ PlatformBootManagerBeforeConsole (
>// the platform should signal the event EFI_END_OF_DXE_EVENT_GUID
>//
>EfiEventGroupSignal ();
> +
> +  //
> +  // Dispatch deferred images after EndOfDxe event.
> +  //
> +  EfiBootManagerDispatchDeferredImages ();
>  }
> 
>  /**
> --
> 2.9.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/BMMUI: add comments for function parameter

2016-11-09 Thread Dong, Eric
Reviewed-by: Eric Dong <eric.d...@intel.com>

> -Original Message-
> From: Bi, Dandan
> Sent: Thursday, November 10, 2016 3:40 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric
> Subject: [patch] MdeModulePkg/BMMUI: add comments for function parameter
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git 
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> index f40c61a..e49ab98 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
> @@ -569,10 +569,11 @@ UpdateTerminalContent (
>  }
> 
>  /**
>Update the console content in ConsoleMenu.
> 
> +  @param ConsoleName   The name for the console device type.
>@param BmmData   The BMM fake NV data.
> 
>  **/
>  VOID
>  UpdateConsoleContent(
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 52/52] BaseTools/VfrCompile/Pccts: Make assignment operator not returning void

2016-10-17 Thread Dong, Eric
 Hi Hao,

I have below comments:

Case 1: In order to keep consistence, can you also change other cases which 
still initialized with '\0'

  mOptions.VfrFileName[0]= '\0';
  mOptions.RecordListFile= NULL;
  mOptions.CreateRecordListFile  = FALSE;
  mOptions.CreateIfrPkgFile  = FALSE;
  mOptions.PkgOutputFileName = NULL;
  mOptions.COutputFileName   = NULL;
  mOptions.OutputDirectory[0]= '\0';
  mOptions.PreprocessorOutputFileName= NULL;
  mOptions.VfrBaseFileName[0]= '\0';


Case 2: for below case, you can use the actual size for the strncpy instead of 
MAX_PATH - 1. Also the last line code is not needed.

  if (strlen (Argv[Index]) > MAX_PATH - 1) {
DebugError (NULL, 0, 1003, "Invalid option value", "Output directory 
name %s is too long", Argv[Index]);
goto Fail;
  }
  strncpy (mOptions.OutputDirectory, Argv[Index], MAX_PATH - 1);
  mOptions.OutputDirectory[MAX_PATH - 1] = 0;

Thanks,
Eric
> -Original Message-
> From: Wu, Hao A
> Sent: Wednesday, October 12, 2016 8:21 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Gao, Liming; Zhu, Yonghong; Dong, Eric; Bi, Dandan
> Subject: [PATCH 52/52] BaseTools/VfrCompile/Pccts: Make assignment operator 
> not returning void
> 
> The assignment operators for class ANTLRTokenPtr return void in current
> code.
> 
> This commit makes them return the reference to the object just like
> primitive types do.
> 
> Cc: Liming Gao <liming@intel.com>
> Cc: Yonghong Zhu <yonghong@intel.com>
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Dandan Bi <dandan...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu <hao.a...@intel.com>
> ---
>  BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h | 4 ++--
>  BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h | 6 --
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h 
> b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h
> index 75b4c86..df89d8f 100644
> --- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h
> +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtr.h
> @@ -58,8 +58,8 @@ public:
>  //  7-Apr-97 133MR1
>  //Fix suggested by Andreas Magnusson
>  //   (andreas.magnus...@mailbox.swipnet.se)
> -void operator = (const ANTLRTokenPtr & lhs); // MR1
> -void operator = (ANTLRAbstractToken *addr);
> +ANTLRTokenPtr& operator = (const ANTLRTokenPtr & lhs);  // MR1
> +ANTLRTokenPtr& operator = (ANTLRAbstractToken *addr);
>  int operator != (const ANTLRTokenPtr ) const   // MR1 
> // MR11 unsigned -> int
>   { return this->ptr_ != q.ptr_; }
>  int operator == (const ANTLRTokenPtr ) const   // MR1 
> // MR11 unsigned -> int
> diff --git a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h 
> b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h
> index 9c07cf5..a1efc3b 100644
> --- a/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h
> +++ b/BaseTools/Source/C/VfrCompile/Pccts/h/ATokPtrImpl.h
> @@ -71,18 +71,20 @@ ANTLRTokenPtr::~ANTLRTokenPtr()
>  //  8-Apr-97 MR1 Make operator -> a const member function
>  // as weall as some other member functions
>  //
> -void ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs)   // MR1
> +ANTLRTokenPtr& ANTLRTokenPtr::operator = (const ANTLRTokenPtr & lhs)// 
> MR1
>  {
>  lhs.ref();   // protect against "xp = xp"; ie same underlying object
>  deref();
>  ptr_ = lhs.ptr_;
> +return *this;
>  }
> 
> -void ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr)
> +ANTLRTokenPtr& ANTLRTokenPtr::operator = (ANTLRAbstractToken *addr)
>  {
>  if (addr != NULL) {
>   addr->ref();
>  }
>  deref();
>  ptr_ = addr;
> +return *this;
>  }
> --
> 1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


  1   2   3   4   >