Re: [edk2] [PATCH] ShellPkg: Clarify the description of acpiview option '-s'

2019-04-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Gao, Zhichao
> Sent: Tuesday, April 02, 2019 2:44 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ray ;
> Gao, Liming 
> Subject: [PATCH] ShellPkg: Clarify the description of acpiview option '-s'
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1153
> 
> The '-s' option of 'acpiview' do not support multiply invcation options.
> So clarify it for users.
> Modify the help decription for UefiShellAcpiViewCommandLib which the
> description is equal or over 80 column. If the line include equal or over
> 80 characters. The display engine would display a blank line for those
> equal 80 characters or a extra line with few words for those over 80
> character. So it is better to keep each line less than 80 characters.
> 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> ---
>  .../UefiShellAcpiViewCommandLib.uni   | 24 ++-
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> index de2fb41067..775d7b1985 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> @@ -41,7 +41,8 @@
>  ".SH OPTIONS\r\n"
>  " \r\n"
>  "  -l - Display list of installed ACPI Tables.\r\n"
> -"  -s - Display only the specified AcpiTable type.\r\n"
> +"  -s - Display only the specified AcpiTable type and only support 
> single\r\n"
> +"   invocation option.\r\n"
>  " AcpiTable: The required ACPI Table type.\r\n"
>  "  -d - Generate a binary file dump of the specified AcpiTable.\r\n"
>  "  -c - Consistency checking (enabled by default).\r\n"
> @@ -54,21 +55,21 @@
>  ".SH DESCRIPTION\r\n"
>  " \r\n"
>  "  This program is provided to allow examination of ACPI table values from
> the\r\n"
> -"  UEFI Shell.  This can help with investigations, especially at that stage
> where\r\n"
> -"  the tables are not enabling an OS to boot.\r\n"
> +"  UEFI Shell.  This can help with investigations, especially at that 
> stage\r\n"
> +"  where the tables are not enabling an OS to boot.\r\n"
>  "  The program is not exhaustive, and only encapsulates detailed knowledge
> of a\r\n"
>  "  limited number of table types.\r\n"
>  " \r\n"
>  "  Default behaviour is to display the content of all tables installed.\r\n"
>  "  'Known' table types (listed in NOTES below) will be parsed and
> displayed\r\n"
> -"  with descriptions and field values.  Where appropriate a degree of
> consistency\r\n"
> -"  checking is done and errors may be reported in the output.\r\n"
> +"  with descriptions and field values.  Where appropriate a degree of\r\n"
> +"  consistency checking is done and errors may be reported in the
> output.\r\n"
>  "  Other table types will be displayed as an array of Hexadecimal bytes.\r\n"
>  " \r\n"
>  "  To facilitate debugging, the -s and -d options can be used to generate
> a\r\n"
>  "  binary file image of a table that can be copied elsewhere for
> investigation\r\n"
> -"  using tools such as those provided by acpica.org.  This is especially
> relevant\r\n"
> -"  for AML type tables like DSDT and SSDT.\r\n"
> +"  using tools such as those provided by acpica.org.  This is especially\r\n"
> +"  relevant for AML type tables like DSDT and SSDT.\r\n"
>  " \r\n"
>  "NOTES:\r\n"
>  "  1. The AcpiTable parameter can match any installed table type.\r\n"
> @@ -77,7 +78,8 @@
>  "  2. -s option supports to display the specified AcpiTable type that is
> present\r\n"
>  " in the system. For normal type AcpiTable, it would display the data of
> the\r\n"
>  " AcpiTable and AcpiTable header. The following type may contain header
> type\r\n"
> -" other than AcpiTable header. The actual header can refer to the ACPI
> spec 6.2\r\n"
> +" other than AcpiTable header. The actual header can refer to the ACPI
> spec\r\n"
> +" 6.2\r\n"
>  " Extra A. Particular types:\r\n"
>  "   APIC

Re: [edk2] [edk2-platforms][PATCH v2 0/2] Adding python build scripts to ClevoOpenBoardPkg , KabylakeOpenBoardPkg and PurleyOpenBoardPkg

2019-04-01 Thread Carsey, Jaben
Blurb missing.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Agyeman
> Sent: Monday, April 01, 2019 2:14 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [edk2-platforms][PATCH v2 0/2] Adding python build scripts
> to ClevoOpenBoardPkg , KabylakeOpenBoardPkg and PurleyOpenBoardPkg
> 
> *** BLURB HERE ***
> 
> Agyeman (2):
>   Platform/Intel: Added python build script.
>   ReadMe.md: Update the build instructions
> 
>  Platform/Intel/BuildBios.py   | 866 ++
>  .../ClevoOpenBoardPkg/N1xxWU/buildConfig.json |  31 +
>  .../KabylakeRvp3/BuildEx.py   |  17 +
>  .../KabylakeRvp3/buildConfig.json |  32 +
>  .../BoardMtOlympus/BuildBoard.py  | 100 ++
>  .../BoardMtOlympus/buildConfig.json   |  35 +
>  Platform/Intel/build.json |  55 ++
>  ReadMe.md |  14 +
>  8 files changed, 1150 insertions(+)
>  create mode 100644 Platform/Intel/BuildBios.py
>  create mode 100644
> Platform/Intel/ClevoOpenBoardPkg/N1xxWU/buildConfig.json
>  create mode 100644
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/BuildEx.py
>  create mode 100644
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/buildConfig.json
>  create mode 100644
> Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/BuildBoard.py
>  create mode 100644
> Platform/Intel/PurleyOpenBoardPkg/BoardMtOlympus/buildConfig.json
>  create mode 100644 Platform/Intel/build.json
> 
> --
> 2.19.1.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 3/4] ShellPkg/UefiHandleParsingLib: Remove some unused Guids

2019-03-28 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ray
> Sent: Thursday, March 28, 2019 6:50 PM
> To: Zhang, Shenglei ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: RE: [PATCH 3/4] ShellPkg/UefiHandleParsingLib: Remove some
> unused Guids
> Importance: High
> 
> Reviewed-by: Ray Ni 
> 
> > -Original Message-
> > From: Zhang, Shenglei
> > Sent: Friday, March 29, 2019 9:41 AM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben ; Ni, Ray 
> > Subject: [PATCH 3/4] ShellPkg/UefiHandleParsingLib: Remove some unused
> > Guids
> >
> > ExtendedSalBootService.h, ExtendedSalServiceClasses.h and McaInitPmi.h
> > will be deleted. So remove the Guids defined in these Protocols. And
> > also remove strings in uni file.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1560
> >
> > Cc: Jaben Carsey 
> > Cc: Ray Ni 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Shenglei Zhang 
> > ---
> >  .../UefiHandleParsingLib/UefiHandleParsingLib.c | 17 -
> >  .../UefiHandleParsingLib.inf| 17 -
> >  .../UefiHandleParsingLib.uni| 17 -
> >  3 files changed, 51 deletions(-)
> >
> > diff --git
> > a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> > index 2d94a52108..a106c0906c 100644
> > --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> > +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> > @@ -2321,23 +2321,6 @@ STATIC CONST GUID_INFO_BLOCK
> mGuidStringList[]
> > = {
> >{STRING_TOKEN(STR_FVB2),
> > ,NULL},
> >{STRING_TOKEN(STR_CPUIO2),,
> > NULL},
> >{STRING_TOKEN(STR_LEGACY_R2),
> ,
> > NULL},
> > -  {STRING_TOKEN(STR_SAL_MIP),   ,
> > NULL},
> > -  {STRING_TOKEN(STR_ES_BS),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_BIO),
> > ,   NULL},
> > -  {STRING_TOKEN(STR_ES_STALL),
> > ,NULL},
> > -  {STRING_TOKEN(STR_ES_RTC),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_VS),
> > , NULL},
> > -  {STRING_TOKEN(STR_ES_MTC),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_RESET),
> > ,NULL},
> > -  {STRING_TOKEN(STR_ES_SC),
> > ,   NULL},
> > -  {STRING_TOKEN(STR_ES_FBS),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_MP),
> > ,   NULL},
> > -  {STRING_TOKEN(STR_ES_PAL),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_BASE),
> > , NULL},
> > -  {STRING_TOKEN(STR_ES_MCA),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_PCI),
> > ,  NULL},
> > -  {STRING_TOKEN(STR_ES_CACHE),
> > ,NULL},
> > -  {STRING_TOKEN(STR_ES_MCA_LOG),
> > ,   NULL},
> >{STRING_TOKEN(STR_S2ARCH),,
> > NULL},
> >{STRING_TOKEN(STR_EODXE), ,
> > NULL},
> >{STRING_TOKEN(STR_ISAHC), ,
> > NULL},
> > diff --git
> > a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> > index a795fb92de..edab57f892 100644
> > --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> > +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> > @@ -234,23 +234,6 @@
> >gEfiFirmwareVolumeBlock2ProtocolGuid## UNDEFINED
> >gEfiCpuIo2ProtocolGuid  ## UNDEFINED
> >gEfiLegacyRegion2ProtocolGuid   ## UNDEFINED
> > -  gEfiSalMcaInitPmiProtocolGuid   ## UNDEFINED
> > -  gEfiExtendedSalBootServiceProtocolGuid  ## UNDEFINED
> > -  gEfiExtendedSalBaseIoServicesProtocolGuid   ## UNDEFINED
> > -  gEfiExtendedSalStallServicesProtocolGuid## UNDEFINED
> > -  gEfiExtendedSalRtcServicesProtocolGuid  ## UNDEFINED
> > -  gEfiExtendedSalVariableServicesProtocolGuid ## UNDEFINED
> > -  gEfiExtendedSalMtcServicesProtocolGuid  ## UNDEFINED
> > -  gEfiExtendedSalResetServicesProtocolGuid## UNDEFINED
> > -  gEfiExtendedSalStatusCodeServicesProtocolGuid   ## UNDEFINED
> > -  gEfiExtendedSalFvBlockServicesProtocolGuid  ## UNDEFINED
> > -  gEfiExtendedSalMpServicesProtocolGuid   ## UNDEFINED
> >

Re: [edk2] [PATCH 2/4] ShellPkg/UefiShellDebug1CommandsLib

2019-03-28 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ray
> Sent: Thursday, March 28, 2019 6:50 PM
> To: Zhang, Shenglei ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: RE: [PATCH 2/4] ShellPkg/UefiShellDebug1CommandsLib
> Importance: High
> 
> Reviewed-by: Ray Ni 
> 
> > -Original Message-
> > From: Zhang, Shenglei
> > Sent: Friday, March 29, 2019 9:41 AM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben ; Ni, Ray 
> > Subject: [PATCH 2/4] ShellPkg/UefiShellDebug1CommandsLib
> >
> > With Itanium architecture unsupported, gEfiSalSystemTableGuid and
> > gEfiMpsTableGuid will be no longer used.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1560
> >
> > Cc: Jaben Carsey 
> > Cc: Ray Ni 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Shenglei Zhang 
> > ---
> >  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 10 --
> >  .../UefiShellDebug1CommandsLib.inf |  2 --
> >  2 files changed, 12 deletions(-)
> >
> > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> > index a4c18c9b68..023806742d 100644
> > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
> > @@ -17,9 +17,7 @@
> >  #include "UefiShellDebug1CommandsLib.h"
> >  #include   #include 
> > -#include   #include  -#include
> > 
> >
> >  /**
> >Make a printable character.
> > @@ -186,10 +184,6 @@ ShellCommandRunDmem (
> >AcpiTableAddress = (UINT64)(UINTN)gST-
> > >ConfigurationTable[TableWalker].VendorTable;
> >continue;
> >  }
> > -if (CompareGuid(
> >ConfigurationTable[TableWalker].VendorGuid,
> > )) {
> > -  SalTableAddress = (UINT64)(UINTN)gST-
> > >ConfigurationTable[TableWalker].VendorTable;
> > -  continue;
> > -}
> >  if
> > (CompareGuid(>ConfigurationTable[TableWalker].VendorGuid,
> > )) {
> >SmbiosTableAddress = (UINT64)(UINTN)gST-
> > >ConfigurationTable[TableWalker].VendorTable;
> >continue;
> > @@ -198,10 +192,6 @@ ShellCommandRunDmem (
> >SmbiosTableAddress = (UINT64) (UINTN) gST-
> > >ConfigurationTable[TableWalker].VendorTable;
> >continue;
> >  }
> > -if (CompareGuid(
> >ConfigurationTable[TableWalker].VendorGuid,
> > )) {
> > -  MpsTableAddress = (UINT64)(UINTN)gST-
> > >ConfigurationTable[TableWalker].VendorTable;
> > -  continue;
> > -}
> >}
> >
> >ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> > (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, diff --git
> >
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsL
> > i
> > b.inf
> >
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsL
> > i
> > b.inf
> > index ec1f87ae19..f2666b7ff9 100644
> > ---
> >
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsL
> > i
> > b.inf
> > +++
> >
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> d
> > +++ sLib.inf
> > @@ -130,8 +130,6 @@
> >gEfiGlobalVariableGuid  ## SOMETIMES_CONSUMES ## GUID
> >gEfiSmbiosTableGuid ## SOMETIMES_CONSUMES ## SystemTable
> >gEfiSmbios3TableGuid## SOMETIMES_CONSUMES ## SystemTable
> > -  gEfiMpsTableGuid## SOMETIMES_CONSUMES ## SystemTable
> > -  gEfiSalSystemTableGuid  ## SOMETIMES_CONSUMES ## SystemTable
> >gEfiAcpi10TableGuid ## SOMETIMES_CONSUMES ## SystemTable
> >gEfiAcpi20TableGuid ## SOMETIMES_CONSUMES ## SystemTable
> >gShellDebug1HiiGuid ## SOMETIMES_CONSUMES ## HII
> > --
> > 2.18.0.windows.1

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


Re: [edk2] Enquiry on GetTimerPeriod function in Ping.c

2019-03-21 Thread Carsey, Jaben
Correct 0 is supposed to indicate an error.

That function may be incorrect for your platform. I think that function is used 
to help determine the granularity to use when determine how long it took for 
packets to make their trip over the network and back.

-Jaben

> -Original Message-
> From: Ooi, Tzy Way
> Sent: Thursday, March 21, 2019 5:20 AM
> To: Carsey, Jaben ; Ni, Ray ;
> edk2-devel@lists.01.org
> Cc: Loh, Tien Hock ; Ooi, Tzy Way
> 
> Subject: Enquiry on GetTimerPeriod function in Ping.c
> 
> Hi,
> 
> I am enabling an UEFI ethernet driver in our platform. While I tried to
> test the driver with ping command, I noticed that ping operation is
> aborted due to the GetTimerPeriod function return a value 0.
> 
> In the function GetTimerPeriod in ping.c, the function will return the
> value of StallCounter/RttTimerTick once it completed all the
> operations. However, the value return in my platform is zero due to
> StallCounter is having smaller value than RttTimerTick.
> 
> I am not sure what is the usage of GetTimerPeriod function and how it
> works. The GetTimerPeriod function will return 0 if any of the
> operation having an error during the execution. However, I suspect that
> this function should not return 0 when StallCounter is having less
> value than RttTimerTick? This is because the function actually did not
> encounter any error. Please correct me if I m wrong.
> 
> Thank you
> 
> Best regards,
> Tzy Way
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Fixed the issue of BaseTools Make cleanall failed.

2019-03-14 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Thursday, March 14, 2019 7:48 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] BaseTools: Fixed the issue of BaseTools Make cleanall
> failed.
> 
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1622
> There is duplicated $(PYTHON_COMMAND) in the
> command of cleanall
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/C/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/Makefile b/BaseTools/Source/C/Makefile
> index 08f0081212..ca71bd1178 100644
> --- a/BaseTools/Source/C/Makefile
> +++ b/BaseTools/Source/C/Makefile
> @@ -65,10 +65,10 @@ clean:
>@if defined PYTHON_COMMAND $(PYTHON_COMMAND)
> Makefiles\NmakeSubdirs.py clean $(LIBRARIES) $(APPLICATIONS)
>@if not defined PYTHON_COMMAND $(PYTHON_HOME)\python.exe
> Makefiles\NmakeSubdirs.py clean $(LIBRARIES) $(APPLICATIONS)
> 
>  .PHONY: cleanall
>  cleanall:
> -  @if defined PYTHON_COMMAND $(PYTHON_COMMAND)
> $(PYTHON_COMMAND) Makefiles\NmakeSubdirs.py cleanall $(LIBRARIES)
> $(APPLICATIONS)
> -  @if not defined PYTHON_COMMAND $(PYTHON_HOME)\python.exe
> $(PYTHON_COMMAND) Makefiles\NmakeSubdirs.py cleanall $(LIBRARIES)
> $(APPLICATIONS)
> +  @if defined PYTHON_COMMAND $(PYTHON_COMMAND)
> Makefiles\NmakeSubdirs.py cleanall $(LIBRARIES) $(APPLICATIONS)
> +  @if not defined PYTHON_COMMAND $(PYTHON_HOME)\python.exe
> Makefiles\NmakeSubdirs.py cleanall $(LIBRARIES) $(APPLICATIONS)
> 
>  !INCLUDE Makefiles\ms.rule
> 
> --
> 2.18.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] ShellPkg/UefiShellAcpiViewCommandLib: Change the note in uni

2019-03-06 Thread Carsey, Jaben
Good catch.  After fixing this typo, my RB stands.

Sent from my iPad

On Mar 6, 2019, at 7:59 AM, Nariman Poushin 
mailto:nariman.pous...@linaro.org>> wrote:



On Wed, 6 Mar 2019 at 15:54, Carsey, Jaben 
mailto:jaben.car...@intel.com>> wrote:
Reviewed-by: Jaben Carsey 
mailto:jaben.car...@intel.com>>

> -Original Message-
> From: Gao, Zhichao
> Sent: Tuesday, March 05, 2019 11:05 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Ni, Ray mailto:ray...@intel.com>>; Carsey, Jaben 
> mailto:jaben.car...@intel.com>>;
> Gao, Liming mailto:liming@intel.com>>
> Subject: [PATCH] ShellPkg/UefiShellAcpiViewCommandLib: Change the note
> in uni
> Importance: High
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1146
>
> Add DSDT and SSDT description in the help information. Depend
> on the implement of UefiShellAcpiViewCommandLib, the "acpiview"
> command support to show all present type in the system not only
> support the listed type in the help information. So change the
> help information of this command.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> mailto:zhichao@intel.com>>
> Cc: Ruiyu Ni mailto:ruiyu...@intel.com>>
> Cc: Jaben Carsey mailto:jaben.car...@intel.com>>
> Cc: Liming Gao mailto:liming@intel.com>>
> ---
>  .../UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.uni   | 8
> +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> index 0762eeba53..f2a2400b91 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> @@ -74,10 +74,15 @@
>  "  1. The AcpiTable parameter can match any installed table type.\r\n"
>  " Tables without specific handling will be displayed as a raw hex dump
> (or\r\n"
>  " dumped to a file if -d is used).\r\n"
> -"  2. Formatted display and checking is provided for these signature
> types:\r\n"
> +"  2. -s option supports to display the specified AcpiTable type that is
> present\r\n"
> +" in the system. For normal type AcpiTable, it would display the data of
> the\r\n"
> +" AcpiTable and AcpiTable header. The following type may contain header
> type\r\n"
> +" other than AcpiTable header. The acual header can refer to the ACPI
> spec 6.2\r\n"
> +" Extra A. Particual types:\r\n"

Should this be "Particular"?

>  "   APIC  - Multiple APIC Description Table (MADT)\r\n"
>  "   BGRT  - Boot Graphics Resource Table\r\n"
>  "   DBG2  - Debug Port Table 2\r\n"
> +"   DSDT  - Differentiated System Description Table\r\n"
>  "   FACP  - Fixed ACPI Description Table (FADT)\r\n"
>  "   GTDT  - Generic Timer Description Table\r\n"
>  "   IORT  - IO Remapping Table\r\n"
> @@ -87,6 +92,7 @@
>  "   SLIT  - System Locality Information Table\r\n"
>  "   SPCR  - Serial Port Console Redirection Table\r\n"
>  "   SRAT  - System Resource Affinity Table\r\n"
> +"   SSDT  - Secondary SystemDescription Table\r\n"
>  "   XSDT  - Extended System Description Table\r\n"
>  " \r\n"
>  ".SH STANDARDS\r\n"
> --
> 2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org<mailto: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] ShellPkg/UefiShellAcpiViewCommandLib: Change the note in uni

2019-03-06 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Gao, Zhichao
> Sent: Tuesday, March 05, 2019 11:05 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ray ; Carsey, Jaben ;
> Gao, Liming 
> Subject: [PATCH] ShellPkg/UefiShellAcpiViewCommandLib: Change the note
> in uni
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1146
> 
> Add DSDT and SSDT description in the help information. Depend
> on the implement of UefiShellAcpiViewCommandLib, the "acpiview"
> command support to show all present type in the system not only
> support the listed type in the help information. So change the
> help information of this command.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Cc: Liming Gao 
> ---
>  .../UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.uni   | 8
> +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> index 0762eeba53..f2a2400b91 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm
> andLib.uni
> @@ -74,10 +74,15 @@
>  "  1. The AcpiTable parameter can match any installed table type.\r\n"
>  " Tables without specific handling will be displayed as a raw hex dump
> (or\r\n"
>  " dumped to a file if -d is used).\r\n"
> -"  2. Formatted display and checking is provided for these signature
> types:\r\n"
> +"  2. -s option supports to display the specified AcpiTable type that is
> present\r\n"
> +" in the system. For normal type AcpiTable, it would display the data of
> the\r\n"
> +" AcpiTable and AcpiTable header. The following type may contain header
> type\r\n"
> +" other than AcpiTable header. The acual header can refer to the ACPI
> spec 6.2\r\n"
> +" Extra A. Particual types:\r\n"
>  "   APIC  - Multiple APIC Description Table (MADT)\r\n"
>  "   BGRT  - Boot Graphics Resource Table\r\n"
>  "   DBG2  - Debug Port Table 2\r\n"
> +"   DSDT  - Differentiated System Description Table\r\n"
>  "   FACP  - Fixed ACPI Description Table (FADT)\r\n"
>  "   GTDT  - Generic Timer Description Table\r\n"
>  "   IORT  - IO Remapping Table\r\n"
> @@ -87,6 +92,7 @@
>  "   SLIT  - System Locality Information Table\r\n"
>  "   SPCR  - Serial Port Console Redirection Table\r\n"
>  "   SRAT  - System Resource Affinity Table\r\n"
> +"   SSDT  - Secondary SystemDescription Table\r\n"
>  "   XSDT  - Extended System Description Table\r\n"
>  " \r\n"
>  ".SH STANDARDS\r\n"
> --
> 2.16.2.windows.1

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


Re: [edk2] [Patch] Document: Update Build spec to remove EDK related contents

2019-03-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, March 04, 2019 9:28 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch] Document: Update Build spec to remove EDK related
> contents
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents from Build spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  .../103_build_intermediate_images.md  |  3 +-
>  12_build_changes_and_customizations/README.md |  4 +-
>  .../42_build_process_overview.md  |  6 +-
>  .../46_file_specifications.md | 20 +
>  6_quick_start/61_environment_variables.md | 24 +-
>  .../82_auto-generation_process.md | 76 +++
>  .../83_auto-generated_code.md | 43 +++
>  .../85_auto-generated_makefiles.md| 23 +++---
>  9_build_or_make_stage/README.md   |  9 +--
>  appendix_a_variables.md   |  3 +-
>  10 files changed, 43 insertions(+), 168 deletions(-)
> 
> diff --git a/10_post-build_imagegen_stage_-
> _flash/103_build_intermediate_images.md b/10_post-
> build_imagegen_stage_-_flash/103_build_intermediate_images.md
> index 5f5aefc..9253cde 100644
> --- a/10_post-build_imagegen_stage_-
> _flash/103_build_intermediate_images.md
> +++ b/10_post-build_imagegen_stage_-
> _flash/103_build_intermediate_images.md
> @@ -1,9 +1,9 @@
>  
> 
>  # 12 Build Changes and Customizations
> 
>  This chapter deals with customizing a build, including options and settings 
> for
> -debugging, using custom tools as well as how to customize EDK component
> builds
> +debugging, using custom tools.
> diff --git
> a/4_edk_ii_build_process_overview/42_build_process_overview.md
> b/4_edk_ii_build_process_overview/42_build_process_overview.md
> index d0725d3..17ed278 100644
> --- a/4_edk_ii_build_process_overview/42_build_process_overview.md
> +++ b/4_edk_ii_build_process_overview/42_build_process_overview.md
> @@ -1,9 +1,9 @@
>  
> 
>  ## 4.2 Build Process Overview
> 
>  Prior to executing a build command, specific system environment variables
> must
> -be initialized: `WORKSPACE`, `EDK_TOOLS_PATH` are required for all builds,
> -while `ECP_SOURCE`, `EFI_SOURCE` and `EDK_SOURCE` are only required to
> build
> -EDK II platforms that contain EDK components and EDK libraries.
> Additionally,
> +be initialized: `WORKSPACE`, `EDK_TOOLS_PATH` are required for all builds.
> Additionally,
>  the provided EDK II tool set must be present in a directory that is in the
>  system environment variable: PATH. The edksetup scripts provided in the
> root
>  directory of the EDK II development tree will set the `WORKSPACE` and
>  `EDK_TOOLS_PATH`, as well as modify the system environment variable,
> PATH to
>  ensure that the tools can execute. Refer to "_Build Environment_" for more
> diff --git a/4_edk_ii_build_process_overview/46_file_specifications.md
> b/4_edk_ii_build_process_overview/46_file_specifications.md
> index a606488..f30f806 100644
> --- a/4_edk_ii_build_process_overview/46_file_specifications.md
> +++ b/4_edk_ii_build_process_overview/46_file_specifications.md
> @@ -1,9 +1,9 @@
>   ---:|
>  | `$(WORKSPACE)`  | `%WORKSPACE%`| 
> `$WORKSPACE`
> |
> -| `$(EFI_SOURCE)` | `%EFI_SOURCE%`   | 
> `$EFI_SOURCE`
> |
> -| `$(EDK_SOURCE)` | `%EDK_SOURCE%`   | 
> `$EDK_SOURCE`
> |
>  | `$(EDK_TOOLS_PATH)` | `%EDK_TOOLS_PATH%`   |
> `$EDK_TOOLS_PATH` |
> -| `$(ECP_SOURCE)` | `%ECP_SOURCE%`   | 
> `$ECP_SOURCE`
> |
> 
>  **
>  **Note:** The `PACKAGES_PATH` and `EDK_TOOLS_BIN` system
> environment variables
>  shall not be referenced in EDK II meta-data files.
>  **
> @@ -413,13 +407,10 @@ conditional directives. Macros can also be defined
> or used in the `[Defines]`,
>  `[LibraryClasses]`, `[Libraries]`, `[Components]` and all PCD sections.
> 
>  Macros defined by the user may be used in the !include statements in DSC
> and
>  FDF files.
> 
> -`EDK_GLOBAL` type macros defined in the DSC file can be used in later
> sections
> -of the DSC, FDF and any of the included

Re: [edk2] [Patch] Document: Update DSC spec to remove EDK related contents

2019-03-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

It's a lot of changes. It looks good to me.

> -Original Message-
> From: Feng, Bob C
> Sent: Monday, March 04, 2019 7:49 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch] Document: Update DSC spec to remove EDK related
> contents
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1453
> 
> Remove EDK related contents inf Dsc spec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  1_introduction/11_overview.md | 14 +--
>  ...=> 210_[components]_section_processing.md} | 27 +-
>  ...ion.md => 211_[userextensions]_section.md} |  4 +-
>  ...212_[defaultstores]_section_processing.md} |  4 +-
>  .../22_build_description_file_format.md   | 50 ++
>  .../23_[defines]_section_processing.md| 12 +--
>  2_dsc_overview/24_[buildoptions]_section.md   | 72 ++
>  .../26_[libraries]_section_processing.md  | 69 --
>  ...26_[libraryclasses]_section_processing.md} |  4 +-
>  ...essing.md => 27_pcd_section_processing.md} | 34 +++
>  ...{29_pcd_sections.md => 28_pcd_sections.md} | 26 ++---
>  ...210_pcd_database.md => 29_pcd_database.md} |  4 +-
>  ...ctions.md => 310_[components]_sections.md} | 62 +---
>  ...ns.md => 311_[userextensions]_sections.md} |  4 +-
>  ...tion.md => 312_[defaultstores]_section.md} |  4 +-
>  3_edk_ii_dsc_file_format/32_general_rules.md  | 13 +--
>  .../33_platform_dsc_definition.md | 17 +---
>  .../35_[defines]_section.md   | 12 +--
>  .../36_[buildoptions]_sections.md | 19 ++--
>  .../38_[libraries]_sections.md| 94 ---
>  ...ons.md => 38_[libraryclasses]_sections.md} |  4 +-
>  ...310_pcd_sections.md => 39_pcd_sections.md} | 14 +--
>  22 files changed, 101 insertions(+), 462 deletions(-)
>  rename 2_dsc_overview/{211_[components]_section_processing.md =>
> 210_[components]_section_processing.md} (84%)
>  rename 2_dsc_overview/{212_[userextensions]_section.md =>
> 211_[userextensions]_section.md} (93%)
>  rename 2_dsc_overview/{213_[defaultstores]_section_processing.md =>
> 212_[defaultstores]_section_processing.md} (93%)
>  delete mode 100644 2_dsc_overview/26_[libraries]_section_processing.md
>  rename 2_dsc_overview/{27_[libraryclasses]_section_processing.md =>
> 26_[libraryclasses]_section_processing.md} (96%)
>  rename 2_dsc_overview/{28_pcd_section_processing.md =>
> 27_pcd_section_processing.md} (94%)
>  rename 2_dsc_overview/{29_pcd_sections.md => 28_pcd_sections.md}
> (93%)
>  rename 2_dsc_overview/{210_pcd_database.md => 29_pcd_database.md}
> (96%)
>  rename 3_edk_ii_dsc_file_format/{311_[components]_sections.md =>
> 310_[components]_sections.md} (81%)
>  rename 3_edk_ii_dsc_file_format/{312_[userextensions]_sections.md =>
> 311_[userextensions]_sections.md} (94%)
>  rename 3_edk_ii_dsc_file_format/{313_[defaultstores]_section.md =>
> 312_[defaultstores]_section.md} (93%)
>  delete mode 100644 3_edk_ii_dsc_file_format/38_[libraries]_sections.md
>  rename 3_edk_ii_dsc_file_format/{39_[libraryclasses]_sections.md =>
> 38_[libraryclasses]_sections.md} (95%)
>  rename 3_edk_ii_dsc_file_format/{310_pcd_sections.md =>
> 39_pcd_sections.md} (97%)
> 
> diff --git a/1_introduction/11_overview.md
> b/1_introduction/11_overview.md
> index d9006df..ff2b517 100644
> --- a/1_introduction/11_overview.md
> +++ b/1_introduction/11_overview.md
> @@ -1,9 +1,9 @@
>   |:-:|::|:-:|::|:-:|:
> :|
>  | EDK Build Tools| YES   | NO   | YES   | NO   | 
> YES   | NO   |
> -| EDK II Build Tools | NO| YES  | NO| YES  | 
> YES   | YES
> |
> +| EDK II Build Tools | NO| YES  | NO| YES  | 
> NO| YES
> |
> 
>  **
>  **Note:** This document is intended for persons doing EFI development
> and
>  support for different platforms. It is most likely only of interest in the
>  event that there is a problem with a build, or if a developer needs to
> perform
> @@ -90,9 +87,6 @@ contain information on the EFI format for FFS or FV file
> creation. The
>  Makefiles will support third party compilation tools - Microsoft, Intel and
> GCC
>  tool chains - and at least one EDK II tool, GenFw. The GenFw tool is used to
>  manipulate the files emitted from the compilation tools.
> 
>  The EDK II build provides UEFI and PI (Unified EFI, Inc.)
> -specifica

Re: [edk2] [PATCH] ShellPkg: Correct a parameter's name

2019-03-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Monday, March 04, 2019 6:06 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ray 
> Subject: [PATCH] ShellPkg: Correct a parameter's name
> Importance: High
> 
> The parameter FilePath of ShellOpenFileByName defined in
> ShellLib.h is incorrect. It should be FileName.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1221
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> ---
>  ShellPkg/Include/Library/ShellLib.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Include/Library/ShellLib.h
> b/ShellPkg/Include/Library/ShellLib.h
> index 2ecc5ee006..78bdcc8c53 100644
> --- a/ShellPkg/Include/Library/ShellLib.h
> +++ b/ShellPkg/Include/Library/ShellLib.h
> @@ -161,7 +161,7 @@ ShellOpenFileByDevicePath(
>otherwise, the Filehandle is NULL. Attributes is valid only for
>EFI_FILE_MODE_CREATE.
> 
> -  @param[in] FilePath   The pointer to file name.
> +  @param[in] FileName   The pointer to file name.
>@param[out] FileHandleThe pointer to the file handle.
>@param[in] OpenMode   The mode to open the file with.
>@param[in] Attributes The file's file attributes.
> @@ -186,7 +186,7 @@ ShellOpenFileByDevicePath(
>  EFI_STATUS
>  EFIAPI
>  ShellOpenFileByName(
> -  IN CONST CHAR16   *FilePath,
> +  IN CONST CHAR16   *FileName,
>OUT SHELL_FILE_HANDLE *FileHandle,
>IN UINT64 OpenMode,
>IN UINT64 Attributes
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH V2] BaseTools:Run packagedoc_cli.py to generate doc failed

2019-03-01 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Fan, ZhijuX
> Sent: Thursday, February 28, 2019 6:52 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH V2] BaseTools:Run packagedoc_cli.py to generate
> doc failed
> 
> The reason for this problem is that the file was opened incorrectly.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  .../plugins/EdkPlugins/edk2/model/doxygengen.py| 7 
> ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git
> a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/mode
> l/doxygengen.py
> b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/mod
> el/doxygengen.py
> index e31df262bc..73349e2f48 100644
> ---
> a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/mode
> l/doxygengen.py
> +++
> b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/mod
> el/doxygengen.py
> @@ -376,9 +376,10 @@ class PackageDocumentAction(DoxygenAction):
>  return
> 
>  try:
> -f = open(path, 'r')
> -lines = f.readlines()
> -f.close()
> +with open(path, 'r') as f:
> +lines = f.readlines()
> +except UnicodeDecodeError:
> +return
>  except IOError:
>  ErrorMsg('Fail to open file %s' % path)
>  return
> --
> 2.14.1.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 V3] BaseTools: Add python3-distutils Ubuntu package checking

2019-02-28 Thread Carsey, Jaben
Is this something that should also get added to edksetup?  Force users to get 
the error without running this test.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Thursday, February 28, 2019 5:19 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch V3] BaseTools: Add python3-distutils Ubuntu package
> checking
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1509
> 
> Add python3-distutils Ubuntu package checking.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Tests/RunTests.py | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py
> index 0dd65632d0..356c1d600c 100644
> --- a/BaseTools/Tests/RunTests.py
> +++ b/BaseTools/Tests/RunTests.py
> @@ -17,10 +17,17 @@
>  #
>  import os
>  import sys
>  import unittest
> 
> +try:
> +import distutils.util
> +except ModuleNotFoundError:
> +sys.exit('''
> +Python reported: "No module named 'distutils.uitl'"
> +''')
> +
>  import TestTools
> 
>  def GetCTestSuite():
>  import CToolsTests
>  return CToolsTests.TheTestSuite()
> --
> 2.20.1.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] Document: Update Dsc spec to all empty value for HIIPcd

2019-02-28 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Wednesday, February 27, 2019 6:11 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] Document: Update Dsc spec to all empty value for
> HIIPcd
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1466
> 
> Update Dsc spec to all empty value for HIIPcd.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  2_dsc_overview/29_pcd_sections.md| 4 ++--
>  3_edk_ii_dsc_file_format/310_pcd_sections.md | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/2_dsc_overview/29_pcd_sections.md
> b/2_dsc_overview/29_pcd_sections.md
> index 791125f..d84d2f4 100644
> --- a/2_dsc_overview/29_pcd_sections.md
> +++ b/2_dsc_overview/29_pcd_sections.md
> @@ -230,11 +230,11 @@ example:
>  `[PcdsDynamicHii.common.Sku1]`
> 
>  While the format for content of this section is as follows, note that the
>  backslash character is used here to indicate the continuation of the line:
> 
> -
> `PcdTokenSpaceGuidCName.PcdCName|VariableName|VariableGuid|Varia
> bleOffset[|HiiDefaultValue[|HiiAttrubte]]`
> +`PcdTokenSpaceGuidCName.PcdCName|VariableName|VariableGuid|Vari
> ableOffset[|[HiiDefaultValue][|HiiAttrubte]]`
> 
>  For VOID* PCDs, the HiiDefaultValue will be a pointer; specifying the
> optional
>  HiiDefaultValue has no meaning.
> 
>  The optional HII Attribute entry is a comma separated list of attributes as
> @@ -340,11 +340,11 @@ Specifying a `SKUID` for an HII PCD selection is
> optional, for example:
>  `[PcdsDynamicExHii.common.Sku1]`
> 
>  While the format for content of this section is as follows, note that the
>  backslash character is used here to indicate the continuation of the line:
> 
> -
> `PcdTokenSpaceGuidCName.PcdCName|VariableName|VariableGuid|Varia
> bleOffset[|HiiDefaultValue]`
> +`PcdTokenSpaceGuidCName.PcdCName|VariableName|VariableGuid|Vari
> ableOffset[|[HiiDefaultValue]]`
> 
>  The optional HII Attribute entry is a comma separated list of attributes as
>  described in Table 9 HII Attributes.
> 
>  **Note:** The VariableName field in the HII format PCD entry must not be
> an empty string.
> diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md
> b/3_edk_ii_dsc_file_format/310_pcd_sections.md
> index f9f1359..f982d60 100644
> --- a/3_edk_ii_dsc_file_format/310_pcd_sections.md
> +++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md
> @@ -503,11 +503,11 @@ sections of the DSC file.
>   ::= {} {} [ ]
> ::= 
>::= {} {}
>   ::= []
> ::= 
> - ::=   [ ]
> + ::=  [] [ ]
>   ::= 
> ::= if (pcddatumtype == "BOOLEAN"):
> {} {}
>   elif (pcddatumtype == "UINT8"):
> {} {}
> @@ -721,11 +721,11 @@ sections of the DSC file.
>   ::= {} {} [ ]
> ::= 
>::= {} {}
>   ::= []
> ::= 
> - ::=   [ ]
> + ::=  [] [ ]
>   ::= 
> ::= if (pcddatumtype == "BOOLEAN"):
> {} {}
>   elif (pcddatumtype == "UINT8"):
> {} {}
> --
> 2.20.1.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] Document: Update the INF spec about [Depex] section

2019-02-28 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Wednesday, February 27, 2019 6:12 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] Document: Update the INF spec about [Depex]
> section
> 
>  ::= {"BEFORE"} {"AFTER"}  should be
>  ::= [{"BEFORE"} {"AFTER"}]
> 
> The "BEFORE" or "AFTER" is optional key words in current implementation.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  3_edk_ii_inf_file_format/314_[depex]_sections.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/3_edk_ii_inf_file_format/314_[depex]_sections.md
> b/3_edk_ii_inf_file_format/314_[depex]_sections.md
> index 942bcf9..3c0820a 100644
> --- a/3_edk_ii_inf_file_format/314_[depex]_sections.md
> +++ b/3_edk_ii_inf_file_format/314_[depex]_sections.md
> @@ -179,11 +179,11 @@ and VOID* datum type, and the size of the PCD
> must be 16 bytes.
>   ::= {} {} {}
> ::= *
>   ["END" ]
>   ::= {} {}
> ::= 
> -  ::= {"BEFORE"} {"AFTER"}  []
> +  ::= [{"BEFORE"} {"AFTER"}] 
> []
>::= {} {}
>  ::= "PUSH"  []
>  ::= "SOR"  []
> ::= {} {}
> ::= {"TRUE"} {"FALSE"} {} {} []
> --
> 2.20.1.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] StdLib: Update resolv.conf to use Google's public DNS servers

2019-02-25 Thread Carsey, Jaben
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Monday, February 25, 2019 11:41 AM
> To: Rebecca Cran ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Daryl McDaniel  li...@mc2research.org>
> Subject: Re: [edk2] [PATCH] StdLib: Update resolv.conf to use Google's public
> DNS servers
> Importance: High
> 
> On 02/25/19 19:36, Rebecca Cran via edk2-devel wrote:
> > The current servers listed appear to be unusable. I suspect most
> > people will get correct DNS servers via DHCP, but the defaults
> > should work for anyone.
> >
> > Change the entries to be Google's public DNS servers.
> > Also, change the domain name to be example.com, to be more applicable
> > to consumers outside Intel.
> > ---
> >  StdLib/Efi/StdLib/etc/resolv.conf | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/StdLib/Efi/StdLib/etc/resolv.conf
> b/StdLib/Efi/StdLib/etc/resolv.conf
> > index 3ac16ac230..724e6297b2 100644
> > --- a/StdLib/Efi/StdLib/etc/resolv.conf
> > +++ b/StdLib/Efi/StdLib/etc/resolv.conf
> > @@ -1,13 +1,13 @@
> >  #
> >  #   Domain name
> >  #
> > -domain  intel.com
> > +domain  example.com
> >
> >  ;
> >  ;   Name Servers
> >  ;
> > -nameserver  206.63.63.61
> > -nameserver  216.251.100.1
> > +nameserver  8.8.8.8
> > +nameserver  8.8.4.4
> >
> >  ; nameserver  10.248.2.1
> >  ; nameserver  10.22.224.204
> >
> 
> Reviewed-by: Laszlo Ersek 
> 
> I'm quite undecided, but I vaguely feel that this should be pushed only
> after we tag "edk2-stable201903". The domain name change doesn't look
> like a pure bugfix, especially for Intel associates. Opinions?

Reviewed-by: Jaben Carsey 

I have no strong opinion on timing.

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


Re: [edk2] [PATCH] StdLib: Update resolv.conf to use Google's DNS servers.

2019-02-25 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Monday, February 25, 2019 2:11 AM
> To: Rebecca Cran ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Daryl McDaniel  li...@mc2research.org>
> Subject: Re: [edk2] [PATCH] StdLib: Update resolv.conf to use Google's DNS
> servers.
> Importance: High
> 
> On 02/23/19 04:41, Rebecca Cran via edk2-devel wrote:
> > Sorry, I've fixed the subject line and added maintainers to the Cc list.
> >
> > This patch also changes the domain from intel.com to example.com, to be
> > more applicable to consumers outside Intel.
> >
> >
> > --
> >
> > Rebecca Cran
> >
> >
> > On 2/22/19 8:38 PM, Rebecca Cran wrote:
> >> The current servers listed appear to be unusable. I suspect most
> >> people will get correct DNS servers via DHCP, but the defaults
> >> should work for anyone.
> >> ---
> >>   StdLib/Efi/StdLib/etc/resolv.conf | 6 +++---
> >>   1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/StdLib/Efi/StdLib/etc/resolv.conf
> >> b/StdLib/Efi/StdLib/etc/resolv.conf
> >> index 3ac16ac230..724e6297b2 100644
> >> --- a/StdLib/Efi/StdLib/etc/resolv.conf
> >> +++ b/StdLib/Efi/StdLib/etc/resolv.conf
> >> @@ -1,13 +1,13 @@
> >>   #
> >>   #   Domain name
> >>   #
> >> -domain  intel.com
> >> +domain  example.com
> >>     ;
> >>   ;   Name Servers
> >>   ;
> >> -nameserver  206.63.63.61
> >> -nameserver  216.251.100.1
> >> +nameserver  8.8.8.8
> >> +nameserver  8.8.4.4
> >>     ; nameserver  10.248.2.1
> >>   ; nameserver  10.22.224.204
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> 
> Can you please repost the patch with an updated subject line / commit
> message? That way we can apply it with git-am without tweaking on the
> maintainer side.
> 
> In v2, you can include:
> 
> Reviewed-by: Laszlo Ersek 
> 
> (If reposting is too much burden, I can do the changes manually once the
> ShellPkg maintainers okay the patch; it's just that the less a
> maintainer has to update a patch, the safer / more robust the process is.)
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch V2] BaseTools: replace Sdict with OrderedDict in UPT

2019-02-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Feng, Bob C
> Sent: Tuesday, February 19, 2019 7:44 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch V2] BaseTools: replace Sdict with OrderedDict in UPT
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1504
> 
> V2: import OrderredDict as Sdict in Misc.py instead
> updating all the py files.
> 
> Sdict class is removed on the commit
> 174a9d3cc8f74f7a731ac5f16ce6864c8eb359ec
> but there are still some py files import it.
> 
> This patch is to use collections.OrderedDict to replace Sdict.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/Python/UPT/Library/Misc.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py
> b/BaseTools/Source/Python/UPT/Library/Misc.py
> index e7ee27cc53..0967ea53d1 100644
> --- a/BaseTools/Source/Python/UPT/Library/Misc.py
> +++ b/BaseTools/Source/Python/UPT/Library/Misc.py
> @@ -1,9 +1,9 @@
>  ## @file
>  # Common routines used by all tools
>  #
> -# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2011 - 2019, 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
> @@ -30,11 +30,11 @@ from os import remove
>  from os import rmdir
>  from os import linesep
>  from os import walk
>  from os import environ
>  import re
> -from collections import OrderedDict
> +from collections import OrderedDict as Sdict
> 
>  import Logger.Log as Logger
>  from Logger import StringTable as ST
>  from Logger import ToolError
>  from Library import GlobalData
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH] ShellPkg: add array index check for shell delay option

2019-02-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zhichao Gao
> Sent: Monday, February 18, 2019 12:28 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] ShellPkg: add array index check for shell delay
> option
> Importance: High
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1528
> 
> Shell delay option without parameters do not check the
> index of shell parameter argv. Add index check to avoid
> invalid pointer references.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao 
> 
> Cc: Liming Gao 
> Cc: Ray Ni 
> ---
>  ShellPkg/Application/Shell/Shell.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index 104f4c8961..ec344137d3 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1,7 +1,7 @@
>  /** @file
>This is THE shell (application)
> 
> -  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
>(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
>Copyright 2015-2018 Dell Technologies.
>This program and the accompanying materials
> @@ -1002,7 +1002,11 @@ ProcessCommandLine(
>   ) == 0) {
>ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay= TRUE;
>// Check for optional delay value following "-delay"
> -  DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +  if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) {
> +DelayValueStr = NULL;
> +  } else {
> +DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +  }
>if (DelayValueStr != NULL){
>  if (*DelayValueStr == L':') {
>DelayValueStr++;
> --
> 2.16.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] BaseTools:BaseTools supports to the driver combination.

2019-02-15 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Fan, ZhijuX
> Sent: Thursday, February 14, 2019 7:18 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTools:BaseTools supports to the driver
> combination.
> 
> BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1520
> 
> To save the image size without the compression, more than
> one drivers can be combined into single one. When more than
> one drivers are combined, their depex will be AND together.
> Below is the example to combine BootManagerPolicyDxe into
> DriverHealthManagerDxe.
> 
> Besides this patch, BaseTools also needs to check the module
> type and make sure all module type are same. Otherwise,
> BaseTools will report the error.
> DRIVER INF has the parameter ENTRY_POINT
> LIBRARY INF has the parameter LIBRARY_CLASS
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/AutoGen/GenC.py | 31
> ++-
>  1 file changed, 26 insertions(+), 5 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
> b/BaseTools/Source/Python/AutoGen/GenC.py
> index 9700bf8527..93e8d78375 100644
> --- a/BaseTools/Source/Python/AutoGen/GenC.py
> +++ b/BaseTools/Source/Python/AutoGen/GenC.py
> @@ -1455,10 +1455,24 @@ def CreateLibraryDestructorCode(Info,
> AutoGenC, AutoGenH):
>  def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
>  if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED,
> SUP_MODULE_SEC]:
>  return
> +ModuleEntryPointList = []
> +for Lib in Info.DependentLibraryList:
> +if len(Lib.ModuleEntryPointList) > 0:
> +if Lib.ModuleType == Info.ModuleType:
> +ModuleEntryPointList = ModuleEntryPointList +
> Lib.ModuleEntryPointList
> +else:
> +EdkLogger.error(
> +"build",
> +CODE_ERROR,
> +"%s \nDriver's ModuleType must be consistent" % Lib,
> +File=str(Info)
> +)
> +ModuleEntryPointList = ModuleEntryPointList +
> Info.Module.ModuleEntryPointList
> +
>  #
>  # Module Entry Points
>  #
> -NumEntryPoints = len(Info.Module.ModuleEntryPointList)
> +NumEntryPoints = len(ModuleEntryPointList)
>  if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
>  PiSpecVersion =
> Info.Module.Specification['PI_SPECIFICATION_VERSION']
>  else:
> @@ -1468,7 +1482,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC,
> AutoGenH):
>  else:
>  UefiSpecVersion = '0x'
>  Dict = {
> -'Function'   :   Info.Module.ModuleEntryPointList,
> +'Function'   :   ModuleEntryPointList,
>  'PiSpecVersion'  :   PiSpecVersion + 'U',
>  'UefiSpecVersion':   UefiSpecVersion + 'U'
>  }
> @@ -1481,7 +1495,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC,
> AutoGenH):
>AUTOGEN_ERROR,
>'%s must have exactly one entry point' % Info.ModuleType,
>File=str(Info),
> -  ExtraData= ", ".join(Info.Module.ModuleEntryPointList)
> +  ExtraData= ", ".join(ModuleEntryPointList)
>)
>  if Info.ModuleType == SUP_MODULE_PEI_CORE:
>  AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))
> @@ -1535,11 +1549,18 @@ def CreateModuleEntryPointCode(Info,
> AutoGenC, AutoGenH):
>  def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):
>  if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED,
> SUP_MODULE_SEC]:
>  return
> +
> +ModuleUnloadImageList = []
> +for Lib in Info.DependentLibraryList:
> +if len(Lib.ModuleUnloadImageList) > 0:
> +ModuleUnloadImageList = ModuleUnloadImageList +
> Lib.ModuleUnloadImageList
> +ModuleUnloadImageList = ModuleUnloadImageList +
> Info.Module.ModuleUnloadImageList
> +
>  #
>  # Unload Image Handlers
>  #
> -NumUnloadImage = len(Info.Module.ModuleUnloadImageList)
> -Dict = {'Count':str(NumUnloadImage) + 'U',
> 'Function':Info.Module.ModuleUnloadImageList}
> +NumUnloadImage = len(ModuleUnloadImageList)
> +Dict = {'Count':str(NumUnloadImage) + 'U',
> 'Function':ModuleUnloadImageList}
>  if NumUnloadImage < 2:
> 
> AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dic
> t))
>  else:
> --
> 2.14.1.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] BaseTools:Function application error

2019-02-14 Thread Carsey, Jaben
I am really confused by this patch and how it ever worked.

I see that you remove the import for sdict.  But I see that sdict is used in 
other places in that file.

I also cant find a class definition for sdict anywhere (certainly not in 
Common/Misc).

So maybe refactor and remove all the other uses of sdict from the file?

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Fan, ZhijuX
> Sent: Thursday, February 14, 2019 1:12 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTools:Function application error
> 
> Error due to incorrect function parameters and attributes
> FileWrite() The first argument it needs is a list, not a file
> This patch abandons this function and saves the file independently
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/Eot/EotMain.py| 5 +++--
>  BaseTools/Source/Python/Workspace/BuildClassObject.py | 1 +
>  BaseTools/Source/Python/build/BuildReport.py  | 9 ++---
>  3 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py
> b/BaseTools/Source/Python/Eot/EotMain.py
> index fd4bee6f90..8c2bfc45e4 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -21,7 +21,7 @@ import Eot.EotGlobalData as EotGlobalData
>  from optparse import OptionParser
>  from Common.StringUtils import NormPath
>  from Common import BuildToolError
> -from Common.Misc import GuidStructureStringToGuidString, sdict
> +from Common.Misc import GuidStructureStringToGuidString
>  from Eot.Parser import *
>  from Eot.InfParserLite import EdkInfParser
>  from Common.StringUtils import GetSplitValueList
> @@ -32,6 +32,7 @@ from Eot.Report import Report
>  from Common.BuildVersion import gBUILD_VERSION
>  from Eot.Parser import ConvertGuid
>  from Common.LongFilePathSupport import OpenLongFilePath as open
> +import collections
>  import struct
>  import uuid
>  import copy
> @@ -57,7 +58,7 @@ class Image(array):
>  self._LEN_ = None
>  self._OFF_ = None
> 
> -self._SubImages = sdict() # {offset: Image()}
> +self._SubImages = collections.OrderedDict() # {offset: Image()}
> 
>  array.__init__(self)
> 
> diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
> b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> index cff77a71ae..6f8a09e87c 100644
> --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
> +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> @@ -261,6 +261,7 @@ class StructurePcd(PcdClassObject):
>  self.PackageDecs = Packages
>  self.DefaultStoreName = [default_store]
>  self.DefaultValues = OrderedDict()
> +self.DefaultFromDSC = None
>  self.PcdMode = None
>  self.SkuOverrideValues = OrderedDict()
>  self.StructName = None
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index 0b98d62cb6..70584570a5 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1651,14 +1651,17 @@ class PredictionReport(object):
>  SourceList = os.path.join(self._EotDir, "SourceFile.txt")
>  GuidList = os.path.join(self._EotDir, "GuidList.txt")
>  DispatchList = os.path.join(self._EotDir, "Dispatch.txt")
> -
> +TempList = []
>  TempFile = open(SourceList, "w+")
>  for Item in self._SourceList:
> -FileWrite(TempFile, Item)
> +TempList.append(Item + TAB_LINE_BREAK)
> +TempFile.writelines(TempList)
>  TempFile.close()
> +TempList = []
>  TempFile = open(GuidList, "w+")
>  for Key in self._GuidMap:
> -FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))
> +TempList.append("%s %s %s" % (Key, self._GuidMap[Key],
> TAB_LINE_BREAK))
> +TempFile.writelines(TempList)
>  TempFile.close()
> 
>  try:
> --
> 2.14.1.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


[edk2] 3rd Party Python Packages

2019-02-12 Thread Carsey, Jaben
Note: deviating from "RE: [edk2] [Patch 0/3] BaseTools: Implement splitquoted 
function"

Laszlo,

Since I am working on some research related to this, I have a few follow up 
questions.

If there is significant performance improvement, how would you feel about 
requiring a 3rd party package to be installed (via pip I think)?
Would you feel more comfortable if BaseTools were able to run either with it or 
without (with performance differences)?

Basically there are potential performance improvements, but use of 3rd party 
python packages is instrumental for many of them.  

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Tuesday, February 12, 2019 6:02 AM
> To: Gao, Liming ; Feng, Bob C
> ; Bi, Dandan 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch 0/3] BaseTools: Implement splitquoted function
> 
> On 02/12/19 14:33, Gao, Liming wrote:
> > Laszlo:
> >  To install python3-distutils should resolve this issue. I expect BaseTools
> build functionality doesn't depend on the third party python lib.
> 
> I completely agree with your expectation, regarding *3rd party* python
> packages. We shouldn't expect developers to install packages from
> repositories that fall outside of their normal distro repos.
> 
> However, my understanding was that python3-distutils should be available
> as a normal (not 3rd party) component on Ubuntu 18. I think we can
> expect developers to install additional packages if those packages are
> readily available in their normal (distro-provided) repos.
> 
> > So, I suggest to check whether python3-distutils is the native python
> library. If it is native python library, why Ubuntu18 doesn't include it. I 
> will
> work with Dandan to collect more information.
> 
> Right, that's exactly what I'm asking for. Thank you very much!
> Laszlo
> 
> >> -Original Message-
> >> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> Sent: Tuesday, February 12, 2019 8:24 PM
> >> To: Feng, Bob C ; Bi, Dandan
> 
> >> Cc: edk2-devel@lists.01.org; Gao, Liming 
> >> Subject: Re: [edk2] [Patch 0/3] BaseTools: Implement splitquoted
> function
> >>
> >> On 02/04/19 20:12, Laszlo Ersek wrote:
> >>> On 02/03/19 06:55, Feng, Bob C wrote:
>  BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1509
>  On some Linux environment, there may be no distutils.util
>  library for python3 that will cause build tool crash.
>  This patch implement distutils.util.split_quoted
>  in BaseTools so that the Basetools will be independent with
>  distutils.util library.
> 
>  Feng, Bob C (3):
>    BaseTools: Implement splitquoted function in Build tool
>    BaseTools: Implement splitquoted function in UPT
>    BaseTools: unit test for splitquoted function
> 
>   BaseTools/Source/Python/AutoGen/UniClassObject.py | 50
> ++
>   BaseTools/Source/Python/UPT/Library/UniClassObject.py | 47
> ---
>   BaseTools/Tests/TestStringSplit.py| 38
> ++
>   3 files changed, 128 insertions(+), 7 deletions(-)
>   create mode 100644 BaseTools/Tests/TestStringSplit.py
> 
> >>>
> >>> Is this really necessary? BZ#1509 references Ubuntu18; however it looks
> >>> like the issue can be resolved by a simple package installation on
> >>> Ubuntu 18:
> >>>
> >>> https://superuser.com/questions/1319047/cant-install-virtual-
> interpreter-in-pycharm-in-linux
> >>>
> >>> """
> >>> sudo apt-get install python3-distutils
> >>> """
> >>>
> >>> I'm not a Ubuntu user myself; so all I can do here (without installing a
> >>> Ubuntu18 VM) is check the Ubuntu package directory:
> >>>
> >>> https://packages.ubuntu.com/search?keywords=python3-
> distutils=names=all=all
> >>>
> >>> python3-distutils appears available for both "bionic (18.04LTS)" and
> >>> "cosmic (18.10)".
> >>>
> >>> Dandan, if you install python3-distutils, does that solve the issue for
> you?
> >>
> >> I'd still like to get an answer to my question, before the series is 
> >> pushed.
> >>
> >> Thanks,
> >> Laszlo
> 
> ___
> 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] FW: [PATCH] BaseTools/BuildReport: fix report for platforms/arches without struct PCDs

2019-02-06 Thread Carsey, Jaben
I sent this earlier, but failed the mailing list part.

Reviewed-by: Jaben Carsey 
And pushed.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Vladimir Olovyannikov via edk2-devel
> Sent: Tuesday, February 05, 2019 8:58 AM
> To: Laszlo Ersek ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [PATCH] BaseTools/BuildReport: fix report for
> platforms/arches without struct PCDs
> 
> Laszlo,
> Thanks a lot for the prompt fix. Works now.
> 
> Tested-by: Vladimir Olovyannikov 
> 
> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, February 5, 2019 3:22 AM
> To: edk2-devel@lists.01.org
> Cc: Bob Feng; Liming Gao; Vladimir Olovyannikov; Yonghong Zhu
> Subject: [PATCH] BaseTools/BuildReport: fix report for platforms/arches
> without struct PCDs
> 
> The goal of commit 97c8f5b9e7d3 ("BaseTools:StructurePCD value display
> incorrect in "Not used" section.", 2019-02-02) was to display the full
> contents of such structure PCDs in the build report that were set in the
> platform DSC or the FDF, but not used in any module INFs. The listings
> would appear in the
> 
>   PCDs not used by modules or in conditional directives
> 
> section of the build report.
> 
> Commit 97c8f5b9e7d3 assumed that any (platform, architecture)
> combination
> would have a (possibly empty) set of structure PCD (and so the set of the
> structure PCDs could be filtered for set-but-unused ones).
> 
> This is not the case: in "DscBuildData.py", in method
> UpdateStructuredPcds(), if "S_pcd_set" remains an empty OrderedDict(),
> then it is not added to "GlobalData.gStructurePcd" *at all*, for the
> current (platform, architecture) combination.
> 
> As a result, when the PCD report tries to fetch the set of structure PCDs
> for the current (platform, architecture), "GlobalData.gStructurePcd" does
> not return an empty OrderedDict(); instead, it raises a KeyError. Fix it
> by defaulting to an empty OrderedDict(), with the get() method.
> 
> Reported-by: Vladimir Olovyannikov
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1513
> Fixes: 97c8f5b9e7d3136b6051a05cf056ce5ca9e79893
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Vladimir Olovyannikov 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> Repo:   https://github.com/lersek/edk2.git
> Branch: report_without_struct_pcds
> 
>  BaseTools/Source/Python/build/BuildReport.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index e457660fcef3..0b98d62cb6aa 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -780,7 +780,7 @@ class PcdReport(object):
>  # Collect the PCD defined in DSC/FDF file, but not used in
> module
>  #
>  UnusedPcdFullList = []
> -StructPcdDict = GlobalData.gStructurePcd[self.Arch]
> +StructPcdDict = GlobalData.gStructurePcd.get(self.Arch,
> collections.OrderedDict())
>  for Name, Guid in StructPcdDict:
>  if (Name, Guid) not in Pa.Platform.Pcds:
>  Pcd = StructPcdDict[(Name, Guid)]
> --
> 2.19.1.3.g30247aa5d201
> ___
> 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] BaseTools: Fix build failure when specifying multiple BUILDTARGET

2019-02-06 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And pushed.

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, February 06, 2019 8:26 AM
> To: Philippe Mathieu-Daudé ; Kinney, Michael D
> ; edk2-devel@lists.01.org; Carsey, Jaben
> 
> Cc: Leif Lindholm 
> Subject: Re: [PATCH v2] BaseTools: Fix build failure when specifying multiple
> BUILDTARGET
> 
> On 02/06/19 13:03, Philippe Mathieu-Daudé wrote:
> > With Python3, the dict.value() method returns an iterator.
> > If a dictionary is updated while an iterator on its keys is used,
> > a RuntimeError is generated.
> > Converting the iterator to a list() forces a copy of the mutable
> > keys in an immutable list which can be safely iterated.
> >
> > Commit f8d11e5a4aaa converted various uses but missed one:
> > When specifying multiple BUILDTARGET, the first target builds
> > successfully, but then the PGen.BuildDatabase._CACHE_ dictionary is
> > updated, and accessing the next target triggers a RuntimeError.
> >
> > Convert this iterator to an immutable list, to solve this build error:
> >
> > $ build -a IA32 -t GCC5 -b RELEASE -b NOOPT -p
> OvmfPkg/OvmfPkgIa32.dsc
> > [...]
> > Processing meta-data ...
> > build.py...
> >  : error C0DE: Unknown fatal error when processing
> [OvmfPkg/OvmfPkgIa32.dsc]
> >
> > (Please send email to edk2-devel@lists.01.org for help, attaching
> following call stack trace!)
> >
> > (Python 3.5.3 on linux) Traceback (most recent call last):
> >   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 2387, in Main
> > MyBuild.Launch()
> >   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 2141, in Launch
> > self._MultiThreadBuildPlatform()
> >   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 1921, in _MultiThreadBuildPlatform
> > self.Progress
> >   File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 304, in
> __init__
> > self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, 
> > *args,
> **kwargs)
> >   File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 477, in
> _InitWorker
> > for BuildData in PGen.BuildDatabase._CACHE_.values():
> > RuntimeError: dictionary changed size during iteration
> >
> > Note: The culprit commit (f8d11e5a4aaa) can not be found with bisection.
> > In 9c2d68c0a299 the build tools default to the python version provided
> > by the ${PYTHON} environment variable, however the Python3 transition is
> > not functional before d943b0c339fe. f8d11e5a4aaa falls between the
> > previous two.
> >
> > Reported-by: Leif Lindholm 
> > Fixes: f8d11e5a4aaa90bf63b4789f3993dd6d16c60787
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Philippe Mathieu-Daude 
> > Tested-by: Leif Lindholm 
> > Acked-by: Laszlo Ersek 
> > ---
> > v2:
> >  - fixed English errors (Laszlo)
> >  - the paragraph about bisection not working is not relevant to
> >the fix, keep it as background info but move it after (Laszlo)
> > Signed-off-by: Philippe Mathieu-Daudé 
> > ---
> >  BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > index a95d2c710e..12592a2a46 100644
> > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > @@ -474,7 +474,7 @@ class WorkspaceAutoGen(AutoGen):
> >
> >  # generate the SourcePcdDict and BinaryPcdDict
> >  PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain,
> Arch)
> > -for BuildData in PGen.BuildDatabase._CACHE_.values():
> > +for BuildData in list(PGen.BuildDatabase._CACHE_.values()):
> >  if BuildData.Arch != Arch:
> >  continue
> >  if BuildData.MetaFile.Ext == '.inf':
> >
> 
> Looks nice, thanks! My A-b stands.
> 
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: Fix build failure when specifying multiple BUILDTARGET

2019-02-05 Thread Carsey, Jaben
Laszlo,

not sure which Andrew you wanted, but he didn’t get added so far as I can tell.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Tuesday, February 05, 2019 4:05 AM
> To: Leif Lindholm 
> Cc: edk2-devel@lists.01.org; Gao, Liming ; Kinney,
> Michael D 
> Subject: Re: [edk2] [PATCH] BaseTools: Fix build failure when specifying
> multiple BUILDTARGET
> 
> (+Mike, +Andrew)
> 
> On 02/05/19 12:47, Leif Lindholm wrote:
> > On Tue, Feb 05, 2019 at 10:03:21AM +0100, Laszlo Ersek wrote:
> >> On 02/05/19 02:23, Philippe Mathieu-Daudé wrote:
> >>> Since 9c2d68c0a299 the build tools default to the python version
> >>> provided by the ${PYTHON} environment variable.
> >>> However the Python3 transition is not effective before d943b0c339fe.
> >>
> >> (1) Do you mean "functional" rather than "effective"?
> >>
> >> (2) Why is this information relevant for this commit? I see that commit
> >> f8d11e5a4aaa, referenced below, falls between the above two, but I'm
> >> unsure if that has any special relevance.
> >>
> >> If the above paragraph is just background info, that's OK with me, of
> >> course.
> >>
> >>> With Python3, the dict.value() method returns an iterator.
> >>> If a dictionary is updated while an iterator on his keys is used,
> >>
> >> (3) s/his/its/
> >>
> >>> a RuntimeError is generated.
> >>> Converting the iterator to a list() forces a copy of the mutable
> >>> keys in an immutable list which can be safely iterated.
> >>>
> >>> Commit f8d11e5a4aaa converted various uses but missed one:
> >>> When specifying multiple BUILDTARGET, the first target builds
> >>> successfully, but then the PGen.BuildDatabase._CACHE_ dictionary is
> >>> updated, and the next target accessing it triggers a RuntimeError.
> >>
> >> (4) Can we clarify this please; I think it's not the "next target" that
> >> accesses the dictionary, instead the code accesses the next target in
> >> the dictionary. How about
> >>
> >>   s/the next target accessing it/accessing the next target/
> >>
> >> ?
> >>
> >>>
> >>> Convert this iterator to an immutable list, to solve this build error:
> >>>
> >>> $ build -a IA32 -t GCC5 -b RELEASE -b NOOPT -p
> OvmfPkg/OvmfPkgIa32.dsc
> >>> [...]
> >>> Processing meta-data ...
> >>> build.py...
> >>>  : error C0DE: Unknown fatal error when processing
> [OvmfPkg/OvmfPkgIa32.dsc]
> >>>
> >>> (Please send email to edk2-devel@lists.01.org for help, attaching
> following call stack trace!)
> >>>
> >>> (Python 3.5.3 on linux) Traceback (most recent call last):
> >>>   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 2387, in Main
> >>> MyBuild.Launch()
> >>>   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 2141, in Launch
> >>> self._MultiThreadBuildPlatform()
> >>>   File
> "BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py", line
> 1921, in _MultiThreadBuildPlatform
> >>> self.Progress
> >>>   File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 304, in
> __init__
> >>> self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch,
> *args, **kwargs)
> >>>   File "BaseTools/Source/Python/AutoGen/AutoGen.py", line 477, in
> _InitWorker
> >>> for BuildData in PGen.BuildDatabase._CACHE_.values():
> >>> RuntimeError: dictionary changed size during iteration
> >>>
> >>> Reported-by: Leif Lindholm 
> >>> Fixes: f8d11e5a4aaa90bf63b4789f3993dd6d16c60787
> >>> Contributed-under: TianoCore Contribution Agreement 1.1
> >>> Signed-off-by: Philippe Mathieu-Daude 
> >>> Tested-by: Leif Lindholm 
> >>> ---
> >>>  BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> >>> index a95d2c710e..12592a2a46 100644
> >>> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> >>> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> >>> @@ -474,7 +474,7 @@ class WorkspaceAutoGen(AutoGen):
> >>>
> >>>  # generate the SourcePcdDict and BinaryPcdDict
> >>>  PGen = PlatformAutoGen(self, self.MetaFile, Target, 
> >>> Toolchain,
> Arch)
> >>> -for BuildData in PGen.BuildDatabase._CACHE_.values():
> >>> +for BuildData in list(PGen.BuildDatabase._CACHE_.values()):
> >>>  if BuildData.Arch != Arch:
> >>>  continue
> >>>  if BuildData.MetaFile.Ext == '.inf':
> >>>
> >>
> >> LGTM :)
> >>
> >> With the commit message updated (as you prefer):
> >>
> >> Acked-by: Laszlo Ersek 
> >
> > I would be surprised if we hear back from the BaseTools maintainers
> > this week (Chinese New Year). For me, I have both a simple workaround
> > and this patch, so I'm OK with waiting.
> >
> > But if anyone reports issues with CI environments or similar, I 

Re: [edk2] [Patch 1/3] BaseTools: Implement splitquoted function in Build tool

2019-02-04 Thread Carsey, Jaben
Code looks good, but I think the function comment is lacking.  How about 
describe the function and what it does instead of saying it replaces distutils 
function (which while correct, didn't really answer my question of "what is 
this supposed to do").

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Saturday, February 02, 2019 9:55 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch 1/3] BaseTools: Implement splitquoted function in
> Build tool
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1509
> On some Linux environment, there may be no distutils.util
> library for python3 that will cause build tool crash.
> This patch implement distutils.util.split_quoted
> in BaseTools so that the build tool will be independent with
> distutils.util library.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/AutoGen/UniClassObject.py | 50
> ++
>  1 file changed, 46 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py
> b/BaseTools/Source/Python/AutoGen/UniClassObject.py
> index d162387cc5..c4b39d25d4 100644
> --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
> +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
> @@ -16,11 +16,10 @@
>  ##
>  # Import Modules
>  #
>  from __future__ import print_function
>  import Common.LongFilePathOs as os, codecs, re
> -import distutils.util
>  import Common.EdkLogger as EdkLogger
>  from io import BytesIO
>  from Common.BuildToolError import *
>  from Common.StringUtils import GetLineNo
>  from Common.Misc import PathClass
> @@ -41,11 +40,11 @@ NON_BREAKING_CHAR = u'\uFFF2'
>  CR = u'\u000D'
>  LF = u'\u000A'
>  NULL = u'\u'
>  TAB = u'\t'
>  BACK_SLASH_PLACEHOLDER = u'\u0006'
> -
> +WHITESPACE = ' \t\n\r\v\f'
>  gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$",
> re.MULTILINE | re.UNICODE)
> 
>  ## Convert a unicode string to a Hex list
>  #
>  # Convert a unicode string to a Hex list
> @@ -216,10 +215,54 @@ def StripComments(Line):
>  CommentPos = Line.find (Comment, CommentPos + 1)
>  else:
>  return Line[:CommentPos].strip()
>  return Line.strip()
> 
> +#
> +# This function implement distutils.util.split_quoted in another way.
> +#
> +def splitquoted(s):
> +words = []
> +word = []
> +InQuoted = False
> +escaped = False
> +CurrentQ = ""
> +s = s.strip()
> +for ch in s:
> +if escaped:
> +# preserve whatever is escaped;
> +# This char will become part of the current word
> +word.append(ch)
> +escaped = False
> +continue
> +
> +if ch in WHITESPACE and not InQuoted:
> +# unescaped, unquoted whitespace: now
> +# we definitely have a word delimiter
> +if "".join(word):
> +words.append("".join(word))
> +word = []
> +continue
> +elif ch == "\\":
> +escaped = True
> +if not InQuoted:
> +continue
> +else:
> +# handle singly-quoted string or doubly-quoted string
> +if ch =='"' or ch == "'":
> +if not InQuoted:
> +InQuoted = True
> +CurrentQ = ch
> +continue
> +elif ch == CurrentQ:
> +InQuoted = False
> +continue
> +word.append(ch)
> +if word:
> +words.append("".join(word))
> +return words
> +
>  ## UniFileClassObject
>  #
>  # A structure for .uni file definition
>  #
>  class UniFileClassObject(object):
> @@ -232,16 +275,15 @@ class UniFileClassObject(object):
>  self.OrderedStringListByToken = {}  #{ u'LanguageIdentifier' : 
> {Token:
> StringDefClassObject} }
>  self.IsCompatibleMode = IsCompatibleMode
>  self.IncludePathList = IncludePathList
>  if len(self.FileList) > 0:
>  self.LoadUniFiles(FileList)
> -
>  #
>  # Get Language definition
>  #
>  def GetLangDef(self, File, Line):
> -Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
> +Lang = splitquoted((Line.split(u"//")[0]))
>  if len(Lang) != 3:
>  try:
>  FileIn = 
> UniFileClassObject.OpenUniFile(LongFilePath(File.Path))
>  except UnicodeError as X:
>  EdkLogger.error("build", FILE_READ_FAILURE, "File read 
> failure: %s"
> % str(X), ExtraData=File);
> --
> 2.20.1.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

Re: [edk2] [PATCH v2] AppPkg: fix webserver build for !Ia32/X64

2019-02-04 Thread Carsey, Jaben
Leif,

Sorry, I missed this one.  Code change here looks good.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Monday, February 04, 2019 4:04 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Carsey, Jaben
> ; Daryl McDaniel 
> Subject: Re: [edk2] [PATCH v2] AppPkg: fix webserver build for !Ia32/X64
> Importance: High
> 
> Mike, Daryl, Jaben - any comments on v2?
> 
> On Fri, Nov 02, 2018 at 10:50:15AM +, Leif Lindholm wrote:
> > The WebServer application is not meant to be Ia32/X64 specific, and would
> > build for other architectures, if it wasn't for the
> >   #include 
> > in WebServer.h. Move that statement to Mtrr.c instead, which is the only
> > consumer, and is already being filtered out for other architectures.
> >
> > Cc: Daryl McDaniel 
> > Cc: Jaben Carsey 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Leif Lindholm 
> > ---
> >
> > Resending only 1/6, since the others got R-b already.
> > Looking at PageList.c, the app was clearly intended to be portable,
> > so updated commit message to reflect this.
> >
> >  AppPkg/Applications/Sockets/WebServer/WebServer.h | 1 -
> >  AppPkg/Applications/Sockets/WebServer/Mtrr.c  | 1 +
> >  2 files changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > index 21b07b63df..16c30c8d6d 100644
> > --- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > +++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > @@ -20,7 +20,6 @@
> >
> >  #include 
> >
> > -#include 
> >  #include 
> >  #include 
> >  #include 
> > diff --git a/AppPkg/Applications/Sockets/WebServer/Mtrr.c
> b/AppPkg/Applications/Sockets/WebServer/Mtrr.c
> > index 54356bde64..4b8482d4e2 100644
> > --- a/AppPkg/Applications/Sockets/WebServer/Mtrr.c
> > +++ b/AppPkg/Applications/Sockets/WebServer/Mtrr.c
> > @@ -15,6 +15,7 @@
> >
> >  #include 
> >  #include 
> > +#include 
> >
> >  #define VARIABLE_MTRR_VALID 0x800
> >
> > --
> > 2.11.0
> >
> ___
> 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 7/7] ShellPkg/UefiShellLib: Use BaseLib api CharToUpper

2019-01-30 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Tuesday, January 29, 2019 10:34 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ray ; Carsey, Jaben 
> Subject: [PATCH v5 7/7] ShellPkg/UefiShellLib: Use BaseLib api CharToUpper
> Importance: High
> 
> Substitute InternalShellCharToUpper with CharToUpper which is a public
> function with the same effect.
> Remove the implement of InternalShellCharToUpper.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1369
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> Reviewed-by: Jaben Carsey 
> Reviewed-by: Liming Gao 
> ---
>  ShellPkg/Library/UefiShellLib/UefiShellLib.c | 31 ++--
>  1 file changed, 2 insertions(+), 29 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index b17266d623..aff933dcdf 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -3740,33 +3740,6 @@ ShellFileExists(
>return (EFI_SUCCESS);
>  }
> 
> -/**
> -  Convert a Unicode character to upper case only if
> -  it maps to a valid small-case ASCII character.
> -
> -  This internal function only deal with Unicode character
> -  which maps to a valid small-case ASCII character, i.e.
> -  L'a' to L'z'. For other Unicode character, the input character
> -  is returned directly.
> -
> -  @param  Char  The character to convert.
> -
> -  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> -  @retval UnchangedOtherwise.
> -
> -**/
> -CHAR16
> -InternalShellCharToUpper (
> -  IN  CHAR16Char
> -  )
> -{
> -  if (Char >= L'a' && Char <= L'z') {
> -return (CHAR16) (Char - (L'a' - L'A'));
> -  }
> -
> -  return Char;
> -}
> -
>  /**
>Convert a Unicode character to numerical value.
> 
> @@ -3789,7 +3762,7 @@ InternalShellHexCharToUintn (
>  return Char - L'0';
>}
> 
> -  return (10 + InternalShellCharToUpper (Char) - L'A');
> +  return (10 + CharToUpper (Char) - L'A');
>  }
> 
>  /**
> @@ -3849,7 +3822,7 @@ InternalShellStrHexToUint64 (
>  String++;
>}
> 
> -  if (InternalShellCharToUpper (*String) == L'X') {
> +  if (CharToUpper (*String) == L'X') {
>  if (*(String - 1) != L'0') {
>return 0;
>  }
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH v5 6/7] ShellPkg/Shell: Use BaseLib api CharToUpper

2019-01-30 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Tuesday, January 29, 2019 10:34 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ray ; Carsey, Jaben 
> Subject: [PATCH v5 6/7] ShellPkg/Shell: Use BaseLib api CharToUpper
> Importance: High
> 
> Substitute InternalShellCharToUpper with a public function
> CharToUpper which has the same function.
> Remove the implement of InternalShellCharToUpper.
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> Reviewed-by: Jaben Carsey 
> Reviewed-by: Liming Gao 
> ---
>  ShellPkg/Application/Shell/ShellManParser.c | 23 +
>  1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellManParser.c
> b/ShellPkg/Application/Shell/ShellManParser.c
> index b180c6c8f7..2c044dbe4a 100644
> --- a/ShellPkg/Application/Shell/ShellManParser.c
> +++ b/ShellPkg/Application/Shell/ShellManParser.c
> @@ -46,27 +46,6 @@ SHELL_MAN_HII_VENDOR_DEVICE_PATH
> mShellManHiiDevicePath = {
>}
>  };
> 
> -
> -/**
> -  Convert a Unicode character to upper case only if
> -  it maps to a valid small-case ASCII character.
> -
> -  This internal function only deal with Unicode character
> -  which maps to a valid small-case ASCII character, i.e.
> -  L'a' to L'z'. For other Unicode character, the input character
> -  is returned directly.
> -
> -  @param  Char  The character to convert.
> -
> -  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> -  @retval UnchangedOtherwise.
> -
> -**/
> -CHAR16
> -InternalShellCharToUpper (
> -  IN CHAR16  Char
> -  );
> -
>  /**
>Verifies that the filename has .EFI on the end.
> 
> @@ -416,7 +395,7 @@ IsTitleHeader(
>ReturnFound = TRUE;  // This is the desired command's title header 
> line.
>State = (BriefDesc == NULL) ? Final : GetBriefDescription;
>  }
> -else if (InternalShellCharToUpper (*Line) != InternalShellCharToUpper
> (*(Command + CommandIndex++))) {
> +else if (CharToUpper (*Line) != CharToUpper (*(Command +
> CommandIndex++))) {
>State = Final;
>  }
>  Line++;
> --
> 2.18.0.windows.1

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


Re: [edk2] [patch] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS tool chain build failure

2019-01-28 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Bi, Dandan
> Sent: Sunday, January 27, 2019 7:29 PM
> To: edk2-devel@lists.01.org
> Cc: Krzysztof Koch ; Carsey, Jaben
> ; Ni, Ray 
> Subject: [patch] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS tool chain
> build failure
> Importance: High
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1491
> 
> This patch is to update the data type of variable "Offset"
> from UINT8 to UINT32 to fix following build issue.
> 
> ...\Parsers\Pptt\PpttParser.c(193): error C2220:
> warning treated as error - no 'object' file generated
> ...\Parsers\Pptt\PpttParser.c(193): warning C4244: '=':
> conversion from 'UINT32' to 'UINT8', possible loss of data
> 
> Cc: Krzysztof Koch 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi 
> ---
>  .../UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c   | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> index d97ddf8e92..bc56fe9ea1 100644
> ---
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> @@ -176,11 +176,11 @@ VOID
>  DumpProcessorHierarchyNodeStructure (
>IN UINT8* Ptr,
>IN UINT8  Length
>)
>  {
> -  UINT8  Offset;
> +  UINT32 Offset;
>UINT8* PrivateResourcePtr;
>UINT32 Index;
>CHAR16 Buffer[OUTPUT_FIELD_COLUMN_WIDTH];
> 
>Offset = ParseAcpi (
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper status

2019-01-25 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And pushed with the BZ added to commit REF.



> -Original Message-
> From: Li, Songpeng
> Sent: Thursday, January 24, 2019 9:08 PM
> To: Vladimir Olovyannikov ; edk2-
> de...@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ray 
> Subject: RE: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper
> status
> Importance: High
> 
> Reviewed-by: Songpeng Li 
> 
> Sorry, the previous email did not include edk2 mailing list.
> 
> Best,
> Songpeng
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Vladimir Olovyannikov via edk2-devel
> > Sent: Thursday, January 24, 2019 2:26 AM
> > To: Carsey, Jaben ; Ni, Ray ;
> > edk2-devel@lists.01.org
> > Cc: Vladimir Olovyannikov 
> > Subject: [edk2] [PATCH] ShellPkg/TftpDynamicCommand: Return proper
> > status
> >
> > Tftp command always returned "SHELL_NOT_FOUND" which is treated as
> an
> > error by callers. Add missing line to clean the ShellStatus on
> > successful operation. If operation has failed, return the error status
> > if available.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Vladimir Olovyannikov
> > 
> > ---
> >  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > index ba753a279b00..88e3988a554e 100644
> > --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > @@ -548,6 +548,8 @@ RunTftp (
> >goto NextHandle;
> >  }
> >
> > +ShellStatus = SHELL_SUCCESS;
> > +
> >  NextHandle:
> >
> >  CloseProtocolAndDestroyServiceChild (
> > @@ -575,6 +577,10 @@ RunTftp (
> >  FreePool (Handles);
> >}
> >
> > +  if ((ShellStatus != SHELL_SUCCESS) && (EFI_ERROR(Status))) {
> > +ShellStatus = Status & ~MAX_BIT;
> > +  }
> > +
> >return ShellStatus;
> >  }
> >
> > --
> > 2.20.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 1/3] MdeModulePkg/CapsuleApp: Refine code logic of parsing parameter.

2019-01-25 Thread Carsey, Jaben
I think that if the application wants to depend on the libs, then we should 
discuss moving the application to the ShellPkg.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Gao, Liming
> Sent: Friday, January 25, 2019 1:25 AM
> To: Zhang, Chao B ; Yao, Jiewen
> ; edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Gao, Liming 
> Subject: Re: [edk2] [PATCH 1/3] MdeModulePkg/CapsuleApp: Refine code
> logic of parsing parameter.
> Importance: High
> 
> Chao:
>   CapsuleApp can base on gEfiShellProtocolGuid and
> gEfiShellParametersProtocolGuid to do it. Current CapsuleApp bases on
> these two protocols to parse the parameters.
> 
> Thanks
> Liming
> From: Zhang, Chao B
> Sent: Friday, January 25, 2019 3:24 PM
> To: Yao, Jiewen ; edk2-devel@lists.01.org; Gao,
> Liming 
> Cc: Wu, Hao A ; Chen, Chen A
> 
> Subject: RE: [edk2] [PATCH 1/3] MdeModulePkg/CapsuleApp: Refine code
> logic of parsing parameter.
> 
> Jiewen & Liming:
>It is a problem. Unlike UiApp. CapsuleApp is supposed to run in Shell.
> ShellLib provides standard parameter parsing support.
> Any suggestion on this?
> 
> From: Yao, Jiewen
> Sent: Friday, January 25, 2019 2:25 PM
> To: Chen, Chen A
> mailto:chen.a.c...@intel.com>>; edk2-
> de...@lists.01.org
> Cc: Wu, Hao A mailto:hao.a...@intel.com>>; Zhang,
> Chao B mailto:chao.b.zh...@intel.com>>
> Subject: RE: [edk2] [PATCH 1/3] MdeModulePkg/CapsuleApp: Refine code
> logic of parsing parameter.
> 
> Hey
> I don't think MdeModulePkg can depend on ShellPkg.
> 
> That is why we do not use ShellLib in the first version.
> 
> Do we change the package dependency rule?
> 
> Thank you
> Yao Jiewen
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Chen A Chen
> > Sent: Friday, January 25, 2019 2:14 PM
> > To: edk2-devel@lists.01.org
> > Cc: Wu, Hao A mailto:hao.a...@intel.com>>;
> Zhang, Chao B
> > mailto:chao.b.zh...@intel.com>>
> > Subject: [edk2] [PATCH 1/3] MdeModulePkg/CapsuleApp: Refine code
> logic
> > of parsing parameter.
> >
> > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1482
> >
> > No change functionality, use ShellLib to parsing command line.
> >
> > Cc: Jian J Wang mailto:jian.j.w...@intel.com>>
> > Cc: Hao Wu mailto:hao.a...@intel.com>>
> > Cc: Zhang Chao B
> mailto:chao.b.zh...@intel.com>>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Chen A Chen
> mailto:chen.a.c...@intel.com>>
> > ---
> >  MdeModulePkg/Application/CapsuleApp/CapsuleApp.c   | 433
> > +++--
> >  MdeModulePkg/Application/CapsuleApp/CapsuleApp.inf |   2 +
> >  2 files changed, 236 insertions(+), 199 deletions(-)
> >
> > diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
> > b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
> > index 4d907242f3..acae0fe261 100644
> > --- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
> > +++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
> > @@ -27,6 +27,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >
> >  #define CAPSULE_HEADER_SIZE  0x20
> >
> > @@ -39,15 +40,27 @@
> >
> >  #define MAX_CAPSULE_NUM 10
> >
> > -extern UINTN  Argc;
> > -extern CHAR16 **Argv;
> > -
> >  //
> >  // Define how many block descriptors we want to test with.
> >  //
> >  UINTN  NumberOfDescriptors = 1;
> > -UINTN  CapsuleFirstIndex;
> > -UINTN  CapsuleLastIndex;
> > +
> > +STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
> > +  {L"-C", TypeFlag},
> > +  {L"-E", TypeFlag},
> > +  {L"-S", TypeFlag},
> > +
> > +  {L"-NR", TypeFlag},
> > +
> > +  {L"-G", TypeValue},
> > +  {L"-O", TypeValue},
> > +  {L"-N", TypeValue},
> > +  {L"-D", TypeValue},
> > +  {L"-P", TypeValue},
> > +  {L"-I", TypeValue},
> > +
> > +  {NULL, TypeMax}
> > +  };
> >
> >  /**
> >Dump capsule information
> > @@ -161,13 +174,12 @@ GetArg (
> >  **/
> >  EFI_STATUS
> >  CreateBmpFmp (
> > -  VOID
> > +  IN CHAR16 *BmpName,
> > +  IN CHAR16
> > *OutputCapsuleName
> >)
> >  {
> > -  CHAR16
> > *OutputCapsuleName;
> >VOID  *BmpBuffer;
> >UINTN FileSize;
> > -  CHAR16*BmpName;
> >UINT8
> > *FullCapsuleBuffer;
> >UINTN
> > FullCapsuleBufferSize;
> >EFI_DISPLAY_CAPSULE   *DisplayCapsule;
> > @@ -191,22 +203,10 @@ CreateBmpFmp (
> >// HorizontalResolution >= BMP_IMAGE_HEADER.PixelWidth
> >// VerticalResolution   >= BMP_IMAGE_HEADER.PixelHeight
> >
> > -  if (Argc != 5) {
> > -Print(L"CapsuleApp: Incorrect parameter count.\n");
> > -return EFI_UNSUPPORTED;
> > -  }
> > -
> > -  if (StrCmp(Argv[3], L"-O") != 0) {
> > -Print(L"CapsuleApp: NO output capsule name.\n");
> > -return EFI_UNSUPPORTED;
> > -  }
> > -  OutputCapsuleName = Argv[4];
> > -
> >

Re: [edk2] [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add support for PPTT

2019-01-24 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And pushed.

> -Original Message-
> From: Sami Mujawar [mailto:sami.muja...@arm.com]
> Sent: Thursday, January 24, 2019 8:05 AM
> To: Carsey, Jaben ; Krzysztof Koch
> ; edk2-devel@lists.01.org
> Cc: leif.lindh...@linaro.org; Matteo Carlini ;
> Stephanie Hughes-Fitt ; Ni, Ray
> ; nd 
> Subject: RE: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add
> support for PPTT
> Importance: High
> 
> Reviewed-by: Sami Mujawar 
> 
> Regards,
> 
> Sami Mujawar
> 
> -Original Message-
> From: Carsey, Jaben 
> Sent: 22 January 2019 05:47 PM
> To: Krzysztof Koch ; edk2-devel@lists.01.org
> Cc: leif.lindh...@linaro.org; Matteo Carlini ;
> Stephanie Hughes-Fitt ; Ni, Ray
> ; Sami Mujawar ; nd
> 
> Subject: RE: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add
> support for PPTT
> 
> Reviewed-by: Jaben Carsey 
> 
> Note: I am not pushing this to allow proper time for other to
> review/comment. The code looks good to me.
> 
> Jaben
> 
> > -Original Message-
> > From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> > Sent: Tuesday, January 22, 2019 9:06 AM
> > To: edk2-devel@lists.01.org
> > Cc: leif.lindh...@linaro.org; matteo.carl...@arm.com;
> > Stephanie.Hughes- f...@arm.com; Carsey, Jaben
> > ; Ni, Ray ;
> > sami.muja...@arm.com; n...@arm.com
> > Subject: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add
> > support for PPTT
> > Importance: High
> >
> > Added the acpiview parser for the PPTT table.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Krzysztof Koch 
> > ---
> > The changes can be seen at:
> >
> https://github.com/KrzysztofKoch1/edk2/tree/woa_390_pptt_acpiview_v1
> >
> > Notes:
> > v1:
> > - add PPTT parser to acpiview   [Krzysztof]
> >
> >  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h  
> >   |
> 23
> > +-
> >
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
> > | 362 
> >
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> > dLib.c   |   4 +-
> >
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> > dLib.inf |   3 +-
> >
> >
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> > dLib.uni |   3 +-
> >  5 files changed, 391 insertions(+), 4 deletions(-)
> >
> > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > index
> >
> ecf7dae9038a4ebcb3e3764964f0c16ca3ef51f6..a42450c1431be343870dabb4e
> > 03f64ed1cf78afc 100644
> > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > @@ -1,7 +1,7 @@
> >  /** @file
> >Header file for ACPI parser
> >
> > -  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
> > +  Copyright (c) 2016 - 2019, ARM Limited. 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 @@ -655,6 +655,27 @@ ParseAcpiMcfg (
> >IN UINT8   AcpiTableRevision
> >);
> >
> > +/**
> > +  This function parses the ACPI PPTT table.
> > +  When trace is enabled this function parses the PPTT table and
> > +  traces the ACPI table fields.
> > +
> > +  This function also performs validation of the ACPI table fields.
> > +
> > +  @param [in] Trace  If TRUE, trace the ACPI fields.
> > +  @param [in] PtrPointer to the start of the buffer.
> > +  @param [in] AcpiTableLengthLength of the ACPI table.
> > +  @param [in] AcpiTableRevision  Revision of the ACPI table.
> > +**/
> > +VOID
> > +EFIAPI
> > +ParseAcpiPptt (
> > +  IN BOOLEAN Trace,
> > +  IN UINT8*  Ptr,
> > +  IN UINT32  AcpiTableLength,
> > +  IN UINT8   AcpiTableRevision
> > +  );
> > +
> >  /**
> >This function parses the ACPI RSDP table.
> >
> > diff --git
> >
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> > c
> >
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> > c
> > new file mode 100644
> > index

Re: [edk2] [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add support for PPTT

2019-01-22 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Note: I am not pushing this to allow proper time for other to review/comment. 
The code looks good to me.

Jaben

> -Original Message-
> From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> Sent: Tuesday, January 22, 2019 9:06 AM
> To: edk2-devel@lists.01.org
> Cc: leif.lindh...@linaro.org; matteo.carl...@arm.com; Stephanie.Hughes-
> f...@arm.com; Carsey, Jaben ; Ni, Ray
> ; sami.muja...@arm.com; n...@arm.com
> Subject: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add
> support for PPTT
> Importance: High
> 
> Added the acpiview parser for the PPTT table.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Krzysztof Koch 
> ---
> The changes can be seen at:
> https://github.com/KrzysztofKoch1/edk2/tree/woa_390_pptt_acpiview_v1
> 
> Notes:
> v1:
> - add PPTT parser to acpiview   [Krzysztof]
> 
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> |  23
> +-
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
> | 362 
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c   |   4 +-
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.inf |   3 +-
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.uni |   3 +-
>  5 files changed, 391 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> index
> ecf7dae9038a4ebcb3e3764964f0c16ca3ef51f6..a42450c1431be343870dabb4e
> 03f64ed1cf78afc 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> @@ -1,7 +1,7 @@
>  /** @file
>Header file for ACPI parser
> 
> -  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
> +  Copyright (c) 2016 - 2019, ARM Limited. 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
> @@ -655,6 +655,27 @@ ParseAcpiMcfg (
>IN UINT8   AcpiTableRevision
>);
> 
> +/**
> +  This function parses the ACPI PPTT table.
> +  When trace is enabled this function parses the PPTT table and
> +  traces the ACPI table fields.
> +
> +  This function also performs validation of the ACPI table fields.
> +
> +  @param [in] Trace  If TRUE, trace the ACPI fields.
> +  @param [in] PtrPointer to the start of the buffer.
> +  @param [in] AcpiTableLengthLength of the ACPI table.
> +  @param [in] AcpiTableRevision  Revision of the ACPI table.
> +**/
> +VOID
> +EFIAPI
> +ParseAcpiPptt (
> +  IN BOOLEAN Trace,
> +  IN UINT8*  Ptr,
> +  IN UINT32  AcpiTableLength,
> +  IN UINT8   AcpiTableRevision
> +  );
> +
>  /**
>This function parses the ACPI RSDP table.
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> new file mode 100644
> index
> ..d97ddf8e925d30917f888bf33
> e2c1346cd330663
> --- /dev/null
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> @@ -0,0 +1,362 @@
> +/** @file
> +  PPTT table parser
> +
> +  Copyright (c) 2019, ARM Limited. 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.
> +
> +  @par Reference(s):
> +- ACPI 6.2 Specification - Errata A, September 2017
> +**/
> +
> +#include 
> +#include 
> +#include "AcpiParser.h"
> +
> +// Local variables
> +STATIC CONST UINT8*  ProcessorTopologyStructureType;
> +STATIC CONST UINT8*  ProcessorTopologyStructureLength;
> +STATIC CONST UINT32* NumberOfPrivateResources;
> +STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
> +
> +/**
> +  An ACPI_PARSER array describing the ACPI PPTT Table.
> +**/
> +STATIC CONST ACPI_PARSER PpttParser[] = {
> +  PARSE_ACPI_HEADER ()
> +};
> +
>

Re: [edk2] A question about shell-application's argument make system blocked;

2019-01-10 Thread Carsey, Jaben
Agreed.  That seems like a bug that needs a Bugzilla filed.  

My question is if the comment character is valid on a command line typed in 
versus in a script file.

> -Original Message-
> From: jim.dai...@dell.com [mailto:jim.dai...@dell.com]
> Sent: Thursday, January 10, 2019 3:34 PM
> To: Carsey, Jaben 
> Cc: sssky...@163.com; edk2-devel@lists.01.org
> Subject: RE: [edk2] A question about shell-application's argument make
> system blocked;
> Importance: High
> 
> Jaben,
> 
> The shell does not parse properly (my opinion) in some instances.
> That is one of the reasons I wrote a separate parser for the shell I
> maintain here at Dell.
> 
> One of the areas I feel the parsing is wrong is when an unescaped "#"
> is inside a quoted string:
> 
>   FS0:\> echo "This should # work."
>   Command Error Status: Invalid Parameter
>   FS0:\> echo "This should ^# work."
>   This should # work.
>   FS0:\>
> 
> The first command is parsed as if this were the command line:
> 
>   FS0:\> echo "This should
>   Command Error Status: Invalid Parameter
>   FS0:\>
> 
> I think many people would expect certain characters inside a quoted
> string, like "#" for example, to NOT need escaping.  The only ones
> that should need escaping (again IMHO) are: ", ^, and %.
> 
> Regards,
> Jim
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Carsey, Jaben
> Sent: Thursday, January 10, 2019 9:16 AM
> To: krishnaLee; edk2-devel@lists.01.org
> Subject: Re: [edk2] A question about shell-application's argument make
> system blocked;
> 
> 
> Is this in a script file?  I don't remember how "comments" work on raw
> command lines where the user types them.
> 
> -Jaben
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > krishnaLee
> > Sent: Wednesday, January 09, 2019 10:13 PM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] A question about shell-application's argument make system
> > blocked;
> > Importance: High
> >
> > Hi everybody,
> > I meet a question,a special arg can make system blocked,follow is my steps.
> > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf:
> > testapp.efi
> > 2,the output is "index:0,string:FS0:\testapp.efi"
> >
> >
> > 3,testapp.efi #abc.
> > 4,the output is same as step 2.  ///< I had read the uefi shell 
> > specification
> > 2.2,the '#' is a comment remark,so I think it is ok.
> >
> >
> > 5 testapp.efi "#abc"
> > 6,the system blocked(dead).  ///< I think it is a bug.
> >
> >
> > //follow is the testapp.efi source code:
> > EFI_STATUS
> > EFIAPI
> > UefiMain (
> > IN EFI_HANDLE ImageHandle,
> > IN EFI_SYSTEM_TABLE *SystemTable
> > )
> > {
> > EFI_STATUS status;
> > EFI_SHELL_PARAMETERS_PROTOCOL* param;
> > status=SystemTable->BootServices-
> >
> >HandleProtocol(ImageHandle,,);
> > if(status!=EFI_SUCCESS)
> > {
> > return0;
> > }
> >
> >
> > for(UINTN i=0;i< param->Argc;i++)
> > {
> > Print(L"index:%d,string:%s\n",i,param->Argv[i]);
> > }
> >
> >
> > return EFI_SUCCESS;
> > }
> >
> >
> > //test environment:
> > //QEMU v2.10.95 + edk2-2018-ovmf-x64.
> > //shell command line:
> > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash
> > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp -
> net
> > none
> > //end
> >
> >
> >
> >
> >
> >
> > thanks,
> > krishna.
> >
> >
> >
> > ___
> > 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 v2] ShellPkg/TftpDynamicCommand: Change file writing method in tftp

2019-01-10 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Li, Songpeng
> Sent: Wednesday, January 09, 2019 6:54 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ray ;
> Wu, Jiaxin 
> Subject: [PATCH v2] ShellPkg/TftpDynamicCommand: Change file writing
> method in tftp
> Importance: High
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1433
> 
> v2: Remove an unused variable.
> 
> Current logic of shell tftp download was writing file after tftp
> download finished, when the file is large, it looks like the shell
> tftp command hanged after download was finished. To improve
> end-user experience, the solution is using split file writing
> instead.
> 
> This patch update the code to open and close file inside
> DownloadFile(), and save each packet to file within callback
> function CheckPacket().
> 
> Since AllocatePage() is no-longer needed, This patch can also
> remove the memory limitation. The download file can be larger
> than system free memory now.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Cc: Wu Jiaxin 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Songpeng Li 
> ---
>  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 154 -
> ---
>  1 file changed, 64 insertions(+), 90 deletions(-)
> 
> diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> index ed081b5bad7c..ba753a279b00 100644
> --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> @@ -41,6 +41,12 @@ STATIC CONST CHAR16 mTftpProgressFrame[] = L"[
>  // (TFTP_PROGRESS_MESSAGE_SIZE-1) '\b'
>  STATIC CONST CHAR16 mTftpProgressDelete[] =
> L"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\
> b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
> 
> +// Local File Handle
> +SHELL_FILE_HANDLE mFileHandle;
> +
> +// Path of the local file, Unicode encoded
> +CONST CHAR16 *mLocalFilePath;
> +
>  /**
>Check and convert the UINT16 option values of the 'tftp' command
> 
> @@ -166,9 +172,6 @@ GetFileSize (
>@param[in]   FileSize   Size of the file in number of bytes
>@param[in]   BlockSize  Value of the TFTP blksize option
>@param[in]   WindowSize Value of the TFTP window size option
> -  @param[out]  Data   Address where to store the address of the 
> buffer
> -  where the data of the file were downloaded in
> -  case of success.
> 
>@retval  EFI_SUCCESS   The file was downloaded.
>@retval  EFI_OUT_OF_RESOURCES  A memory allocation failed.
> @@ -184,8 +187,7 @@ DownloadFile (
>IN   CONST CHAR8  *AsciiFilePath,
>IN   UINTNFileSize,
>IN   UINT16   BlockSize,
> -  IN   UINT16   WindowSize,
> -  OUT  VOID **Data
> +  IN   UINT16   WindowSize
>);
> 
>  /**
> @@ -287,7 +289,6 @@ RunTftp (
>CHAR8   *AsciiRemoteFilePath;
>UINTN   FilePathSize;
>CONST CHAR16*Walker;
> -  CONST CHAR16*LocalFilePath;
>EFI_MTFTP4_CONFIG_DATA  Mtftp4ConfigData;
>EFI_HANDLE  *Handles;
>UINTN   HandleCount;
> @@ -297,9 +298,6 @@ RunTftp (
>EFI_HANDLE  Mtftp4ChildHandle;
>EFI_MTFTP4_PROTOCOL *Mtftp4;
>UINTN   FileSize;
> -  UINTN   DataSize;
> -  VOID*Data;
> -  SHELL_FILE_HANDLE   FileHandle;
>UINT16  BlockSize;
>UINT16  WindowSize;
> 
> @@ -309,7 +307,6 @@ RunTftp (
>AsciiRemoteFilePath = NULL;
>Handles = NULL;
>FileSize= 0;
> -  DataSize= 0;
>BlockSize   = MTFTP_DEFAULT_BLKSIZE;
>WindowSize  = MTFTP_DEFAULT_WINDOWSIZE;
> 
> @@ -385,7 +382,7 @@ RunTftp (
>UnicodeStrToAsciiStrS (RemoteFilePath, AsciiRemoteFilePath, FilePathSize);
> 
>if (ParamCount == 4) {
> -LocalFilePath = ShellCommandLineGetRawValue (CheckPackage, 3);
> +mLocalFilePath = ShellCommandLineGetRawValue (CheckPackage, 3);
>} else {
>  Walker = RemoteFilePath + StrLen (RemoteFilePath);
>  while ((--Walker) >= RemoteFilePath) {
> @@ -394,7 +391,7 @@ RunTftp (
>  break;
>}
>  }
> -LocalFilePath = Walker + 1;
> +mLocalFilePath = Walker + 1;
>}
> 
>//
> @@ -492,7 +489,6 @@ RunTftp (
> (NicNumber < HandleCount) && (ShellStatus != SHELL_SUCCESS);
> 

Re: [edk2] A question about shell-application's argument make system blocked;

2019-01-10 Thread Carsey, Jaben
Is this in a script file?  I don't remember how "comments" work on raw command 
lines where the user types them.

-Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> krishnaLee
> Sent: Wednesday, January 09, 2019 10:13 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] A question about shell-application's argument make system
> blocked;
> Importance: High
> 
> Hi everybody,
> I meet a question,a special arg can make system blocked,follow is my steps.
> 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf:
> testapp.efi
> 2,the output is "index:0,string:FS0:\testapp.efi"
> 
> 
> 3,testapp.efi #abc.
> 4,the output is same as step 2.  ///< I had read the uefi shell specification
> 2.2,the '#' is a comment remark,so I think it is ok.
> 
> 
> 5 testapp.efi "#abc"
> 6,the system blocked(dead).  ///< I think it is a bug.
> 
> 
> //follow is the testapp.efi source code:
> EFI_STATUS
> EFIAPI
> UefiMain (
> IN EFI_HANDLE ImageHandle,
> IN EFI_SYSTEM_TABLE *SystemTable
> )
> {
> EFI_STATUS status;
> EFI_SHELL_PARAMETERS_PROTOCOL* param;
> status=SystemTable->BootServices-
> >HandleProtocol(ImageHandle,,);
> if(status!=EFI_SUCCESS)
> {
> return0;
> }
> 
> 
> for(UINTN i=0;i< param->Argc;i++)
> {
> Print(L"index:%d,string:%s\n",i,param->Argv[i]);
> }
> 
> 
> return EFI_SUCCESS;
> }
> 
> 
> //test environment:
> //QEMU v2.10.95 + edk2-2018-ovmf-x64.
> //shell command line:
> //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash
> "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp -net
> none
> //end
> 
> 
> 
> 
> 
> 
> thanks,
> krishna.
> 
> 
> 
> ___
> 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 1/3 V2] BaseTools: Remove unused logic for EDKI

2019-01-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Feng, Bob C
> Sent: Tuesday, January 08, 2019 11:15 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch 1/3 V2] BaseTools: Remove unused logic for EDKI
> Importance: High
> 
> From: "Feng, Bob C" 
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
> Remove EDK module type support from BaseTools python code.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py|  93 ++---
>  BaseTools/Source/Python/AutoGen/GenC.py   |  90 -
>  BaseTools/Source/Python/AutoGen/GenMake.py|  18 +-
>  BaseTools/Source/Python/Common/DataType.py|   2 -
>  BaseTools/Source/Python/Common/GlobalData.py  |   6 -
>  .../Source/Python/Workspace/DecBuildData.py   |   1 -
>  .../Source/Python/Workspace/DscBuildData.py   |   3 -
>  .../Source/Python/Workspace/InfBuildData.py   | 191 +-
>  .../Source/Python/Workspace/MetaFileParser.py |  22 --
>  .../Python/Workspace/WorkspaceCommon.py   |  29 +--
>  BaseTools/Source/Python/build/BuildReport.py  |  54 ++---
>  BaseTools/Source/Python/build/build.py|  65 --
>  edksetup.bat  |   3 -
>  13 files changed, 116 insertions(+), 461 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index d646cd50ce..d3d0d96e71 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -2174,46 +2174,11 @@ class PlatformAutoGen(AutoGen):
>  Pcd.MaxDatumSize = str(len(Value.split(',')))
>  else:
>  Pcd.MaxDatumSize = str(len(Value) - 1)
>  return Pcds.values()
> 
> -## Resolve library names to library modules
> -#
> -# (for Edk.x modules)
> -#
> -#   @param  Module  The module from which the library names will be
> resolved
> -#
> -#   @retval library_listThe list of library modules
> -#
> -def ResolveLibraryReference(self, Module):
> -EdkLogger.verbose("")
> -EdkLogger.verbose("Library instances of module [%s] [%s]:" %
> (str(Module), self.Arch))
> -LibraryConsumerList = [Module]
> -
> -# "CompilerStub" is a must for Edk modules
> -if Module.Libraries:
> -Module.Libraries.append("CompilerStub")
> -LibraryList = []
> -while len(LibraryConsumerList) > 0:
> -M = LibraryConsumerList.pop()
> -for LibraryName in M.Libraries:
> -Library = self.Platform.LibraryClasses[LibraryName, 
> ':dummy:']
> -if Library is None:
> -for Key in self.Platform.LibraryClasses.data:
> -if LibraryName.upper() == Key.upper():
> -Library = self.Platform.LibraryClasses[Key, 
> ':dummy:']
> -break
> -if Library is None:
> -EdkLogger.warn("build", "Library [%s] is not found" %
> LibraryName, File=str(M),
> -ExtraData="\t%s [%s]" % (str(Module), self.Arch))
> -continue
> 
> -if Library not in LibraryList:
> -LibraryList.append(Library)
> -LibraryConsumerList.append(Library)
> -EdkLogger.verbose("\t" + LibraryName + " : " + 
> str(Library) + ' ' +
> str(type(Library)))
> -return LibraryList
> 
>  ## Calculate the priority value of the build option
>  #
>  # @paramKeyBuild option definition contain:
> TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
>  #
> @@ -2377,16 +2342,12 @@ class PlatformAutoGen(AutoGen):
>  #
>  #   @retval options The options appended with build options in 
> platform
>  #
>  def ApplyBuildOption(self, Module):
>  # Get the different options for the different style module
> -if Module.AutoGenVersion < 0x00010005:
> -PlatformOptions = self.EdkBuildOption
> -ModuleTypeOptions =
> self.Platform.GetBuildOptionsByModuleType(EDK_NAME,
> Module.ModuleType)
> -else:
> -PlatformOptions = self.EdkIIBuildOption
> -ModuleTypeOptions =
> self.Platform.GetBuildOptionsByModuleType(EDKII_NAME,
> Module.ModuleType)
> +PlatformOpt

Re: [edk2] [Patch 3/3 V2] BaseTools: Remove unused logic from C tools

2019-01-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Note: in BaseTools/Source/C/EfiRom/EfiRom.h.  it looks like you both delete and 
add EBC.

> -Original Message-
> From: Feng, Bob C
> Sent: Wednesday, January 09, 2019 12:34 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch 3/3 V2] BaseTools: Remove unused logic from C tools
> Importance: High
> 
> From: "Feng, Bob C" 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1350
> Remove IA64 support from BaseTools C code.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/C/Common/BasePeCoff.c|  14 +-
>  BaseTools/Source/C/Common/PeCoffLoaderEx.c| 162 +-
>  BaseTools/Source/C/EfiRom/EfiRom.h|   3 +-
>  BaseTools/Source/C/GenFv/GenFvInternalLib.c   |  72 +---
>  BaseTools/Source/C/GenFv/GenFvInternalLib.h   |  10 --
>  BaseTools/Source/C/GenFw/Elf64Convert.c   |   5 -
>  BaseTools/Source/C/GenFw/GenFw.c  |   6 +-
>  BaseTools/Source/C/GenFw/elf_common.h |  85 -
>  .../C/Include/IndustryStandard/PeImage.h  |   3 -
>  BaseTools/Source/C/Makefiles/header.makefile  |   1 -
>  BaseTools/Source/C/VolInfo/VolInfo.c  |   2 +-
>  11 files changed, 10 insertions(+), 353 deletions(-)
> 
> diff --git a/BaseTools/Source/C/Common/BasePeCoff.c
> b/BaseTools/Source/C/Common/BasePeCoff.c
> index 1d89a300de..d5cefbd0b0 100644
> --- a/BaseTools/Source/C/Common/BasePeCoff.c
> +++ b/BaseTools/Source/C/Common/BasePeCoff.c
> @@ -54,17 +54,10 @@ PeCoffLoaderRelocateIa32Image (
>IN OUT CHAR8   *Fixup,
>IN OUT CHAR8   **FixupData,
>IN UINT64  Adjust
>);
> 
> -RETURN_STATUS
> -PeCoffLoaderRelocateIpfImage (
> -  IN UINT16  *Reloc,
> -  IN OUT CHAR8   *Fixup,
> -  IN OUT CHAR8   **FixupData,
> -  IN UINT64  Adjust
> -  );
> 
>  RETURN_STATUS
>  PeCoffLoaderRelocateArmImage (
>IN UINT16  **Reloc,
>IN OUT CHAR8   *Fixup,
> @@ -182,11 +175,10 @@ Returns:
>} else {
>  ImageContext->Machine = TeHdr->Machine;
>}
> 
>if (ImageContext->Machine != EFI_IMAGE_MACHINE_IA32 && \
> -  ImageContext->Machine != EFI_IMAGE_MACHINE_IA64 && \
>ImageContext->Machine != EFI_IMAGE_MACHINE_X64  && \
>ImageContext->Machine != EFI_IMAGE_MACHINE_ARMT && \
>ImageContext->Machine != EFI_IMAGE_MACHINE_EBC  && \
>ImageContext->Machine != EFI_IMAGE_MACHINE_AARCH64) {
>  if (ImageContext->Machine == IMAGE_FILE_MACHINE_ARM) {
> @@ -814,13 +806,10 @@ Returns:
>Status = PeCoffLoaderRelocateIa32Image (Reloc, Fixup, ,
> Adjust);
>break;
>  case EFI_IMAGE_MACHINE_ARMT:
>Status = PeCoffLoaderRelocateArmImage (, Fixup, ,
> Adjust);
>break;
> -case EFI_IMAGE_MACHINE_IA64:
> -  Status = PeCoffLoaderRelocateIpfImage (Reloc, Fixup, ,
> Adjust);
> -  break;
>  default:
>Status = RETURN_UNSUPPORTED;
>break;
>  }
>  if (RETURN_ERROR (Status)) {
> @@ -1317,13 +1306,12 @@ PeCoffLoaderGetPdbPointer (
>// Assume PE32 image with IA32 Machine field.
>//
>Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
>break;
>  case EFI_IMAGE_MACHINE_X64:
> -case EFI_IMAGE_MACHINE_IPF:
>//
> -  // Assume PE32+ image with X64 or IPF Machine field
> +  // Assume PE32+ image with X64 Machine field
>//
>Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
>break;
>  default:
>//
> diff --git a/BaseTools/Source/C/Common/PeCoffLoaderEx.c
> b/BaseTools/Source/C/Common/PeCoffLoaderEx.c
> index 2d9a2a8978..fa8c7e3d17 100644
> --- a/BaseTools/Source/C/Common/PeCoffLoaderEx.c
> +++ b/BaseTools/Source/C/Common/PeCoffLoaderEx.c
> @@ -1,7 +1,7 @@
>  /** @file
> -IA32, X64 and IPF Specific relocation fixups
> +IA32 and X64 Specific relocation fixups
> 
>  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
>  Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
> @@ -97,170 +97,10 @@ Returns:
>  --*/
>  {
>return RETURN_UNSUPPORTED;
>  }
> 
> -RETURN_STATUS
> -PeCoffLoaderRelocateIpfImage (
> -  IN UINT16  *Reloc,
> -  IN OUT CHAR8   *Fixup,
> -  IN OUT CHAR8   **FixupData,
> -  IN UINT64  Adjust
> -  )
> -/*++
>

Re: [edk2] [Patch 3/3 V2] BaseTools: Remove unused ECP related code from C tools

2019-01-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Feng, Bob C
> Sent: Wednesday, January 09, 2019 12:35 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C ; Gao, Liming
> ; Carsey, Jaben 
> Subject: [Patch 3/3 V2] BaseTools: Remove unused ECP related code from C
> tools
> Importance: High
> 
> From: "Feng, Bob C" 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1350
> Remove ECP support from BaseTools C code.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/C/Include/IndustryStandard/pci22.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci22.h
> b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
> index d7c5f0c858..873ce69094 100644
> --- a/BaseTools/Source/C/Include/IndustryStandard/pci22.h
> +++ b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
> @@ -178,11 +178,10 @@ typedef struct {
>  #define PCI_IF_16850  0x05
>  #define PCI_IF_16950  0x06
>  #define PCI_SUBCLASS_PARALLEL 0x01
>  #define PCI_IF_PARALLEL_PORT  0x00
>  #define PCI_IF_BI_DIR_PARALLEL_PORT   0x01
> -#define PCI_IF_ECP_PARALLEL_PORT  0x02
>  #define PCI_IF_1284_CONTROLLER0x03
>  #define PCI_IF_1284_DEVICE0xFE
>  #define PCI_SUBCLASS_MULTIPORT_SERIAL 0x02
>  #define PCI_SUBCLASS_MODEM0x03
>  #define PCI_IF_GENERIC_MODEM  0x00
> --
> 2.19.1.windows.1

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


Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update

2019-01-09 Thread Carsey, Jaben
Liming,

I think that the user should not need to set PYTHON3_ENABLE at all if they 
manually set PYTHON_COMMAND.

-Jaben


> -Original Message-
> From: Gao, Liming
> Sent: Tuesday, January 08, 2019 4:43 PM
> To: Carsey, Jaben ; Laszlo Ersek
> ; Ni, Ray ; edk2-devel@lists.01.org;
> leif.lindh...@linaro.org; af...@apple.com; Kinney, Michael D
> 
> Subject: RE: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> Importance: High
> 
> Jaben:
>   I also think this way. Now, we have two envs PYTHON3_ENABLE and
> PYTHON_COMMAND. The behavior can be combined as the below to
> support this usage. If user wants the specific python interpreter, he only
> needs to set PYTHON_COMMAND env.
> 
> If PYTHON3_ENABLE is set, PYTHON_COMMAND will be set to the found one
> by edk2 scripts based on PYTHON3_ENABLE value.
> If PYTHON3_ENABLE is not set, but PYTHON_COMMAND is set, then
> PYTHON_COMMAND will be used to run python script. No version check
> here.
> If PYTHON3_ENABLE is not set, but PYTHON_COMMAND is not set,
> PYTHON_COMMAND will be set to the high version python installed in OS.
> 
> Thanks
> Liming
> >-Original Message-
> >From: Carsey, Jaben
> >Sent: Wednesday, January 09, 2019 2:06 AM
> >To: Laszlo Ersek ; Gao, Liming
> ;
> >Ni, Ray ; edk2-devel@lists.01.org;
> leif.lindh...@linaro.org;
> >af...@apple.com; Kinney, Michael D 
> >Subject: RE: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >
> >
> >
> >> -Original Message-
> >> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> Sent: Tuesday, January 08, 2019 9:26 AM
> >> To: Carsey, Jaben ; Gao, Liming
> >> ; Ni, Ray ; edk2-
> >> de...@lists.01.org; leif.lindh...@linaro.org; af...@apple.com; Kinney,
> >> Michael D 
> >> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >> Importance: High
> >>
> >> On 01/08/19 17:22, Carsey, Jaben wrote:
> >> > Liming and Laszlo,
> >> >  What if we add a 4th option to the environment variable - the path to
> >> a specific python interpreter for use.
> >>
> >> I thought of that, but how do the build tools derive the python version
> >> just from the pathname of the interpreter?
> >>
> >> Will they run "$INTERPRETER --version" and parse the output?
> >>
> >> I think that could be brittle; distributions sometimes customize the
> >> version strings of their executables. The "--version" output is usually
> >> human-readable, not machine-readable (per intent).
> >
> >Laszlo, you lost me. How is that related to an exact path?   If the user
> specifies
> >the path, then always use that specific interpreter.
> >
> >>
> >> Thanks,
> >> Laszlo
> >>
> >> >
> >> > -Jaben
> >> >
> >> >
> >> >> -Original Message-
> >> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> >Of
> >> >> Gao, Liming
> >> >> Sent: Tuesday, January 08, 2019 6:23 AM
> >> >> To: Laszlo Ersek ; Ni, Ray ;
> >edk2-
> >> >> de...@lists.01.org; leif.lindh...@linaro.org; af...@apple.com; Kinney,
> >> >> Michael D 
> >> >> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >> >>
> >> >> Laszlo:
> >> >>   Yes. This can be supported. But, I don't know what purpose to specify
> >> >> python minor version of Python3. Current implementation in Python3
> >> branch
> >> >> always tries to find the high version installed in OS. For example,
> >> Python3.4,
> >> >> Python3.7 are both installed, Python3.7 will be chosen. Does this policy
> >> meet
> >> >> with your usage?
> >> >>
> >> >> Thanks
> >> >> Liming
> >> >>> -Original Message-
> >> >>> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> >>> Sent: Tuesday, January 8, 2019 3:04 AM
> >> >>> To: Gao, Liming ; Ni, Ray ;
> >> edk2-
> >> >> de...@lists.01.org; leif.lindh...@linaro.org;
> >> >>> af...@apple.com; Kinney, Michael D 
> >> >>> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >> >>>
> >> >>> On 01/07/19 14:41, Gao, Liming wrote:
> >> >>>> Ray:
> >> >>>>  I think this proposal is good to recommend Python3 as the

Re: [edk2] [Patch v1 1/1] MdeModulePkg: fix comments in BaseSortLib

2019-01-09 Thread Carsey, Jaben
I did the work last year so I didn't do anything but the email this year...

> -Original Message-
> From: Zeng, Star
> Sent: Tuesday, January 08, 2019 5:18 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Wang, Jian J ; Zeng, Star 
> Subject: RE: [Patch v1 1/1] MdeModulePkg: fix comments in BaseSortLib
> Importance: High
> 
> How about updating "2018" to "2019"? :)
> 
> 
> With that, Reviewed-by: Star Zeng .
> 
> Thanks,
> Star
> -Original Message-
> From: Carsey, Jaben
> Sent: Wednesday, January 9, 2019 5:58 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Wang, Jian J 
> Subject: [Patch v1 1/1] MdeModulePkg: fix comments in BaseSortLib
> 
> The comments are incorrect for the base version of this lib.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jaben Carsey 
> Cc: Star Zeng 
> Cc: Jian J Wang 
> ---
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.c | 22 
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c
> b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c
> index ab8a60585ee2..8f30c00971eb 100644
> --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c
> +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>Library used for sorting routines.
> 
> -  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. 
> +  Copyright (c) 2009 - 2018, 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 @@ -193,14 +193,12 @@ DevicePathCompare (  }
> 
>  /**
> -  Function to compare 2 strings without regard to case of the characters.
> +  Not supported in Base version.
> 
> -  @param[in] Buffer1Pointer to String to compare.
> -  @param[in] Buffer2Pointer to second String to compare.
> +  @param[in] Buffer1  Ignored.
> +  @param[in] Buffer2  Ignored.
> 
> -  @retval 0 Buffer1 equal to Buffer2.
> -  @return < 0   Buffer1 is less than Buffer2.
> -  @return > 0   Buffer1 is greater than Buffer2.
> +  ASSERT and return 0.
>  **/
>  INTN
>  EFIAPI
> @@ -215,14 +213,12 @@ StringNoCaseCompare (
> 
> 
>  /**
> -  Function to compare 2 strings.
> +  Not supported in Base version.
> 
> -  @param[in] Buffer1Pointer to String to compare (CHAR16**).
> -  @param[in] Buffer2Pointer to second String to compare 
> (CHAR16**).
> +  @param[in] Buffer1  Ignored.
> +  @param[in] Buffer2  Ignored.
> 
> -  @retval 0 Buffer1 equal to Buffer2.
> -  @return < 0   Buffer1 is less than Buffer2.
> -  @return > 0   Buffer1 is greater than Buffer2.
> +  ASSERT and return 0.
>  **/
>  INTN
>  EFIAPI
> --
> 2.16.2.windows.1

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


Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update

2019-01-08 Thread Carsey, Jaben



> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Tuesday, January 08, 2019 9:26 AM
> To: Carsey, Jaben ; Gao, Liming
> ; Ni, Ray ; edk2-
> de...@lists.01.org; leif.lindh...@linaro.org; af...@apple.com; Kinney,
> Michael D 
> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> Importance: High
> 
> On 01/08/19 17:22, Carsey, Jaben wrote:
> > Liming and Laszlo,
> > What if we add a 4th option to the environment variable - the path to
> a specific python interpreter for use.
> 
> I thought of that, but how do the build tools derive the python version
> just from the pathname of the interpreter?
> 
> Will they run "$INTERPRETER --version" and parse the output?
> 
> I think that could be brittle; distributions sometimes customize the
> version strings of their executables. The "--version" output is usually
> human-readable, not machine-readable (per intent).

Laszlo, you lost me. How is that related to an exact path?   If the user 
specifies the path, then always use that specific interpreter.

> 
> Thanks,
> Laszlo
> 
> >
> > -Jaben
> >
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> Gao, Liming
> >> Sent: Tuesday, January 08, 2019 6:23 AM
> >> To: Laszlo Ersek ; Ni, Ray ; edk2-
> >> de...@lists.01.org; leif.lindh...@linaro.org; af...@apple.com; Kinney,
> >> Michael D 
> >> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >>
> >> Laszlo:
> >>   Yes. This can be supported. But, I don't know what purpose to specify
> >> python minor version of Python3. Current implementation in Python3
> branch
> >> always tries to find the high version installed in OS. For example,
> Python3.4,
> >> Python3.7 are both installed, Python3.7 will be chosen. Does this policy
> meet
> >> with your usage?
> >>
> >> Thanks
> >> Liming
> >>> -Original Message-
> >>> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >>> Sent: Tuesday, January 8, 2019 3:04 AM
> >>> To: Gao, Liming ; Ni, Ray ;
> edk2-
> >> de...@lists.01.org; leif.lindh...@linaro.org;
> >>> af...@apple.com; Kinney, Michael D 
> >>> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >>>
> >>> On 01/07/19 14:41, Gao, Liming wrote:
> >>>> Ray:
> >>>>  I think this proposal is good to recommend Python3 as the default
> >> interpreter. I summary the updated proposal.
> >>>>
> >>>> 1. PYTHON3_ENABLE env is not set. edksetup.bat/edksetup.sh will find
> >> higher version python installed in OS. If Python3 is found,
> >>> Python3 will be used. Then, if python2 is found, and python2 is used. If
> not
> >> found, report error and stop build. This will change the
> >>> default python interpreter from Python2 to Python3 when they both are
> >> installed.
> >>>> 2. PYTHON3_EANBLE env is set to TRUE. edksetup.bat/edksetup.sh will
> >> find Python3. If Python3 is found, Python3 will be used. If not
> >>> found, report error and stop build.
> >>>> 3. PYTHON3_ENABLE env is set to not TRUE. edksetup.bat/edksetup.sh
> >> will find Python2. If Python2 is found, Python2 will be used. If
> >>> not found, report error and stop build.
> >>>> Once Python is found, edksetup.bat/edksetup.sh and build tool will
> both
> >> print message to let user aware which version python tool is
> >>> used in this build.
> >>>
> >>> If we're going for this level of flexibility, I'd like to suggest /
> >>> request another improvement. Some Linux distros intend to
> accommodate
> >>> multiple Python3 versions at the same time (this is not a typo; I don't
> >>> mean Python2+Python3, but multiple Python3 versions). So basically I'd
> >>> suggest that we offer a method for specifying a python version
> >>> (2/3/auto-detect), plus, in case a specific major version is specified,
> >>> that we allow the user to specify the precise interpreter pathname too.
> >>>
> >>> Thanks,
> >>> Laszlo
> >> ___
> >> 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] [RFC] Edk2 BaseTools Python3 Migration Update

2019-01-08 Thread Carsey, Jaben
Liming and Laszlo,
What if we add a 4th option to the environment variable - the path to a 
specific python interpreter for use.

-Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Gao, Liming
> Sent: Tuesday, January 08, 2019 6:23 AM
> To: Laszlo Ersek ; Ni, Ray ; edk2-
> de...@lists.01.org; leif.lindh...@linaro.org; af...@apple.com; Kinney,
> Michael D 
> Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> 
> Laszlo:
>   Yes. This can be supported. But, I don't know what purpose to specify
> python minor version of Python3. Current implementation in Python3 branch
> always tries to find the high version installed in OS. For example, Python3.4,
> Python3.7 are both installed, Python3.7 will be chosen. Does this policy meet
> with your usage?
> 
> Thanks
> Liming
> > -Original Message-
> > From: Laszlo Ersek [mailto:ler...@redhat.com]
> > Sent: Tuesday, January 8, 2019 3:04 AM
> > To: Gao, Liming ; Ni, Ray ; edk2-
> de...@lists.01.org; leif.lindh...@linaro.org;
> > af...@apple.com; Kinney, Michael D 
> > Subject: Re: [edk2] [RFC] Edk2 BaseTools Python3 Migration Update
> >
> > On 01/07/19 14:41, Gao, Liming wrote:
> > > Ray:
> > >  I think this proposal is good to recommend Python3 as the default
> interpreter. I summary the updated proposal.
> > >
> > > 1. PYTHON3_ENABLE env is not set. edksetup.bat/edksetup.sh will find
> higher version python installed in OS. If Python3 is found,
> > Python3 will be used. Then, if python2 is found, and python2 is used. If not
> found, report error and stop build. This will change the
> > default python interpreter from Python2 to Python3 when they both are
> installed.
> > > 2. PYTHON3_EANBLE env is set to TRUE. edksetup.bat/edksetup.sh will
> find Python3. If Python3 is found, Python3 will be used. If not
> > found, report error and stop build.
> > > 3. PYTHON3_ENABLE env is set to not TRUE. edksetup.bat/edksetup.sh
> will find Python2. If Python2 is found, Python2 will be used. If
> > not found, report error and stop build.
> > > Once Python is found, edksetup.bat/edksetup.sh and build tool will both
> print message to let user aware which version python tool is
> > used in this build.
> >
> > If we're going for this level of flexibility, I'd like to suggest /
> > request another improvement. Some Linux distros intend to accommodate
> > multiple Python3 versions at the same time (this is not a typo; I don't
> > mean Python2+Python3, but multiple Python3 versions). So basically I'd
> > suggest that we offer a method for specifying a python version
> > (2/3/auto-detect), plus, in case a specific major version is specified,
> > that we allow the user to specify the precise interpreter pathname too.
> >
> > Thanks,
> > Laszlo
> ___
> 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] BaseTools/GenFds: permit stripped MM_CORE_STANDALONE binaries

2019-01-03 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, January 03, 2019 4:13 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTools/GenFds: permit stripped
> MM_CORE_STANDALONE binaries
> 
> The standalone MM core is executed in place, and resides in a
> separate execution context which may be space constrained.
> Since code and data may be mapped with different attributes for
> security reasons, the PE/COFF binary could have a section
> alignment of 4 KB.
> 
> This means that any relocation data is not only useless, but it
> will also take up 4 KB of valuable space.
> 
> So add support for the RELOCS_STRIPPED attribute on FFS files of
> this type, so that we can get rid of the .reloc section altogether.
> Combined with the FIXED attribute (which enables an optimization
> in GenFfs that strips redundant padding) and a TE type binary, this
> gets rid of all the needless padding around the standalone MM core
> binary.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Jagadeesh Ujja 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Source/Python/GenFds/EfiSection.py  | 2 +-
>  BaseTools/Source/Python/GenFds/FdfParser.py   | 2 +-
>  BaseTools/Source/Python/GenFds/FfsInfStatement.py | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py
> b/BaseTools/Source/Python/GenFds/EfiSection.py
> index f8573b5c7d1b..0be176ec8ae1 100644
> --- a/BaseTools/Source/Python/GenFds/EfiSection.py
> +++ b/BaseTools/Source/Python/GenFds/EfiSection.py
> @@ -68,7 +68,7 @@ class EfiSection (EfiSectionClassObject):
>  StringData = FfsInf.__ExtendMacro__(self.StringData)
>  ModuleNameStr = FfsInf.__ExtendMacro__('$(MODULE_NAME)')
>  NoStrip = True
> -if FfsInf.ModuleType in (SUP_MODULE_SEC,
> SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM) and SectionType in
> (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
> +if FfsInf.ModuleType in (SUP_MODULE_SEC,
> SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM,
> SUP_MODULE_MM_CORE_STANDALONE) and SectionType in
> (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
>  if FfsInf.KeepReloc is not None:
>  NoStrip = FfsInf.KeepReloc
>  elif FfsInf.KeepRelocFromRule is not None:
> diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py
> b/BaseTools/Source/Python/GenFds/FdfParser.py
> index e000228d2f6c..de0b166030e7 100644
> --- a/BaseTools/Source/Python/GenFds/FdfParser.py
> +++ b/BaseTools/Source/Python/GenFds/FdfParser.py
> @@ -2589,7 +2589,7 @@ class FdfParser:
>  #
>  @staticmethod
>  def _FileCouldHaveRelocFlag (FileType):
> -if FileType in {SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,
> SUP_MODULE_PEIM, 'PEI_DXE_COMBO'}:
> +if FileType in {SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,
> SUP_MODULE_PEIM, SUP_MODULE_MM_CORE_STANDALONE,
> 'PEI_DXE_COMBO'}:
>  return True
>  else:
>  return False
> diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
> b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
> index c1073c96e9aa..d4c61c074963 100644
> --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
> +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
> @@ -901,7 +901,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
>  #   @retval string   File name of the generated section file
>  #
>  def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr,
> IsMakefile = False):
> -if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,
> SUP_MODULE_PEIM):
> +if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,
> SUP_MODULE_PEIM, SUP_MODULE_MM_CORE_STANDALONE):
>  if Rule.KeepReloc is not None:
>  self.KeepRelocFromRule = Rule.KeepReloc
>  SectFiles = []
> --
> 2.17.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 v1 2/2] StdLib/Environs: Avoid infinite recursion in _Exit

2019-01-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And pushed.

> -Original Message-
> From: Alex James [mailto:theracermas...@gmail.com]
> Sent: Monday, December 17, 2018 8:25 PM
> To: edk2-devel@lists.01.org
> Cc: Daryl McDaniel ; Carsey, Jaben
> 
> Subject: [PATCH v1 2/2] StdLib/Environs: Avoid infinite recursion in _Exit
> Importance: High
> 
> Use __builtin_unreachable instead of infinite recursion to fix an
> infinite recursion error when building StdLib with XCODE5/CLANG38.
> 
> Cc: Daryl McDaniel 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Alex James 
> ---
>  StdLib/LibC/StdLib/Environs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/StdLib/LibC/StdLib/Environs.c b/StdLib/LibC/StdLib/Environs.c
> index 15221a1260..a29cb9954c 100644
> --- a/StdLib/LibC/StdLib/Environs.c
> +++ b/StdLib/LibC/StdLib/Environs.c
> @@ -120,7 +120,7 @@ _Exit(int status)
>longjmp(gMD->MainExit, 0x55); // Get out of here.  longjmp can't return
> 0. Use 0x55 for a non-zero value.
> 
>  #ifdef __GNUC__
> -  _Exit(status);/* Keep GCC happy - never reached */
> +  __builtin_unreachable (); // Keep GCC happy
>  #endif
>  }
> 
> --
> 2.20.1

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


Re: [edk2] [PATCH v1 2/2] StdLib/Environs: Avoid infinite recursion in _Exit

2019-01-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And pushed.

> -Original Message-
> From: Alex James [mailto:theracermas...@gmail.com]
> Sent: Monday, December 17, 2018 8:25 PM
> To: edk2-devel@lists.01.org
> Cc: Daryl McDaniel ; Carsey, Jaben
> 
> Subject: [PATCH v1 2/2] StdLib/Environs: Avoid infinite recursion in _Exit
> Importance: High
> 
> Use __builtin_unreachable instead of infinite recursion to fix an
> infinite recursion error when building StdLib with XCODE5/CLANG38.
> 
> Cc: Daryl McDaniel 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Alex James 
> ---
>  StdLib/LibC/StdLib/Environs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/StdLib/LibC/StdLib/Environs.c b/StdLib/LibC/StdLib/Environs.c
> index 15221a1260..a29cb9954c 100644
> --- a/StdLib/LibC/StdLib/Environs.c
> +++ b/StdLib/LibC/StdLib/Environs.c
> @@ -120,7 +120,7 @@ _Exit(int status)
>longjmp(gMD->MainExit, 0x55); // Get out of here.  longjmp can't return
> 0. Use 0x55 for a non-zero value.
> 
>  #ifdef __GNUC__
> -  _Exit(status);/* Keep GCC happy - never reached */
> +  __builtin_unreachable (); // Keep GCC happy
>  #endif
>  }
> 
> --
> 2.20.1

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


Re: [edk2] [PATCH v4 6/7] ShellPkg/Shell: Use BaseLib api CharToUpper

2018-12-31 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Tuesday, December 25, 2018 12:17 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [PATCH v4 6/7] ShellPkg/Shell: Use BaseLib api CharToUpper
> Importance: High
> 
> Substitute InternalShellCharToUpper with a public function
> CharToUpper which has the same function.
> Remove the implement of InternalShellCharToUpper.
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> ---
>  ShellPkg/Application/Shell/ShellManParser.c | 23 +
>  1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellManParser.c
> b/ShellPkg/Application/Shell/ShellManParser.c
> index b180c6c8f7..2c044dbe4a 100644
> --- a/ShellPkg/Application/Shell/ShellManParser.c
> +++ b/ShellPkg/Application/Shell/ShellManParser.c
> @@ -46,27 +46,6 @@ SHELL_MAN_HII_VENDOR_DEVICE_PATH
> mShellManHiiDevicePath = {
>}
>  };
> 
> -
> -/**
> -  Convert a Unicode character to upper case only if
> -  it maps to a valid small-case ASCII character.
> -
> -  This internal function only deal with Unicode character
> -  which maps to a valid small-case ASCII character, i.e.
> -  L'a' to L'z'. For other Unicode character, the input character
> -  is returned directly.
> -
> -  @param  Char  The character to convert.
> -
> -  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> -  @retval UnchangedOtherwise.
> -
> -**/
> -CHAR16
> -InternalShellCharToUpper (
> -  IN CHAR16  Char
> -  );
> -
>  /**
>Verifies that the filename has .EFI on the end.
> 
> @@ -416,7 +395,7 @@ IsTitleHeader(
>ReturnFound = TRUE;  // This is the desired command's title header 
> line.
>State = (BriefDesc == NULL) ? Final : GetBriefDescription;
>  }
> -else if (InternalShellCharToUpper (*Line) != InternalShellCharToUpper
> (*(Command + CommandIndex++))) {
> +else if (CharToUpper (*Line) != CharToUpper (*(Command +
> CommandIndex++))) {
>State = Final;
>  }
>  Line++;
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH v4 7/7] ShellPkg/UefiShellLib: Use BaseLib api CharToUpper

2018-12-31 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zhang, Shenglei
> Sent: Tuesday, December 25, 2018 12:17 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [PATCH v4 7/7] ShellPkg/UefiShellLib: Use BaseLib api CharToUpper
> Importance: High
> 
> Substitute InternalShellCharToUpper with CharToUpper which is a public
> function with the same effect.
> Remove the implement of InternalShellCharToUpper.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1369
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang 
> ---
>  ShellPkg/Library/UefiShellLib/UefiShellLib.c | 31 ++--
>  1 file changed, 2 insertions(+), 29 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index b17266d623..aff933dcdf 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -3740,33 +3740,6 @@ ShellFileExists(
>return (EFI_SUCCESS);
>  }
> 
> -/**
> -  Convert a Unicode character to upper case only if
> -  it maps to a valid small-case ASCII character.
> -
> -  This internal function only deal with Unicode character
> -  which maps to a valid small-case ASCII character, i.e.
> -  L'a' to L'z'. For other Unicode character, the input character
> -  is returned directly.
> -
> -  @param  Char  The character to convert.
> -
> -  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> -  @retval UnchangedOtherwise.
> -
> -**/
> -CHAR16
> -InternalShellCharToUpper (
> -  IN  CHAR16Char
> -  )
> -{
> -  if (Char >= L'a' && Char <= L'z') {
> -return (CHAR16) (Char - (L'a' - L'A'));
> -  }
> -
> -  return Char;
> -}
> -
>  /**
>Convert a Unicode character to numerical value.
> 
> @@ -3789,7 +3762,7 @@ InternalShellHexCharToUintn (
>  return Char - L'0';
>}
> 
> -  return (10 + InternalShellCharToUpper (Char) - L'A');
> +  return (10 + CharToUpper (Char) - L'A');
>  }
> 
>  /**
> @@ -3849,7 +3822,7 @@ InternalShellStrHexToUint64 (
>  String++;
>}
> 
> -  if (InternalShellCharToUpper (*String) == L'X') {
> +  if (CharToUpper (*String) == L'X') {
>  if (*(String - 1) != L'0') {
>return 0;
>  }
> --
> 2.18.0.windows.1

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


Re: [edk2] [PATCH v2] ShellPkg/UefiShellDebug1CommandsLib: Remove the unused function CharToUpper

2018-12-14 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Friday, December 14, 2018 1:54 AM
> To: Zhang, Shenglei ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ruiyu 
> Subject: Re: [PATCH v2] ShellPkg/UefiShellDebug1CommandsLib: Remove
> the unused function CharToUpper
> Importance: High
> 
> On 12/14/18 08:56, Shenglei Zhang wrote:
> > CharToUpper is an unused function, so it will be removed.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1399
> >
> > v2:Update the title.
> >
> > Cc: Laszlo Ersek 
> > Cc: Jaben Carsey 
> > Cc: Ruiyu Ni 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Shenglei Zhang 
> > ---
> >  .../UefiShellDebug1CommandsLib.c  | 28 ---
> >  1 file changed, 28 deletions(-)
> >
> > diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.c
> > index bd4dfa98f7..480441b0f9 100644
> > ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.c
> > +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.c
> > @@ -113,34 +113,6 @@ UefiShellDebug1CommandsLibDestructor (
> >return (EFI_SUCCESS);
> >  }
> >
> > -/**
> > -  Convert a Unicode character to upper case only if
> > -  it maps to a valid small-case ASCII character.
> > -
> > -  This internal function only deal with Unicode character
> > -  which maps to a valid small-case ASCII character, i.e.
> > -  L'a' to L'z'. For other Unicode character, the input character
> > -  is returned directly.
> > -
> > -  @param  Char  The character to convert.
> > -
> > -  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> > -  @retval UnchangedOtherwise.
> > -
> > -
> > -  //Stolen from MdePkg Baselib
> > -**/
> > -CHAR16
> > -CharToUpper (
> > -  IN  CHAR16Char
> > -  )
> > -{
> > -  if (Char >= L'a' && Char <= L'z') {
> > -return (CHAR16) (Char - (L'a' - L'A'));
> > -  }
> > -
> > -  return Char;
> > -}
> >
> >  /**
> >Function returns a system configuration table that is stored in the
> >
> 
> Reviewed-by: Laszlo Ersek 
> 
> Thanks!
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-12-06 Thread Carsey, Jaben
I will submit a new change with those changed back.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Carsey, Jaben
> Sent: Thursday, December 6, 2018 4:50 PM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [Patch v1 1/1] BaseTools: create and use a standard
> shared variable for '*'
> Importance: High
> 
> How about undo those and push the remaining?  Since that's a very small
> change.
> 
> -Jaben
> 
> > -Original Message-
> > From: Zhu, Yonghong
> > Sent: Monday, December 3, 2018 5:53 PM
> > To: Carsey, Jaben ; edk2-devel@lists.01.org
> > Cc: Gao, Liming ; Zhu, Yonghong
> > 
> > Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard
> > shared variable for '*'
> > Importance: High
> >
> > Yes.  I prefer not to change it.
> >
> > Best Regards,
> > Zhu Yonghong
> >
> >
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Monday, December 03, 2018 11:19 PM
> > To: Zhu, Yonghong ; edk2-devel@lists.01.org
> > Cc: Gao, Liming 
> > Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard
> > shared variable for '*'
> >
> > I was trying to change all use of *, without regard to the usage of it.
> >
> > Do you think that mathematical * should not be changed?
> >
> > -Jaben
> >
> > > -Original Message-
> > > From: Zhu, Yonghong
> > > Sent: Sunday, December 02, 2018 6:31 PM
> > > To: Carsey, Jaben ; edk2-devel@lists.01.org
> > > Cc: Gao, Liming ; Zhu, Yonghong
> > > 
> > > Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard
> > > shared variable for '*'
> > > Importance: High
> > >
> > > Hi Jaben,
> > >
> > > In this patch, it also changed the mathematics multiplicative '*'
> > > (used in
> > > expression) to  TAB_STAR, is it by on purpose?
> > > Eg:
> > > -NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', 
> > > '>>', '!', '=', '>',
> > '<',
> > > '?', ':']
> > > +NonLetterOpLst = ['+', '-', TAB_STAR, '/', '%', '&', '|', '^',
> > > + '~', '<<', '>>', '!', '=',
> > > '>', '<', '?', ':']
> > >
> > > Best Regards,
> > > Zhu Yonghong
> > >
> > > -Original Message-
> > > From: Carsey, Jaben
> > > Sent: Friday, November 16, 2018 11:40 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Zhu, Yonghong ; Gao, Liming
> > > 
> > > Subject: [Patch v1 1/1] BaseTools: create and use a standard shared
> > > variable for '*'
> > >
> > > add a variable for the string '*' and then use it instead of lots of '*'
> > >
> > > Cc: Yonghong Zhu 
> > > Cc: Liming Gao 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Jaben Carsey 
> > > ---
> > >  BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++-
> --
> > > ---
> > >  BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++--
> > >  BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++---
> > >  BaseTools/Source/Python/Common/DataType.py |  1 +
> > >  BaseTools/Source/Python/Common/Expression.py   |  4 +-
> > >  BaseTools/Source/Python/Common/Misc.py |  2 +-
> > >  BaseTools/Source/Python/Common/ToolDefClassObject.py   | 23 +-
> ---
> > >  BaseTools/Source/Python/Common/VpdInfoFile.py  |  8 +--
> > >  BaseTools/Source/Python/GenFds/FdfParser.py|  5 +-
> > >  BaseTools/Source/Python/GenFds/GenFds.py   |  2 +-
> > >  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  8 +--
> > >  BaseTools/Source/Python/GenFds/Section.py  |  2 +-
> > >  BaseTools/Source/Python/Workspace/DscBuildData.py  |  6 +--
> > >  13 files changed, 70 insertions(+), 69 deletions(-)
> > >
> > > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > > b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > > index f3560bfc787d..25417c447061 100644
> > > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > > @@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen):
> > >  PcdValue = Sku.DefaultValue
> > >  if P

Re: [edk2] [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-12-06 Thread Carsey, Jaben
How about undo those and push the remaining?  Since that's a very small change.

-Jaben

> -Original Message-
> From: Zhu, Yonghong
> Sent: Monday, December 3, 2018 5:53 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Gao, Liming ; Zhu, Yonghong
> 
> Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard shared
> variable for '*'
> Importance: High
> 
> Yes.  I prefer not to change it.
> 
> Best Regards,
> Zhu Yonghong
> 
> 
> -Original Message-
> From: Carsey, Jaben
> Sent: Monday, December 03, 2018 11:19 PM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard shared
> variable for '*'
> 
> I was trying to change all use of *, without regard to the usage of it.
> 
> Do you think that mathematical * should not be changed?
> 
> -Jaben
> 
> > -Original Message-
> > From: Zhu, Yonghong
> > Sent: Sunday, December 02, 2018 6:31 PM
> > To: Carsey, Jaben ; edk2-devel@lists.01.org
> > Cc: Gao, Liming ; Zhu, Yonghong
> > 
> > Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard
> > shared variable for '*'
> > Importance: High
> >
> > Hi Jaben,
> >
> > In this patch, it also changed the mathematics multiplicative '*'
> > (used in
> > expression) to  TAB_STAR, is it by on purpose?
> > Eg:
> > -NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', 
> > '>>', '!', '=', '>',
> '<',
> > '?', ':']
> > +NonLetterOpLst = ['+', '-', TAB_STAR, '/', '%', '&', '|', '^',
> > + '~', '<<', '>>', '!', '=',
> > '>', '<', '?', ':']
> >
> > Best Regards,
> > Zhu Yonghong
> >
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Friday, November 16, 2018 11:40 PM
> > To: edk2-devel@lists.01.org
> > Cc: Zhu, Yonghong ; Gao, Liming
> > 
> > Subject: [Patch v1 1/1] BaseTools: create and use a standard shared
> > variable for '*'
> >
> > add a variable for the string '*' and then use it instead of lots of '*'
> >
> > Cc: Yonghong Zhu 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jaben Carsey 
> > ---
> >  BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++---
> > ---
> >  BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++--
> >  BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++---
> >  BaseTools/Source/Python/Common/DataType.py |  1 +
> >  BaseTools/Source/Python/Common/Expression.py   |  4 +-
> >  BaseTools/Source/Python/Common/Misc.py |  2 +-
> >  BaseTools/Source/Python/Common/ToolDefClassObject.py   | 23 +
> >  BaseTools/Source/Python/Common/VpdInfoFile.py  |  8 +--
> >  BaseTools/Source/Python/GenFds/FdfParser.py|  5 +-
> >  BaseTools/Source/Python/GenFds/GenFds.py   |  2 +-
> >  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  8 +--
> >  BaseTools/Source/Python/GenFds/Section.py  |  2 +-
> >  BaseTools/Source/Python/Workspace/DscBuildData.py  |  6 +--
> >  13 files changed, 70 insertions(+), 69 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > index f3560bfc787d..25417c447061 100644
> > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> > @@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen):
> >  PcdValue = Sku.DefaultValue
> >  if PcdValue == "":
> >  PcdValue  = Pcd.DefaultValue
> > -if Sku.VpdOffset != '*':
> > +if Sku.VpdOffset != TAB_STAR:
> >  if PcdValue.startswith("{"):
> >  Alignment = 8
> >  elif PcdValue.startswith("L"):
> > @@ -1462,7 +1462,7 @@ class PlatformAutoGen(AutoGen):
> >  VpdFile.Add(Pcd, SkuName, Sku.VpdOffset)
> >  SkuValueMap[PcdValue].append(Sku)
> >  # if the offset of a VPD is *, then it need
> > to be fixed up by third party tool.
> > -if not NeedProcessVpdMapFile and Sku.VpdOffset == 
> > "*":
> > +   

Re: [edk2] [PATCH edk2-platforms 5/6] Platform: add acpiview to Seattle/Styx platforms

2018-12-05 Thread Carsey, Jaben
You didn't CC anyone, but that is the right syntax for adding the shell command.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Wednesday, December 05, 2018 10:50 AM
> To: edk2-devel@lists.01.org
> Cc: a...@softiron.co.uk
> Subject: [edk2] [PATCH edk2-platforms 5/6] Platform: add acpiview to
> Seattle/Styx platforms
> Importance: High
> 
> Enable the 'acpiview' UEFI shell command so we can inspect the ACPI
> tables at boot time.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  Platform/AMD/OverdriveBoard/OverdriveBoard.dsc  | 1 +
>  Platform/LeMaker/CelloBoard/CelloBoard.dsc  | 1 +
>  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> index 7c66af6128c5..ed67c986b7db 100644
> --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> @@ -731,6 +731,7 @@ DEFINE DO_CAPSULE   = FALSE
> 
> NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1
> CommandsLib.inf
> +
> NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCo
> mmandLib.inf
> 
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingL
> ib.inf
>PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> 
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfg
> CommandLib.inf
> diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> index 7c22bbbfa90f..057bf0eb67de 100644
> --- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> +++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
> @@ -663,6 +663,7 @@ DEFINE DO_FLASHER   = FALSE
> 
> NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1
> CommandsLib.inf
> +
> NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCo
> mmandLib.inf
> 
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingL
> ib.inf
>PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> 
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfg
> CommandLib.inf
> diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> index 793bd5359a23..985ba2253a90 100644
> --- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> +++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
> @@ -658,6 +658,7 @@ DEFINE DO_FLASHER   = FALSE
> 
> NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Com
> mandsLib.inf
> 
> NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1
> CommandsLib.inf
> +
> NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCo
> mmandLib.inf
> 
> HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingL
> ib.inf
>PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> 
> BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfg
> CommandLib.inf
> --
> 2.19.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 v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-12-03 Thread Carsey, Jaben
I was trying to change all use of *, without regard to the usage of it.

Do you think that mathematical * should not be changed?

-Jaben

> -Original Message-
> From: Zhu, Yonghong
> Sent: Sunday, December 02, 2018 6:31 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Gao, Liming ; Zhu, Yonghong
> 
> Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard shared
> variable for '*'
> Importance: High
> 
> Hi Jaben,
> 
> In this patch, it also changed the mathematics multiplicative '*' (used in
> expression) to  TAB_STAR, is it by on purpose?
> Eg:
> -NonLetterOpLst = ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<', 
> '>>', '!', '=', '>', '<',
> '?', ':']
> +NonLetterOpLst = ['+', '-', TAB_STAR, '/', '%', '&', '|', '^', '~', 
> '<<', '>>', '!', '=',
> '>', '<', '?', ':']
> 
> Best Regards,
> Zhu Yonghong
> 
> -Original Message-
> From: Carsey, Jaben
> Sent: Friday, November 16, 2018 11:40 PM
> To: edk2-devel@lists.01.org
> Cc: Zhu, Yonghong ; Gao, Liming
> 
> Subject: [Patch v1 1/1] BaseTools: create and use a standard shared variable
> for '*'
> 
> add a variable for the string '*' and then use it instead of lots of '*'
> 
> Cc: Yonghong Zhu 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jaben Carsey 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++---
> ---
>  BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++--
>  BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++---
>  BaseTools/Source/Python/Common/DataType.py |  1 +
>  BaseTools/Source/Python/Common/Expression.py   |  4 +-
>  BaseTools/Source/Python/Common/Misc.py |  2 +-
>  BaseTools/Source/Python/Common/ToolDefClassObject.py   | 23 +
>  BaseTools/Source/Python/Common/VpdInfoFile.py  |  8 +--
>  BaseTools/Source/Python/GenFds/FdfParser.py|  5 +-
>  BaseTools/Source/Python/GenFds/GenFds.py   |  2 +-
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  8 +--
>  BaseTools/Source/Python/GenFds/Section.py  |  2 +-
>  BaseTools/Source/Python/Workspace/DscBuildData.py  |  6 +--
>  13 files changed, 70 insertions(+), 69 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index f3560bfc787d..25417c447061 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen):
>  PcdValue = Sku.DefaultValue
>  if PcdValue == "":
>  PcdValue  = Pcd.DefaultValue
> -if Sku.VpdOffset != '*':
> +if Sku.VpdOffset != TAB_STAR:
>  if PcdValue.startswith("{"):
>  Alignment = 8
>  elif PcdValue.startswith("L"):
> @@ -1462,7 +1462,7 @@ class PlatformAutoGen(AutoGen):
>  VpdFile.Add(Pcd, SkuName, Sku.VpdOffset)
>  SkuValueMap[PcdValue].append(Sku)
>  # if the offset of a VPD is *, then it need to be 
> fixed up by third
> party tool.
> -if not NeedProcessVpdMapFile and Sku.VpdOffset == 
> "*":
> +if not NeedProcessVpdMapFile and Sku.VpdOffset ==
> TAB_STAR:
>  NeedProcessVpdMapFile = True
>  if self.Platform.VpdToolGuid is None or
> self.Platform.VpdToolGuid == '':
>  EdkLogger.error("Build", FILE_NOT_FOUND, \ 
> @@ -1522,7
> +1522,7 @@ class PlatformAutoGen(AutoGen):
>  PcdValue = Sku.DefaultValue
>  if PcdValue == "":
>  PcdValue  = DscPcdEntry.DefaultValue
> -if Sku.VpdOffset != '*':
> +if Sku.VpdOffset != TAB_STAR:
>  if PcdValue.startswith("{"):
>  Alignment = 8
>  elif PcdValue.startswith("L"):
> @@ -1545,7 +1545,7 @@ class PlatformAutoGen(AutoGen):
>  SkuValueMap[PcdValue] = []
>  VpdFile.Add(DscPcdEntry, SkuName, 
> Sku.VpdOffset)
> 

Re: [edk2] [RFC] Proposal to add edk2-apps repository

2018-11-30 Thread Carsey, Jaben
I do not think that expanding shellPkg would work since there is no requirement 
that any of these apps depend on it.  As was stated, MicroPythonPkg does not.

I also do not think that moving ShellPkg makes lots of sense since it is used 
by many platforms.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ni,
> Ruiyu
> Sent: Thursday, November 29, 2018 7:40 PM
> To: krishnaLee ; Kinney, Michael D
> 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] [RFC] Proposal to add edk2-apps repository
> Importance: High
> 
> Krishna,
> The reason there are applications inside MdeModulePkg/Application is that
> the shell protocol was in ShellPkg when the app was developed and
> MdeModulePkg cannot depend on ShellPkg (rule).
> Now since shell protocol is moved to MdePkg, any apps can depend on shell
> protocol. (In fact they wanted to but just wasn't allowed due to reason
> above.)
> 
> I even prefer to move the ShellPkg to the edk2-app repo Mike proposed.
> Instead of enlarge the ShellPkg:)
> 
> I don't prefer edk2-libc unless we have a strategy/plan to make ordinary C
> developer easy by promoting the std-c pkg.
> The other reason I prefer edk2-app is then ShellPkg might be moved to that
> new repo.
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > krishnaLee
> > Sent: Friday, November 30, 2018 9:45 AM
> > To: edk2-devel@lists.01.org
> > Subject: Re: [edk2] [RFC] Proposal to add edk2-apps repository
> >
> > Kinney,
> > I always think there may be two kinds of apps:
> > 1,some apps have dependency on uefi_shell(shell-
> lib,efi_shell_protocol,...they
> > usually execute under uefi_shell),I would call them
> "uefi_shell_application";
> > 2,some apps have no dependency on uefi_shell(such as apps in
> > MdeModulePkg/Application),I would call them
> "standard_uefi_application".
> >
> > The "AppPkg / StdLib / StdLibPrivateInternalFiles" packages are usually
> used by
> > uefi_shell_application,I think they can all move to ShellPkg,no need to
> create
> > new package ?
> >
> >
> > Thanks,
> > krishna.
> >
> > At 2018-11-30 08:46:58, "Kinney, Michael D" 
> > wrote:
> > >Leif,
> > >
> > >I did consider the edk2-libc name.  The port of Python 2.7 is in the
> > >AppPkg as well and it uses libc.
> > >
> > >So the content of this new package is a combination of libc And apps
> > >that use libc.
> > >
> > >I am definitely open to alternate names.  2 options so far:
> > >
> > >* edk2-apps
> > >* edk2-libc
> > >
> > >Thanks,
> > >
> > >Mike
> > >
> > >> -Original Message-
> > >> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > >> Sent: Thursday, November 29, 2018 2:41 PM
> > >> To: Kinney, Michael D 
> > >> Cc: edk2-devel@lists.01.org
> > >> Subject: Re: [edk2] [RFC] Proposal to add edk2-apps repository
> > >>
> > >> On Thu, Nov 29, 2018 at 05:58:08PM +, Kinney, Michael D wrote:
> > >> > Hello,
> > >> >
> > >> > I would like to propose the creation of a new repository called
> > >> > edk2-apps.  This repository would initially be used to host the
> > >> > following packages from the edk2 repository:
> > >> >
> > >> > * AppPkg
> > >> > * StdLib
> > >> > * StdLibPrivateInternalFiles
> > >>
> > >> Let me start by saying I 100% back moving these out of the main edk2
> > >> repository.
> > >>
> > >> > These 3 packages provide support for the libc along with
> > >> > applications that depend on libc.  None of the other packages in
> > >> > the edk2 repository use these packages, so these 3 package can be
> > >> > safely moved without any impacts to platform firmware builds.
> > >> > Build configurations that do use libc features can clone the
> > >> > edk2-apps repository and add it to PACKAGES_PATH.
> > >>
> > >> I must confess to never having properly understood the scope of
> > >> AppPkg to begin with.
> > >>
> > >> AppPkg/Applications/Hello does not appear to have any further (real)
> > >> dependency on libc than MdeModulePkg/Application/HelloWorld/, and
> .
> > >>
> > >> And certainly MdeModulePkg/Applications contain plenty of ...
> > >> applications.
> > >>
> > >> So, if the purpose is simply to provide some examples of application
> > >> written to libc rather than UEFI - should this be edk2- libc instead?
> > >>
> > >> Best Regards,
> > >>
> > >> Leif
> > >>
> > >> > The history of these 3 packages would be preserved when importing
> > >> > the content into edk2-apps.  After The import is verified, these 3
> > >> > packages would be deleted from the edk2 repository.
> > >> >
> > >> > This proposal helps reduce the size of the edk2 repository and
> > >> > focuses edk2 repository on packages used to provide UEFI/PI
> > >> > conformant firmware.
> > >> >
> > >> > If there are no concerns with this proposal, I will enter a
> > >> > Tianocore BZs for the two steps.
> > >> >
> > >> > Best regards,
> > >> >
> > >> > Mike
> > >> > ___
> > >> > 

Re: [edk2] [PATCH 6/6] BaseTools/CommonLib: drop definition of MAX_UINTN

2018-11-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, November 29, 2018 4:31 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Gao, Liming 
> Subject: [edk2] [PATCH 6/6] BaseTools/CommonLib: drop definition of
> MAX_UINTN
> 
> The maximum value that can be represented by the native word size
> of the *target* should be irrelevant when compiling tools that
> run on the build *host*. So drop the definition of MAX_UINTN, now
> that we no longer use it.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Source/C/Common/CommonLib.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/BaseTools/Source/C/Common/CommonLib.h
> b/BaseTools/Source/C/Common/CommonLib.h
> index 6930d9227b87..b1c6c00a3478 100644
> --- a/BaseTools/Source/C/Common/CommonLib.h
> +++ b/BaseTools/Source/C/Common/CommonLib.h
> @@ -22,7 +22,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY
> KIND, EITHER EXPRESS OR IMPLIED.
> 
>  #define MAX_LONG_FILE_PATH 500
> 
> -#define MAX_UINTN MAX_ADDRESS
>  #define MAX_UINT64 ((UINT64)0xULL)
>  #define MAX_UINT16  ((UINT16)0x)
>  #define MAX_UINT8   ((UINT8)0xFF)
> --
> 2.19.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 4/6] BaseTools/DevicePath: use MAX_UINT16 as default device path max size

2018-11-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, November 29, 2018 4:31 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Gao, Liming 
> Subject: [edk2] [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as
> default device path max size
> 
> Replace the default size limit of IsDevicePathValid() with a value
> that does not depend on the native word size of the build host.
> 
> 64 KB seems sufficient as the upper bound of a device path handled
> by UEFI.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> index d4ec2742b7c8..ba7f83e53070 100644
> --- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> +++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> @@ -62,7 +62,7 @@ IsDevicePathValid (
>ASSERT (DevicePath != NULL);
> 
>if (MaxSize == 0) {
> -MaxSize = MAX_UINTN;
> +MaxSize = MAX_UINT16;
>   }
> 
>//
> @@ -78,7 +78,7 @@ IsDevicePathValid (
>return FALSE;
>  }
> 
> -if (NodeLength > MAX_UINTN - Size) {
> +if (NodeLength > MAX_UINT16 - Size) {
>return FALSE;
>  }
>  Size += NodeLength;
> --
> 2.19.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/6] BaseTools/CommonLib: use explicit 64-bit type in Strtoi()

2018-11-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, November 29, 2018 4:31 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Gao, Liming 
> Subject: [edk2] [PATCH 2/6] BaseTools/CommonLib: use explicit 64-bit type
> in Strtoi()
> 
> Don't use the native word size string to number parsing routines,
> but instead, use the 64-bit one and cast to UINTN.
> 
> Currently, the only user is in Source/C/DevicePath/DevicePathFromText.c
> which takes care to use Strtoi64 () unless it assumes the value fits
> in 32-bit, so this change is a no-op even on 32-bit build hosts.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Source/C/Common/CommonLib.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/Common/CommonLib.c
> b/BaseTools/Source/C/Common/CommonLib.c
> index bea6af0a45b1..c5e32b1292e0 100644
> --- a/BaseTools/Source/C/Common/CommonLib.c
> +++ b/BaseTools/Source/C/Common/CommonLib.c
> @@ -2252,9 +2252,9 @@ Strtoi (
>)
>  {
>if (IsHexStr (Str)) {
> -return StrHexToUintn (Str);
> +return (UINTN)StrHexToUint64 (Str);
>} else {
> -return StrDecimalToUintn (Str);
> +return (UINTN)StrDecimalToUint64 (Str);
>}
>  }
> 
> --
> 2.19.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 3/6] BaseTools/DevicePath: use explicit 64-bit number parsing routines

2018-11-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, November 29, 2018 4:31 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek ; Gao, Liming 
> Subject: [edk2] [PATCH 3/6] BaseTools/DevicePath: use explicit 64-bit
> number parsing routines
> 
> Replace invocations of StrHexToUintn() with StrHexToUint64(), so
> that we can drop the former.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  BaseTools/Source/C/DevicePath/DevicePathFromText.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/C/DevicePath/DevicePathFromText.c
> b/BaseTools/Source/C/DevicePath/DevicePathFromText.c
> index 555efa1acdde..6151926af9aa 100644
> --- a/BaseTools/Source/C/DevicePath/DevicePathFromText.c
> +++ b/BaseTools/Source/C/DevicePath/DevicePathFromText.c
> @@ -520,7 +520,7 @@ EisaIdFromText (
>return (((Text[0] - 'A' + 1) & 0x1f) << 10)
> + (((Text[1] - 'A' + 1) & 0x1f) <<  5)
> + (((Text[2] - 'A' + 1) & 0x1f) <<  0)
> -   + (UINT32) (StrHexToUintn ([3]) << 16)
> +   + (UINT32) (StrHexToUint64 ([3]) << 16)
> ;
>  }
> 
> @@ -1506,7 +1506,7 @@ DevPathFromTextNVMe (
> 
>Index = sizeof (Nvme->NamespaceUuid) / sizeof (UINT8);
>while (Index-- != 0) {
> -Uuid[Index] = (UINT8) StrHexToUintn (SplitStr (, L'-
> '));
> +Uuid[Index] = (UINT8) StrHexToUint64 (SplitStr (, L'-
> '));
>}
> 
>return (EFI_DEVICE_PATH_PROTOCOL *) Nvme;
> --
> 2.19.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 v1 1/1] BaseTools: cleanup LongFilePathSupport usage

2018-11-27 Thread Carsey, Jaben
Poke.  Any comments on this one?

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jaben Carsey
> Sent: Friday, November 16, 2018 7:38 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch v1 1/1] BaseTools: cleanup LongFilePathSupport usage
> 
> 1) remove an identical function and import it from
> Common.LongFilePathSupport
> 2) remove an import that is not needed/used.
> 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jaben Carsey 
> ---
>  BaseTools/Source/Python/AutoGen/UniClassObject.py | 14 +-
>  BaseTools/Source/Python/build/build.py|  1 -
>  2 files changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py
> b/BaseTools/Source/Python/AutoGen/UniClassObject.py
> index 384f31b165de..764d95ec660b 100644
> --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
> +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
> @@ -24,7 +24,7 @@ from io import BytesIO
>  from Common.BuildToolError import *
>  from Common.StringUtils import GetLineNo
>  from Common.Misc import PathClass
> -from Common.LongFilePathSupport import LongFilePath
> +from Common.LongFilePathSupport import LongFilePath, UniToStr
>  from Common.GlobalData import *
>  ##
>  # Static definitions
> @@ -46,18 +46,6 @@ BACK_SLASH_PLACEHOLDER = u'\u0006'
> 
>  gIncludePattern = re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$",
> re.MULTILINE | re.UNICODE)
> 
> -## Convert a python unicode string to a normal string
> -#
> -# Convert a python unicode string to a normal string
> -# UniToStr(u'I am a string') is 'I am a string'
> -#
> -# @param Uni:  The python unicode string
> -#
> -# @retval: The formatted normal string
> -#
> -def UniToStr(Uni):
> -return repr(Uni)[2:-1]
> -
>  ## Convert a unicode string to a Hex list
>  #
>  # Convert a unicode string to a Hex list
> diff --git a/BaseTools/Source/Python/build/build.py
> b/BaseTools/Source/Python/build/build.py
> index d74082fc2666..5eeb626cfbbb 100644
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -36,7 +36,6 @@ from subprocess import *
>  from Common import Misc as Utils
> 
>  from Common.LongFilePathSupport import OpenLongFilePath as open
> -from Common.LongFilePathSupport import LongFilePath
>  from Common.TargetTxtClassObject import *
>  from Common.ToolDefClassObject import *
>  from Common.DataType import *
> --
> 2.16.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 v1 1/1] BaseTools: Move Identification file to Eot

2018-11-27 Thread Carsey, Jaben
Poke.  Any comments on this one?

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jaben Carsey
> Sent: Friday, November 16, 2018 7:42 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch v1 1/1] BaseTools: Move Identification file to Eot
> Importance: High
> 
> Move the Identification file.
> This file is only ever imported into the Eot tool.
> 
> Cc: Yonghong Zhu 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jaben Carsey 
> ---
>  BaseTools/Source/Python/{Common => Eot}/Identification.py | 0
>  BaseTools/Source/Python/Eot/InfParserLite.py  | 3 ++-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Identification.py
> b/BaseTools/Source/Python/Eot/Identification.py
> similarity index 100%
> rename from BaseTools/Source/Python/Common/Identification.py
> rename to BaseTools/Source/Python/Eot/Identification.py
> diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py
> b/BaseTools/Source/Python/Eot/InfParserLite.py
> index c910c129a719..0cfe0398f05f 100644
> --- a/BaseTools/Source/Python/Eot/InfParserLite.py
> +++ b/BaseTools/Source/Python/Eot/InfParserLite.py
> @@ -16,11 +16,12 @@
>  #
>  from __future__ import print_function
>  from __future__ import absolute_import
> +
>  import Common.LongFilePathOs as os
>  import Common.EdkLogger as EdkLogger
>  from Common.DataType import *
>  from CommonDataClass.DataClass import *
> -from Common.Identification import *
> +from Eot.Identification import Identification
>  from Common.StringUtils import *
>  from Eot.Parser import *
>  from Eot import Database
> --
> 2.16.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 v1 1/1] BaseTools: create and use a standard shared variable for '*'

2018-11-27 Thread Carsey, Jaben
Poke.  Any comments on this one?

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jaben Carsey
> Sent: Friday, November 16, 2018 7:40 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch v1 1/1] BaseTools: create and use a standard shared
> variable for '*'
> Importance: High
> 
> add a variable for the string '*' and then use it instead of lots of '*'
> 
> Cc: Yonghong Zhu 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jaben Carsey 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++---
> ---
>  BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++--
>  BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++---
>  BaseTools/Source/Python/Common/DataType.py |  1 +
>  BaseTools/Source/Python/Common/Expression.py   |  4 +-
>  BaseTools/Source/Python/Common/Misc.py |  2 +-
>  BaseTools/Source/Python/Common/ToolDefClassObject.py   | 23 +
>  BaseTools/Source/Python/Common/VpdInfoFile.py  |  8 +--
>  BaseTools/Source/Python/GenFds/FdfParser.py|  5 +-
>  BaseTools/Source/Python/GenFds/GenFds.py   |  2 +-
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py |  8 +--
>  BaseTools/Source/Python/GenFds/Section.py  |  2 +-
>  BaseTools/Source/Python/Workspace/DscBuildData.py  |  6 +--
>  13 files changed, 70 insertions(+), 69 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index f3560bfc787d..25417c447061 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen):
>  PcdValue = Sku.DefaultValue
>  if PcdValue == "":
>  PcdValue  = Pcd.DefaultValue
> -if Sku.VpdOffset != '*':
> +if Sku.VpdOffset != TAB_STAR:
>  if PcdValue.startswith("{"):
>  Alignment = 8
>  elif PcdValue.startswith("L"):
> @@ -1462,7 +1462,7 @@ class PlatformAutoGen(AutoGen):
>  VpdFile.Add(Pcd, SkuName, Sku.VpdOffset)
>  SkuValueMap[PcdValue].append(Sku)
>  # if the offset of a VPD is *, then it need to be 
> fixed up by third
> party tool.
> -if not NeedProcessVpdMapFile and Sku.VpdOffset == 
> "*":
> +if not NeedProcessVpdMapFile and Sku.VpdOffset ==
> TAB_STAR:
>  NeedProcessVpdMapFile = True
>  if self.Platform.VpdToolGuid is None or
> self.Platform.VpdToolGuid == '':
>  EdkLogger.error("Build", FILE_NOT_FOUND, \
> @@ -1522,7 +1522,7 @@ class PlatformAutoGen(AutoGen):
>  PcdValue = Sku.DefaultValue
>  if PcdValue == "":
>  PcdValue  = DscPcdEntry.DefaultValue
> -if Sku.VpdOffset != '*':
> +if Sku.VpdOffset != TAB_STAR:
>  if PcdValue.startswith("{"):
>  Alignment = 8
>  elif PcdValue.startswith("L"):
> @@ -1545,7 +1545,7 @@ class PlatformAutoGen(AutoGen):
>  SkuValueMap[PcdValue] = []
>  VpdFile.Add(DscPcdEntry, SkuName, 
> Sku.VpdOffset)
>  SkuValueMap[PcdValue].append(Sku)
> -if not NeedProcessVpdMapFile and 
> Sku.VpdOffset == "*":
> +if not NeedProcessVpdMapFile and 
> Sku.VpdOffset ==
> TAB_STAR:
>  NeedProcessVpdMapFile = True
>  if DscPcdEntry.DatumType == TAB_VOID and
> PcdValue.startswith("L"):
>  UnicodePcdArray.add(DscPcdEntry)
> @@ -1573,7 +1573,7 @@ class PlatformAutoGen(AutoGen):
>  if os.path.exists(VpdMapFilePath):
>  VpdFile.Read(VpdMapFilePath)
> 
> -# Fixup "*" offset
> +# Fixup TAB_STAR offset
>  for pcd in VpdSkuMap:
>  vpdinfo = VpdFile.GetVpdInfo(pcd)
>  if vpdinfo is None:
> @@ -2210,15 +2210,15 @@ class PlatformAutoGen(AutoGen):
>  def CalculatePriorityValue(self, Key):
>  Target, ToolChain, Arch, CommandType, Attr = Key.split('_')
>  PriorityValue = 0x1
> -if Target == "*":
> +if Target == TAB_STAR:
>  

Re: [edk2] [PATCH edk2-staging 10/20] IntelUndiPkg/XGigUndiDxe: drop StdLibC library class reference

2018-11-15 Thread Carsey, Jaben
Agreed.  
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Wednesday, November 14, 2018 6:34 PM
> To: edk2-devel@lists.01.org
> Cc: Kacperski, Kamil ; Jin, Eric
> ; Orlowski, Pawel ; Kinney,
> Michael D ; Hsiung, Harry L
> 
> Subject: [edk2] [PATCH edk2-staging 10/20] IntelUndiPkg/XGigUndiDxe: drop
> StdLibC library class reference
> Importance: High
> 
> StdLibc should not be used in drivers (it has dependencies on Shell
> protocols), but in fact, we don't appear to rely on it in the first
> place, so just drop the reference.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> index beee8aa8134e..b5747565fbea 100644
> --- a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> +++ b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
> @@ -132,7 +132,6 @@ GCC:*_*_*_CC_FLAGS = -DEFI32
>PrintLib
>UefiLib
>HiiLib
> -  StdLibC
> 
>  [LibraryClasses.X64]
> 
> --
> 2.17.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] BaseTools: Replace the sqlite database with list

2018-11-09 Thread Carsey, Jaben
This is much easier to review! Thanks!

I am good with the code change.

I wonder: If we do not have the DB does it take longer if I do build, clean, 
build than it did before?

> -Original Message-
> From: Feng, Bob C
> Sent: Friday, November 09, 2018 12:42 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Carsey, Jaben
> 
> Subject: [Patch V2] BaseTools: Replace the sqlite database with list
> Importance: High
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1288
> 
> [V2]
> Optimize this patch so that it can be easy to review.
> This patch is just apply the change to original files while
> not create new similar files.
> 
> [V1]
> This patch is one of build tool performance improvement
> series patches.
> 
> This patch is going to use python list to store the parser data
> instead of using sqlite database.
> 
> The replacement solution is as below:
> 
> SQL insert: list.append()
> SQL select: list comprehension. for example:
> Select * from table where field = “something”
> ->
> [ item for item in table if item[3] == “something”]
> 
> SQL update: python map function. for example:
> Update table set field1=newvalue where filed2 = “something”.
> -> map(lambda x: x[1] = newvalue,
>[item for item in table if item[2] == “something”])
> 
> SQL delete: list comprehension.
> 
> With this change, We can save the time of interpreting SQL statement
> and the time of write database to file system
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: BobCF 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/Python/GenFds/GenFds.py  |   3 +-
>  .../Source/Python/Workspace/MetaDataTable.py  |  93 ++-
>  .../Source/Python/Workspace/MetaFileParser.py |   5 +-
>  .../Source/Python/Workspace/MetaFileTable.py  | 248 ++
>  .../Python/Workspace/WorkspaceDatabase.py | 131 +
>  BaseTools/Source/Python/build/build.py|  27 +-
>  6 files changed, 186 insertions(+), 321 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/GenFds.py
> b/BaseTools/Source/Python/GenFds/GenFds.py
> index 0c8091b798..4fd96706af 100644
> --- a/BaseTools/Source/Python/GenFds/GenFds.py
> +++ b/BaseTools/Source/Python/GenFds/GenFds.py
> @@ -222,12 +222,11 @@ def main():
>  if "TOOL_CHAIN_TAG" not in GlobalData.gGlobalDefines:
>  GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] =
> GenFdsGlobalVariable.ToolChainTag
> 
>  """call Workspace build create database"""
>  GlobalData.gDatabasePath =
> os.path.normpath(os.path.join(ConfDirectoryPath,
> GlobalData.gDatabasePath))
> -BuildWorkSpace = WorkspaceDatabase(GlobalData.gDatabasePath)
> -BuildWorkSpace.InitDatabase()
> +BuildWorkSpace = WorkspaceDatabase()
> 
>  #
>  # Get files real name in workspace dir
>  #
>  GlobalData.gAllFiles = DirCache(Workspace)
> diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py
> b/BaseTools/Source/Python/Workspace/MetaDataTable.py
> index bd751eadfb..8becddbe08 100644
> --- a/BaseTools/Source/Python/Workspace/MetaDataTable.py
> +++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py
> @@ -37,84 +37,58 @@ class Table(object):
>  _COLUMN_ = ''
>  _ID_STEP_ = 1
>  _ID_MAX_ = 0x8000
>  _DUMMY_ = 0
> 
> -def __init__(self, Cursor, Name='', IdBase=0, Temporary=False):
> -self.Cur = Cursor
> +def __init__(self, Db, Name='', IdBase=0, Temporary=False):
> +self.Db = Db
>  self.Table = Name
>  self.IdBase = int(IdBase)
>  self.ID = int(IdBase)
>  self.Temporary = Temporary
> +self.Contents = []
> 
>  def __str__(self):
>  return self.Table
> 
>  ## Create table
>  #
>  # Create a table
>  #
>  def Create(self, NewTable=True):
> -if NewTable:
> -self.Drop()
> -
> -if self.Temporary:
> -SqlCommand = """create temp table IF NOT EXISTS %s (%s)""" %
> (self.Table, self._COLUMN_)
> -else:
> -SqlCommand = """create table IF NOT EXISTS %s (%s)""" % 
> (self.Table,
> self._COLUMN_)
> -EdkLogger.debug(EdkLogger.DEBUG_8, SqlCommand)
> -self.Cur.execute(SqlCommand)
> +self.Db.CreateEmptyTable(self.Table)
>  self.ID = self.GetId()
> 
>  ## Insert table
>  #
>  # Insert a record into a table
>  #
>  def Insert(self, *Args):
>  self.ID = self.ID + self._ID_STEP_
>

Re: [edk2] [PATCH] BaseTools: Enable Pcd Array support.

2018-11-09 Thread Carsey, Jaben
How concerned with spaces in the DSC lines are we?  The following looks very 
sensitive to spaces and could be replaced with a regular expression that would 
be more flexible.

if "{CODE(" not in PcdValue:

aprox:
if re.match('[{]\w*CODE\w*[(]', PcdValue)

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> BobCF
> Sent: Wednesday, November 07, 2018 1:19 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTools: Enable Pcd Array support.
> 
> From: "bob.c.f...@intel.com" 
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1292
> 
> This patch is going to enable Array data type for PCD.
> 
> 1. Support Pcd ARRAY as Structure PCD type
>including basic datatype array and structure array.
>For example:
>gStructuredPcdPkgTokenSpaceGuid.PcdTest|{0x0}|TEST[10]|0x00010080
> 
> gStructuredPcdPkgTokenSpaceGuid.PcdTest2|{0x0}|UINT8[10]|0x00010081
> 2. Support C CODE style value initialization in DEC/DSC.
>For example:
> gStructuredPcdPkgTokenSpaceGuid.PcdTest|{CODE({
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
>   {0, {0, 0, 0, 0,  0, 0, 0}},
> })}
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Common/Expression.py  | 396 +
> -
>  BaseTools/Source/Python/Common/Misc.py|   2 +
>  .../Python/Workspace/BuildClassObject.py  |  85 +++-
>  .../Source/Python/Workspace/DecBuildData.py   |  29 +-
>  .../Source/Python/Workspace/DscBuildData.py   | 384 +++--
>  .../Source/Python/Workspace/MetaFileParser.py |  86 +++-
>  6 files changed, 644 insertions(+), 338 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index a21ab5daa7..f6e245be70 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -820,221 +820,219 @@ class ValueExpressionEx(ValueExpression):
> 
>  def __call__(self, RealValue=False, Depth=0):
>  PcdValue = self.PcdValue
> -try:
> -PcdValue = ValueExpression.__call__(self, RealValue, Depth)
> -if self.PcdType == TAB_VOID and (PcdValue.startswith("'") or
> PcdValue.startswith("L'")):
> -PcdValue, Size = ParseFieldValue(PcdValue)
> -PcdValueList = []
> -for I in range(Size):
> -PcdValueList.append('0x%02X'%(PcdValue & 0xff))
> -PcdValue = PcdValue >> 8
> -PcdValue = '{' + ','.join(PcdValueList) + '}'
> -elif self.PcdType in TAB_PCD_NUMERIC_TYPES and
> (PcdValue.startswith("'") or \
> -  PcdValue.startswith('"') or PcdValue.startswith("L'") 
> or
> PcdValue.startswith('L"') or PcdValue.startswith('{')):
> -raise BadExpression
> -except WrnExpression as Value:
> -PcdValue = Value.result
> -except BadExpression as Value:
> -if self.PcdType in TAB_PCD_NUMERIC_TYPES:
> -PcdValue = PcdValue.strip()
> -if PcdValue.startswith('{') and PcdValue.endswith('}'):
> -PcdValue = SplitPcdValueString(PcdValue[1:-1])
> -if ERR_STRING_CMP.split(':')[0] in Value.message:
> -raise BadExpression("Type: %s, Value: %s, %s" % 
> (self.PcdType,
> PcdValue, Value))
> -if isinstance(PcdValue, type([])):
> -TmpValue = 0
> -Size = 0
> -ValueType = ''
> -for Item in PcdValue:
> -Item = Item.strip()
> -if Item.startswith(TAB_UINT8):
> -ItemSize = 1
> -ValueType = TAB_UINT8
> -elif Item.startswith(TAB_UINT16):
> -ItemSize = 2
> -ValueType = TAB_UINT16
> -elif Item.startswith(TAB_UINT32):
> -ItemSize = 4
> -ValueType = TAB_UINT32
> -elif Item.startswith(TAB_UINT64):
> -ItemSize = 8
> -ValueType = TAB_UINT64
> -elif Item[0] in {'"', "'", 'L'}:
> -ItemSize = 0
> -ValueType = TAB_VOID
> -else:
> -ItemSize = 0
> -ValueType = TAB_UINT8
> -Item = ValueExpressionEx(Item, ValueType, 
> self._Symb)(True)
> -
> - 

Re: [edk2] [PATCH v3 0/2] SortLib for UEFI SEC

2018-11-08 Thread Carsey, Jaben
For the series.
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jeff Brasen
> Sent: Thursday, November 08, 2018 11:04 AM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen 
> Subject: [edk2] [PATCH v3 0/2] SortLib for UEFI SEC
> 
> This patch series enables support for BaseSortLib in UEFI SEC Phase.
> This requires the addition of the AllocateZeroPool which is implemented
> in the PrePiMemoryAllocationLib.
> 
> Changelog:
> v1 - Initial version
> v2 - Update order of NULL check in MemoryAllocationLib
> v3 - Switch to ZeroMem from SetMem
> 
> Jeff Brasen (2):
>   EmbeddedPkg/PrePiMemoryAllocationLib: Added AllocateZeroPool()
>   MdeModulePkg/BaseSortLib: Enable for all module types
> 
>  .../PrePiMemoryAllocationLib/MemoryAllocationLib.c | 32
> ++
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf   |  4 +--
>  2 files changed, 34 insertions(+), 2 deletions(-)
> 
> --
> 2.7.4
> 
> ___
> 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] BaseTools: Optimize string concatenation

2018-11-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Feng, Bob C
> Sent: Thursday, November 08, 2018 2:16 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Carsey, Jaben
> 
> Subject: [Patch] BaseTools: Optimize string concatenation
> Importance: High
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1288
> 
> This patch is one of build tool performance improvement
> series patches.
> 
> This patch is going to use join function instead of
> string += string2 statement.
> 
> Current code use string += string2 in a loop to combine
> a string. while creating a string list in a loop and using
> "".join(stringlist) after the loop will be much faster.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: BobCF 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/Python/AutoGen/StrGather.py  | 39 +
> --
>  BaseTools/Source/Python/Common/Misc.py| 21 +-
>  .../Source/Python/Workspace/InfBuildData.py   |  4 +-
>  .../Python/Workspace/WorkspaceCommon.py   | 11 ++
>  4 files changed, 44 insertions(+), 31 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py
> b/BaseTools/Source/Python/AutoGen/StrGather.py
> index 361d499076..d34a9e9447 100644
> --- a/BaseTools/Source/Python/AutoGen/StrGather.py
> +++ b/BaseTools/Source/Python/AutoGen/StrGather.py
> @@ -135,11 +135,11 @@ def AscToHexList(Ascii):
>  # @param UniGenCFlag  UniString is generated into AutoGen C file when it
> is set to True
>  #
>  # @retval Str:   A string of .h file content
>  #
>  def CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode,
> UniGenCFlag):
> -Str = ''
> +Str = []
>  ValueStartPtr = 60
>  Line = COMMENT_DEFINE_STR + ' ' + LANGUAGE_NAME_STRING_NAME
> + ' ' * (ValueStartPtr - len(DEFINE_STR +
> LANGUAGE_NAME_STRING_NAME)) + DecToHexStr(0, 4) +
> COMMENT_NOT_REFERENCED
>  Str = WriteLine(Str, Line)
>  Line = COMMENT_DEFINE_STR + ' ' +
> PRINTABLE_LANGUAGE_NAME_STRING_NAME + ' ' * (ValueStartPtr -
> len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_NAME)) +
> DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED
>  Str = WriteLine(Str, Line)
> @@ -164,16 +164,16 @@ def CreateHFileContent(BaseName,
> UniObjectClass, IsCompatibleMode, UniGenCFlag):
>  Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' +
> DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
>  else:
>  Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * 
> (ValueStartPtr -
> len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) +
> COMMENT_NOT_REFERENCED
>  UnusedStr = WriteLine(UnusedStr, Line)
> 
> -Str = ''.join([Str, UnusedStr])
> +Str.extend( UnusedStr)
> 
>  Str = WriteLine(Str, '')
>  if IsCompatibleMode or UniGenCFlag:
>  Str = WriteLine(Str, 'extern unsigned char ' + BaseName + 
> 'Strings[];')
> -return Str
> +return "".join(Str)
> 
>  ## Create a complete .h file
>  #
>  # Create a complet .h file with file header and file content
>  #
> @@ -185,11 +185,11 @@ def CreateHFileContent(BaseName,
> UniObjectClass, IsCompatibleMode, UniGenCFlag):
>  # @retval Str:   A string of complete .h file
>  #
>  def CreateHFile(BaseName, UniObjectClass, IsCompatibleMode,
> UniGenCFlag):
>  HFile = WriteLine('', CreateHFileContent(BaseName, UniObjectClass,
> IsCompatibleMode, UniGenCFlag))
> 
> -return HFile
> +return "".join(HFile)
> 
>  ## Create a buffer to store all items in an array
>  #
>  # @param BinBuffer   Buffer to contain Binary data.
>  # @param Array:  The array need to be formatted
> @@ -209,11 +209,11 @@ def CreateBinBuffer(BinBuffer, Array):
>  #
>  def CreateArrayItem(Array, Width = 16):
>  MaxLength = Width
>  Index = 0
>  Line = '  '
> -ArrayItem = ''
> +ArrayItem = []
> 
>  for Item in Array:
>  if Index < MaxLength:
>  Line = Line + Item + ',  '
>  Index = Index + 1
> @@ -221,11 +221,11 @@ def CreateArrayItem(Array, Width = 16):
>  ArrayItem = WriteLine(ArrayItem, Line)
>  Line = '  ' + Item + ',  '
>  Index = 1
>  ArrayItem = Write(ArrayItem, Line.rstrip())
> 
> -return ArrayItem
> +return "".join(ArrayItem)
> 
>  ## CreateCFileStringValue
>  #
>  # Create a line with string value
>  #
> @@ -236,11 +236,11 @@ def CreateArrayItem(Array, Width = 16):
> 
>  def CreateCFileStringValue(Value):
>  Value = [StringBlockType] + Value
>  Str = WriteLine('', CreateArray

Re: [edk2] [Patch] BaseTools: Customize deepcopy function.

2018-11-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> BobCF
> Sent: Wednesday, November 07, 2018 10:04 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Gao, Liming
> 
> Subject: [edk2] [Patch] BaseTools: Customize deepcopy function.
> Importance: High
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1288
> 
> This patch is one of build tool performance improvement
> series patches.
> 
> This patch is going to customize the deepcopy function for
> SkuClass, PcdClassObject and python dictionary.
> 
> python deepcopy copy everything of a object, but for our current
> usage we just need to copy the data we care about recursively.
> 
> By implementing __deepcopy__ for SkuClass, PcdClassObject, we can
> customize
> deepcopy function for them.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: BobCF 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> ---
>  BaseTools/Source/Python/Common/Expression.py  |  4 +-
>  BaseTools/Source/Python/Common/Misc.py| 16 ++
>  .../Python/CommonDataClass/CommonClass.py | 15 ++
>  .../Python/Workspace/BuildClassObject.py  | 52 +++
>  .../Source/Python/Workspace/DscBuildData.py   |  6 +--
>  5 files changed, 88 insertions(+), 5 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index a21ab5daa7..091c0f4296 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -15,11 +15,11 @@
>  from __future__ import print_function
>  from __future__ import absolute_import
>  from Common.GlobalData import *
>  from CommonDataClass.Exceptions import BadExpression
>  from CommonDataClass.Exceptions import WrnExpression
> -from .Misc import GuidStringToGuidStructureString, ParseFieldValue
> +from .Misc import GuidStringToGuidStructureString,
> ParseFieldValue,CopyDict
>  import Common.EdkLogger as EdkLogger
>  import copy
>  from Common.DataType import *
>  import sys
>  from random import sample
> @@ -353,11 +353,11 @@ class ValueExpression(BaseExpression):
>  raise BadExpression(ERR_EMPTY_EXPR)
> 
>  #
>  # The symbol table including PCD and macro mapping
>  #
> -self._Symb = copy.deepcopy(SymbolTable)
> +self._Symb = CopyDict(SymbolTable)
>  self._Symb.update(self.LogicalOperators)
>  self._Idx = 0
>  self._Len = len(self._Expr)
>  self._Token = ''
>  self._WarnExcept = None
> diff --git a/BaseTools/Source/Python/Common/Misc.py
> b/BaseTools/Source/Python/Common/Misc.py
> index 3b8efb2e71..80236db160 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -39,10 +39,11 @@ from Common.LongFilePathSupport import
> OpenLongFilePath as open
>  from Common.MultipleWorkspace import MultipleWorkspace as mws
>  import uuid
>  from CommonDataClass.Exceptions import BadExpression
>  from Common.caching import cached_property
>  import subprocess
> +from collections import OrderedDict
>  ## Regular expression used to find out place holders in string template
>  gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE |
> re.UNICODE)
> 
>  ## regular expressions for map file processing
>  startPatternGeneral = re.compile("^Start[' ']+Length[' ']+Name[' ']+Class")
> @@ -2129,10 +2130,25 @@ def PackByteFormatGUID(Guid):
>  Guid[8],
>  Guid[9],
>  Guid[10],
>  )
> 
> +## DeepCopy dict/OrderedDict recusively
> +#
> +#   @param  ori_dicta nested dict or ordereddict
> +#
> +#   @retval new dict or orderdict
> +#
> +def CopyDict(ori_dict):
> +dict_type = ori_dict.__class__
> +new_dict = dict_type()
> +for key in ori_dict:
> +if isinstance(ori_dict[key],(dict,OrderedDict)):
> +new_dict[key] = CopyDict(ori_dict[key])
> +else:
> +new_dict[key] = ori_dict[key]
> +return new_dict
>  ##
>  #
>  # This acts like the main() function for the script, unless it is 'import'ed 
> into
> another
>  # script.
>  #
> diff --git a/BaseTools/Source/Python/CommonDataClass/CommonClass.py
> b/BaseTools/Source/Python/CommonDataClass/CommonClass.py
> index a98cf8a7c5..336bb11671 100644
> --- a/BaseTools/Source/Python/CommonDataClass/CommonClass.py
> +++ b/BaseTools/Source/Python/CommonDataClass/CommonClass.py
> @@ -78,5 +78,20 @@ class SkuInfoClass(object):
>

Re: [edk2] [PATCH v1] ShellPkg/TftpDynamicCommand: Clarify the retry count option in command.

2018-11-07 Thread Carsey, Jaben
Wu,

I plan to push this patch tomorrow, but I would like to add this to the commit 
message.  What do you think?

"This fixes the bug where parameter value 0 causes failure."

-Jaben

> -Original Message-
> From: Fu, Siyuan
> Sent: Monday, November 05, 2018 10:51 PM
> To: Wu, Jiaxin ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ye, Ting 
> Subject: RE: [PATCH v1] ShellPkg/TftpDynamicCommand: Clarify the retry
> count option in command.
> Importance: High
> 
> Reviewed-by: Fu Siyuan 
> 
> 
> 
> > -Original Message-
> > From: Wu, Jiaxin
> > Sent: Monday, November 5, 2018 2:59 PM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben ; Ye, Ting
> ;
> > Fu, Siyuan ; Wu, Jiaxin 
> > Subject: [PATCH v1] ShellPkg/TftpDynamicCommand: Clarify the retry
> count
> > option in command.
> >
> > [-c ] is to define the number of times to transmit request
> > packets and wait for a response. The default value is 6. But it doesn't
> > specify the behavior of zero value. Here, The patch is to clear that:
> > Set to zero also means to use the default value.
> >
> > Cc: Carsey Jaben 
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Wu Jiaxin 
> > ---
> >  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c   | 6 +-
> >  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni | 3 ++-
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > index ac2813efc3..028686e1ff 100644
> > --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> > @@ -216,11 +216,11 @@ EFI_MTFTP4_CONFIG_DATA
> DefaultMtftp4ConfigData = {
> >{ { 0, 0, 0, 0 } },   // SubnetMask- Not relevant
> > as UseDefaultSetting=TRUE
> >0,// LocalPort - Automatically
> > assigned port number.
> >{ { 0, 0, 0, 0 } },   // GatewayIp - Not relevant
> > as UseDefaultSetting=TRUE
> >{ { 0, 0, 0, 0 } },   // ServerIp  - Not known yet
> >69,   // InitialServerPort - Standard TFTP
> > server port
> > -  6,// TryCount  - Max number of
> > retransmissions.
> > +  6,// TryCount  - The number of
> > times to transmit request packets and wait for a response.
> >4 // TimeoutValue  - Retransmission
> > timeout in seconds.
> >  };
> >
> >  STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
> >{L"-i", TypeValue},
> > @@ -419,10 +419,14 @@ RunTftp (
> >ValueStr = ShellCommandLineGetValue (CheckPackage, L"-c");
> >if (ValueStr != NULL) {
> >  if (!StringToUint16 (ValueStr, )) {
> >goto Error;
> >  }
> > +
> > +if (Mtftp4ConfigData.TryCount == 0) {
> > +  Mtftp4ConfigData.TryCount = 6;
> > +}
> >}
> >
> >ValueStr = ShellCommandLineGetValue (CheckPackage, L"-t");
> >if (ValueStr != NULL) {
> >  if (!StringToUint16 (ValueStr, )) {
> > diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> > b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> > index 654e42ad23..ff64912564 100644
> > --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> > +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> > @@ -56,11 +56,12 @@
> >  "  -i interface - Specifies an adapter name, i.e., eth0.\r\n"
> >  "  -l port  - Specifies the local port number. Default value is
> > 0\r\n"
> >  " and the port number is automatically assigned.\r\n"
> >  "  -r port  - Specifies the remote port number. Default value is
> > 69.\r\n"
> >  "  -c  - The number of times to transmit request packets
> > and\r\n"
> > -" wait for a response. The default value is 6.\r\n"
> > +" wait for a response. The default value is 6. Set to
> > zero\r\n"
> > +" also means to use the default value.\r\n"
> >  "  -t  - The number of seconds to wait for a response
> > after\r\n"
> >  " sending a request packet. Default value is 4s.\r\n"
> >  "  -s   - Specifies the TFTP blksize option as defined in RFC
> > 2348.\r\n"
> >  " Valid range is between 8 and 65464, default value
> > is 512.\r\n"
> >  "  -w  - Specifies the TFTP windowsize option as defined in
> > RFC 7440.\r\n"
> > --
> > 2.17.1.windows.2

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


Re: [edk2] [PATCH] ShellPkg/ShellLib: Fix potential NULL deference issue

2018-11-07 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Wednesday, November 07, 2018 1:37 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A ; Jim Dailey 
> Subject: [edk2] [PATCH] ShellPkg/ShellLib: Fix potential NULL deference
> issue
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Jim Dailey 
> Cc: Hao A Wu 
> ---
>  ShellPkg/Library/UefiShellLib/UefiShellLib.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index 580a1ee612..b17266d623 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -72,6 +72,7 @@ FullyQualifyPath(
>  {
>CONST CHAR16 *WorkingPath;
>CONST CHAR16 *InputPath;
> +  CHAR16   *CharPtr;
>CHAR16   *InputFileSystem;
>UINTNFileSystemCharCount;
>CHAR16   *FullyQualifiedPath;
> @@ -131,7 +132,10 @@ FullyQualifyPath(
>  // truncate the new path after the file system part.
>  //
>  StrCpyS(FullyQualifiedPath, Size/sizeof(CHAR16), WorkingPath);
> -*(StrStr(FullyQualifiedPath, L":") + 1) = CHAR_NULL;
> +CharPtr = StrStr(FullyQualifiedPath, L":");
> +if (CharPtr != NULL) {
> +  *(CharPtr + 1) = CHAR_NULL;
> +}
>} else {
>  //
>  // Relative path: start with the working directory and append "\".
> --
> 2.16.1.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 1/3] Maintainers.txt: Remove EdkShellPkg and EkdShellBinPkg

2018-11-05 Thread Carsey, Jaben
Laszlo,  thanks a bunch for this information.  I hadn’t realized I had to do 
that manually.

Jaben

> On Nov 5, 2018, at 8:52 AM, Laszlo Ersek  wrote:
> 
>> On 11/01/18 12:31, Leif Lindholm wrote:
>>> On Thu, Nov 01, 2018 at 06:03:22AM +, Zhang, Shenglei wrote:
>>> Hi Leif,
>>> 
>>> Thanks for your comments. Actually there is a cover letter. 
>>> https://lists.01.org/pipermail/edk2-devel/2018-October/031666.html
>> 
>> Ah, I missed that one since I was on cc on the rest of the set, but
>> not the cover letter.
> 
> Indeed it is important to collect all CC's from the individual patches
> and to add them to the cover letter.
> 
> Laszlo
> ___
> 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 v1] ShellPkg/TftpDynamicCommand: Clarify the retry count option in command.

2018-11-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Wu, Jiaxin
> Sent: Sunday, November 04, 2018 10:59 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ye, Ting ;
> Fu, Siyuan ; Wu, Jiaxin 
> Subject: [PATCH v1] ShellPkg/TftpDynamicCommand: Clarify the retry count
> option in command.
> Importance: High
> 
> [-c ] is to define the number of times to transmit request
> packets and wait for a response. The default value is 6. But it doesn't
> specify the behavior of zero value. Here, The patch is to clear that:
> Set to zero also means to use the default value.
> 
> Cc: Carsey Jaben 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c   | 6 +-
>  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni | 3 ++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> index ac2813efc3..028686e1ff 100644
> --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> @@ -216,11 +216,11 @@ EFI_MTFTP4_CONFIG_DATA
> DefaultMtftp4ConfigData = {
>{ { 0, 0, 0, 0 } },   // SubnetMask- Not relevant as
> UseDefaultSetting=TRUE
>0,// LocalPort - Automatically 
> assigned port number.
>{ { 0, 0, 0, 0 } },   // GatewayIp - Not relevant as
> UseDefaultSetting=TRUE
>{ { 0, 0, 0, 0 } },   // ServerIp  - Not known yet
>69,   // InitialServerPort - Standard TFTP 
> server port
> -  6,// TryCount  - Max number of 
> retransmissions.
> +  6,// TryCount  - The number of 
> times to transmit
> request packets and wait for a response.
>4 // TimeoutValue  - Retransmission 
> timeout in seconds.
>  };
> 
>  STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
>{L"-i", TypeValue},
> @@ -419,10 +419,14 @@ RunTftp (
>ValueStr = ShellCommandLineGetValue (CheckPackage, L"-c");
>if (ValueStr != NULL) {
>  if (!StringToUint16 (ValueStr, )) {
>goto Error;
>  }
> +
> +if (Mtftp4ConfigData.TryCount == 0) {
> +  Mtftp4ConfigData.TryCount = 6;
> +}
>}
> 
>ValueStr = ShellCommandLineGetValue (CheckPackage, L"-t");
>if (ValueStr != NULL) {
>  if (!StringToUint16 (ValueStr, )) {
> diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> index 654e42ad23..ff64912564 100644
> --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.uni
> @@ -56,11 +56,12 @@
>  "  -i interface - Specifies an adapter name, i.e., eth0.\r\n"
>  "  -l port  - Specifies the local port number. Default value is 
> 0\r\n"
>  " and the port number is automatically assigned.\r\n"
>  "  -r port  - Specifies the remote port number. Default value is 
> 69.\r\n"
>  "  -c  - The number of times to transmit request packets
> and\r\n"
> -" wait for a response. The default value is 6.\r\n"
> +" wait for a response. The default value is 6. Set to 
> zero\r\n"
> +" also means to use the default value.\r\n"
>  "  -t  - The number of seconds to wait for a response after\r\n"
>  " sending a request packet. Default value is 4s.\r\n"
>  "  -s   - Specifies the TFTP blksize option as defined in RFC
> 2348.\r\n"
>  " Valid range is between 8 and 65464, default value is 
> 512.\r\n"
>  "  -w  - Specifies the TFTP windowsize option as defined in
> RFC 7440.\r\n"
> --
> 2.17.1.windows.2

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


Re: [edk2] [PATCH] BaseTools: Check the max size for string PCD.

2018-10-31 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zhaozh1x
> Sent: Wednesday, October 31, 2018 3:36 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH] BaseTools: Check the max size for string PCD.
> 
> According to PCD_DATABASE_INIT in
> edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h,
> the max size for string PCD should not exceed USHRT_MAX 65535(0x).
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: ZhiqiangX Zhao 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Cc: Bob Feng 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index 9c3759c0f5..33f7e6471d 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -1397,6 +1397,13 @@ class PlatformAutoGen(AutoGen):
>  self.VariableInfo = 
> self.CollectVariables(self._DynamicPcdList)
>  vardump = self.VariableInfo.dump()
>  if vardump:
> +#
> +#According to PCD_DATABASE_INIT in
> edk2\MdeModulePkg\Include\Guid\PcdDataBaseSignatureGuid.h,
> +#the max size for string PCD should not exceed USHRT_MAX
> 65535(0x).
> +#typedef UINT16 SIZE_INFO;
> +#//SIZE_INFO  SizeTable[];
> +if len(vardump.split(",")) > 0x:
> +EdkLogger.error("build", RESOURCE_OVERFLOW, 'The 
> current
> length of PCD %s value is %d, it exceeds to the max size of String PCD.'
> %(".".join([PcdNvStoreDfBuffer.TokenSpaceGuidCName,PcdNvStoreDfBuffe
> r.TokenCName]) ,len(vardump.split(","
>  PcdNvStoreDfBuffer.DefaultValue = vardump
>  for skuname in PcdNvStoreDfBuffer.SkuInfoList:
>  PcdNvStoreDfBuffer.SkuInfoList[skuname].DefaultValue 
> =
> vardump
> --
> 2.14.1.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 V2] BaseTools: Add special handle for '\' use in Pcd Value

2018-10-31 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Tuesday, October 30, 2018 8:50 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch V2] BaseTools: Add special handle for '\' use in Pcd
> Value
> 
> From: zhijufan 
> 
> V2: Follow PEP8 to not multiples import on one line
> 
> Case:
> gEfiOzmosisPkgTokenSpaceGuid.PcdBootLogFolderPath|L"\\Logs\\"|VOID*
> |12
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1287
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/Common/Expression.py | 14 +-
>  BaseTools/Source/Python/Common/Misc.py   |  8 ++--
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 05459b9c26..a21ab5daa7 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -22,6 +22,8 @@ import Common.EdkLogger as EdkLogger
>  import copy
>  from Common.DataType import *
>  import sys
> +from random import sample
> +import string
> 
>  ERR_STRING_EXPR = 'This operator cannot be used in string expression:
> [%s].'
>  ERR_SNYTAX  = 'Syntax error, the rest of expression cannot be
> evaluated: [%s].'
> @@ -55,6 +57,8 @@ PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-
> zA-Z][0-9A-Za-z_]*$')
>  #
>  def SplitString(String):
>  # There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi'
> +RanStr = ''.join(sample(string.ascii_letters + string.digits, 8))
> +String = String.replace('', RanStr).strip()
>  RetList = []
>  InSingleQuote = False
>  InDoubleQuote = False
> @@ -87,11 +91,16 @@ def SplitString(String):
>  raise BadExpression(ERR_STRING_TOKEN % Item)
>  if Item:
>  RetList.append(Item)
> +for i, ch in enumerate(RetList):
> +if RanStr in ch:
> +RetList[i] = ch.replace(RanStr,'')
>  return RetList
> 
>  def SplitPcdValueString(String):
>  # There might be escaped comma in GUID() or DEVICE_PATH() or " "
>  # or ' ' or L' ' or L" "
> +RanStr = ''.join(sample(string.ascii_letters + string.digits, 8))
> +String = String.replace('', RanStr).strip()
>  RetList = []
>  InParenthesis = 0
>  InSingleQuote = False
> @@ -124,6 +133,9 @@ def SplitPcdValueString(String):
>  raise BadExpression(ERR_STRING_TOKEN % Item)
>  if Item:
>  RetList.append(Item)
> +for i, ch in enumerate(RetList):
> +if RanStr in ch:
> +RetList[i] = ch.replace(RanStr,'')
>  return RetList
> 
>  def IsValidCName(Str):
> @@ -390,7 +402,7 @@ class ValueExpression(BaseExpression):
>  elif not Val:
>  Val = False
>  RealVal = '""'
> -elif not Val.startswith('L"') and not Val.startswith('{') and not
> Val.startswith("L'"):
> +elif not Val.startswith('L"') and not Val.startswith('{') and not
> Val.startswith("L'") and not Val.startswith("'"):
>  Val = True
>  RealVal = '"' + RealVal + '"'
> 
> diff --git a/BaseTools/Source/Python/Common/Misc.py
> b/BaseTools/Source/Python/Common/Misc.py
> index b32b7cdc5f..3b8efb2e71 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -24,6 +24,7 @@ import re
>  import pickle
>  import array
>  import shutil
> +from random import sample
>  from struct import pack
>  from UserDict import IterableUserDict
>  from UserList import UserList
> @@ -1236,7 +1237,8 @@ def IsFieldValueAnArray (Value):
>  return False
> 
>  def AnalyzePcdExpression(Setting):
> -Setting = Setting.strip()
> +RanStr = ''.join(sample(string.ascii_letters + string.digits, 8))
> +Setting = Setting.replace('', RanStr).strip()
>  # There might be escaped quote in a string: \", \\\" , \', \\\'
>  Data = Setting
>  # There might be '|' in string and in ( ... | ... ), replace it with '-'
> @@ -1269,7 +1271,9 @@ def AnalyzePcdExpression(Setting):
>  break
>  FieldList.append(Setting[StartPos:Pos].strip())
>  StartPos = Pos + 1
> -
> +for i, ch in enumerate(FieldList):
> +if RanStr in ch:
> +FieldList[i] = ch.replace(RanStr,'')
>  return FieldList
> 
>  def ParseDevPathValue (Value):
> --
> 2.18.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 1/2] EmbeddedPkg/PrePiMemoryAllocationLib: Added AllocateZeroPool()

2018-10-30 Thread Carsey, Jaben
Code looks good.
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jeff Brasen
> Sent: Tuesday, October 30, 2018 2:31 PM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen 
> Subject: [edk2] [PATCH 1/2] EmbeddedPkg/PrePiMemoryAllocationLib:
> Added AllocateZeroPool()
> 
> This function is exposed by the MemoryAllocationLib header.
> An AllocateZeroPool() function has been added to fix modules depending on
> this library and this function.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen 
> ---
>  .../PrePiMemoryAllocationLib/MemoryAllocationLib.c | 32
> ++
>  1 file changed, 32 insertions(+)
> 
> diff --git
> a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
> b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
> index 0e75e23..f93f9cf 100644
> ---
> a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
> +++
> b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
> @@ -16,6 +16,7 @@
>  #include 
> 
>  #include 
> +#include 
>  #include 
>  #include 
> 
> @@ -195,6 +196,37 @@ AllocatePool (
>  }
> 
>  /**
> +  Allocates and zeros a buffer of type EfiBootServicesData.
> +
> +  Allocates the number bytes specified by AllocationSize of type
> EfiBootServicesData, clears the
> +  buffer with zeros, and returns a pointer to the allocated buffer.  If
> AllocationSize is 0, then a
> +  valid buffer of 0 size is returned.  If there is not enough memory 
> remaining
> to satisfy the
> +  request, then NULL is returned.
> +
> +  @param  AllocationSizeThe number of bytes to allocate and zero.
> +
> +  @return A pointer to the allocated buffer or NULL if allocation fails.
> +
> +**/
> +VOID *
> +EFIAPI
> +AllocateZeroPool (
> +  IN UINTN  AllocationSize
> +  )
> +{
> +  VOID *Buffer;
> +
> +  Buffer = AllocatePool (AllocationSize);
> +  if (NULL == Buffer) {
> +return NULL;
> +  }
> +
> +  SetMem (Buffer, AllocationSize, 0);
> +
> +  return Buffer;
> +}
> +
> +/**
>Frees a buffer that was previously allocated with one of the pool 
> allocation
> functions in the
>Memory Allocation Library.
> 
> --
> 2.7.4
> 
> ___
> 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/2] MdeModulePkg/BaseSortLib: Enable for all module types

2018-10-30 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jeff Brasen
> Sent: Tuesday, October 30, 2018 2:31 PM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen 
> Subject: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all
> module types
> 
> Expose BaseSortLib for use in SEC and PEI phases.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen 
> ---
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> index f807cd7..5bd1aa1 100644
> --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> @@ -18,9 +18,9 @@
>BASE_NAME  = BaseSortLib
>MODULE_UNI_FILE= BaseSortLib.uni
>FILE_GUID  = 03F3331B-F12D-494f-BF37-E55A657F2497
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = SortLib|DXE_DRIVER DXE_RUNTIME_DRIVER
> UEFI_APPLICATION UEFI_DRIVER
> +  LIBRARY_CLASS  = SortLib
> 
>  #
>  #  VALID_ARCHITECTURES   = IA32 X64 EBC
> --
> 2.7.4
> 
> ___
> 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] BaseTools: Add special handle for '\' use in Pcd Value

2018-10-30 Thread Carsey, Jaben
Please separate includes to each on their own line. PEP8 says no to multiples 
on one line.
Not: 
include random, string

But instead:
include string
include random

Also, if we only need sample from random, can we just use "from random import 
sample"?

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Tuesday, October 30, 2018 6:28 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] BaseTools: Add special handle for '\' use in Pcd Value
> 
> From: zhijufan 
> 
> Case:
> gEfiOzmosisPkgTokenSpaceGuid.PcdBootLogFolderPath|L"\\Logs\\"|VOID*
> |12
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1287
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/Common/Expression.py | 13 -
>  BaseTools/Source/Python/Common/Misc.py   |  9 ++---
>  2 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 05459b9..6eec0de 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -20,10 +20,11 @@ from CommonDataClass.Exceptions import
> WrnExpression
>  from .Misc import GuidStringToGuidStructureString, ParseFieldValue
>  import Common.EdkLogger as EdkLogger
>  import copy
>  from Common.DataType import *
>  import sys
> +import random, string
> 
>  ERR_STRING_EXPR = 'This operator cannot be used in string expression:
> [%s].'
>  ERR_SNYTAX  = 'Syntax error, the rest of expression cannot be
> evaluated: [%s].'
>  ERR_MATCH   = 'No matching right parenthesis.'
>  ERR_STRING_TOKEN= 'Bad string token: [%s].'
> @@ -53,10 +54,12 @@ PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-
> z_]*\.[_a-zA-Z][0-9A-Za-z_]*$')
>  #  Split string to list according double quote
>  #  For example: abc"de\"f"ghi"jkl"mn will be: ['abc', '"de\"f"', 'ghi', 
> '"jkl"',
> 'mn']
>  #
>  def SplitString(String):
>  # There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi'
> +RanStr = ''.join(random.sample(string.ascii_letters + string.digits, 8))
> +String = String.replace('', RanStr).strip()
>  RetList = []
>  InSingleQuote = False
>  InDoubleQuote = False
>  Item = ''
>  for i, ch in enumerate(String):
> @@ -85,15 +88,20 @@ def SplitString(String):
>  Item += String[i]
>  if InSingleQuote or InDoubleQuote:
>  raise BadExpression(ERR_STRING_TOKEN % Item)
>  if Item:
>  RetList.append(Item)
> +for i, ch in enumerate(RetList):
> +if RanStr in ch:
> +RetList[i] = ch.replace(RanStr,'')
>  return RetList
> 
>  def SplitPcdValueString(String):
>  # There might be escaped comma in GUID() or DEVICE_PATH() or " "
>  # or ' ' or L' ' or L" "
> +RanStr = ''.join(random.sample(string.ascii_letters + string.digits, 8))
> +String = String.replace('', RanStr).strip()
>  RetList = []
>  InParenthesis = 0
>  InSingleQuote = False
>  InDoubleQuote = False
>  Item = ''
> @@ -122,10 +130,13 @@ def SplitPcdValueString(String):
>  Item += String[i]
>  if InSingleQuote or InDoubleQuote or InParenthesis:
>  raise BadExpression(ERR_STRING_TOKEN % Item)
>  if Item:
>  RetList.append(Item)
> +for i, ch in enumerate(RetList):
> +if RanStr in ch:
> +RetList[i] = ch.replace(RanStr,'')
>  return RetList
> 
>  def IsValidCName(Str):
>  return True if __ValidString.match(Str) else False
> 
> @@ -388,11 +399,11 @@ class ValueExpression(BaseExpression):
>  if Val == 'L""':
>  Val = False
>  elif not Val:
>  Val = False
>  RealVal = '""'
> -elif not Val.startswith('L"') and not Val.startswith('{') and not
> Val.startswith("L'"):
> +elif not Val.startswith('L"') and not Val.startswith('{') and not
> Val.startswith("L'") and not Val.startswith("'"):
>  Val = True
>  RealVal = '"' + RealVal + '"'
> 
>  # The expression has been parsed, but the end of expression is not
> reached
>  # It means the rest does not comply EBNF of 
> diff --git a/BaseTools/Source/Python/Common/Misc.py
> b/BaseTools/Source/Python/Common/Misc.py
> index b32b7cd..b27268a 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -15,11 +15,11 @@
>  # Import Modules
>  #
>  from __future__ import absolute_import
>  import Common.LongFilePathOs as os
>  import sys
> -import string
> +import random, string
>  import threading
>  import time
>  import re
>  import pickle
>  import array
> @@ -1234,11 +1234,12 @@ def IsFieldValueAnArray (Value):
>  if Value[0] == "'" and 

Re: [edk2] ** NOTICE ** edk2-devel mailing list configuration changes

2018-10-29 Thread Carsey, Jaben
I have the same behavior as Leif describes (with probably the hypothesized 
client).

When I reply, I get nothing but the mailing list in "to" (empty "cc").

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Monday, October 29, 2018 2:10 PM
> To: Kinney, Michael D 
> Cc: EDK II Development ; Cetola, Stephano
> 
> Subject: Re: [edk2] ** NOTICE ** edk2-devel mailing list configuration
> changes
> 
> Hi Mike,
> 
> I could hypothesise about which email client you may be using :)
> 
> But let me instead mention that the two email clients I have (mutt and
> gmail web interface) behave identically - neither adds the original
> sender to cc when the list server forces a reply-to header.
> 
> Regards,
> 
> Leif
> 
> On Mon, Oct 29, 2018 at 08:49:09PM +, Kinney, Michael D wrote:
> > Leif,
> >
> > Very strange.  When I do the same on that email, it
> > shows Paul on the To address line.
> >
> > Mike
> >
> > > -Original Message-
> > > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > > Sent: Monday, October 29, 2018 1:40 PM
> > > To: Kinney, Michael D 
> > > Cc: EDK II Development ;
> > > Cetola, Stephano 
> > > Subject: Re: [edk2] ** NOTICE ** edk2-devel mailing list
> > > configuration changes
> > >
> > > Hi Mike,
> > >
> > > When I try to "reply-to", the email from Paul A Lohr,
> > > sent 10 minutes
> > > after your one below, he does not show up in either "to"
> > > or "cc".
> > >
> > > OK, I missed the excitement during the plugfest. I'll go
> > > back and see
> > > what I can find there.
> > >
> > > Regards,
> > >
> > > Leif
> > >
> > > On Mon, Oct 29, 2018 at 08:23:43PM +, Kinney,
> > > Michael D wrote:
> > > > Leif,
> > > >
> > > > I have enabled a different configuration setting
> > > > that should be better.
> > > >
> > > > Please try some emails and let me know if there
> > > > are any impacts.
> > > >
> > > > The reason for these changes is the DMARC related
> > > > issue that occurred on 10-19-2018 that required a
> > > > number of users to be disabled.  The goal of these
> > > > changes is to enable those users to be re-activated.
> > > >
> > > > Thanks,
> > > >
> > > > Mike
> > > >
> > > > > -Original Message-
> > > > > From: Leif Lindholm
> > > [mailto:leif.lindh...@linaro.org]
> > > > > Sent: Monday, October 29, 2018 12:54 PM
> > > > > To: EDK II Development 
> > > > > Cc: Kinney, Michael D ;
> > > > > Cetola, Stephano 
> > > > > Subject: Re: [edk2] ** NOTICE ** edk2-devel mailing
> > > list
> > > > > configuration changes
> > > > >
> > > > > Hi Mike,
> > > > >
> > > > > On Mon, Oct 29, 2018 at 06:42:44PM +, Kinney,
> > > > > Michael D wrote:
> > > > > > Some configuration changes have been made to
> > > > > > the edk2-devel mailing list to handle posts from
> > > > > > a domain with a DMARC Reject/Quarantine policy
> > > > > > enabled. If this is detected then the from address
> > > > > > is now munged.
> > > > > >
> > > > > > One side effect of this setting is that the
> > > > > > behavior of Reply has changed.  Instead of being
> > > > > > a reply to the poster of the message, the Reply
> > > > > > address is the edk2-devel mailing list.
> > > > >
> > > > > The behaviour looks somewhat broken, since as far as
> > > I
> > > > > can tell,
> > > > > replies now longer include the person you're
> > > replying
> > > > > to.
> > > > > (This doesn't happen when replying specifically to
> > > > > _you_, because you
> > > > > cc yourself on everything).
> > > > >
> > > > > > If you wish to send a private reply to only the
> > > > > > poster of the message, you may have to perform
> > > > > > some manual steps.
> > > > > >
> > > > > > Please let me know if you have any concerns about
> > > > > > these changes or if these configuration changes
> > > > > > cause any other side effects.
> > > > >
> > > > > Can we make sure the person being replied to is at
> > > least
> > > > > on cc?
> > > > > Otherwise, we've just broken the workflow for anyone
> > > > > filtering on
> > > > > whether they are on "to" or "cc".
> > > > >
> > > > > Why was this change necessary?
> > > > >
> > > > > Regards,
> > > > >
> > > > > Leif
> ___
> 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 1/2 V2] BaseTools: Add $(INC)-like support when compiling .nasm files

2018-10-25 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Thursday, October 25, 2018 8:05 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch 1/2 V2] BaseTools: Add $(INC)-like support when
> compiling .nasm files
> 
> From: zhijufan 
> 
> current edk2\BaseTools\Conf\build_rule.template, the compile of nasm
> source files does not have the $(INC) support.
> 
> The '-I' option only includes the directory of the nasm source file
> (${s_path}(+)). Hence, it will be impossible for nasm files to include
> files outside of the nasm source file directory.
> 
> As a comparison, the compile of both .s and .asm have $(INC) support
> in their compile commands.
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1085
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index b4377ee..f754f03 100644
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -165,11 +165,11 @@ class BuildFile(object):
>  _INCLUDE_CMD_ = {
>  "nmake" :   '!INCLUDE',
>  "gmake" :   "include"
>  }
> 
> -_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I",
> "RVCT" : "-I"}
> +_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I",
> "RVCT" : "-I", "NASM" : "-I"}
> 
>  ## Constructor of BuildFile
>  #
>  #   @param  AutoGenObject   Object of AutoGen class
>  #
> @@ -594,10 +594,21 @@ cleanlib:
>  "macro_name"   : "INC",
>  "source_file" : 
> IncludePathList
>  }
>  )
>  FileMacroList.append(FileMacro)
> +for File in self.FileCache.keys():
> +if not str(File).endswith('.nasm'):
> +continue
> +IncludePathList = []
> +for P in  MyAgo.IncludePathList:
> +IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P,
> self.Macros)
> +if not P.endswith('\\'):
> +IncludePath += '\\'
> +IncludePathList.append(IncludePath)
> +
> FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro_nam
> e": "NASM_INC", "source_file": IncludePathList}))
> +break
> 
>  # Generate macros used to represent files containing list of input 
> files
>  for ListFileMacro in self.ListFileMacros:
>  ListFileName = os.path.join(MyAgo.OutputDir, "%s.lst" %
> ListFileMacro.lower()[:len(ListFileMacro) - 5])
>  FileMacroList.append("%s = %s" % (ListFileMacro, ListFileName))
> --
> 2.6.1.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 1/2] BaseTools: Add $(INC)-like support when compiling .nasm files

2018-10-25 Thread Carsey, Jaben



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Thursday, October 25, 2018 12:38 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when
> compiling .nasm files
> 
> From: zhijufan 
> 
> current edk2\BaseTools\Conf\build_rule.template, the compile of nasm
> source files does not have the $(INC) support.
> 
> The '-I' option only includes the directory of the nasm source file
> (${s_path}(+)). Hence, it will be impossible for nasm files to include
> files outside of the nasm source file directory.
> 
> As a comparison, the compile of both .s and .asm have $(INC) support
> in their compile commands.
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1085
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> b/BaseTools/Source/Python/AutoGen/GenMake.py
> index d94d8f9..8860d50 100644
> --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> @@ -165,11 +165,11 @@ class BuildFile(object):
>  _INCLUDE_CMD_ = {
>  "nmake" :   '!INCLUDE',
>  "gmake" :   "include"
>  }
> 
> -_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I",
> "RVCT" : "-I"}
> +_INC_FLAG_ = {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I",
> "RVCT" : "-I", "NASM" : "-I"}
> 
>  ## Constructor of BuildFile
>  #
>  #   @param  AutoGenObject   Object of AutoGen class
>  #
> @@ -594,10 +594,22 @@ cleanlib:
>  "macro_name"   : "INC",
>  "source_file" : 
> IncludePathList
>  }
>  )
>  FileMacroList.append(FileMacro)
> +for File in self.FileCache.keys():
> +if not str(File).endswith('.nasm'):
> +continue
> +FileMacro = ""
> +IncludePathList = []
> +for P in  MyAgo.IncludePathList:
> +IncludePathList.append(self._INC_FLAG_['NASM'] +
> self.PlaceMacro(P, self.Macros))
> +if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros:
> +
> self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(self._INC_FLAG
> _['NASM'] + P)
> +FileMacro +=
> self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC",
> "source_file": IncludePathList})

Why do we use += on FileMacro here?  Seems like = will be fine.  We can also 
skip initializing the FileMacro since it's only ever assigned here.

> +FileMacroList.append(FileMacro)
> +break
> 
>  # Generate macros used to represent files containing list of input 
> files
>  for ListFileMacro in self.ListFileMacros:
>  ListFileName = os.path.join(MyAgo.OutputDir, "%s.lst" %
> ListFileMacro.lower()[:len(ListFileMacro) - 5])
>  FileMacroList.append("%s = %s" % (ListFileMacro, ListFileName))
> --
> 2.6.1.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 1/2] ShellPkg-Shell App: Provide fully-qualified path to shell scripts

2018-10-24 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Ray?

I can push this one also if you don't see an issue.

> -Original Message-
> From: jim.dai...@dell.com [mailto:jim.dai...@dell.com]
> Sent: Wednesday, October 24, 2018 9:35 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [edk2][PATCH 1/2] ShellPkg-Shell App: Provide fully-qualified path
> to shell scripts
> Importance: High
> 
> Add a function to return the fully-qualified version of some path.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Include/Library/ShellLib.h  | 40 +
>  ShellPkg/Library/UefiShellLib/UefiShellLib.c | 93 +++-
>  2 files changed, 132 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Include/Library/ShellLib.h
> b/ShellPkg/Include/Library/ShellLib.h
> index 92fddc50f5..cd7e9c47c3 100644
> --- a/ShellPkg/Include/Library/ShellLib.h
> +++ b/ShellPkg/Include/Library/ShellLib.h
> @@ -2,6 +2,7 @@
>Provides interface to shell functionality for shell commands and
> applications.
> 
>Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +  Copyright 2018 Dell Technologies.
>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
> @@ -35,6 +36,45 @@
>  extern EFI_SHELL_PARAMETERS_PROTOCOL *gEfiShellParametersProtocol;
>  extern EFI_SHELL_PROTOCOL*gEfiShellProtocol;
> 
> +/**
> +  Return the fully-qualified version of a relative path or an absolute path 
> that
> +  does not include a file system reference.
> +
> +  If ASSERTs are disabled, and if the input parameter is NULL or points to
> NULL,
> +  then NULL is returned.
> +
> +  If the input path contains a ":", this function assumes that it is part of 
> a
> +  reference to a file system (e.g. "FS0:").  In such a case, Path is cleaned
> +  and returned.
> +
> +  If there is no working directory or there is not enough memory available to
> +  create the fully-qualified path, Path is cleaned and returned.
> +
> +  Otherwise, the current file system or working directory (as appropriate) is
> +  prepended to Path.  The input Path is freed and the resulting path is
> cleaned,
> +  assigned to Path, and returned.
> +
> +  NOTE: If the input path is an empty string, then the current working
> directory
> +  (if it exists) is returned.  In other words, an empty input path is treated
> +  exactly the same as ".".
> +
> +  @param[in, out] Path  On input, a pointer to some file or directory path.
> On
> +output, a pointer to the clean and possibly fully-
> +qualified version of the input path.  The input 
> pointer
> +may be freed and reassigned on output.
> +
> +  @retval NULL  The input pointer or the path itself was NULL.
> +
> +  @return A pointer to the clean, fully-qualified version of Path.  If memory
> +  allocation fails, or if there is no working directory, then a 
> pointer
> +  to the clean, but not necessarily fully-qualified version of Path.
> +**/
> +CHAR16*
> +EFIAPI
> +FullyQualifyPath(
> +  IN OUT CHAR16 **Path
> +  );
> +
>  /**
>This function will retrieve the information about the file for the handle
>specified and store it in allocated pool memory.
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index f04adbb63f..52ca3ce1b1 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -2,7 +2,7 @@
>Provides interface to shell functionality for shell commands and
> applications.
> 
>(C) Copyright 2016 Hewlett Packard Enterprise Development LP
> -  Copyright 2016 Dell Inc.
> +  Copyright 2016-2018 Dell Technologies.
>Copyright (c) 2006 - 2018, 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
> @@ -36,6 +36,97 @@ EFI_HANDLEmEfiShellEnvironment2Handle;
>  FILE_HANDLE_FUNCTION_MAP  FileFunctionMap;
>  EFI_UNICODE_COLLATION_PROTOCOL  *mUnicodeCollationProtocol;
> 
> +/**
> +  Return the fully-qualified version of a relative path or an absolute path 
> that
> +  does not include a file system reference.
> +
> +  If asserts are disabled, and if the input parameter is NULL or points to
> NULL,
> +  then NULL is retu

Re: [edk2] [PATCH 2/2] ShellPkg-Shell App: Provide fully-qualified path to shell scripts

2018-10-24 Thread Carsey, Jaben
Looks good to me.
Ray?

Reviewed-by: Jaben Carsey 

p.s. Ray if you agree you can RB and I will handle the push.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim.dai...@dell.com
> Sent: Wednesday, October 24, 2018 9:36 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [edk2] [PATCH 2/2] ShellPkg-Shell App: Provide fully-qualified path
> to shell scripts
> Importance: High
> 
> Section 3.6.2 of version 2.2 of the shell specification requires that
> the first positional argument (i.e. arg 0) of a shell script resolves
> to "the full path name of the script itself."
> 
> Ensure that the startup script and any scripts launched by the shell
> meet this requirement.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/Shell.c | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index 6185b6ac80..fe88177d57 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -3,6 +3,7 @@
> 
>Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
>(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
> +  Copyright 2018 Dell Technologies.
>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
> @@ -1275,7 +1276,8 @@ DoStartupScript(
> 
>FileStringPath = LocateStartupScript (ImagePath, FilePath);
>if (FileStringPath != NULL) {
> -Status = RunScriptFile (FileStringPath, NULL, L"",
> ShellInfoObject.NewShellParametersProtocol);
> +FileStringPath = FullyQualifyPath();
> +Status = RunScriptFile (FileStringPath, NULL, FileStringPath,
> ShellInfoObject.NewShellParametersProtocol);
>  FreePool (FileStringPath);
>} else {
>  //
> @@ -2474,6 +2476,7 @@ RunCommandOrFile(
>}
>switch (Type) {
>  case   Script_File_Name:
> +  CommandWithPath = FullyQualifyPath();
>Status = RunScriptFile (CommandWithPath, NULL, CmdLine,
> ParamProtocol);
>break;
>  case   Efi_Application:
> @@ -2812,7 +2815,12 @@ RunScriptFileHandle (
>DeleteScriptFileStruct(NewScriptFile);
>return (EFI_OUT_OF_RESOURCES);
>  }
> -for (LoopVar = 0 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc;
> LoopVar++) {
> +//
> +// Put the full path of the script file into Argv[0] as required by 
> section
> +// 3.6.2 of version 2.2 of the shell specification.
> +//
> +NewScriptFile->Argv[0] = StrnCatGrow(>Argv[0], NULL,
> NewScriptFile->ScriptName, 0);
> +for (LoopVar = 1 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc;
> LoopVar++) {
>ASSERT(NewScriptFile->Argv[LoopVar] == NULL);
>NewScriptFile->Argv[LoopVar] = StrnCatGrow(
> >Argv[LoopVar], NULL, ShellInfoObject.NewShellParametersProtocol-
> >Argv[LoopVar], 0);
>if (NewScriptFile->Argv[LoopVar] == NULL) {
> --
> 2.17.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 V2] BaseTool: Support different PCDs that refers to the same EFI variable.

2018-10-22 Thread Carsey, Jaben
No effect on functionality, but sometimes first is spelled fisrt in below 
patch.  

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Feng, Bob C
> Sent: Sunday, October 21, 2018 3:48 AM
> To: Zhao, ZhiqiangX ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [PATCH V2] BaseTool: Support different PCDs that refers
> to the same EFI variable.
> 
> Reviewed-by: Bob Feng 
> 
> -Original Message-
> From: Zhao, ZhiqiangX
> Sent: Thursday, October 18, 2018 3:12 PM
> To: edk2-devel@lists.01.org
> Cc: Zhao, ZhiqiangX ; Gao, Liming
> ; Zhu, Yonghong ; Feng,
> Bob C 
> Subject: [PATCH V2] BaseTool: Support different PCDs that refers to the
> same EFI variable.
> 
> V2:
> Make the code of patch both compatible for Python2 and Python3.
> 
> V1:
> If different PCDs refer to the same EFI variable, then do EFI variable
> combination, according to the VariableOffset of different PCDS.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: ZhiqiangX Zhao 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Cc: Bob Feng 
> ---
>  BaseTools/Source/Python/AutoGen/GenVar.py | 97 ++
> -
>  1 file changed, 30 insertions(+), 67 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py
> b/BaseTools/Source/Python/AutoGen/GenVar.py
> index 036f00e2bb..98f88e2497 100644
> --- a/BaseTools/Source/Python/AutoGen/GenVar.py
> +++ b/BaseTools/Source/Python/AutoGen/GenVar.py
> @@ -56,51 +56,7 @@ class VariableMgr(object):
>  value_str += ",".join(default_var_bin_strip)
>  value_str += "}"
>  return value_str
> -def Do_combine(self,sku_var_info_offset_list):
> -newvalue = {}
> -for item in sku_var_info_offset_list:
> -data_type = item.data_type
> -value_list = item.default_value.strip("{").strip("}").split(",")
> -if data_type in DataType.TAB_PCD_NUMERIC_TYPES:
> -data_flag =
> DataType.PACK_CODE_BY_SIZE[MAX_SIZE_TYPE[data_type]]
> -data = value_list[0]
> -value_list = []
> -for data_byte in pack(data_flag, int(data, 16) if
> data.upper().startswith('0X') else int(data)):
> -value_list.append(hex(unpack("B", data_byte)[0]))
> -newvalue[int(item.var_offset, 16) if
> item.var_offset.upper().startswith("0X") else int(item.var_offset)] =
> value_list
> -try:
> -newvaluestr = "{" +
> ",".join(VariableMgr.assemble_variable(newvalue)) +"}"
> -except:
> -EdkLogger.error("build", AUTOGEN_ERROR, "Variable offset 
> conflict in
> PCDs: %s \n" % (" and ".join(item.pcdname for item in
> sku_var_info_offset_list)))
> -return newvaluestr
> -def Do_Merge(self,sku_var_info_offset_list):
> -StructrurePcds = sorted([item for item in sku_var_info_offset_list if
> item.StructurePcd], key = lambda x: x.PcdDscLine, reverse =True )
> -Base = StructrurePcds[0]
> -BaseValue = Base.default_value.strip("{").strip("}").split(",")
> -Override = [item for item in sku_var_info_offset_list if not
> item.StructurePcd and item.PcdDscLine > Base.PcdDscLine]
> -newvalue = {}
> -for item in Override:
> -data_type = item.data_type
> -value_list = item.default_value.strip("{").strip("}").split(",")
> -if data_type in DataType.TAB_PCD_NUMERIC_TYPES:
> -data_flag =
> DataType.PACK_CODE_BY_SIZE[MAX_SIZE_TYPE[data_type]]
> -data = value_list[0]
> -value_list = []
> -for data_byte in pack(data_flag, int(data, 16) if
> data.upper().startswith('0X') else int(data)):
> -value_list.append(hex(unpack("B", data_byte)[0]))
> -newvalue[int(item.var_offset, 16) if
> item.var_offset.upper().startswith("0X") else int(item.var_offset)] =
> (value_list,item.pcdname,item.PcdDscLine)
> -for offset in newvalue:
> -value_list,itemPcdname,itemPcdDscLine = newvalue[offset]
> -if offset > len(BaseValue) or (offset + len(value_list) >
> len(BaseValue)):
> -EdkLogger.error("build", AUTOGEN_ERROR, "The EFI Variable
> referred by PCD %s in line %s exceeds variable size: %s\n" %
> (itemPcdname,itemPcdDscLine,hex(len(BaseValue
> -for i in xrange(len(value_list)):
> -BaseValue[offset + i] = value_list[i]
> -newvaluestr =  "{" + ",".join(BaseValue) +"}"
> -return newvaluestr
> -def NeedMerge(self,sku_var_info_offset_list):
> -if [item for item in sku_var_info_offset_list if item.StructurePcd]:
> -return True
> -return False
> +
>  def combine_variable(self):
>  indexedvarinfo = collections.OrderedDict()
>  for item in self.VarInfo:
> @@ -109,30 +65,37 @@ class VariableMgr(object):
>  indexedvarinfo[(item.skuname, 

Re: [edk2] [Patch] BaseTool: Filter out unused structure pcds

2018-10-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> BobCF
> Sent: Friday, October 19, 2018 5:00 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] BaseTool: Filter out unused structure pcds
> 
> The current code handle all the structure pcds
> even if there is no module or library use them.
> This patch is going to filter out the unused structure pcds.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng 
> Cc: Liming Gao 
> ---
>  .../Source/Python/Workspace/DscBuildData.py   | 19
> +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index e481ea4f64..31bce16d15 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -274,10 +274,11 @@ class DscBuildData(PlatformBuildClassObject):
>  self._RFCLanguages  = None
>  self._ISOLanguages  = None
>  self._VpdToolGuid   = None
>  self._MacroDict = None
>  self.DefaultStores  = None
> +self.UsedStructurePcd   = None
> 
>  ## handle Override Path of Module
>  def _HandleOverridePath(self):
>  RecordList = self._RawData[MODEL_META_DATA_COMPONENT,
> self._Arch]
>  for Record in RecordList:
> @@ -1476,10 +1477,11 @@ class DscBuildData(PlatformBuildClassObject):
>  if str_pcd_obj.Type in
> [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
> self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
>  str_pcd_obj_str.DefaultFromDSC = 
> {skuname:{defaultstore:
> str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore,
> str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in
> DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
>  else:
>  str_pcd_obj_str.DefaultFromDSC = 
> {skuname:{defaultstore:
> str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore,
> str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in
> DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
>  S_pcd_set[Pcd] = str_pcd_obj_str
> +self.FilterStrcturePcd(S_pcd_set)
>  if S_pcd_set:
>  GlobalData.gStructurePcd[self.Arch] = S_pcd_set
>  for stru_pcd in S_pcd_set.values():
>  for skuid in SkuIds:
>  if skuid in stru_pcd.SkuOverrideValues:
> @@ -1571,10 +1573,27 @@ class DscBuildData(PlatformBuildClassObject):
>  elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in
> pcd.SkuInfoList:
>  del pcd.SkuInfoList[TAB_COMMON]
> 
>  map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if
> Pcds[pcdkey].Type in DynamicPcdType])
>  return Pcds
> +#Filter the StrucutrePcd that is not used by any module in dsc file and 
> fdf
> file.
> +def FilterStrcturePcd(self, S_pcd_set):
> +if not self.UsedStructurePcd:
> +FdfInfList = []
> +if GlobalData.gFdfParser:
> +FdfInfList = GlobalData.gFdfParser.Profile.InfList
> +FdfModuleList = [PathClass(NormPath(Inf), GlobalData.gWorkspace,
> Arch=self._Arch) for Inf in FdfInfList]
> +AllModulePcds = set()
> +ModuleSet = set(self._Modules.keys() + self.LibraryInstances +
> FdfModuleList)
> +for ModuleFile in ModuleSet:
> +ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target,
> self._Toolchain]
> +AllModulePcds = AllModulePcds | set(ModuleData.Pcds.keys())
> +
> +self.UsedStructurePcd = AllModulePcds
> +UnusedStruPcds = set(S_pcd_set.keys()) - self.UsedStructurePcd
> +for (Token, TokenSpaceGuid) in UnusedStruPcds:
> +del S_pcd_set[(Token, TokenSpaceGuid)]
> 
>  ## Retrieve non-dynamic PCD settings
>  #
>  #   @param  TypePCD type
>  #
> --
> 2.18.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] BaseTools: Fix the bug that PcdValueFromComm is not set

2018-10-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Friday, October 19, 2018 12:27 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix the bug that PcdValueFromComm is
> not set
> 
> the bug is PcdValueFromComm is not set, but the Pcd have been override
> by the command line option.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index e481ea4..17e6f62 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -1065,10 +1065,11 @@ class DscBuildData(PlatformBuildClassObject):
>  continue
>  for key in BuildData.Pcds:
>  PcdItem = BuildData.Pcds[key]
>  if (TokenSpaceGuidCName, TokenCName) ==
> (PcdItem.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName
> =="":
>  PcdItem.DefaultValue = pcdvalue
> +PcdItem.PcdValueFromComm = pcdvalue
>  #In command line, the latter full assign value in commandLine should
> override the former field assign value.
>  #For example, --pcd Token.pcd.field="" --pcd Token.pcd=H"{}"
>  delete_assign = []
>  field_assign = {}
>  if GlobalData.BuildOptionPcd:
> --
> 2.6.1.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] BaseTools: Fix the crash issue when Dynamic structure Pcd use in FDF

2018-10-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Friday, October 19, 2018 12:21 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix the crash issue when Dynamic
> structure Pcd use in FDF
> 
> The case is use Dynamic structure Pcd in the FDF file.
> Current code already save the  Guid, Name and Filed info for those Pcd,
> but it directly use the dict key as [Name, Guid] and cause this crash
> issue.
> 
> Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1264
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index f2146a7..804f579 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -567,12 +567,12 @@ class WorkspaceAutoGen(AutoGen):
>  if (Name, Guid) not in DecPcds:
>  EdkLogger.error(
>  'build',
>  PARSER_ERROR,
>  "PCD (%s.%s) used in FDF is not declared in DEC 
> files." % (Guid,
> Name),
> -File = self.FdfProfile.PcdFileLineDict[Name, 
> Guid][0],
> -Line = self.FdfProfile.PcdFileLineDict[Name, Guid][1]
> +File = self.FdfProfile.PcdFileLineDict[Name, Guid, 
> Fileds][0],
> +Line = self.FdfProfile.PcdFileLineDict[Name, Guid, 
> Fileds][1]
>  )
>  else:
>  # Check whether Dynamic or DynamicEx PCD used in FDF 
> file. If
> used, build break and give a error message.
>  if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey \
>  or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in
> DecPcdsKey \
> @@ -581,12 +581,12 @@ class WorkspaceAutoGen(AutoGen):
>  elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or 
> (Name,
> Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:
>  EdkLogger.error(
>  'build',
>  PARSER_ERROR,
>  "Using Dynamic or DynamicEx type of PCD 
> [%s.%s] in FDF file
> is not allowed." % (Guid, Name),
> -File = self.FdfProfile.PcdFileLineDict[Name, 
> Guid][0],
> -Line = self.FdfProfile.PcdFileLineDict[Name, 
> Guid][1]
> +File = self.FdfProfile.PcdFileLineDict[Name, 
> Guid, Fileds][0],
> +Line = self.FdfProfile.PcdFileLineDict[Name, 
> Guid, Fileds][1]
>  )
> 
>  Pa = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, 
> Arch)
>  #
>  # Explicitly collect platform's dynamic PCDs
> --
> 2.6.1.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] BaseTools: Fix one crash bug in the report for Fixed structure Pcd

2018-10-18 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Note that you could change your first 2 lines (of the new content in both 
places) to:
for Data in OverrideValues.values():

since you don't ever use the key later on...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Thursday, October 18, 2018 7:25 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix one crash bug in the report for Fixed
> structure Pcd
> 
> The case is:
> in the DSC file:
> SKUID_IDENTIFIER   = ALL
> 
> [SkuIds]
>   0|DEFAULT
>   1|A
> 
> [PcdsFixedAtBuild.common.A]
>   TokenSpaceGuid.Test401|{0x0F, 0x12}
>   TokenSpaceGuid.Test401.TEST401INT8ARRAY[0]|'B'
> 
> in the build report, Data = OverrideValues[Keys[0]], but the Keys[0]
> is the keyword "DEFAULT", and in this case the "DEFAULT" SKU doesn't
> save any value, then it cause the Data is empty, in the next code
> when we use the code it cause crash.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/build/BuildReport.py | 23 +
> --
>  1 file changed, 13 insertions(+), 10 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/build/BuildReport.py
> b/BaseTools/Source/Python/build/BuildReport.py
> index 14143b3..5e2a664 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1089,14 +1089,16 @@ class PcdReport(object):
>  DscOverride = False
>  else:
>  if not Pcd.SkuInfoList:
>  OverrideValues = Pcd.SkuOverrideValues
>  if OverrideValues:
> -Keys = list(OverrideValues.keys())
> -Data = OverrideValues[Keys[0]]
> -Struct = list(Data.values())
> -DscOverride = 
> self.ParseStruct(Struct[0])
> +for key in OverrideValues.keys():
> +Data = OverrideValues[key]
> +Struct = list(Data.values())
> +if Struct:
> +DscOverride = 
> self.ParseStruct(Struct[0])
> +break
>  else:
>  SkuList = sorted(Pcd.SkuInfoList.keys())
>  for Sku in SkuList:
>  SkuInfo = Pcd.SkuInfoList[Sku]
>  if TypeName in ('DYNHII', 'DEXHII'):
> @@ -1265,16 +1267,17 @@ class PcdReport(object):
>  Value = "0x{:X} ({})".format(int(Value, 0), Value)
>  FileWrite(File, ' %-*s   : %6s %10s = %s' % (self.MaxLen, 
> Flag + ' ' +
> PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))
>  if IsStructure:
>  OverrideValues = Pcd.SkuOverrideValues
>  if OverrideValues:
> -Keys = list(OverrideValues.keys())
> -Data = OverrideValues[Keys[0]]
> -Struct = list(Data.values())
> -if Struct:
> -OverrideFieldStruct = self.OverrideFieldValue(Pcd, 
> Struct[0])
> -self.PrintStructureInfo(File, OverrideFieldStruct)
> +for key in OverrideValues.keys():
> +Data = OverrideValues[key]
> +Struct = list(Data.values())
> +if Struct:
> +OverrideFieldStruct = 
> self.OverrideFieldValue(Pcd, Struct[0])
> +self.PrintStructureInfo(File, 
> OverrideFieldStruct)
> +break
>  self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, 
> DscDefaultValue,
> InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)
>  else:
>  FirstPrint = True
>  SkuList = sorted(Pcd.SkuInfoList.keys())
>  for Sku in SkuList:
> --
> 2.6.1.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] Community Discussion: General Code and Commit message standards

2018-10-18 Thread Carsey, Jaben
I would like to know when a patch fixes a BZ. Subject/body I have less strong 
opinion about.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> stephano
> Sent: Thursday, October 18, 2018 2:13 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Community Discussion: General Code and Commit message
> standards
> 
> This discussion was tabled as it will probably be its own meeting rather
> than part of our general discussions this month.
> 
> Recently on the list Laszlo and Star agreed that we should be adding the
> CVE to the subject of any patch that fixes a CVE. I will be documenting
> this in the wiki as well as Contributions.txt.
> 
> This thread is meant as a chance to begin discussions before we meet to
> formally review the topic. It will give folks a chance to research any
> known pain points or suggested solutions.
> 
> Cheers,
> Stephano
> ___
> 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] BaseTools: Fix a bug --pcd option enable and use the pcd in expression

2018-10-18 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Gao, Liming
> Sent: Wednesday, October 17, 2018 6:04 PM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [Patch] BaseTools: Fix a bug --pcd option enable and use
> the pcd in expression
> 
> Reviewed-by: Liming Gao 
> 
> >-Original Message-
> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >Yonghong Zhu
> >Sent: Wednesday, October 17, 2018 8:36 AM
> >To: edk2-devel@lists.01.org
> >Subject: [edk2] [Patch] BaseTools: Fix a bug --pcd option enable and use the
> >pcd in expression
> >
> >the case is:
> >in the DSC:
> >[PcdsFixedAtBuild.common]
> > TokenSpaceGuid.TestFixedPcd|0xFFEAA000
> >
> >[PcdsDynamicExDefault.common.DEFAULT]
> >!if TokenSpaceGuid.PcdFlag == TRUE
> >TokenSpaceGuid.PcdTest|TokenSpaceGuid.TestFixedPcd
> >!endif
> >
> >Then build with --pcd TokenSpaceGuid.PcdFlag=TRUE, it report failure,
> >but if we build without this --pcd option, it could build success.
> >we found when the --pcd is enabled, the fixedatbuild pcds are not be
> >collected into expression to calculate.
> >
> >Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1256
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Yonghong Zhu 
> >---
> > BaseTools/Source/Python/Workspace/DscBuildData.py | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> >b/BaseTools/Source/Python/Workspace/DscBuildData.py
> >index f41038e..ace348b 100644
> >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> >@@ -2942,6 +2942,7 @@ class DscBuildData(PlatformBuildClassObject):
> > if ModuleFile in self._Modules:
> > continue
> > ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target,
> >self._Toolchain]
> > PkgSet.update(ModuleData.Packages)
> > self._DecPcds, self._GuidDict = GetDeclaredPcd(self, self._Bdb,
> >self._Arch, self._Target, self._Toolchain, PkgSet)
> >+self._GuidDict.update(GlobalData.gPlatformPcds)
> > return self._DecPcds
> >--
> >2.6.1.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
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] BaseTools: Remove Arch specific build options for PcdValueInit tool.

2018-10-18 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> BobCF
> Sent: Wednesday, October 17, 2018 10:43 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] BaseTools: Remove Arch specific build options for
> PcdValueInit tool.
> 
> PcdValueInit tool is Arch independent, the Arch specific
> build options should be removed from PcdValueInit makefile.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob C Feng 
> Cc: Liming Gao 
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 19ac71ac09..47f5033953 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -2344,11 +2344,11 @@ class DscBuildData(PlatformBuildClassObject):
>  if Tool != 'CC':
>  continue
> 
>  if Target == "*" or Target == self._Target:
>  if Tag == "*" or Tag == self._Toolchain:
> -if Arch == "*" or Arch == self.Arch:
> +if Arch == "*":
>  if Tool not in BuildOptions:
>  BuildOptions[Tool] = OrderedDict()
>  if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
> or
> self.BuildOptions[Options].startswith('='):
>  BuildOptions[Tool][Attr] = 
> self.BuildOptions[Options]
>  else:
> --
> 2.18.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 V2] BaseTools: Convert "Unicode string" to "byte array" if value type diff

2018-10-18 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zhaozh1x
> Sent: Wednesday, October 17, 2018 10:09 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH V2] BaseTools: Convert "Unicode string" to "byte
> array" if value type diff
> 
> V2:
> Fixed 3 typo.
> Use startswith(('L"',"L'")) to check if a string is Unicode string.
> Use a set PcdValueTypeSet instead of a list PcdValueTypeList to save
> memory.
> 
> V1:
> For the same one VOID* pcd, if the default value type of one SKU is
> "Unicode string", the other SKUs are "OtherVOID*"(ASCII string or
> byte array),Then convert "Unicode string" to "byte array".
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: ZhiqiangX Zhao 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Cc: Bob Feng 
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 7854e71db6..9b9ace9b56 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -2877,6 +2877,15 @@ class DscBuildData(PlatformBuildClassObject):
>  elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in
> pcd.SkuInfoList:
>  del pcd.SkuInfoList[TAB_COMMON]
> 
> +#For the same one VOID* pcd, if the default value type of one SKU is
> "Unicode string",
> +#the other SKUs are "OtherVOID*"(ASCII string or byte array),Then
> convert "Unicode string" to "byte array".
> +for pcd in Pcds.values():
> +PcdValueTypeSet = set()
> +for sku in pcd.SkuInfoList.values():
> +PcdValueTypeSet.add("UnicodeString" if
> sku.DefaultValue.startswith(('L"',"L'")) else "OtherVOID*")
> +if len(PcdValueTypeSet) > 1:
> +for sku in pcd.SkuInfoList.values():
> +sku.DefaultValue = StringToArray(sku.DefaultValue) if
> sku.DefaultValue.startswith(('L"',"L'")) else sku.DefaultValue
> 
>  map(self.FilterSkuSettings, Pcds.values())
>  return Pcds
> --
> 2.14.1.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] BaseTools: covert "unicode string" to "byte array" if value type diff.

2018-10-17 Thread Carsey, Jaben



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Wednesday, October 17, 2018 11:37 AM
> To: Zhao, ZhiqiangX 
> Cc: edk2-devel@lists.01.org; Gao, Liming 
> Subject: Re: [edk2] [PATCH] BaseTools: covert "unicode string" to "byte
> array" if value type diff.
> 
> Hi,
> 
> On 10/17/18 13:08, Zhaozh1x wrote:
> > For the same one VOID* pcd, if the default value type of one sku is
> > "unicode string", the other skus are "OtherVOID*"(ascii string or
> > byte array),Then covert "unicode string" to "byte array".
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: ZhiqiangX Zhao 
> > Cc: Liming Gao 
> > Cc: Yonghong Zhu 
> > Reviewed-by: Bob Feng 
> > ---
> >  BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> > index 7854e71db6..9b783de84b 100644
> > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> > @@ -2877,6 +2877,15 @@ class DscBuildData(PlatformBuildClassObject):
> >  elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in
> pcd.SkuInfoList:
> >  del pcd.SkuInfoList[TAB_COMMON]
> >
> > +#For the same one VOID* pcd, if the default value type of one sku 
> > is
> "unicode string",
> > +#the other skus are "OtherVOID*"(ascii string or byte array),Then
> covert "unicode string" to "byte array".
> > +for pcd in Pcds.values():
> > +PcdValueTypeList = []
> > +for sku in pcd.SkuInfoList.values():
> > +PcdValueTypeList.append("UnicodeString" if
> sku.DefaultValue.startswith("L") else "OtherVOID*")
> > +if "UnicodeString" in PcdValueTypeList and "OtherVOID*" in
> PcdValueTypeList:

If you use a set instead of a list here, it will save memory any then instead 
of testing for both items being there, you could just check the length being > 
1 which would also be faster than 2 "in" tests.

> > +for sku in pcd.SkuInfoList.values():
> > +sku.DefaultValue = StringToArray(sku.DefaultValue) if
> sku.DefaultValue.startswith("L") else sku.DefaultValue
> >
> >  map(self.FilterSkuSettings, Pcds.values())
> >  return Pcds
> >
> 
> no comments on the code change, just a superficial one on the subject
> line: please replace "covert" with "convert".
> 
> There are two more instances of the typo in the patch: in the commit
> message, and in the new code too. (Three occurrences in total.)
> 
> Normally I shouldn't obsess about such small typos, in case they don't
> obscure the intended meaning. However, "covert" did confuse me, because
> it is an existent word, and it has a specific meaning in computing:
> 
> https://en.wikipedia.org/wiki/Covert_channel
> 
> Thanks!
> Laszlo
> ___
> 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] BaseTools/ECC: Add a checkpoint to check no usage for deprecated functions.

2018-10-17 Thread Carsey, Jaben
Propose to use a set not a list when the data is unordered and unique names of 
functions.

With that: reviewed-by:Jaben.carsey 

Sent from my iPad

> On Oct 16, 2018, at 7:25 PM, Yonghong Zhu  wrote:
> 
> From: Hess Chen 
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hess Chen 
> ---
> BaseTools/Source/Python/Ecc/Check.py | 60 
> BaseTools/Source/Python/Ecc/Configuration.py |  3 ++
> BaseTools/Source/Python/Ecc/EccToolError.py  |  2 +
> BaseTools/Source/Python/Ecc/config.ini   |  2 +
> 4 files changed, 67 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/Ecc/Check.py 
> b/BaseTools/Source/Python/Ecc/Check.py
> index eb086362bd..3baf81fa44 100644
> --- a/BaseTools/Source/Python/Ecc/Check.py
> +++ b/BaseTools/Source/Python/Ecc/Check.py
> @@ -270,6 +270,66 @@ class Check(object):
> self.FunctionLayoutCheckPrototype()
> self.FunctionLayoutCheckBody()
> self.FunctionLayoutCheckLocalVariable()
> +self.FunctionLayoutCheckDeprecated() 
> +
> +# To check if the deprecated functions are used
> +def FunctionLayoutCheckDeprecated(self):
> +if EccGlobalData.gConfig.CFunctionLayoutCheckNoDeprecated == '1' or 
> EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or 
> EccGlobalData.gConfig.CheckAll == '1':
> +EdkLogger.quiet("Checking function no deprecated one being used 
> ...")
> +
> +DeprecatedFunctionList = ['UnicodeValueToString',
> +  'AsciiValueToString',
> +  'StrCpy',
> +  'StrnCpy',
> +  'StrCat',
> +  'StrnCat',
> +  'UnicodeStrToAsciiStr',
> +  'AsciiStrCpy',
> +  'AsciiStrnCpy',
> +  'AsciiStrCat',
> +  'AsciiStrnCat',
> +  'AsciiStrToUnicodeStr',
> +  'PcdSet8',
> +  'PcdSet16',
> +  'PcdSet32',
> +  'PcdSet64',
> +  'PcdSetPtr',
> +  'PcdSetBool',
> +  'PcdSetEx8',
> +  'PcdSetEx16',
> +  'PcdSetEx32',
> +  'PcdSetEx64',
> +  'PcdSetExPtr',
> +  'PcdSetExBool',
> +  'LibPcdSet8',
> +  'LibPcdSet16',
> +  'LibPcdSet32',
> +  'LibPcdSet64',
> +  'LibPcdSetPtr',
> +  'LibPcdSetBool',
> +  'LibPcdSetEx8',
> +  'LibPcdSetEx16',
> +  'LibPcdSetEx32',
> +  'LibPcdSetEx64',
> +  'LibPcdSetExPtr',
> +  'LibPcdSetExBool',
> +  'GetVariable',
> +  'GetEfiGlobalVariable',
> +  ]
> +
> +for IdentifierTable in EccGlobalData.gIdentifierTableList:
> +SqlCommand = """select ID, Name, BelongsToFile from %s
> +where Model = %s """ % (IdentifierTable, 
> MODEL_IDENTIFIER_FUNCTION_CALLING)
> +RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
> +for Record in RecordSet:
> +for Key in DeprecatedFunctionList:
> +if Key == Record[1]:
> +if not 
> EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_DEPRECATE,
>  Key):
> +OtherMsg = 'The function [%s] is deprecated 
> which should NOT be used' % Key
> +
> EccGlobalData.gDb.TblReport.Insert(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_DEPRECATE,
> +   
> OtherMsg=OtherMsg,
> +   
> BelongsToTable=IdentifierTable,
> +   
> BelongsToItem=Record[0])
> 
> def WalkTree(self):
> IgnoredPattern = c.GetIgnoredDirListPattern()
> diff --git a/BaseTools/Source/Python/Ecc/Configuration.py 
> b/BaseTools/Source/Python/Ecc/Configuration.py
> index 

Re: [edk2] [PATCH] BaseTools/EOT: Change to call a program instead of calling Python API.

2018-10-15 Thread Carsey, Jaben
Hess,

Thanks for the clarification. Makes sense!

I glanced at, but didn't read in detail the code... so.

Acked-by: Jaben Carsey 

> -Original Message-
> From: Chen, Hesheng
> Sent: Monday, October 15, 2018 2:34 PM
> To: Carsey, Jaben ; Zhu, Yonghong
> ; edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] BaseTools/EOT: Change to call a program instead
> of calling Python API.
> Importance: High
> 
> Hello Jaben,
> The API is provided by C code and we want Python tool to use it. The tool
> used to call Python API from DLL files and now we need run Python tools
> from source so we can't build a specific version of DLL binary for it. The DLL
> file may be different for different version of Python. So now we just call the
> C program directly for the API.
> 
> Best Regards,
> Chen, Hess
> Intel China Software Center
> Tel: +86-21-6116-6740
> Email: hesheng.c...@intel.com
> 
> -Original Message-
> From: Carsey, Jaben
> Sent: Tuesday, October 16, 2018 1:45 AM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Chen, Hesheng 
> Subject: RE: [edk2] [PATCH] BaseTools/EOT: Change to call a program instead
> of calling Python API.
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Yonghong Zhu
> > Sent: Monday, October 15, 2018 3:24 AM
> > To: edk2-devel@lists.01.org
> > Cc: Chen, Hesheng 
> > Subject: [edk2] [PATCH] BaseTools/EOT: Change to call a program
> > instead of calling Python API.
> >
> > From: hchen30 
> >
> > Update the EOT tool to call the program itself instead of calling the
> > Python API when parsing FV images.
> 
> Why do we prefer to launch the separate python program instead of calling
> the APIs?
> 
> 
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Hess Chen 
> > ---
> >  BaseTools/Source/Python/Eot/{Eot.py => EotMain.py} | 465
> > +++--
> > 
> >  BaseTools/Source/Python/Eot/InfParserLite.py   |  26 +-
> >  BaseTools/Source/Python/Eot/Parser.py  |  28 +-
> >  BaseTools/Source/Python/Eot/Report.py  |   6 +-
> >  BaseTools/Source/Python/build/BuildReport.py   |   2 +-
> >  5 files changed, 84 insertions(+), 443 deletions(-)  rename
> > BaseTools/Source/Python/Eot/{Eot.py => EotMain.py} (75%)
> >
> > diff --git a/BaseTools/Source/Python/Eot/Eot.py
> > b/BaseTools/Source/Python/Eot/EotMain.py
> > similarity index 75%
> > rename from BaseTools/Source/Python/Eot/Eot.py
> > rename to BaseTools/Source/Python/Eot/EotMain.py
> > index ce83da1495..49a1494126 100644
> > --- a/BaseTools/Source/Python/Eot/Eot.py
> > +++ b/BaseTools/Source/Python/Eot/EotMain.py
> > @@ -17,18 +17,20 @@
> >  from __future__ import absolute_import  import
> Common.LongFilePathOs
> > as os, time, glob  import Common.EdkLogger as EdkLogger -from . import
> > EotGlobalData
> > +import Eot.EotGlobalData as EotGlobalData
> >  from optparse import OptionParser
> >  from Common.StringUtils import NormPath  from Common import
> > BuildToolError  from Common.Misc import
> > GuidStructureStringToGuidString, sdict -from .InfParserLite import *
> > -from . import c -from . import Database
> > +from Eot.Parser import *
> > +from Eot.InfParserLite import EdkInfParser from Common.StringUtils
> > +import GetSplitValueList from Eot import c from Eot import Database
> >  from array import array
> > -from .Report import Report
> > +from Eot.Report import Report
> >  from Common.BuildVersion import gBUILD_VERSION -from .Parser import
> > ConvertGuid
> > +from Eot.Parser import ConvertGuid
> >  from Common.LongFilePathSupport import OpenLongFilePath as open
> > import struct  import uuid @@ -58,14 +60,14 @@ class Image(array):
> >
> >  self._SubImages = sdict() # {offset: Image()}
> >
> > -array.__init__(self, 'B')
> > +array.__init__(self)
> >
> >  def __repr__(self):
> >  return self._ID_
> >
> >  def __len__(self):
> >  Len = array.__len__(self)
> > -for Offset in self._SubImages:
> > +for Offset in self._SubImages.keys():
> >  Len += len(self._SubImages[Offset])
> >  return Len
> >
> > @@ -154,19 +156,11 @@ class CompressedImage(Image):
> >
> >  def _GetSections(self):
> >  try:
> > -from . import EfiCompressor
> > -TmpData = EfiCompressor.FrameworkDecompress(
> > -  

Re: [edk2] [PATCH] BaseTools/EOT: Change to call a program instead of calling Python API.

2018-10-15 Thread Carsey, Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Monday, October 15, 2018 3:24 AM
> To: edk2-devel@lists.01.org
> Cc: Chen, Hesheng 
> Subject: [edk2] [PATCH] BaseTools/EOT: Change to call a program instead of
> calling Python API.
> 
> From: hchen30 
> 
> Update the EOT tool to call the program itself instead of calling the Python
> API when parsing FV images.

Why do we prefer to launch the separate python program instead of calling the 
APIs?


> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hess Chen 
> ---
>  BaseTools/Source/Python/Eot/{Eot.py => EotMain.py} | 465 +++--
> 
>  BaseTools/Source/Python/Eot/InfParserLite.py   |  26 +-
>  BaseTools/Source/Python/Eot/Parser.py  |  28 +-
>  BaseTools/Source/Python/Eot/Report.py  |   6 +-
>  BaseTools/Source/Python/build/BuildReport.py   |   2 +-
>  5 files changed, 84 insertions(+), 443 deletions(-)
>  rename BaseTools/Source/Python/Eot/{Eot.py => EotMain.py} (75%)
> 
> diff --git a/BaseTools/Source/Python/Eot/Eot.py
> b/BaseTools/Source/Python/Eot/EotMain.py
> similarity index 75%
> rename from BaseTools/Source/Python/Eot/Eot.py
> rename to BaseTools/Source/Python/Eot/EotMain.py
> index ce83da1495..49a1494126 100644
> --- a/BaseTools/Source/Python/Eot/Eot.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -17,18 +17,20 @@
>  from __future__ import absolute_import
>  import Common.LongFilePathOs as os, time, glob
>  import Common.EdkLogger as EdkLogger
> -from . import EotGlobalData
> +import Eot.EotGlobalData as EotGlobalData
>  from optparse import OptionParser
>  from Common.StringUtils import NormPath
>  from Common import BuildToolError
>  from Common.Misc import GuidStructureStringToGuidString, sdict
> -from .InfParserLite import *
> -from . import c
> -from . import Database
> +from Eot.Parser import *
> +from Eot.InfParserLite import EdkInfParser
> +from Common.StringUtils import GetSplitValueList
> +from Eot import c
> +from Eot import Database
>  from array import array
> -from .Report import Report
> +from Eot.Report import Report
>  from Common.BuildVersion import gBUILD_VERSION
> -from .Parser import ConvertGuid
> +from Eot.Parser import ConvertGuid
>  from Common.LongFilePathSupport import OpenLongFilePath as open
>  import struct
>  import uuid
> @@ -58,14 +60,14 @@ class Image(array):
> 
>  self._SubImages = sdict() # {offset: Image()}
> 
> -array.__init__(self, 'B')
> +array.__init__(self)
> 
>  def __repr__(self):
>  return self._ID_
> 
>  def __len__(self):
>  Len = array.__len__(self)
> -for Offset in self._SubImages:
> +for Offset in self._SubImages.keys():
>  Len += len(self._SubImages[Offset])
>  return Len
> 
> @@ -154,19 +156,11 @@ class CompressedImage(Image):
> 
>  def _GetSections(self):
>  try:
> -from . import EfiCompressor
> -TmpData = EfiCompressor.FrameworkDecompress(
> -self[self._HEADER_SIZE_:],
> -len(self) - self._HEADER_SIZE_
> -)
> +TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
>  DecData = array('B')
>  DecData.fromstring(TmpData)
>  except:
> -from . import EfiCompressor
> -TmpData = EfiCompressor.UefiDecompress(
> -self[self._HEADER_SIZE_:],
> -len(self) - self._HEADER_SIZE_
> -)
> +TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
>  DecData = array('B')
>  DecData.fromstring(TmpData)
> 
> @@ -297,7 +291,7 @@ class Depex(Image):
> 
>  Expression = property(_GetExpression)
> 
> -## FirmwareVolume() class
> +# # FirmwareVolume() class
>  #
>  #  A class for Firmware Volume
>  #
> @@ -308,12 +302,12 @@ class FirmwareVolume(Image):
> 
>  _FfsGuid = "8C8CE578-8A3D-4F1C-9935-896185C32DD3"
> 
> -_GUID_  = struct.Struct("16x 1I2H8B")
> -_LENGTH_= struct.Struct("16x 16x 1Q")
> -_SIG_   = struct.Struct("16x 16x 8x 1I")
> -_ATTR_  = struct.Struct("16x 16x 8x 4x 1I")
> -_HLEN_  = struct.Struct("16x 16x 8x 4x 4x 1H")
> -_CHECKSUM_  = struct.Struct("16x 16x 8x 4x 4x 2x 1H")
> +_GUID_ = struct.Struct("16x 1I2H8B")
> +_LENGTH_ = struct.Struct("16x 16x 1Q")
> +_SIG_ = struct.Struct("16x 16x 8x 1I")
> +_ATTR_ = struct.Struct("16x 16x 8x 4x 1I")
> +_HLEN_ = struct.Struct("16x 16x 8x 4x 4x 1H")
> +_CHECKSUM_ = struct.Struct("16x 16x 8x 4x 4x 2x 1H")
> 
>  def __init__(self, Name=''):
>  Image.__init__(self)
> @@ -387,7 +381,7 @@ class FirmwareVolume(Image):
>  DepexString = DepexList[0].strip()
> 

Re: [edk2] [Patch] BaseTools: Add check for the string type whether is same

2018-10-15 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Monday, October 15, 2018 5:45 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [Patch] BaseTools: Add check for the string type whether is
> same
> 
> From: zhijufan 
> 
> Relational and equality operators require both operands to be of
> the same type.
> Treat the string 'A' and "A" as same type, but for "A" and L"A"
> are not same type since one is general string, another is unicode
> string.
> 
> True:'A'<'B', "A"<"B" 'A'<"B", L'A' Error:'A' 
> Cc: Liming Gao 
> Cc: Yonghong Zhu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhiju.Fan 
> ---
>  BaseTools/Source/Python/Common/Expression.py | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 78c69fa..84898f7 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -295,12 +295,12 @@ class ValueExpression(BaseExpression):
>  # bitwise and logical operation between number and 
> boolean is
> allowed
>  pass
>  else:
>  raise BadExpression(ERR_EXPR_TYPE)
>  if isinstance(Oprand1, type('')) and isinstance(Oprand2, 
> type('')):
> -if (Oprand1.startswith('L"') and not 
> Oprand2.startswith('L"')) or \
> -(not Oprand1.startswith('L"') and 
> Oprand2.startswith('L"')):
> +if ((Oprand1.startswith('L"') or Oprand1.startswith('L')) 
> and (not
> Oprand2.startswith('L"')) and (not Oprand2.startswith("L'"))) or \
> +(((not Oprand1.startswith('L"')) and (not
> Oprand1.startswith("L'"))) and (Oprand2.startswith('L"') or
> Oprand2.startswith('L'))):
>  raise BadExpression(ERR_STRING_CMP % (Oprand1, Operator,
> Oprand2))
>  if 'in' in Operator and isinstance(Oprand2, type('')):
>  Oprand2 = Oprand2.split()
>  EvalStr = 'Oprand1 ' + Operator + ' Oprand2'
> 
> @@ -825,10 +825,12 @@ class ValueExpressionEx(ValueExpression):
>  except BadExpression as Value:
>  if self.PcdType in TAB_PCD_NUMERIC_TYPES:
>  PcdValue = PcdValue.strip()
>  if PcdValue.startswith('{') and PcdValue.endswith('}'):
>  PcdValue = SplitPcdValueString(PcdValue[1:-1])
> +if ERR_STRING_CMP.split(':')[0] in Value.message:
> +raise BadExpression("Type: %s, Value: %s, %s" % 
> (self.PcdType,
> PcdValue, Value))
>  if isinstance(PcdValue, type([])):
>  TmpValue = 0
>  Size = 0
>  ValueType = ''
>  for Item in PcdValue:
> --
> 2.6.1.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] BaseTools: Fix bugs use special character in the --pcd option

2018-10-15 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Monday, October 15, 2018 5:46 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix bugs use special character in the --pcd
> option
> 
> Cases:
> --pcd Token.Name="!"
> --pcd Token.Name="\'W&\'"
> --pcd Token.Name="2*h"
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index aaef404..1a0a293 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -1078,10 +1078,12 @@ class DscBuildData(PlatformBuildClassObject):
>  if PcdValue.upper() == 'TRUE':
>  PcdValue = str(1)
>  if not FieldName:
>  if PcdDatumType not in TAB_PCD_NUMERIC_TYPES:
>  PcdValue = '"' + PcdValue + '"'
> +elif not PcdValue.isdigit() and not 
> PcdValue.upper().startswith('0X'):
> +PcdValue = '"' + PcdValue + '"'
>  else:
>  IsArray = False
>  Base = 10
>  if PcdValue.upper().startswith('0X'):
>  Base = 16
> --
> 2.6.1.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] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override

2018-10-08 Thread Carsey, Jaben



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Gao, Liming
> Sent: Sunday, October 07, 2018 6:42 PM
> To: Tomas Pilar (tpilar) ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf
> OptionROM override
> 
> Pilar:
>   The change is good. Could you also update INF and FDF spec for this usage?
> If you don't know how to update INF and FDF spec, please submit BZ. I will
> provide the spec patch.
> 
>   Reviewed-by: Liming Gao 
> 
> Thanks
> Liming
> >-Original Message-
> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >Tomas Pilar (tpilar)
> >Sent: Tuesday, October 02, 2018 10:46 PM
> >To: edk2-devel@lists.01.org
> >Subject: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf
> >OptionROM override
> >
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Tomas Pilar 
> >---
> > BaseTools/Source/Python/GenFds/FdfParser.py | 11 ---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> >diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py
> >b/BaseTools/Source/Python/GenFds/FdfParser.py
> >index 63687e98bb..a65f2cfd2d 100644
> >--- a/BaseTools/Source/Python/GenFds/FdfParser.py
> >+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
> >@@ -4469,10 +4469,15 @@ class FdfParser:
> > if self.__IsKeyword( "PCI_DEVICE_ID"):
> > if not self.__IsToken( "="):
> > raise Warning("expected '='", self.FileName,
> >self.CurrentLineNumber)
> >-if not self.__GetNextHexNumber():
> >-raise Warning("expected Hex device id", 
> >self.FileName,
> >self.CurrentLineNumber)
> >
> >-Overrides.PciDeviceId = self.__Token
> >+# Get a list of PCI IDs
> >+Overrides.PciDeviceId = ""
> >+
> >+while self.__GetNextHexNumber():
> >+Overrides.PciDeviceId += " " + self.__Token

Can we change to minimize looping string concatenation here?  This in a loop 
will cause lots of memory allocation/deallocation and slow things down.

Maybe : 
Overrides.PciDeviceId = "{} {}".format(Overrides.PciDeviceId, self.__Token)


> >+
> >+if not Overrides.PciDeviceId:
> >+raise Warning("expected one or more Hex device ids",
> >self.FileName, self.CurrentLineNumber)
> > continue
> >
> > if self.__IsKeyword( "PCI_REVISION"):
> >--
> >2.17.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


Re: [edk2] [PATCH] ShellPkg-Cd: Ensure all valid cd targets are handled properly

2018-10-08 Thread Carsey, Jaben
Seems good to me.

Any thoughts Ray?

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: jim.dai...@dell.com [mailto:jim.dai...@dell.com]
> Sent: Thursday, October 04, 2018 9:47 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ruiyu 
> Subject: [edk2] [PATCH] ShellPkg-Cd: Ensure all valid cd targets are handled
> properly
> Importance: High
> 
> ShellPkg-Cd: Ensure all valid cd targets are handled properly
> 
> Make sure that PathCleanUpDirectories() is called on all valid targets
> of the cd command.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
> index 79dd2096f4..1eb7056aee 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
> @@ -4,6 +4,7 @@
>(C) Copyright 2016 Hewlett Packard Enterprise Development LP
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
>Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> +  Copyright (c) 2018, Dell Technologies. 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
> @@ -261,9 +262,6 @@ ShellCommandRunCd (
> 
>  if (Param1Copy != NULL && IsCurrentFileSystem (Param1Copy, Cwd)) {
>Status = ReplaceDriveWithCwd (,Cwd);
> -  if (!EFI_ERROR (Status)) {
> -Param1Copy = PathCleanUpDirectories (Param1Copy);
> -  }
>  } else {
>//
>// Can't use cd command to change filesystem.
> @@ -302,13 +300,15 @@ ShellCommandRunCd (
>  StrCatS (TempBuffer, TotalSize / sizeof (CHAR16), 
> Param1Copy);
> 
>  FreePool (Param1Copy);
> -Param1Copy = PathCleanUpDirectories (TempBuffer);
> +Param1Copy = TempBuffer;
> +TempBuffer = NULL;
>}
>  }
>}
>  }
> 
>  if (!EFI_ERROR(Status)) {
> +  Param1Copy = PathCleanUpDirectories (Param1Copy);
>Status = ExtractDriveAndPath (Param1Copy, , );
>  }
> 
> --
> 2.17.0.windows.1

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


Re: [edk2] [Patch 2/2] ShellPkg/TftpDynamicCommand: Correct comments to align with the input parameter.

2018-10-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Sunday, October 07, 2018 8:03 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ye, Ting ;
> Fu, Siyuan ; Wu, Jiaxin ; Bi,
> Dandan 
> Subject: [edk2] [Patch 2/2] ShellPkg/TftpDynamicCommand: Correct
> comments to align with the input parameter.
> Importance: High
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1230
> 
> Cc: Carsey Jaben 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> Cc: Bi Dandan 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin 
> ---
>  ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> index d4391b9f33..ccf7abde42 100644
> --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
> @@ -163,10 +163,11 @@ GetFileSize (
>@param[in]   Mtftp4 MTFTP4 protocol interface
>@param[in]   FilePath   Path of the file, Unicode encoded
>@param[in]   AsciiFilePath  Path of the file, ASCII encoded
>@param[in]   FileSize   Size of the file in number of bytes
>@param[in]   BlockSize  Value of the TFTP blksize option
> +  @param[in]   WindowSize Value of the TFTP window size option
>@param[out]  Data   Address where to store the address of the 
> buffer
>where the data of the file were downloaded in
>case of success.
> 
>@retval  EFI_SUCCESS   The file was downloaded.
> @@ -904,10 +905,11 @@ Error :
>@param[in]   Mtftp4 MTFTP4 protocol interface
>@param[in]   FilePath   Path of the file, Unicode encoded
>@param[in]   AsciiFilePath  Path of the file, ASCII encoded
>@param[in]   FileSize   Size of the file in number of bytes
>@param[in]   BlockSize  Value of the TFTP blksize option
> +  @param[in]   WindowSize Value of the TFTP window size option
>@param[out]  Data   Address where to store the address of the 
> buffer
>where the data of the file were downloaded in
>case of success.
> 
>@retval  EFI_SUCCESS   The file was downloaded.
> --
> 2.17.1.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


  1   2   3   4   5   6   7   >