Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-02-01 Thread Song, BinX
Hi Laszlo,

Thanks for your reply, I have also discussed this patch with Eric and Ray, all 
comments will be in the V2 patch.

Best Regards,
Bell Song


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, February 1, 2018 9:16 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.d...@intel.com>
> Subject: Re: [PATCH] UefiCpuPkg: Enhance CPU feature dependency check
> 
> On 02/01/18 03:09, Song, BinX wrote:
> > Hi Laszlo,
> >
> > Thanks for your comments.
> > Explain the issue first:
> > In CpuCommonFeaturesLib.inf -> CpuCommonFeaturesLib.c ->
> CpuCommonFeaturesLibConstructor() function,
> > it invokes RegisterCpuFeature() to register CPU feature. Some original
> source codes is here.
> >   if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
> > Status = RegisterCpuFeature (
> >"AESNI",
> >AesniGetConfigData,
> >AesniSupport,
> >AesniInitialize,
> >CPU_FEATURE_AESNI,
> >CPU_FEATURE_END
> >);
> > ASSERT_EFI_ERROR (Status);
> >   }
> >   if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
> > Status = RegisterCpuFeature (
> >"MWAIT",
> >NULL,
> >MonitorMwaitSupport,
> >MonitorMwaitInitialize,
> >CPU_FEATURE_MWAIT,
> >CPU_FEATURE_END
> >);
> > ASSERT_EFI_ERROR (Status);
> >   }
> >
> > Then I update them to below.
> >   if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
> > Status = RegisterCpuFeature (
> >"AESNI",
> >AesniGetConfigData,
> >AesniSupport,
> >AesniInitialize,
> >CPU_FEATURE_AESNI,
> >CPU_FEATURE_MWAIT | CPU_FEATURE_BEFORE,
> >CPU_FEATURE_END
> >);
> > ASSERT_EFI_ERROR (Status);
> >   }
> >   if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
> > Status = RegisterCpuFeature (
> >"MWAIT",
> >NULL,
> >MonitorMwaitSupport,
> >MonitorMwaitInitialize,
> >CPU_FEATURE_MWAIT,
> >CPU_FEATURE_AESNI | CPU_FEATURE_BEFORE,
> >CPU_FEATURE_END
> >);
> > ASSERT_EFI_ERROR (Status);
> >   }
> > Original function CheckCpuFeaturesDependency() will enter a dead loop
> and prompt nothing when checking and sorting them.
> 
> Ah, I see, so the RegisterCpuFeature() call can add before/after hints
> to the features. And circular dependencies cause an infinite loop currently.
> 
> > I think a better way is to detect this conflicted logic and give some hints 
> > to
> user, then assert(false).
> >
> > For your three comments.
> > 1. How about change to this?
> >   if (BeforeFlag) {
> > DEBUG ((DEBUG_ERROR, "Error: Feature %a before condition is invalid!",
> CurrentCpuFeature->FeatureName));
> >   } else {
> > DEBUG ((DEBUG_ERROR, "Error: Feature %a after condition is invalid!",
> CurrentCpuFeature->FeatureName));
> >   }
> 
> It's OK to do this as well:
> 
>   DEBUG ((
> DEBUG_ERROR,
> "Error: Feature %a %a condition is invalid!\n",
> CurrentCpuFeature->FeatureName,
> BeforeFlag ? "before" : "after"
> ));
> 
> > 2. Will update it in V2 patch.
> > 3. How about add a prefix before the name?
> RegisterCpuFeaturesLibSortCpuFeatures() will be unique.
> 
> Sure.
> 
> Thanks!
> Laszlo
> 
> >
> > Best Regards,
> > Bell Song
> >
> >> -Original Message-
> >> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> Sent: Wednesday, January 31, 2018 5:44 PM
> >> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> >> Cc: Dong, Eric <eric.d...@intel.com>
> >> Subject: Re: [PATCH] UefiCpuPkg: Enhance CPU feature dependency
> check
> >>
> >> On 01/31/18 08:00, Song, BinX wrote:
> >>> Current CPU feature dependency check will hang on when meet below
> or
> >>> similar case:
> >>> if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
> >>>   Status = RegisterCpuFeature (
> >>>  "AESNI",
> >>>  

Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-01-31 Thread Song, BinX
Hi Laszlo,

Thanks for your comments.
Explain the issue first:
In CpuCommonFeaturesLib.inf -> CpuCommonFeaturesLib.c -> 
CpuCommonFeaturesLibConstructor() function,
it invokes RegisterCpuFeature() to register CPU feature. Some original source 
codes is here.
  if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
Status = RegisterCpuFeature (
   "AESNI",
   AesniGetConfigData,
   AesniSupport,
   AesniInitialize,
   CPU_FEATURE_AESNI,
   CPU_FEATURE_END
   );
ASSERT_EFI_ERROR (Status);
  }
  if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
Status = RegisterCpuFeature (
   "MWAIT",
   NULL,
   MonitorMwaitSupport,
   MonitorMwaitInitialize,
   CPU_FEATURE_MWAIT,
   CPU_FEATURE_END
   );
ASSERT_EFI_ERROR (Status);
  }

Then I update them to below.
  if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
Status = RegisterCpuFeature (
   "AESNI",
   AesniGetConfigData,
   AesniSupport,
   AesniInitialize,
   CPU_FEATURE_AESNI,
   CPU_FEATURE_MWAIT | CPU_FEATURE_BEFORE,
   CPU_FEATURE_END
   );
ASSERT_EFI_ERROR (Status);
  }
  if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
Status = RegisterCpuFeature (
   "MWAIT",
   NULL,
   MonitorMwaitSupport,
   MonitorMwaitInitialize,
   CPU_FEATURE_MWAIT,
   CPU_FEATURE_AESNI | CPU_FEATURE_BEFORE,
   CPU_FEATURE_END
   );
ASSERT_EFI_ERROR (Status);
  }
Original function CheckCpuFeaturesDependency() will enter a dead loop and 
prompt nothing when checking and sorting them.
I think a better way is to detect this conflicted logic and give some hints to 
user, then assert(false).

For your three comments.
1. How about change to this?
  if (BeforeFlag) {
DEBUG ((DEBUG_ERROR, "Error: Feature %a before condition is invalid!", 
CurrentCpuFeature->FeatureName));
  } else {
DEBUG ((DEBUG_ERROR, "Error: Feature %a after condition is invalid!", 
CurrentCpuFeature->FeatureName));
  }
2. Will update it in V2 patch.
3. How about add a prefix before the name? 
RegisterCpuFeaturesLibSortCpuFeatures() will be unique.

Best Regards,
Bell Song

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, January 31, 2018 5:44 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.d...@intel.com>
> Subject: Re: [PATCH] UefiCpuPkg: Enhance CPU feature dependency check
> 
> On 01/31/18 08:00, Song, BinX wrote:
> > Current CPU feature dependency check will hang on when meet below or
> > similar case:
> > if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
> >   Status = RegisterCpuFeature (
> >  "AESNI",
> >  AesniGetConfigData,
> >  AesniSupport,
> >  AesniInitialize,
> >  CPU_FEATURE_AESNI,
> >  CPU_FEATURE_MWAIT | CPU_FEATURE_BEFORE,
> >  CPU_FEATURE_END
> >  );
> >   ASSERT_EFI_ERROR (Status);
> > }
> > if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
> >   Status = RegisterCpuFeature (
> >  "MWAIT",
> >  NULL,
> >  MonitorMwaitSupport,
> >  MonitorMwaitInitialize,
> >  CPU_FEATURE_MWAIT,
> >  CPU_FEATURE_AESNI | CPU_FEATURE_BEFORE,
> >  CPU_FEATURE_END
> >  );
> >   ASSERT_EFI_ERROR (Status);
> > }
> >
> > Solution is to separate current CPU feature dependency check into
> > sort and check two parts.
> >
> > Sort function:
> > According to CPU feature's dependency, sort all CPU features.
> > Later dependency will override previous dependency if they are conflicted.
> >
> > Check function:
> > Check sorted CPU features' relationship, ASSERT invalid relationship.
> >
> > Cc: Eric Dong <eric.d...@intel.com>
> > Cc: Laszlo Ersek <ler...@redhat.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 271
> -
> >  .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h   |   7 +
> >  .../RegisterCpuFeaturesLib.c   | 130 +-
> >  3 files changed, 278 insertions(+), 130 deletions(-)
> >
> > diff --git
> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesIni

Re: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-01-30 Thread Song, BinX
Hi All,

Attached my test case F.Y.R.

Best Regards,
Bell Song

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Song, BinX
> Sent: Wednesday, January 31, 2018 3:01 PM
> To: edk2-devel@lists.01.org
> Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency
> check
> 
> Current CPU feature dependency check will hang on when meet below or
> similar case:
> if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
>   Status = RegisterCpuFeature (
>  "AESNI",
>  AesniGetConfigData,
>  AesniSupport,
>  AesniInitialize,
>  CPU_FEATURE_AESNI,
>  CPU_FEATURE_MWAIT | CPU_FEATURE_BEFORE,
>  CPU_FEATURE_END
>  );
>   ASSERT_EFI_ERROR (Status);
> }
> if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
>   Status = RegisterCpuFeature (
>  "MWAIT",
>  NULL,
>  MonitorMwaitSupport,
>  MonitorMwaitInitialize,
>  CPU_FEATURE_MWAIT,
>  CPU_FEATURE_AESNI | CPU_FEATURE_BEFORE,
>  CPU_FEATURE_END
>  );
>   ASSERT_EFI_ERROR (Status);
> }
> 
> Solution is to separate current CPU feature dependency check into
> sort and check two parts.
> 
> Sort function:
> According to CPU feature's dependency, sort all CPU features.
> Later dependency will override previous dependency if they are conflicted.
> 
> Check function:
> Check sorted CPU features' relationship, ASSERT invalid relationship.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bell Song <binx.s...@intel.com>
> ---
>  .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 271
> -
>  .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h   |   7 +
>  .../RegisterCpuFeaturesLib.c   | 130 +-
>  3 files changed, 278 insertions(+), 130 deletions(-)
> 
> diff --git
> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> index 4d75c07..2fd0d5f 100644
> --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
> @@ -423,6 +423,271 @@ DumpRegisterTableOnProcessor (
>  }
> 
>  /**
> +  From FeatureBitMask, find the right feature entry in CPU feature list.
> +
> +  @param[in]  FeatureListThe pointer to CPU feature list.
> +  @param[in]  CurrentFeature The pointer to current CPU feature.
> +  @param[in]  BeforeFlag TRUE: BeforeFeatureBitMask; FALSE:
> AfterFeatureBitMask.
> +
> +  @return  The pointer to right CPU feature entry.
> +**/
> +LIST_ENTRY *
> +FindFeatureInList(
> +  IN LIST_ENTRY  *CpuFeatureList,
> +  IN CPU_FEATURES_ENTRY  *CurrentCpuFeature,
> +  IN BOOLEAN  BeforeFlag
> +  )
> +{
> +  LIST_ENTRY *TempEntry;
> +  CPU_FEATURES_ENTRY *TempFeature;
> +  UINT8  *FeatureBitMask;
> +
> +  FeatureBitMask = BeforeFlag ? CurrentCpuFeature-
> >BeforeFeatureBitMask : CurrentCpuFeature->AfterFeatureBitMask;
> +  TempEntry = GetFirstNode (CpuFeatureList);
> +  while (!IsNull (CpuFeatureList, TempEntry)) {
> +TempFeature = CPU_FEATURE_ENTRY_FROM_LINK (TempEntry);
> +if (IsBitMaskMatchCheck (FeatureBitMask, TempFeature->FeatureMask)){
> +  return TempEntry;
> +}
> +TempEntry = TempEntry->ForwardLink;
> +  }
> +
> +  DEBUG ((DEBUG_ERROR, "Error: Feature %a ", CurrentCpuFeature-
> >FeatureName, BeforeFlag ? "before ":"after ", "condition is invalid!\n"));
> +  DEBUG ((DEBUG_ERROR, "Error: Please check %a relationship!\n",
> CurrentCpuFeature->FeatureName));
> +  ASSERT (FALSE);
> +
> +  return NULL;
> +}
> +
> +/**
> +  In CPU feature list, check if one entry is before another entry.
> +
> +  @param[in]  FeatureList  The pointer to CPU feature list.
> +  @param[in]  OneEntry The pointer to current CPU feature entry.
> +  @param[in]  AnotherEntry The pointer to checked CPU feature entry.
> +
> +  @return TRUE One entry is before another entry.
> +  @return FALSEOne entry is NOT before another entry.
> +**/
> +BOOLEAN
> +CheckEntryBeforeEntry(
> +  IN LIST_ENTRY  *CpuFeatureList,
> +  IN LIST_ENTRY  *OneEntry,
> +  IN LIST_ENT

[edk2] [PATCH] UefiCpuPkg: Enhance CPU feature dependency check

2018-01-30 Thread Song, BinX
Current CPU feature dependency check will hang on when meet below or
similar case:
if (IsCpuFeatureSupported (CPU_FEATURE_AESNI)) {
  Status = RegisterCpuFeature (
 "AESNI",
 AesniGetConfigData,
 AesniSupport,
 AesniInitialize,
 CPU_FEATURE_AESNI,
 CPU_FEATURE_MWAIT | CPU_FEATURE_BEFORE,
 CPU_FEATURE_END
 );
  ASSERT_EFI_ERROR (Status);
}
if (IsCpuFeatureSupported (CPU_FEATURE_MWAIT)) {
  Status = RegisterCpuFeature (
 "MWAIT",
 NULL,
 MonitorMwaitSupport,
 MonitorMwaitInitialize,
 CPU_FEATURE_MWAIT,
 CPU_FEATURE_AESNI | CPU_FEATURE_BEFORE,
 CPU_FEATURE_END
 );
  ASSERT_EFI_ERROR (Status);
}

Solution is to separate current CPU feature dependency check into
sort and check two parts.

Sort function:
According to CPU feature's dependency, sort all CPU features.
Later dependency will override previous dependency if they are conflicted.

Check function:
Check sorted CPU features' relationship, ASSERT invalid relationship.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 271 -
 .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h   |   7 +
 .../RegisterCpuFeaturesLib.c   | 130 +-
 3 files changed, 278 insertions(+), 130 deletions(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index 4d75c07..2fd0d5f 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -423,6 +423,271 @@ DumpRegisterTableOnProcessor (
 }
 
 /**
+  From FeatureBitMask, find the right feature entry in CPU feature list.
+
+  @param[in]  FeatureListThe pointer to CPU feature list.
+  @param[in]  CurrentFeature The pointer to current CPU feature.
+  @param[in]  BeforeFlag TRUE: BeforeFeatureBitMask; FALSE: 
AfterFeatureBitMask.
+
+  @return  The pointer to right CPU feature entry.
+**/
+LIST_ENTRY *
+FindFeatureInList(
+  IN LIST_ENTRY  *CpuFeatureList,
+  IN CPU_FEATURES_ENTRY  *CurrentCpuFeature,
+  IN BOOLEAN  BeforeFlag
+  )
+{
+  LIST_ENTRY *TempEntry;
+  CPU_FEATURES_ENTRY *TempFeature;
+  UINT8  *FeatureBitMask;
+
+  FeatureBitMask = BeforeFlag ? CurrentCpuFeature->BeforeFeatureBitMask : 
CurrentCpuFeature->AfterFeatureBitMask;
+  TempEntry = GetFirstNode (CpuFeatureList);
+  while (!IsNull (CpuFeatureList, TempEntry)) {
+TempFeature = CPU_FEATURE_ENTRY_FROM_LINK (TempEntry);
+if (IsBitMaskMatchCheck (FeatureBitMask, TempFeature->FeatureMask)){
+  return TempEntry;
+}
+TempEntry = TempEntry->ForwardLink;
+  }
+
+  DEBUG ((DEBUG_ERROR, "Error: Feature %a ", CurrentCpuFeature->FeatureName, 
BeforeFlag ? "before ":"after ", "condition is invalid!\n"));
+  DEBUG ((DEBUG_ERROR, "Error: Please check %a relationship!\n", 
CurrentCpuFeature->FeatureName));
+  ASSERT (FALSE);
+
+  return NULL;
+}
+
+/**
+  In CPU feature list, check if one entry is before another entry.
+
+  @param[in]  FeatureList  The pointer to CPU feature list.
+  @param[in]  OneEntry The pointer to current CPU feature entry.
+  @param[in]  AnotherEntry The pointer to checked CPU feature entry.
+
+  @return TRUE One entry is before another entry.
+  @return FALSEOne entry is NOT before another entry.
+**/
+BOOLEAN
+CheckEntryBeforeEntry(
+  IN LIST_ENTRY  *CpuFeatureList,
+  IN LIST_ENTRY  *OneEntry,
+  IN LIST_ENTRY  *AnotherEntry
+  )
+{
+  LIST_ENTRY *TempEntry;
+
+  TempEntry = OneEntry;
+  while (!IsNull (CpuFeatureList, TempEntry)) {
+if (IsNull (AnotherEntry, TempEntry)) {
+  return TRUE;
+}
+TempEntry = TempEntry->ForwardLink;
+  }
+  return FALSE;
+}
+
+/**
+  Check sorted CPU features' relationship, ASSERT invalid one.
+
+  @param[in]  FeatureList  The pointer to CPU feature list.
+**/
+VOID
+CheckCpuFeaturesRelationShip (
+  IN LIST_ENTRY  *FeatureList
+  )
+{
+  LIST_ENTRY *CurrentEntry;
+  CPU_FEATURES_ENTRY *CurrentFeature;
+  LIST_ENTRY *CheckEntry;
+  CPU_FEATURES_ENTRY *CheckFeature;
+
+  //
+  // From head to tail, one by one to check all CPU features.
+  //
+  CurrentEntry = GetFirstNode (FeatureList);
+  while (!IsNull (FeatureList, CurrentEntry)) {
+CurrentFeature = CPU_FEATURE_ENTRY_FROM_LINK (CurrentEntry);
+ASSERT (CurrentFeature->Sorted);
+if (CurrentFeature->BeforeAll) {
+  CheckEntry = CurrentEntry->BackLink;
+  while (!IsNull (FeatureList, CheckEntry)) {
+

[edk2] [PATCH] UefiCpuPkg: Enhance feature dependency check

2018-01-11 Thread Song, BinX
Enhance MCA feature dependency check base on SDM pseudocode example 15-1.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
index b012c69..58dc45a 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/MachineCheck.c
@@ -105,6 +105,9 @@ McaSupport (
   IN VOID  *ConfigData  OPTIONAL
   )
 {
+  if (!MceSupport (ProcessorNumber, CpuInfo, ConfigData)) {
+return FALSE;
+  }
   return (CpuInfo->CpuIdVersionInfoEdx.Bits.MCA == 1);
 }
 
-- 
2.10.2.windows.1

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


[edk2] [PATCH] UefiCpuPkg: Fix comment typo for MtrrLibApplyFixedMtrrs function

2017-12-26 Thread Song, BinX
Fix comment typo for MtrrLibApplyFixedMtrrs function

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c 
b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index 619b500..f37b740 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -1683,7 +1683,7 @@ MtrrLibCalculateMtrrs (
 
 
 /**
-  Apply the variable MTRR settings to memory range array.
+  Apply the fixed MTRR settings to memory range array.
 
   @param Fixed The fixed MTRR settings.
   @param RangesReturn the memory range array holding memory type
-- 
2.10.2.windows.1

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


[edk2] [PATCH] UefiCpuPkg: Update AESNI support checking logic

2017-12-24 Thread Song, BinX
With correct model CPU, current checking logic will
always execute AsmReadMsr64 operation and then check
ECX.AESNI[bit 25] = 1. Update checking logic to check
ECX.AESNI[bit 25] = 1 first and then do AsmReadMsr64
operation.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
index 880f092..56b1b55 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/Aesni.c
@@ -62,15 +62,17 @@ AesniSupport (
 {
   MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER   *MsrFeatureConfig;
 
-  if (IS_SANDY_BRIDGE_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
-  IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) 
||
-  IS_XEON_5600_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-  IS_XEON_E7_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
-  IS_XEON_PHI_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {
-MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) ConfigData;
-ASSERT (MsrFeatureConfig != NULL);
-MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 
(MSR_SANDY_BRIDGE_FEATURE_CONFIG);
-return (CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI == 1);
+  if (CpuInfo->CpuIdVersionInfoEcx.Bits.AESNI == 1) {
+if (IS_SANDY_BRIDGE_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
+IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, 
CpuInfo->DisplayModel) ||
+IS_XEON_5600_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) 
||
+IS_XEON_E7_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
+IS_XEON_PHI_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) 
{
+  MsrFeatureConfig = (MSR_SANDY_BRIDGE_FEATURE_CONFIG_REGISTER *) 
ConfigData;
+  ASSERT (MsrFeatureConfig != NULL);
+  MsrFeatureConfig[ProcessorNumber].Uint64 = AsmReadMsr64 
(MSR_SANDY_BRIDGE_FEATURE_CONFIG);
+}
+return TRUE;
   }
   return FALSE;
 }
-- 
2.10.2.windows.1

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


[edk2] [PATCH] UefiCpuPkg: Delete redundant PcdGetSize PcdCpuFeaturesSupport

2017-12-21 Thread Song, BinX
When CpuCommonFeaturesLib use RegisterCpuFeaturesLib to register
CPU features, the CpuFeaturesData->BitMaskSize has already been
initialized. So delete redundant PcdGetSize PcdCpuFeaturesSupport
in CpuInitDataInitialize.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index b8f76f1..2fbde34 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -149,7 +149,6 @@ CpuInitDataInitialize (
   CpuFeaturesData = GetCpuFeaturesData ();
   CpuFeaturesData->InitOrder = AllocateZeroPool (sizeof 
(CPU_FEATURES_INIT_ORDER) * NumberOfCpus);
   ASSERT (CpuFeaturesData->InitOrder != NULL);
-  CpuFeaturesData->BitMaskSize = (UINT32) PcdGetSize (PcdCpuFeaturesSupport);
 
   //
   // Collect CPU Features information
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH V2] UefiCpuPkg: Keep library class header file definition independent

2017-12-21 Thread Song, BinX
Hi Mike,

Thanks for your suggestion.
After discussion with Eric, I know there is a function named 
IsCpuFeatureSupported() to do the feature valid/invalid check.
User should do IsCpuFeatureSupported() check first and then 
RegisterCpuFeature().
So there is no need to add any code to do the same work, I will roll back the 
patch which has been checked in before.

Best Regards,
Bell Song


> -Original Message-
> From: Kinney, Michael D
> Sent: Tuesday, December 19, 2017 7:21 AM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org; Kinney,
> Michael D <michael.d.kin...@intel.com>
> Cc: Dong, Eric <eric.d...@intel.com>; ler...@redhat.com; Ni, Ruiyu
> <ruiyu...@intel.com>
> Subject: RE: [PATCH V2] UefiCpuPkg: Keep library class header file definition
> independent
> 
> This still does not work because a library instance that
> registers a new CPU feature may want to use a new feature
> bit larger than MAX.  This change moves the define
> from the RegisterCpuFeaturesLib library class to the
> implementation of the RegisterCpuFeaturesLibs.
> 
> The components that know the maximum bit number are the
> NULL lib instances that register CPU features (e.g.
> CpuCommonFeaturesLib) and the platform developer that
> that provides the set of NULL lib instances in a platform
> DSC file and the associated PCDs.  For example, the
> following DSC fragment only specifies a single NULL lib
> instance that registers CPU features.  However, it is
> legal to provide additional NULL lib instances from
> Si packages.
> 
>   UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.inf {
> 
> 
> NULL|UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib
> .inf
>   }
> 
> The maximum size of the bitmask for CPU features is known
> by the size of the PCD called PcdCpuFeaturesSupport that
> has a DEC default value based on CpuCommonFeaturesLib but
> can be set to a larger size based on the maximum bit used
> by all the NULL lib instances.
> 
> So maybe the valid check should just verify that the bit
> number passed in is < PcdGetSize (PcdCpuFeaturesSupport) * 8.
> This eliminates the use of the #define value and uses an
> existing PCD.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Song, BinX
> > Sent: Sunday, December 17, 2017 9:37 PM
> > To: edk2-devel@lists.01.org
> > Cc: Dong, Eric <eric.d...@intel.com>;
> > ler...@redhat.com; Ni, Ruiyu <ruiyu...@intel.com>;
> > Kinney, Michael D <michael.d.kin...@intel.com>
> > Subject: [PATCH V2] UefiCpuPkg: Keep library class
> > header file definition independent
> >
> > V2:
> > Move CPU_FEATURE_MAX definition from header file to C
> > file.
> > V1:
> > Keep library class header file definition independent
> >
> > Cc: Eric Dong <eric.d...@intel.com>
> > Cc: Laszlo Ersek <ler...@redhat.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > |  5 -
> >
> > .../Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesL
> > ib.c   | 11 ++-
> >  2 files changed, 6 insertions(+), 10 deletions(-)
> >
> > diff --git
> > a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > index fc3ccda..9331e49 100644
> > ---
> > a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > +++
> > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > @@ -71,11 +71,6 @@
> >  #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE
> > (32+9)
> >  #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS
> > (32+10)
> >  #define CPU_FEATURE_PPIN
> > (32+11)
> > -//
> > -// Currently, CPU_FEATURE_PROC_TRACE is the MAX
> > feature we support.
> > -// If you define a feature bigger than it, please also
> > replace it
> > -// in RegisterCpuFeatureLibIsFeatureValid function.
> > -//
> >  #define CPU_FEATURE_PROC_TRACE
> > (32+12)
> >
> >  #define CPU_FEATURE_BEFORE_ALL
> > BIT27
> > diff --git
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > index 6ec26e1..afc424c 100644
> > ---
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > +++
> > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > @@ -13,6 +13,10 @@
> >  **/
> >
> >  #include "Re

[edk2] [PATCH V2] UefiCpuPkg: Keep library class header file definition independent

2017-12-17 Thread Song, BinX
V2:
Move CPU_FEATURE_MAX definition from header file to C file.
V1:
Keep library class header file definition independent

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h   |  5 -
 .../Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c   | 11 ++-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
index fc3ccda..9331e49 100644
--- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
+++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
@@ -71,11 +71,6 @@
 #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE (32+9)
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
 #define CPU_FEATURE_PPIN(32+11)
-//
-// Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
-// If you define a feature bigger than it, please also replace it
-// in RegisterCpuFeatureLibIsFeatureValid function.
-//
 #define CPU_FEATURE_PROC_TRACE  (32+12)
 
 #define CPU_FEATURE_BEFORE_ALL  BIT27
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
index 6ec26e1..afc424c 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
@@ -13,6 +13,10 @@
 **/
 
 #include "RegisterCpuFeatures.h"
+//
+// Please keep CPU_FEATURE_MAX as the max CPU feature
+//
+#define CPU_FEATURE_MAX  (32+12)
 
 /**
   Checks if two CPU feature bit masks are equal.
@@ -97,11 +101,8 @@ RegisterCpuFeatureLibIsFeatureValid (
 
   Data = Feature;
   Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL | 
CPU_FEATURE_AFTER_ALL);
-  //
-  // Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
-  // If you define a feature bigger than it, please replace it at below.
-  //
-  if (Data > CPU_FEATURE_PROC_TRACE) {
+
+  if (Data > CPU_FEATURE_MAX) {
 DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
 return FALSE;
   }
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH] UefiCpuPkg: Keep library class header file definition independent

2017-12-17 Thread Song, BinX
Hi Ray & Mike,

Thanks for your suggestion, I will update a V2 patch.

Best Regards,
Bell Song

> -Original Message-
> From: Kinney, Michael D
> Sent: Saturday, December 16, 2017 1:34 AM
> To: Ni, Ruiyu <ruiyu...@intel.com>; Song, BinX <binx.s...@intel.com>;
> edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kin...@intel.com>
> Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> Subject: RE: [edk2] [PATCH] UefiCpuPkg: Keep library class header file
> definition independent
> 
> Ray,
> 
> I agree.  The max should not be in the lib class
> header file.
> 
> Mike
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-
> > boun...@lists.01.org] On Behalf Of Ni, Ruiyu
> > Sent: Thursday, December 14, 2017 9:02 PM
> > To: Song, BinX <binx.s...@intel.com>; edk2-
> > de...@lists.01.org
> > Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> > Subject: Re: [edk2] [PATCH] UefiCpuPkg: Keep library
> > class header file definition independent
> >
> > On 12/14/2017 4:31 PM, Song, BinX wrote:
> > > Keep library class header file definition independent
> > >
> > > Cc: Eric Dong <eric.d...@intel.com>
> > > Cc: Laszlo Ersek <ler...@redhat.com>
> > > Contributed-under: TianoCore Contribution Agreement
> > 1.1
> > > Signed-off-by: Bell Song <binx.s...@intel.com>
> > > ---
> > >   UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > | 7 +++
> > >
> > UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFe
> > aturesLib.c | 7 ++-
> > >   2 files changed, 5 insertions(+), 9 deletions(-)
> > >
> > > diff --git
> > a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > index fc3ccda..9582ad8 100644
> > > ---
> > a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > +++
> > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > @@ -71,12 +71,11 @@
> > >   #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE
> > (32+9)
> > >   #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS
> > (32+10)
> > >   #define CPU_FEATURE_PPIN
> > (32+11)
> > > +#define CPU_FEATURE_PROC_TRACE
> > (32+12)
> > >   //
> > > -// Currently, CPU_FEATURE_PROC_TRACE is the MAX
> > feature we support.
> > > -// If you define a feature bigger than it, please
> > also replace it
> > > -// in RegisterCpuFeatureLibIsFeatureValid function.
> > > +// Please keep CPU_FEATURE_MAX as the max CPU
> > feature
> > >   //
> > > -#define CPU_FEATURE_PROC_TRACE
> > (32+12)
> > > +#define CPU_FEATURE_MAX
> > (32+12)
> > I think we need to define this CPU_FEATURE_MAX in
> > RegisterCpuFeaturesLib.c.
> >
> > Thinking about another instance of
> > RegisterCpuFeatureLib
> > that only supports features up to (32+9).
> > The MAX will be 32+9 for that instance.
> > The library class header only defines the features and
> > corresponding ID (32+xx).
> > Library instance chooses which features to support.
> >
> > >
> > >   #define CPU_FEATURE_BEFORE_ALL
> > BIT27
> > >   #define CPU_FEATURE_AFTER_ALL
> > BIT28
> > > diff --git
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > > index 6ec26e1..911f4d0 100644
> > > ---
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > > +++
> > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpu
> > FeaturesLib.c
> > > @@ -97,11 +97,8 @@
> > RegisterCpuFeatureLibIsFeatureValid (
> > >
> > > Data = Feature;
> > > Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER
> > | CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL);
> > > -  //
> > > -  // Currently, CPU_FEATURE_PROC_TRACE is the MAX
> > feature we support.
> > > -  // If you define a feature bigger than it, please
> > replace it at below.
> > > -  //
> > > -  if (Data > CPU_FEATURE_PROC_TRACE) {
> > > +
> > > +  if (Data > CPU_FEATURE_MAX) {
> > >   DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x
> > ", Feature));
> > >   return FALSE;
> > > }
> > >
> >
> >
> > --
> > Thanks,
> > Ray
> > ___
> > 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] [PATCH] UefiCpuPkg: Keep library class header file definition independent

2017-12-14 Thread Song, BinX
Keep library class header file definition independent

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h| 7 +++
 UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c | 7 ++-
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
index fc3ccda..9582ad8 100644
--- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
+++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
@@ -71,12 +71,11 @@
 #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE (32+9)
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
 #define CPU_FEATURE_PPIN(32+11)
+#define CPU_FEATURE_PROC_TRACE  (32+12)
 //
-// Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
-// If you define a feature bigger than it, please also replace it
-// in RegisterCpuFeatureLibIsFeatureValid function.
+// Please keep CPU_FEATURE_MAX as the max CPU feature
 //
-#define CPU_FEATURE_PROC_TRACE  (32+12)
+#define CPU_FEATURE_MAX (32+12)
 
 #define CPU_FEATURE_BEFORE_ALL  BIT27
 #define CPU_FEATURE_AFTER_ALL   BIT28
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
index 6ec26e1..911f4d0 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
@@ -97,11 +97,8 @@ RegisterCpuFeatureLibIsFeatureValid (
 
   Data = Feature;
   Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL | 
CPU_FEATURE_AFTER_ALL);
-  //
-  // Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
-  // If you define a feature bigger than it, please replace it at below.
-  //
-  if (Data > CPU_FEATURE_PROC_TRACE) {
+
+  if (Data > CPU_FEATURE_MAX) {
 DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
 return FALSE;
   }
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH V2] UefiCpuPkg: Check invalid RegisterCpuFeature parameter

2017-12-13 Thread Song, BinX
Hi All,

Thanks for your suggestion, I will update a V3 patch.

Best Regards,
Bell Song

From: Fan Jeff [mailto:vanjeff_...@hotmail.com]
Sent: Wednesday, December 13, 2017 11:35 PM
To: Ni, Ruiyu <ruiyu...@intel.com>; Laszlo Ersek <ler...@redhat.com>; Song, 
BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
Cc: Dong, Eric <eric.d...@intel.com>
Subject: 答复: [edk2] [PATCH V2] UefiCpuPkg: Check invalid RegisterCpuFeature 
parameter


I agree to add one _MAX #define in library instance implementation instead of 
in class header file.



Jeff




From: edk2-devel 
<edk2-devel-boun...@lists.01.org<mailto:edk2-devel-boun...@lists.01.org>> on 
behalf of Ni, Ruiyu <ruiyu...@intel.com<mailto:ruiyu...@intel.com>>
Sent: Wednesday, December 13, 2017 4:49:01 PM
To: Laszlo Ersek; Song, BinX; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Dong, Eric
Subject: Re: [edk2] [PATCH V2] UefiCpuPkg: Check invalid RegisterCpuFeature 
parameter

On 12/13/2017 4:44 PM, Laszlo Ersek wrote:
> On 12/13/17 03:35, Song, BinX wrote:
>> V2:
>> Update function name, add more detail description.
>> V1:
>> Check and assert invalid RegisterCpuFeature function parameter
>>
>> Cc: Eric Dong <eric.d...@intel.com<mailto:eric.d...@intel.com>>
>> Cc: Laszlo Ersek <ler...@redhat.com<mailto:ler...@redhat.com>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Bell Song <binx.s...@intel.com<mailto:binx.s...@intel.com>>
>> ---
>>   .../Include/Library/RegisterCpuFeaturesLib.h   |  5 
>>   .../RegisterCpuFeaturesLib.c   | 29 
>> ++
>>   2 files changed, 34 insertions(+)
>>
>> diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
>> b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
>> index 9331e49..fc3ccda 100644
>> --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
>> +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
>> @@ -71,6 +71,11 @@
>>   #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE (32+9)
>>   #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
>>   #define CPU_FEATURE_PPIN(32+11)
>> +//
>> +// Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
>> +// If you define a feature bigger than it, please also replace it
>> +// in RegisterCpuFeatureLibIsFeatureValid function.
>> +//
>>   #define CPU_FEATURE_PROC_TRACE  (32+12)
>>
>>   #define CPU_FEATURE_BEFORE_ALL  BIT27
>> diff --git 
>> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c 
>> b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
>> index dd6a82b..6ec26e1 100644
>> --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
>> +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
>> @@ -81,6 +81,34 @@ DumpCpuFeature (
>>   }
>>
>>   /**
>> +  Determines if the CPU feature is valid.
>> +
>> +  @param[in]  FeaturePointer to CPU feature
>> +
>> +  @retval TRUE  The CPU feature is valid.
>> +  @retval FALSE The CPU feature is invalid.
>> +**/
>> +BOOLEAN
>> +RegisterCpuFeatureLibIsFeatureValid (
>> +  IN UINT32Feature
>> +  )
>> +{
>> +  UINT32  Data;
>> +
>> +  Data = Feature;
>> +  Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL 
>> | CPU_FEATURE_AFTER_ALL);
>> +  //
>> +  // Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
>> +  // If you define a feature bigger than it, please replace it at below.
>> +  //
>> +  if (Data > CPU_FEATURE_PROC_TRACE) {
>> +DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
>> +return FALSE;
>> +  }
>> +  return TRUE;
>> +}
>> +
>> +/**
>> Determines if the feature bit mask is in dependent CPU feature bit mask 
>> buffer.
>>
>> @param[in]  FeatureMaskPointer to CPU feature bit mask
>> @@ -444,6 +472,7 @@ RegisterCpuFeature (
>>
>> VA_START (Marker, InitializeFunc);
>> Feature = VA_ARG (Marker, UINT32);
>> +  ASSERT (RegisterCpuFeatureLibIsFeatureValid(Feature));
>> while (Feature != CPU_FEATURE_END) {
>>   ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))
>>   != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));
>>
>
> The consensus thus far seems to be that we should not add a separate
> _MAX macro f

[edk2] [PATCH V2] UefiCpuPkg: Check invalid RegisterCpuFeature parameter

2017-12-12 Thread Song, BinX
V2:
Update function name, add more detail description.
V1:
Check and assert invalid RegisterCpuFeature function parameter

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 .../Include/Library/RegisterCpuFeaturesLib.h   |  5 
 .../RegisterCpuFeaturesLib.c   | 29 ++
 2 files changed, 34 insertions(+)

diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
index 9331e49..fc3ccda 100644
--- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
+++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
@@ -71,6 +71,11 @@
 #define CPU_FEATURE_APIC_TPR_UPDATE_MESSAGE (32+9)
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
 #define CPU_FEATURE_PPIN(32+11)
+//
+// Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
+// If you define a feature bigger than it, please also replace it
+// in RegisterCpuFeatureLibIsFeatureValid function.
+//
 #define CPU_FEATURE_PROC_TRACE  (32+12)
 
 #define CPU_FEATURE_BEFORE_ALL  BIT27
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
index dd6a82b..6ec26e1 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
@@ -81,6 +81,34 @@ DumpCpuFeature (
 }
 
 /**
+  Determines if the CPU feature is valid.
+
+  @param[in]  FeaturePointer to CPU feature
+
+  @retval TRUE  The CPU feature is valid.
+  @retval FALSE The CPU feature is invalid.
+**/
+BOOLEAN
+RegisterCpuFeatureLibIsFeatureValid (
+  IN UINT32Feature
+  )
+{
+  UINT32  Data;
+
+  Data = Feature;
+  Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL | 
CPU_FEATURE_AFTER_ALL);
+  //
+  // Currently, CPU_FEATURE_PROC_TRACE is the MAX feature we support.
+  // If you define a feature bigger than it, please replace it at below.
+  //
+  if (Data > CPU_FEATURE_PROC_TRACE) {
+DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
+return FALSE;
+  }
+  return TRUE;
+}
+
+/**
   Determines if the feature bit mask is in dependent CPU feature bit mask 
buffer.
 
   @param[in]  FeatureMaskPointer to CPU feature bit mask
@@ -444,6 +472,7 @@ RegisterCpuFeature (
 
   VA_START (Marker, InitializeFunc);
   Feature = VA_ARG (Marker, UINT32);
+  ASSERT (RegisterCpuFeatureLibIsFeatureValid(Feature));
   while (Feature != CPU_FEATURE_END) {
 ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))
 != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature parameter

2017-12-12 Thread Song, BinX
Hi Ray,

Got it, I will update a V2 patch.

Best Regards,
Bell Song

> -Original Message-
> From: Ni, Ruiyu
> Sent: Tuesday, December 12, 2017 4:44 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> Subject: RE: [edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature
> parameter
> 
> > -Original Message-
> > From: Song, BinX
> > Sent: Monday, December 11, 2017 6:00 PM
> > To: Ni, Ruiyu <ruiyu...@intel.com>; edk2-devel@lists.01.org
> > Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> > Subject: RE: [edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature
> > parameter
> >
> > Hi Ray,
> >
> > Below is my opinions for your 2 questions:
> > 1. Can we rename this function name to
> > "RegisterCpuFeatureLibIsFeatureValid"?
> > [Bell]: In content of RegisterCpuFeaturesLib.c, there is a function named
> > IsBitMaskMatchCheck(), it's my function's base, they have similar function -
> a
> > small valid/invalid check, So I think it is better to keep them align.
> The original function name IsCheck() is not good. Please do not follow
> the
> same naming style.
> 
> > 2. Can we just say "CPU_FEATURE_PROC_TRACE" is the MAX feature we
> > support?
> > [Bell]: Discussed with Eric before, we should not define this as a MAX
> feature
> > for future extension purpose.
> I didn't mean to define a new MAX macro.
> You just need to update the comments.
> >
> > Best Regards,
> > Bell Song
> >
> >
> > > -Original Message-
> > > From: Ni, Ruiyu
> > > Sent: Monday, December 11, 2017 5:40 PM
> > > To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> > > Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> > > Subject: Re: [edk2] [PATCH] UefiCpuPkg: Check invalid
> > > RegisterCpuFeature parameter
> > >
> > > On 12/11/2017 4:16 PM, Song, BinX wrote:
> > > > Check and assert invalid RegisterCpuFeature function parameter
> > > >
> > > > Cc: Eric Dong <eric.d...@intel.com>
> > > > Cc: Laszlo Ersek <ler...@redhat.com>
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Bell Song <binx.s...@intel.com>
> > > > ---
> > > >   .../Include/Library/RegisterCpuFeaturesLib.h   |  4 
> > > >   .../RegisterCpuFeaturesLib.c   | 28
> > ++
> > > >   2 files changed, 32 insertions(+)
> > > >
> > > > diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > > index 9331e49..54244cd 100644
> > > > --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > > +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > > > @@ -72,6 +72,10 @@
> > > >   #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
> > > >   #define CPU_FEATURE_PPIN(32+11)
> > > > +//
> > > > +// When you add new CPU features, please also replace the minor
> CPU
> > > feature
> > > > +// with the max CPU feature in the IsFeatureValidCheck() function.
> > > > +//
> > > >   #define CPU_FEATURE_PROC_TRACE  (32+12)
> > > >
> > > >   #define CPU_FEATURE_BEFORE_ALL  BIT27
> > > >   #define CPU_FEATURE_AFTER_ALL   BIT28
> > > > diff --git
> > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > > > index dd6a82b..f75d900 100644
> > > > ---
> > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > > > +++
> > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > > > @@ -81,6 +81,33 @@ DumpCpuFeature (
> > > >   }
> > > >
> > > >   /**
> > > > +  Determines if the CPU feature is valid.
> > > > +
> > > > +  @param[in]  FeaturePointer to CPU feature
> > > > +
> > > > +  @retval TRUE  The CPU feature is valid.
> > > > +  @retval FALSE The CPU feature is invalid.
> > > > +**/
> > > > +BOOLEAN
> > > > +IsFeatureValidCheck (
> > > C

Re: [edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature parameter

2017-12-11 Thread Song, BinX
Hi Ray,

Below is my opinions for your 2 questions:
1. Can we rename this function name to "RegisterCpuFeatureLibIsFeatureValid"?
[Bell]: In content of RegisterCpuFeaturesLib.c, there is a function named 
IsBitMaskMatchCheck(), it's my function's base, they have similar function - a 
small valid/invalid check,
So I think it is better to keep them align.
2. Can we just say "CPU_FEATURE_PROC_TRACE" is the MAX feature we support?
[Bell]: Discussed with Eric before, we should not define this as a MAX feature 
for future extension purpose.

Best Regards,
Bell Song


> -Original Message-
> From: Ni, Ruiyu
> Sent: Monday, December 11, 2017 5:40 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: ler...@redhat.com; Dong, Eric <eric.d...@intel.com>
> Subject: Re: [edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature
> parameter
> 
> On 12/11/2017 4:16 PM, Song, BinX wrote:
> > Check and assert invalid RegisterCpuFeature function parameter
> >
> > Cc: Eric Dong <eric.d...@intel.com>
> > Cc: Laszlo Ersek <ler...@redhat.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >   .../Include/Library/RegisterCpuFeaturesLib.h   |  4 
> >   .../RegisterCpuFeaturesLib.c   | 28 
> > ++
> >   2 files changed, 32 insertions(+)
> >
> > diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > index 9331e49..54244cd 100644
> > --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
> > @@ -72,6 +72,10 @@
> >   #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
> >   #define CPU_FEATURE_PPIN(32+11)
> > +//
> > +// When you add new CPU features, please also replace the minor CPU
> feature
> > +// with the max CPU feature in the IsFeatureValidCheck() function.
> > +//
> >   #define CPU_FEATURE_PROC_TRACE  (32+12)
> >
> >   #define CPU_FEATURE_BEFORE_ALL  BIT27
> >   #define CPU_FEATURE_AFTER_ALL   BIT28
> > diff --git
> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > index dd6a82b..f75d900 100644
> > ---
> a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > +++
> b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
> > @@ -81,6 +81,33 @@ DumpCpuFeature (
> >   }
> >
> >   /**
> > +  Determines if the CPU feature is valid.
> > +
> > +  @param[in]  FeaturePointer to CPU feature
> > +
> > +  @retval TRUE  The CPU feature is valid.
> > +  @retval FALSE The CPU feature is invalid.
> > +**/
> > +BOOLEAN
> > +IsFeatureValidCheck (
> Can we rename this function name to
> "RegisterCpuFeatureLibIsFeatureValid"?
> 
> 
> > +  IN UINT32Feature
> > +  )
> > +{
> > +  UINT32  Data;
> > +
> > +  Data = Feature;
> > +  Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER |
> CPU_FEATURE_BEFORE_ALL | CPU_FEATURE_AFTER_ALL);
> > +  //
> > +  // Please replace CPU feature below with the MAX one if have.
> Can we just say "CPU_FEATURE_PROC_TRACE" is the MAX feature we
> support?
> 
> 
> > +  //
> > +  if (Data > CPU_FEATURE_PROC_TRACE) {
> > +DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
> > +return FALSE;
> > +  }
> > +  return TRUE;
> > +}
> > +
> > +/**
> > Determines if the feature bit mask is in dependent CPU feature bit mask
> buffer.
> >
> > @param[in]  FeatureMaskPointer to CPU feature bit mask
> > @@ -444,6 +471,7 @@ RegisterCpuFeature (
> >
> > VA_START (Marker, InitializeFunc);
> > Feature = VA_ARG (Marker, UINT32);
> > +  ASSERT (IsFeatureValidCheck(Feature));
> > while (Feature != CPU_FEATURE_END) {
> >   ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))
> >   != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));
> >
> 
> 
> --
> Thanks,
> Ray
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] UefiCpuPkg: Check invalid RegisterCpuFeature parameter

2017-12-11 Thread Song, BinX
Check and assert invalid RegisterCpuFeature function parameter

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 .../Include/Library/RegisterCpuFeaturesLib.h   |  4 
 .../RegisterCpuFeaturesLib.c   | 28 ++
 2 files changed, 32 insertions(+)

diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h 
b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
index 9331e49..54244cd 100644
--- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
+++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h
@@ -72,6 +72,10 @@
 #define CPU_FEATURE_ENERGY_PERFORMANCE_BIAS (32+10)
 #define CPU_FEATURE_PPIN(32+11)
+//
+// When you add new CPU features, please also replace the minor CPU feature
+// with the max CPU feature in the IsFeatureValidCheck() function. 
+//
 #define CPU_FEATURE_PROC_TRACE  (32+12)

 #define CPU_FEATURE_BEFORE_ALL  BIT27
 #define CPU_FEATURE_AFTER_ALL   BIT28
diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
index dd6a82b..f75d900 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c
@@ -81,6 +81,33 @@ DumpCpuFeature (
 }
 
 /**
+  Determines if the CPU feature is valid.
+
+  @param[in]  FeaturePointer to CPU feature
+
+  @retval TRUE  The CPU feature is valid.
+  @retval FALSE The CPU feature is invalid.
+**/
+BOOLEAN
+IsFeatureValidCheck (
+  IN UINT32Feature
+  )
+{
+  UINT32  Data;
+
+  Data = Feature;
+  Data &= ~(CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER | CPU_FEATURE_BEFORE_ALL | 
CPU_FEATURE_AFTER_ALL);
+  //
+  // Please replace CPU feature below with the MAX one if have.
+  //
+  if (Data > CPU_FEATURE_PROC_TRACE) {
+DEBUG ((DEBUG_ERROR, "Invalid CPU feature: 0x%x ", Feature));
+return FALSE;
+  }
+  return TRUE;
+}
+
+/**
   Determines if the feature bit mask is in dependent CPU feature bit mask 
buffer.
 
   @param[in]  FeatureMaskPointer to CPU feature bit mask
@@ -444,6 +471,7 @@ RegisterCpuFeature (
 
   VA_START (Marker, InitializeFunc);
   Feature = VA_ARG (Marker, UINT32);
+  ASSERT (IsFeatureValidCheck(Feature));
   while (Feature != CPU_FEATURE_END) {
 ASSERT ((Feature & (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER))
 != (CPU_FEATURE_BEFORE | CPU_FEATURE_AFTER));
-- 
2.10.2.windows.1

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


[edk2] [PATCH] UefiCpuPkg: Singularize function name

2017-12-11 Thread Song, BinX
Change GetSupportPcds and GetConfigurationPcds to be singular

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 .../RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 48 +++---
 .../RegisterCpuFeaturesLib/RegisterCpuFeatures.h   |  8 ++--
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c 
b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
index b8f76f1..d72ffec 100644
--- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
+++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
@@ -56,7 +56,7 @@ SetSettingPcd (
   @return  The pointer to CPU feature bits mask buffer.
 **/
 UINT8 *
-GetSupportPcds (
+GetSupportPcd (
   VOID
   )
 {
@@ -77,7 +77,7 @@ GetSupportPcds (
   @return  The pointer to CPU feature bits mask buffer.
 **/
 UINT8 *
-GetConfigurationPcds (
+GetConfigurationPcd (
   VOID
   )
 {
@@ -180,8 +180,8 @@ CpuInitDataInitialize (
   //
   // Get support and configuration PCDs
   //
-  CpuFeaturesData->SupportPcds   = GetSupportPcds ();
-  CpuFeaturesData->ConfigurationPcds = GetConfigurationPcds ();
+  CpuFeaturesData->SupportPcd   = GetSupportPcd ();
+  CpuFeaturesData->ConfigurationPcd = GetConfigurationPcd ();
 }
 
 /**
@@ -321,7 +321,7 @@ CollectProcessorData (
   Entry = GetFirstNode (>FeatureList);
   while (!IsNull (>FeatureList, Entry)) {
 CpuFeature = CPU_FEATURE_ENTRY_FROM_LINK (Entry);
-if (IsBitMaskMatch (CpuFeaturesData->SupportPcds, 
CpuFeature->FeatureMask)) {
+if (IsBitMaskMatch (CpuFeaturesData->SupportPcd, CpuFeature->FeatureMask)) 
{
   if (CpuFeature->SupportFunc == NULL) {
 //
 // If SupportFunc is NULL, then the feature is supported.
@@ -444,29 +444,29 @@ AnalysisProcessorFeatures (
   CPU_FEATURES_DATA*CpuFeaturesData;
 
   CpuFeaturesData = GetCpuFeaturesData ();
-  CpuFeaturesData->CapabilityPcds = AllocatePool 
(CpuFeaturesData->BitMaskSize);
-  ASSERT (CpuFeaturesData->CapabilityPcds != NULL);
-  SetMem (CpuFeaturesData->CapabilityPcds, CpuFeaturesData->BitMaskSize, 0xFF);
+  CpuFeaturesData->CapabilityPcd = AllocatePool (CpuFeaturesData->BitMaskSize);
+  ASSERT (CpuFeaturesData->CapabilityPcd != NULL);
+  SetMem (CpuFeaturesData->CapabilityPcd, CpuFeaturesData->BitMaskSize, 0xFF);
   for (ProcessorNumber = 0; ProcessorNumber < NumberOfCpus; ProcessorNumber++) 
{
 CpuInitOrder = >InitOrder[ProcessorNumber];
 //
 // Calculate the last capability on all processors
 //
-SupportedMaskAnd (CpuFeaturesData->CapabilityPcds, 
CpuInitOrder->FeaturesSupportedMask);
+SupportedMaskAnd (CpuFeaturesData->CapabilityPcd, 
CpuInitOrder->FeaturesSupportedMask);
   }
   //
   // Calculate the last setting
   //
 
-  CpuFeaturesData->SettingPcds = AllocateCopyPool 
(CpuFeaturesData->BitMaskSize, CpuFeaturesData->CapabilityPcds);
-  ASSERT (CpuFeaturesData->SettingPcds != NULL);
-  SupportedMaskAnd (CpuFeaturesData->SettingPcds, 
CpuFeaturesData->ConfigurationPcds);
+  CpuFeaturesData->SettingPcd = AllocateCopyPool 
(CpuFeaturesData->BitMaskSize, CpuFeaturesData->CapabilityPcd);
+  ASSERT (CpuFeaturesData->SettingPcd != NULL);
+  SupportedMaskAnd (CpuFeaturesData->SettingPcd, 
CpuFeaturesData->ConfigurationPcd);
 
   //
   // Save PCDs and display CPU PCDs
   //
-  SetCapabilityPcd (CpuFeaturesData->CapabilityPcds);
-  SetSettingPcd (CpuFeaturesData->SettingPcds);
+  SetCapabilityPcd (CpuFeaturesData->CapabilityPcd);
+  SetSettingPcd (CpuFeaturesData->SettingPcd);
 
   //
   // Dump the last CPU feature list
@@ -476,8 +476,8 @@ AnalysisProcessorFeatures (
 Entry = GetFirstNode (>FeatureList);
 while (!IsNull (>FeatureList, Entry)) {
   CpuFeature = CPU_FEATURE_ENTRY_FROM_LINK (Entry);
-  if (IsBitMaskMatch (CpuFeature->FeatureMask, 
CpuFeaturesData->CapabilityPcds)) {
-if (IsBitMaskMatch (CpuFeature->FeatureMask, 
CpuFeaturesData->SettingPcds)) {
+  if (IsBitMaskMatch (CpuFeature->FeatureMask, 
CpuFeaturesData->CapabilityPcd)) {
+if (IsBitMaskMatch (CpuFeature->FeatureMask, 
CpuFeaturesData->SettingPcd)) {
   DEBUG ((DEBUG_INFO, "[Enable   ] "));
 } else {
   DEBUG ((DEBUG_INFO, "[Disable  ] "));
@@ -489,13 +489,13 @@ AnalysisProcessorFeatures (
   Entry = Entry->ForwardLink;
 }
 DEBUG ((DEBUG_INFO, "PcdCpuFeaturesSupport:\n"));
-DumpCpuFeatureMask (CpuFeaturesData->SupportPcds);
+DumpCpuFeatureMask (CpuFeaturesData->SupportPcd);
 DEBUG ((DEBUG_INFO, "PcdCpuFeaturesUserConfiguration:\n"));
-DumpCpuFeatureMask (CpuFeaturesData->ConfigurationPcds);
+DumpCpuFeatureMask (CpuFeaturesData->ConfigurationPcd);
 DEBUG ((DEBUG_INFO, "PcdCpuFeaturesCapability:\n"));
-DumpCpuFeatureMask (CpuFeaturesData->CapabilityPcds);
+DumpCpuFeatureMask 

[edk2] [PATCH V2 3/5] MdePkg: Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c| 2 +-
 MdePkg/Library/BaseLib/X64/CpuBreakpoint.c | 2 +-
 MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c 
b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
index f5df7f2..4f8c92d 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
@@ -19,7 +19,7 @@
   Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
 **/
 
-void __debugbreak ();
+void __debugbreak (VOID);
 
 #pragma intrinsic(__debugbreak)
 
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c 
b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
index d654f84..7d0cf4c 100644
--- a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
@@ -17,7 +17,7 @@
   Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
 **/
 
-void __debugbreak ();
+void __debugbreak (VOID);
 
 #pragma intrinsic(__debugbreak)
 
diff --git 
a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c 
b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
index 8b8e528..744201b 100644
--- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
+++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
@@ -38,6 +38,7 @@ EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER 
*mExtractGetInfoHandlerTable = NULL;
 RETURN_STATUS
 EFIAPI
 ReallocateExtractHandlerTable (
+  VOID
   )
 { 
   //
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2 5/5] ShellPkg: Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 ShellPkg/Application/Shell/Shell.c   | 1 +
 ShellPkg/Application/Shell/ShellProtocol.c   | 2 ++
 ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 +
 3 files changed, 4 insertions(+)

diff --git a/ShellPkg/Application/Shell/Shell.c 
b/ShellPkg/Application/Shell/Shell.c
index 656206f..2adc992 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -726,6 +726,7 @@ FreeResources:
 **/
 EFI_STATUS
 SetBuiltInAlias(
+  VOID
   )
 {
   EFI_STATUS  Status;
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index 5e34b8d..dc3deee 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -1679,6 +1679,7 @@ InternalShellExecute(
 STATIC
 BOOLEAN
 NestingEnabled(
+  VOID
 )
 {
   EFI_STATUS  Status;
@@ -3286,6 +3287,7 @@ EfiShellIsRootShell(
 **/
 CHAR16 *
 InternalEfiShellGetListAlias(
+  VOID
   )
 {
   
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 25d3e33..677791c 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -369,6 +369,7 @@ ShellLibDestructor (
 EFI_STATUS
 EFIAPI
 ShellInitialize (
+  VOID
   )
 {
   EFI_STATUS Status;
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2 2/5] MdeModulePkg: Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 MdeModulePkg/Include/Library/PlatformVarCleanupLib.h| 1 +
 .../Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c | 1 +
 .../Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c | 2 ++
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c| 1 +
 MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c  | 1 +
 MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c  | 1 +
 MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 1 +
 7 files changed, 8 insertions(+)

diff --git a/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h 
b/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
index a4691f0..1d642f6 100644
--- a/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
+++ b/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
@@ -32,6 +32,7 @@ typedef enum {
 VAR_ERROR_FLAG
 EFIAPI
 GetLastBootVarErrorFlag (
+  VOID
   );
 
 /**
diff --git 
a/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
index 427adb8..c623e1e 100644
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
@@ -186,6 +186,7 @@ BrotliGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 BrotliDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c 
b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
index b96d786..aa4d93b 100644
--- a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
+++ b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
@@ -61,6 +61,7 @@ SECURITY2_INFO *mSecurity2Table  = NULL;
 RETURN_STATUS
 EFIAPI
 ReallocateSecurityHandlerTable (
+  VOID
   )
 {
   //
@@ -301,6 +302,7 @@ ExecuteSecurityHandlers (
 RETURN_STATUS
 EFIAPI
 ReallocateSecurity2HandlerTable (
+  VOID
   )
 {
   //
diff --git 
a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c 
b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
index ada9a80..b02dc51 100644
--- a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
@@ -207,6 +207,7 @@ LzmaArchGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaArchDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c 
b/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
index f19e0d2..7ef9fbb 100644
--- a/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
@@ -190,6 +190,7 @@ LzmaGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c 
b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
index c5fd30e..450b4b3 100644
--- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
+++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
@@ -1187,6 +1187,7 @@ Done:
 VAR_ERROR_FLAG
 EFIAPI
 GetLastBootVarErrorFlag (
+  VOID
   )
 {
   return mLastVarErrorFlag;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 901b35c..297741c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -751,6 +751,7 @@ PopExpression (
 **/
 UINTN
 SaveExpressionEvaluationStackOffset (
+  VOID
   )
 {
   UINTN TempStackOffset;
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2 4/5] NetworkPkg: Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c 
b/NetworkPkg/IScsiDxe/IScsiDriver.c
index fbeef97..a0ece3a 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -87,6 +87,7 @@ IScsiIsDevicePathSupported (
 **/
 EFI_STATUS
 IScsiCheckAip (
+  VOID
   )
 {
   UINTNAipHandleCount;
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2 1/5] IntelFrameworkModulePkg: Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 .../BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c  | 1 +
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c | 1 +
 .../Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c| 1 +
 3 files changed, 3 insertions(+)

diff --git 
a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
 
b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
index 5d64f02..cb009e7 100644
--- 
a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
+++ 
b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
@@ -1040,6 +1040,7 @@ TianoDecompress (
 RETURN_STATUS
 EFIAPI
 TianoDecompressLibConstructor (
+  VOID
 )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
index ada9a80..b02dc51 100644
--- 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
+++ 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
@@ -207,6 +207,7 @@ LzmaArchGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaArchDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
index f19e0d2..7ef9fbb 100644
--- 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
+++ 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
@@ -190,6 +190,7 @@ LzmaGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2 0/5] Fix MSFT C4255 warning

2017-11-09 Thread Song, BinX
V2:
Fix MSFT C4255 warning.
V1:
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
Bell Song (5):
  IntelFrameworkModulePkg: Fix MSFT C4255 warning
  MdeModulePkg: Fix MSFT C4255 warning
  MdePkg: Fix MSFT C4255 warning
  NetworkPkg: Fix MSFT C4255 warning
  ShellPkg: Fix MSFT C4255 warning

 .../BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c | 1 +
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c| 1 +
 .../Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c   | 1 +
 MdeModulePkg/Include/Library/PlatformVarCleanupLib.h| 1 +
 .../Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c | 1 +
 .../Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c | 2 ++
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c| 1 +
 MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c  | 1 +
 MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c  | 1 +
 MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 1 +
 MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c | 2 +-
 MdePkg/Library/BaseLib/X64/CpuBreakpoint.c  | 2 +-
 MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c  | 1 +
 NetworkPkg/IScsiDxe/IScsiDriver.c   | 1 +
 ShellPkg/Application/Shell/Shell.c  | 1 +
 ShellPkg/Application/Shell/ShellProtocol.c  | 2 ++
 ShellPkg/Library/UefiShellLib/UefiShellLib.c| 1 +
 17 files changed, 19 insertions(+), 2 deletions(-)

-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH 05/14] IntelFsp2WrapperPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Hi Jiewen,

Do you mean we fix the problem after enable MSFT C4255 warning?
If yes, I have fix them in related patch, such as MdeModulePkg.

Best Regards,
Bell Song


> -Original Message-
> From: Yao, Jiewen
> Sent: Tuesday, November 7, 2017 1:39 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: Gao, Liming <liming@intel.com>
> Subject: RE: [PATCH 05/14] IntelFsp2WrapperPkg: Enable MSFT C4255
> warning
> 
> Hi
> I suggest we fix the problem.
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Song,
> > BinX
> > Sent: Tuesday, November 7, 2017 1:35 PM
> > To: edk2-devel@lists.01.org
> > Cc: Gao, Liming <liming@intel.com>
> > Subject: [edk2] [PATCH 05/14] IntelFsp2WrapperPkg: Enable MSFT C4255
> warning
> >
> > Enable MSFT C4255 warning
> >
> > From MSDN:
> > Compiler Warning (level 4) C4255
> > function' : no function prototype given: converting '()' to '(void)'
> > The compiler did not find an explicit list of arguments to a function.
> > This warning is for the C compiler only.
> >
> > Cc: Liming Gao <liming@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> > b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> > index 6496dad..4b4d5b2 100644
> > --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> > +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> > @@ -95,3 +95,4 @@
> >
> >  [BuildOptions]
> >*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
> > +  MSFT:*_*_*_CC_FLAGS = /we4255
> > --
> > 2.10.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


[edk2] [PATCH 14/14] UefiCpuPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 UefiCpuPkg/UefiCpuPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
index 41cf809..a691ccc 100644
--- a/UefiCpuPkg/UefiCpuPkg.dsc
+++ b/UefiCpuPkg/UefiCpuPkg.dsc
@@ -156,3 +156,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 12/14] SignedCapsulePkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc 
b/SignedCapsulePkg/SignedCapsulePkg.dsc
index 7ea74d7..4d24db2 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -208,3 +208,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 13/14] SourceLevelDebugPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc 
b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
index d9b1b84..e17976d 100644
--- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
+++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
@@ -110,3 +110,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 07/14] MdePkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c| 2 +-
 MdePkg/Library/BaseLib/X64/CpuBreakpoint.c | 2 +-
 MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c | 1 +
 MdePkg/MdePkg.dsc  | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c 
b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
index f5df7f2..4f8c92d 100644
--- a/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c
@@ -19,7 +19,7 @@
   Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
 **/
 
-void __debugbreak ();
+void __debugbreak (VOID);
 
 #pragma intrinsic(__debugbreak)
 
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c 
b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
index d654f84..7d0cf4c 100644
--- a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
@@ -17,7 +17,7 @@
   Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
 **/
 
-void __debugbreak ();
+void __debugbreak (VOID);
 
 #pragma intrinsic(__debugbreak)
 
diff --git 
a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c 
b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
index 8b8e528..744201b 100644
--- a/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
+++ b/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c
@@ -38,6 +38,7 @@ EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER 
*mExtractGetInfoHandlerTable = NULL;
 RETURN_STATUS
 EFIAPI
 ReallocateExtractHandlerTable (
+  VOID
   )
 { 
   //
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 8f57263..9032836 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -189,3 +189,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 05/14] IntelFsp2WrapperPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
index 6496dad..4b4d5b2 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
@@ -95,3 +95,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 06/14] MdeModulePkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 MdeModulePkg/Include/Library/PlatformVarCleanupLib.h| 1 +
 .../Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c | 1 +
 .../Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c | 2 ++
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c| 1 +
 MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c  | 1 +
 MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c  | 1 +
 MdeModulePkg/MdeModulePkg.dsc   | 2 +-
 MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 1 +
 8 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h 
b/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
index a4691f0..1d642f6 100644
--- a/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
+++ b/MdeModulePkg/Include/Library/PlatformVarCleanupLib.h
@@ -32,6 +32,7 @@ typedef enum {
 VAR_ERROR_FLAG
 EFIAPI
 GetLastBootVarErrorFlag (
+  VOID
   );
 
 /**
diff --git 
a/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
index 427adb8..c623e1e 100644
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
@@ -186,6 +186,7 @@ BrotliGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 BrotliDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c 
b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
index b96d786..aa4d93b 100644
--- a/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
+++ b/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
@@ -61,6 +61,7 @@ SECURITY2_INFO *mSecurity2Table  = NULL;
 RETURN_STATUS
 EFIAPI
 ReallocateSecurityHandlerTable (
+  VOID
   )
 {
   //
@@ -301,6 +302,7 @@ ExecuteSecurityHandlers (
 RETURN_STATUS
 EFIAPI
 ReallocateSecurity2HandlerTable (
+  VOID
   )
 {
   //
diff --git 
a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c 
b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
index ada9a80..b02dc51 100644
--- a/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
@@ -207,6 +207,7 @@ LzmaArchGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaArchDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c 
b/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
index f19e0d2..7ef9fbb 100644
--- a/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
+++ b/MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
@@ -190,6 +190,7 @@ LzmaGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c 
b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
index c5fd30e..450b4b3 100644
--- a/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
+++ b/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c
@@ -1187,6 +1187,7 @@ Done:
 VAR_ERROR_FLAG
 EFIAPI
 GetLastBootVarErrorFlag (
+  VOID
   )
 {
   return mLastVarErrorFlag;
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index ad34254..e0becab 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -490,4 +490,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
-
+  MSFT:*_*_*_CC_FLAGS = /we4255
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 901b35c..297741c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -751,6 +751,7 @@ PopExpression (
 **/
 UINTN
 SaveExpressionEvaluationStackOffset (
+  VOID
   )
 {
   UINTN TempStackOffset;
-- 
2.10.2.windows.1

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


[edk2] [PATCH 04/14] IntelFsp2Pkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 IntelFsp2Pkg/IntelFsp2Pkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 1469d35..770cc01 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -80,3 +80,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 01/14] FatPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 FatPkg/FatPkg.dsc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/FatPkg/FatPkg.dsc b/FatPkg/FatPkg.dsc
index 841201c..243f547 100644
--- a/FatPkg/FatPkg.dsc
+++ b/FatPkg/FatPkg.dsc
@@ -85,3 +85,6 @@
 [Components]
   FatPkg/FatPei/FatPei.inf
   FatPkg/EnhancedFatDxe/Fat.inf
+
+[BuildOptions]
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 08/14] NetworkPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 1 +
 NetworkPkg/NetworkPkg.dsc | 1 +
 2 files changed, 2 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c 
b/NetworkPkg/IScsiDxe/IScsiDriver.c
index fbeef97..a0ece3a 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -87,6 +87,7 @@ IScsiIsDevicePathSupported (
 **/
 EFI_STATUS
 IScsiCheckAip (
+  VOID
   )
 {
   UINTNAipHandleCount;
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index b193f5f..f8c65cc 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -128,3 +128,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 11/14] ShellPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 ShellPkg/Application/Shell/Shell.c   | 1 +
 ShellPkg/Application/Shell/ShellProtocol.c   | 2 ++
 ShellPkg/Library/UefiShellLib/UefiShellLib.c | 1 +
 ShellPkg/ShellPkg.dsc| 1 +
 4 files changed, 5 insertions(+)

diff --git a/ShellPkg/Application/Shell/Shell.c 
b/ShellPkg/Application/Shell/Shell.c
index 5471930..4f84bb3 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -726,6 +726,7 @@ FreeResources:
 **/
 EFI_STATUS
 SetBuiltInAlias(
+  VOID
   )
 {
   EFI_STATUS  Status;
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index 5e34b8d..dc3deee 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -1679,6 +1679,7 @@ InternalShellExecute(
 STATIC
 BOOLEAN
 NestingEnabled(
+  VOID
 )
 {
   EFI_STATUS  Status;
@@ -3286,6 +3287,7 @@ EfiShellIsRootShell(
 **/
 CHAR16 *
 InternalEfiShellGetListAlias(
+  VOID
   )
 {
   
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 25d3e33..677791c 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -369,6 +369,7 @@ ShellLibDestructor (
 EFI_STATUS
 EFIAPI
 ShellInitialize (
+  VOID
   )
 {
   EFI_STATUS Status;
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index ed6ac43..d56edb7 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -133,3 +133,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 09/14] PcAtChipsetPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 PcAtChipsetPkg/PcAtChipsetPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc 
b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
index b740f00..19e892f 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
@@ -61,3 +61,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 10/14] SecurityPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 SecurityPkg/SecurityPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index bb7147e..a90914d 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -336,4 +336,4 @@
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:256
   INTEL:*_*_IA32_DLINK_FLAGS = /ALIGN:256
 *_*_*_CC_FLAGS   = -D DISABLE_NEW_DEPRECATED_INTERFACES
-
+   MSFT:*_*_*_CC_FLAGS   = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 02/14] IntelFrameworkModulePkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc  | 1 +
 .../BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c  | 1 +
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c | 1 +
 .../Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c| 1 +
 4 files changed, 4 insertions(+)

diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index a9a01aa..0cc6184 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -199,3 +199,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+  MSFT:*_*_*_CC_FLAGS = /we4255
diff --git 
a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
 
b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
index 5d64f02..cb009e7 100644
--- 
a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
+++ 
b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
@@ -1040,6 +1040,7 @@ TianoDecompress (
 RETURN_STATUS
 EFIAPI
 TianoDecompressLibConstructor (
+  VOID
 )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
index ada9a80..b02dc51 100644
--- 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
+++ 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c
@@ -207,6 +207,7 @@ LzmaArchGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaArchDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
diff --git 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
index f19e0d2..7ef9fbb 100644
--- 
a/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
+++ 
b/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c
@@ -190,6 +190,7 @@ LzmaGuidedSectionExtraction (
 EFI_STATUS
 EFIAPI
 LzmaDecompressLibConstructor (
+  VOID
   )
 {
   return ExtractGuidedSectionRegisterHandlers (
-- 
2.10.2.windows.1

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


[edk2] [PATCH 03/14] IntelFrameworkPkg: Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
 IntelFrameworkPkg/IntelFrameworkPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc 
b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
index 2985d38..c9940e4 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
@@ -72,4 +72,4 @@
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
-
+  MSFT:*_*_*_CC_FLAGS = /we4255
-- 
2.10.2.windows.1

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


[edk2] [PATCH 00/14] Enable MSFT C4255 warning

2017-11-06 Thread Song, BinX
Enable MSFT C4255 warning.

>From MSDN:
Compiler Warning (level 4) C4255
function' : no function prototype given: converting '()' to '(void)'
The compiler did not find an explicit list of arguments to a function.
This warning is for the C compiler only.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bell Song 
---
Bell Song (14):
  FatPkg: Enable MSFT C4255 warning
  IntelFrameworkModulePkg: Enable MSFT C4255 warning
  IntelFrameworkPkg: Enable MSFT C4255 warning
  IntelFsp2Pkg: Enable MSFT C4255 warning
  IntelFsp2WrapperPkg: Enable MSFT C4255 warning
  MdeModulePkg: Enable MSFT C4255 warning
  MdePkg: Enable MSFT C4255 warning
  NetworkPkg: Enable MSFT C4255 warning
  PcAtChipsetPkg: Enable MSFT C4255 warning
  SecurityPkg: Enable MSFT C4255 warning
  ShellPkg: Enable MSFT C4255 warning
  SignedCapsulePkg: Enable MSFT C4255 warning
  SourceLevelDebugPkg: Enable MSFT C4255 warning
  UefiCpuPkg: Enable MSFT C4255 warning

 FatPkg/FatPkg.dsc  | 3 +++
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc| 1 +
 .../BaseUefiTianoCustomDecompressLib.c | 1 +
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c   | 1 +
 .../Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c  | 1 +
 IntelFrameworkPkg/IntelFrameworkPkg.dsc| 2 +-
 IntelFsp2Pkg/IntelFsp2Pkg.dsc  | 1 +
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc| 1 +
 MdeModulePkg/Include/Library/PlatformVarCleanupLib.h   | 1 +
 .../Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c| 1 +
 .../Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c| 2 ++
 .../Library/LzmaCustomDecompressLib/F86GuidedSectionExtraction.c   | 1 +
 MdeModulePkg/Library/LzmaCustomDecompressLib/GuidedSectionExtraction.c | 1 +
 MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupLib.c | 1 +
 MdeModulePkg/MdeModulePkg.dsc  | 2 +-
 MdeModulePkg/Universal/SetupBrowserDxe/Expression.c| 1 +
 MdePkg/Library/BaseLib/Ia32/CpuBreakpoint.c| 2 +-
 MdePkg/Library/BaseLib/X64/CpuBreakpoint.c | 2 +-
 MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.c | 1 +
 MdePkg/MdePkg.dsc  | 1 +
 NetworkPkg/IScsiDxe/IScsiDriver.c  | 1 +
 NetworkPkg/NetworkPkg.dsc  | 1 +
 PcAtChipsetPkg/PcAtChipsetPkg.dsc  | 1 +
 SecurityPkg/SecurityPkg.dsc| 2 +-
 ShellPkg/Application/Shell/Shell.c | 1 +
 ShellPkg/Application/Shell/ShellProtocol.c | 2 ++
 ShellPkg/Library/UefiShellLib/UefiShellLib.c   | 1 +
 ShellPkg/ShellPkg.dsc  | 1 +
 SignedCapsulePkg/SignedCapsulePkg.dsc  | 1 +
 SourceLevelDebugPkg/SourceLevelDebugPkg.dsc| 1 +
 UefiCpuPkg/UefiCpuPkg.dsc  | 1 +
 31 files changed, 35 insertions(+), 5 deletions(-)

-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

2017-08-22 Thread Song, BinX
Got it, thanks.

Best Regards,
Bell Song

From: Yao, Jiewen
Sent: Wednesday, August 23, 2017 11:03 AM
To: Song, BinX <binx.s...@intel.com>; Gao, Liming <liming@intel.com>; 
Kinney, Michael D <michael.d.kin...@intel.com>; Kinney, Michael D 
<michael.d.kin...@intel.com>
Cc: edk2-devel@lists.01.org
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

Never mind.
If we agree to use "empty" in comment, I can update for you when I check in.

Thank you
Yao Jiewen

From: Song, BinX
Sent: Wednesday, August 23, 2017 11:02 AM
To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Gao, 
Liming <liming@intel.com<mailto:liming@intel.com>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>; Kinney, 
Michael D <michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

Hi Jiewen,

Do I need to update this patch?

Best Regards,
Bell Song

From: Yao, Jiewen
Sent: Wednesday, August 23, 2017 10:54 AM
To: Gao, Liming <liming@intel.com<mailto:liming@intel.com>>; Kinney, 
Michael D <michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>; 
Song, BinX <binx.s...@intel.com<mailto:binx.s...@intel.com>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

I checked existing code, we have below styles:
  MD4 Digest Wrapper Implementation which does not provide real capabilities.
  Null Base Debug Library instance with empty functions.
  A emptry template implementation of PCD Library.
  Base Performance Library which provides no service.

I think we can name it to be "empty functions", "empty implementation"

Thank you
Yao Jiewen

From: Gao, Liming
Sent: Wednesday, August 23, 2017 10:35 AM
To: Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>; Song, BinX 
<binx.s...@intel.com<mailto:binx.s...@intel.com>>; Yao, Jiewen 
<jiewen@intel.com<mailto:jiewen@intel.com>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

Mike:
  TempRamInitApi() is referred in 
Library\SecFspSecPlatformLibNull\Ia32\Flat32.nasm. FspSecCoreM, FspSecCoreS and 
FspSecCoreT all link this library.

  How about describe this function as the empty implementation?

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Kinney, Michael D
>Sent: Wednesday, August 23, 2017 6:27 AM
>To: Song, BinX <binx.s...@intel.com<mailto:binx.s...@intel.com>>; Yao, Jiewen 
><jiewen@intel.com<mailto:jiewen@intel.com>>;
>Kinney, Michael D 
><michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
>Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
>Subject: Re: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with
>WHOLEARCHIVE option
>
>Bell Song,
>
>Why is it documented as a "Dummy" function?
>
>There must be a reference to this symbol somewhere or it would
>not generate a link error.  The implementation is an empty
>function.  Is that a better way to describe this function?
>
>Mike
>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
>> Behalf Of Song, BinX
>> Sent: Sunday, August 20, 2017 11:35 PM
>> To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>
>> Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
>> Subject: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with
>> WHOLEARCHIVE option
>>
>> V2:
>> - Recover TempRamInitApi API and add dummy TempRamInitApi
>> function to fix
>>   build error with WHOLEARCHIVE option
>>
>> V1:
>> - Delete useless external TempRamInitApi API to fix
>> /WHOLEARCHIVE build
>>   error with VS2015 tool chain
>>
>> Cc: Jiewen Yao <jiewen@intel.com<mailto:jiewen@intel.com>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Bell Song <binx.s...@intel.com<mailto:binx.s...@intel.com>>
>> ---
>>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm | 10 ++
>>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | 10 ++
>>  2 fi

Re: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

2017-08-22 Thread Song, BinX
Hi Jiewen,

Do I need to update this patch?

Best Regards,
Bell Song

From: Yao, Jiewen
Sent: Wednesday, August 23, 2017 10:54 AM
To: Gao, Liming <liming@intel.com>; Kinney, Michael D 
<michael.d.kin...@intel.com>; Song, BinX <binx.s...@intel.com>; Kinney, Michael 
D <michael.d.kin...@intel.com>
Cc: edk2-devel@lists.01.org
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

I checked existing code, we have below styles:
  MD4 Digest Wrapper Implementation which does not provide real capabilities.
  Null Base Debug Library instance with empty functions.
  A emptry template implementation of PCD Library.
  Base Performance Library which provides no service.

I think we can name it to be "empty functions", "empty implementation"

Thank you
Yao Jiewen

From: Gao, Liming
Sent: Wednesday, August 23, 2017 10:35 AM
To: Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>; Song, BinX 
<binx.s...@intel.com<mailto:binx.s...@intel.com>>; Yao, Jiewen 
<jiewen@intel.com<mailto:jiewen@intel.com>>; Kinney, Michael D 
<michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

Mike:
  TempRamInitApi() is referred in 
Library\SecFspSecPlatformLibNull\Ia32\Flat32.nasm. FspSecCoreM, FspSecCoreS and 
FspSecCoreT all link this library.

  How about describe this function as the empty implementation?

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Kinney, Michael D
>Sent: Wednesday, August 23, 2017 6:27 AM
>To: Song, BinX <binx.s...@intel.com<mailto:binx.s...@intel.com>>; Yao, Jiewen 
><jiewen@intel.com<mailto:jiewen@intel.com>>;
>Kinney, Michael D 
><michael.d.kin...@intel.com<mailto:michael.d.kin...@intel.com>>
>Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
>Subject: Re: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with
>WHOLEARCHIVE option
>
>Bell Song,
>
>Why is it documented as a "Dummy" function?
>
>There must be a reference to this symbol somewhere or it would
>not generate a link error.  The implementation is an empty
>function.  Is that a better way to describe this function?
>
>Mike
>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On
>> Behalf Of Song, BinX
>> Sent: Sunday, August 20, 2017 11:35 PM
>> To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>
>> Cc: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
>> Subject: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with
>> WHOLEARCHIVE option
>>
>> V2:
>> - Recover TempRamInitApi API and add dummy TempRamInitApi
>> function to fix
>>   build error with WHOLEARCHIVE option
>>
>> V1:
>> - Delete useless external TempRamInitApi API to fix
>> /WHOLEARCHIVE build
>>   error with VS2015 tool chain
>>
>> Cc: Jiewen Yao <jiewen@intel.com<mailto:jiewen@intel.com>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Bell Song <binx.s...@intel.com<mailto:binx.s...@intel.com>>
>> ---
>>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm | 10 ++
>>  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | 10 ++
>>  2 files changed, 20 insertions(+)
>>
>> diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
>> b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
>> index 9744e16..81b531e 100644
>> --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
>> +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
>> @@ -195,6 +195,16 @@ ASM_PFX(AsmGetPeiCoreOffset):
>> ret
>>
>>  ;--
>> --
>> +; TempRamInit API
>> +;
>> +; Dummy function for VS2015 WHOLEARCHIVE build option
>> +;
>> +;--
>> --
>> +global ASM_PFX(TempRamInitApi)
>> +ASM_PFX(TempRamInitApi):
>> +  ret
>> +
>> +;--
>> --
>>  ; Module Entrypoint API
>>  ;--
>> --
>>  global ASM_PFX(_ModuleEntryPoint)
>> diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
>> b/IntelFs

[edk2] [PATCH V3] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

2017-08-21 Thread Song, BinX
V3:
- Update dummy TempRamInitApi function and remove unnecessary info

V2:
- Recover TempRamInitApi API and add dummy TempRamInitApi function to fix
  build error with WHOLEARCHIVE option

V1:
- Delete useless external TempRamInitApi API to fix /WHOLEARCHIVE build
  error

Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm | 11 +++
 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | 11 +++
 2 files changed, 22 insertions(+)

diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
index 9744e16..6833ca3 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
@@ -195,6 +195,17 @@ ASM_PFX(AsmGetPeiCoreOffset):
ret
 
 ;
+; TempRamInit API
+;
+; Dummy function for WHOLEARCHIVE build option
+;
+;
+global ASM_PFX(TempRamInitApi)
+ASM_PFX(TempRamInitApi):
+  jmp $
+  ret
+
+;
 ; Module Entrypoint API
 ;
 global ASM_PFX(_ModuleEntryPoint)
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
index cdc1149..80678dd 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
@@ -54,6 +54,17 @@ ASM_PFX(FspApiCommonContinue):
   ret
 
 ;
+; TempRamInit API
+;
+; Dummy function for WHOLEARCHIVE build option
+;
+;
+global ASM_PFX(TempRamInitApi)
+ASM_PFX(TempRamInitApi):
+  jmp $
+  ret
+
+;
 ; Module Entrypoint API
 ;
 global ASM_PFX(_ModuleEntryPoint)
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

2017-08-21 Thread Song, BinX
Hi Jiewen,

Yes, I will update.

Best Regards,
Bell Song


> -Original Message-
> From: Yao, Jiewen
> Sent: Monday, August 21, 2017 4:26 PM
> To: Song, BinX <binx.s...@intel.com>
> Cc: edk2-devel@lists.01.org
> Subject: RE: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE
> option
> 
> Hi
> Can we add "JMP $" before ret for the empty function?
> 
> It is to prevent the empty function is linked by mistake.
> 
> Thank you
> Yao Jiewen
> 
> > -Original Message-
> > From: Song, BinX
> > Sent: Monday, August 21, 2017 2:35 PM
> > To: Yao, Jiewen <jiewen@intel.com>
> > Cc: edk2-devel@lists.01.org
> > Subject: [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option
> >
> > V2:
> > - Recover TempRamInitApi API and add dummy TempRamInitApi function to
> fix
> >   build error with WHOLEARCHIVE option
> >
> > V1:
> > - Delete useless external TempRamInitApi API to fix /WHOLEARCHIVE build
> >   error with VS2015 tool chain
> >
> > Cc: Jiewen Yao <jiewen@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm | 10 ++
> >  IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | 10 ++
> >  2 files changed, 20 insertions(+)
> >
> > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
> > b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
> > index 9744e16..81b531e 100644
> > --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
> > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
> > @@ -195,6 +195,16 @@ ASM_PFX(AsmGetPeiCoreOffset):
> > ret
> >
> >  
> > ;
> > +; TempRamInit API
> > +;
> > +; Dummy function for VS2015 WHOLEARCHIVE build option
> > +;
> > +;
> > +global ASM_PFX(TempRamInitApi)
> > +ASM_PFX(TempRamInitApi):
> > +  ret
> > +
> > +;
> >  ; Module Entrypoint API
> >  
> > ;
> >  global ASM_PFX(_ModuleEntryPoint)
> > diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
> > b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
> > index cdc1149..06a791f 100644
> > --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
> > +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
> > @@ -54,6 +54,16 @@ ASM_PFX(FspApiCommonContinue):
> >ret
> >
> >  
> > ;
> > +; TempRamInit API
> > +;
> > +; Dummy function for VS2015 WHOLEARCHIVE build option
> > +;
> > +;
> > +global ASM_PFX(TempRamInitApi)
> > +ASM_PFX(TempRamInitApi):
> > +  ret
> > +
> > +;
> >  ; Module Entrypoint API
> >  
> > ;
> >  global ASM_PFX(_ModuleEntryPoint)
> > --
> > 2.10.2.windows.1

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


[edk2] [PATCH V2] IntelFsp2Pkg: Fix build error with WHOLEARCHIVE option

2017-08-21 Thread Song, BinX
V2: 
- Recover TempRamInitApi API and add dummy TempRamInitApi function to fix
  build error with WHOLEARCHIVE option

V1:
- Delete useless external TempRamInitApi API to fix /WHOLEARCHIVE build
  error with VS2015 tool chain

Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm | 10 ++
 IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm | 10 ++
 2 files changed, 20 insertions(+)

diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
index 9744e16..81b531e 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
@@ -195,6 +195,16 @@ ASM_PFX(AsmGetPeiCoreOffset):
ret
 
 ;
+; TempRamInit API
+;
+; Dummy function for VS2015 WHOLEARCHIVE build option
+;
+;
+global ASM_PFX(TempRamInitApi)
+ASM_PFX(TempRamInitApi):
+  ret
+
+;
 ; Module Entrypoint API
 ;
 global ASM_PFX(_ModuleEntryPoint)
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
index cdc1149..06a791f 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryS.nasm
@@ -54,6 +54,16 @@ ASM_PFX(FspApiCommonContinue):
   ret
 
 ;
+; TempRamInit API
+;
+; Dummy function for VS2015 WHOLEARCHIVE build option
+;
+;
+global ASM_PFX(TempRamInitApi)
+ASM_PFX(TempRamInitApi):
+  ret
+
+;
 ; Module Entrypoint API
 ;
 global ASM_PFX(_ModuleEntryPoint)
-- 
2.10.2.windows.1

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


[edk2] [PATCH] MdeModulePkg: Delete useless case code

2017-08-02 Thread Song, BinX
- Delete useless case code to fix /WHOLEARCHIVE build
  error with VS2015 tool chain

Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 .../Universal/RegularExpressionDxe/Oniguruma/reggnu.c|  9 -
 .../Universal/RegularExpressionDxe/Oniguruma/regposix.c  | 12 
 2 files changed, 21 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
index 1b52328..7fa5819 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
@@ -151,15 +151,6 @@ re_mbcinit(int mb_code)
   case RE_MBCTYPE_ASCII:
 enc = ONIG_ENCODING_ASCII;
 break;
-  case RE_MBCTYPE_EUC:
-enc = ONIG_ENCODING_EUC_JP;
-break;
-  case RE_MBCTYPE_SJIS:
-enc = ONIG_ENCODING_SJIS;
-break;
-  case RE_MBCTYPE_UTF8:
-enc = ONIG_ENCODING_UTF8;
-break;
   default:
 return ;
 break;
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
index 06cad48..cfca25e 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
@@ -238,18 +238,6 @@ reg_set_encoding(int mb_code)
   case REG_POSIX_ENCODING_ASCII:
 enc = ONIG_ENCODING_ASCII;
 break;
-  case REG_POSIX_ENCODING_EUC_JP:
-enc = ONIG_ENCODING_EUC_JP;
-break;
-  case REG_POSIX_ENCODING_SJIS:
-enc = ONIG_ENCODING_SJIS;
-break;
-  case REG_POSIX_ENCODING_UTF8:
-enc = ONIG_ENCODING_UTF8;
-break;
-  case REG_POSIX_ENCODING_UTF16_BE:
-enc = ONIG_ENCODING_UTF16_BE;
-break;
   case REG_POSIX_ENCODING_UTF16_LE:
 enc = ONIG_ENCODING_UTF16_LE;
 break;
-- 
2.10.2.windows.1

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


[edk2] [PATCH] MdeModulePkg: Delete never touched code

2017-08-02 Thread Song, BinX
- Delete never touched code

Cc: Star Zeng 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c   | 3 +--
 MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
index 7fa5819..f9af9ca 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/reggnu.c
@@ -152,8 +152,7 @@ re_mbcinit(int mb_code)
 enc = ONIG_ENCODING_ASCII;
 break;
   default:
-return ;
-break;
+return;
   }
 
   onigenc_set_default_encoding(enc);
diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
index cfca25e..299b88c 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposix.c
@@ -243,8 +243,7 @@ reg_set_encoding(int mb_code)
 break;
 
   default:
-return ;
-break;
+return;
   }
 
   onigenc_set_default_encoding(enc);
-- 
2.10.2.windows.1

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


[edk2] [PATCH] IntelFsp2Pkg: Delete useless external TempRamInitApi API

2017-08-02 Thread Song, BinX
- Delete useless external TempRamInitApi API to fix /WHOLEARCHIVE build 
  error with VS2015 tool chain

Cc: Jiewen Yao 
Cc: Giri P Mudusuru 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm 
b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm
index 122eb9e..ee78312 100644
--- a/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm
+++ b/IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/Ia32/Flat32.nasm
@@ -16,8 +16,6 @@
 ; Define assembler characteristics
 ;
 
-extern   ASM_PFX(TempRamInitApi)
-
 SECTION .text
 
 %macro RET_ESI  0
@@ -66,11 +64,6 @@ ASM_PFX(SecPlatformInit):
 ;
 global ASM_PFX(ProtectedModeEntryPoint)
 ASM_PFX(ProtectedModeEntryPoint):
-  ;
-  ; Dummy function. Consume 2 API to make sure they can be linked.
-  ;
-  mov  eax, ASM_PFX(TempRamInitApi)
-
   ; Should never return
   jmp  $
 
-- 
2.10.2.windows.1

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


[edk2] [PATCH] ShellPkg: Update header file including style

2017-08-02 Thread Song, BinX
- Update header file including style to avoid MSDN C4464 warning

Cc: Jaben Carsey 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c  | 2 +-
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c | 2 +-
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 2 +-
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c| 2 +-
 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c| 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
index 50ba048..b40276d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
@@ -12,7 +12,7 @@
 
 **/
 
-#include "../UefiShellDebug1CommandsLib.h"
+#include "UefiShellDebug1CommandsLib.h"
 #include "PrintInfo.h"
 #include "QueryTable.h"
 #include "EventLogInfo.h"
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
index 6920263..edfdcc9 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
@@ -13,7 +13,7 @@
 **/
 
 
-#include "../UefiShellDebug1CommandsLib.h"
+#include "UefiShellDebug1CommandsLib.h"
 #include 
 #include "LibSmbiosView.h"
 #include "SmbiosView.h"
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 038f111..7a75554 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -14,7 +14,7 @@
 
 **/
 
-#include "../UefiShellDebug1CommandsLib.h"
+#include "UefiShellDebug1CommandsLib.h"
 #include "PrintInfo.h"
 #include "LibSmbiosView.h"
 #include "QueryTable.h"
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index afea429..3c561ad 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -14,7 +14,7 @@
 
 **/
 
-#include "../UefiShellDebug1CommandsLib.h"
+#include "UefiShellDebug1CommandsLib.h"
 #include "QueryTable.h"
 #include "PrintInfo.h"
 
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
index a5b16fe..6e7c763 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
@@ -13,7 +13,7 @@
 
 **/
 
-#include "../UefiShellDebug1CommandsLib.h"
+#include "UefiShellDebug1CommandsLib.h"
 #include "LibSmbiosView.h"
 #include "SmbiosView.h"
 #include "PrintInfo.h"
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH v2] MdeModulePkg BrotliLib: Fix the regression logic issue in loop

2017-04-13 Thread Song, BinX
Reviewed-by:  Bell Song <binx.s...@intel.com>

Best Regards,
Bell Song

> -Original Message-
> From: Gao, Liming
> Sent: Friday, April 14, 2017 10:00 AM
> To: edk2-devel@lists.01.org
> Cc: Song, BinX <binx.s...@intel.com>
> Subject: [PATCH v2] MdeModulePkg BrotliLib: Fix the regression logic issue in
> loop
> 
> In V2, change logic to avoid use mtf[-1] style to get value.
> 
> Roll back to previous logic, and use point + offset to get byte value.
> 
> Cc: Bell Song <binx.s...@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming@intel.com>
> ---
>  MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
> b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
> index 67f0ff2..6557ba6 100644
> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
> +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
> @@ -855,6 +855,7 @@ static BROTLI_NOINLINE void
> InverseMoveToFrontTransform(
>uint32_t i = 4;
>uint32_t upper_bound = state->mtf_upper_bound;
>uint8_t* mtf = >mtf[4];  /* Make mtf[-1] addressable. */
> +  uint8_t* mtft = >mtf[3];
>/* Load endian-aware constant. */
>const uint8_t b0123[4] = {0, 1, 2, 3};
>uint32_t pattern;
> @@ -875,10 +876,10 @@ static BROTLI_NOINLINE void
> InverseMoveToFrontTransform(
>  uint8_t value = mtf[index];
>  upper_bound |= (uint32_t)v[i];
>  v[i] = value;
> -mtf[-1] = value;
> -while (index > 0) {
> +mtft[0] = value;
> +while (index >= 0) {
> +  mtft[index + 1] = mtft[index];
>index--;
> -  mtf[index + 1] = mtf[index];
>  }
>}
>/* Remember amount of elements to be reinitialized. */
> --
> 2.8.0.windows.1

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


[edk2] [PATCH] BaseTools: Sync BrotliCompress script the same style

2017-04-13 Thread Song, BinX
- Sync BrotliCompress script the same style with BrotliCompress.bat

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/BrotliCompress | 55 +++---
 1 file changed, 32 insertions(+), 23 deletions(-)

diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
index 49358b2..ca32d6a 100755
--- a/BaseTools/BinWrappers/PosixLike/BrotliCompress
+++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress
@@ -14,39 +14,48 @@
 QLT="-q 9"
 INPUTFLAG=0
 
-while [ $# != 0 ];do
-  case $1 in
--d)
+for arg; do
+  if [ $1 = -d ]
+then
   INPUTFLAG=1
-  ARGS+="$1 "
-;;
--e)
+  fi
+  if [ $1 = -e ]
+then
   INPUTFLAG=1
-;;
--g)
+  shift
+  continue;
+  fi
+  if [ $1 = -g ]
+then
   ARGS+="$1 $2 "
   shift
-;;
--o)
+  shift
+  continue;
+  fi
+  if [ $1 = -o ]
+then
   ARGS+="$1 $2 "
   shift
-;;
--q)
+  shift
+  continue;
+  fi
+  if [ $1 = -q ]
+then
   QLT="$1 $2 "
   shift
-;;
-*)
-  if [ $INPUTFLAG -eq 1 ]
-  then
-if [ -z $2 ]
-  then
-ARGS+="$QLT -i $1 "
-break;
-fi
+  shift
+  continue;
+  fi
+  if [ $INPUTFLAG -eq 1 ]
+then
+  if [ -z $2 ]
+then
+  ARGS+="$QLT -i $1 "
+  break;
   fi
-  ARGS+="$1 "
-  esac
+  fi
 
+ARGS+="$1 "
 shift
 done
 
-- 
2.10.2.windows.1

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


[edk2] [PATCH] BaseTools: Add --version option in Brotli and BrotliCompress

2017-04-12 Thread Song, BinX
https://bugzilla.tianocore.org/show_bug.cgi?id=464
V2:
- Add build version

V1:
- Add --version option in Brotli and BrotliCompress

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/BrotliCompress | 29 ++---
 .../Source/C/BrotliCompress/BrotliCompress.bat | 30 +-
 BaseTools/Source/C/BrotliCompress/tools/bro.c  | 18 -
 3 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
index 59c6465..49358b2 100755
--- a/BaseTools/BinWrappers/PosixLike/BrotliCompress
+++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress
@@ -11,32 +11,43 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #
-LVL="--quality 9"
+QLT="-q 9"
+INPUTFLAG=0
 
 while [ $# != 0 ];do
   case $1 in
 -d)
-  ARGS+="--decompress "
+  INPUTFLAG=1
+  ARGS+="$1 "
 ;;
 -e)
+  INPUTFLAG=1
 ;;
 -g)
-  ARGS+="--gap $2 "
+  ARGS+="$1 $2 "
   shift
 ;;
--l)
-  LVL="--quality $2 "
+-o)
+  ARGS+="$1 $2 "
   shift
 ;;
--o)
-  ARGS+="--output $2 "
+-q)
+  QLT="$1 $2 "
   shift
 ;;
 *)
-  ARGS+="--input $1 "
+  if [ $INPUTFLAG -eq 1 ]
+  then
+if [ -z $2 ]
+  then
+ARGS+="$QLT -i $1 "
+break;
+fi
+  fi
+  ARGS+="$1 "
   esac
 
 shift
 done
 
-exec Brotli $ARGS $LVL
+exec Brotli $ARGS
diff --git a/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat 
b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
index 257bf1e..b291ff0 100644
--- a/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
+++ b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
@@ -14,48 +14,54 @@
 @echo off
 @setlocal
 
-set LVL=--quality 9
+set QLT=-q 9
+set INPUTFLAG=0
 
 :Begin
 if "%1"=="" goto End
 
 if "%1"=="-d" (
-  set ARGS=%ARGS% --decompress
-  shift
-  goto Begin
+  set INPUTFLAG=1
 )
 
 if "%1"=="-e" (
+  set INPUTFLAG=1
   shift
   goto Begin
 )
 
 if "%1"=="-g" (
-  set ARGS=%ARGS% --gap %2
+  set ARGS=%ARGS% %1 %2
   shift
   shift
   goto Begin
 )
 
-if "%1"=="-l" (
-  set LVL=--quality %2
+if "%1"=="-o" (
+  set ARGS=%ARGS% %1 %2
   shift
   shift
   goto Begin
 )
 
-if "%1"=="-o" (
-  set ARGS=%ARGS% --output %2
-  set INTMP=%2
+if "%1"=="-q" (
+  set QLT=%1 %2
   shift
   shift
   goto Begin
 )
 
-set ARGS=%ARGS% --input %1
+if %INPUTFLAG%==1 (
+ if "%2"=="" (
+set ARGS=%ARGS% %QLT% -i %1
+goto End
+  )
+)
+
+set ARGS=%ARGS% %1
 shift
 goto Begin
 
 :End
-Brotli %ARGS% %LVL%
+Brotli %ARGS%
 @echo on
diff --git a/BaseTools/Source/C/BrotliCompress/tools/bro.c 
b/BaseTools/Source/C/BrotliCompress/tools/bro.c
index 2fa9f05..ef4592d 100644
--- a/BaseTools/Source/C/BrotliCompress/tools/bro.c
+++ b/BaseTools/Source/C/BrotliCompress/tools/bro.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "../dec/decode.h"
 #include "../enc/encode.h"
@@ -67,6 +68,11 @@ static int ParseQuality(const char* s, int* quality) {
   return 0;
 }
 
+#define UTILITY_NAME  "Brotli"
+#define UTILITY_MAJOR_VERSION 0
+#define UTILITY_MINOR_VERSION 5
+#define UTILITY_REVERSION 2
+
 static void ParseArgv(int argc, char **argv,
   char **input_path,
   char **output_path,
@@ -110,6 +116,15 @@ static void ParseArgv(int argc, char **argv,
   }
   *verbose = 1;
   continue;
+} else if (!strcmp("--version", argv[k])) {
+  fprintf(stderr,
+  "%s Version %d.%d.%d %s\n",
+  UTILITY_NAME,
+  UTILITY_MAJOR_VERSION,
+  UTILITY_MINOR_VERSION,
+  UTILITY_REVERSION,
+  __BUILD_VERSION);
+  exit(1);
 }
 if (k < argc - 1) {
   if (!strcmp("--input", argv[k]) ||
@@ -177,7 +192,8 @@ error:
   fprintf(stderr,
   "Usage: %s [--force] [--quality n] [--gap n] [--decompress]"
   " [--input filename] [--output filename] [--repeat iters]"
-  " [--verbose] [--window n] [--custom-dictionary filename]\n",
+  " [--verbose] [--window n] [--custom-dictionary filename]"
+  " [--version]\n",
   argv[0]);
   exit(1);
 }
-- 
2.10.2.windows.1

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


[edk2] [PATCH] BaseTools: Add --version option in Brotli and BrotliCompress

2017-04-07 Thread Song, BinX
https://bugzilla.tianocore.org/show_bug.cgi?id=464
- Add --version option in Brotli and BrotliCompress

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/BrotliCompress   | 3 +++
 BaseTools/Source/C/BrotliCompress/BrotliCompress.bat | 6 ++
 BaseTools/Source/C/BrotliCompress/tools/bro.c| 8 +++-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
index 59c6465..f7a2079 100755
--- a/BaseTools/BinWrappers/PosixLike/BrotliCompress
+++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress
@@ -32,6 +32,9 @@ while [ $# != 0 ];do
   ARGS+="--output $2 "
   shift
 ;;
+--version)
+  ARGS+="$1 "
+;;
 *)
   ARGS+="--input $1 "
   esac
diff --git a/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat 
b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
index 257bf1e..5949782 100644
--- a/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
+++ b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
@@ -52,6 +52,12 @@ if "%1"=="-o" (
   goto Begin
 )
 
+if "%1"=="--version" (
+  set ARGS=%ARGS% %1
+  shift
+  goto Begin
+)
+
 set ARGS=%ARGS% --input %1
 shift
 goto Begin
diff --git a/BaseTools/Source/C/BrotliCompress/tools/bro.c 
b/BaseTools/Source/C/BrotliCompress/tools/bro.c
index 2fa9f05..df54738 100644
--- a/BaseTools/Source/C/BrotliCompress/tools/bro.c
+++ b/BaseTools/Source/C/BrotliCompress/tools/bro.c
@@ -67,6 +67,8 @@ static int ParseQuality(const char* s, int* quality) {
   return 0;
 }
 
+#define BRO_VER  "0.5.2"
+
 static void ParseArgv(int argc, char **argv,
   char **input_path,
   char **output_path,
@@ -110,6 +112,9 @@ static void ParseArgv(int argc, char **argv,
   }
   *verbose = 1;
   continue;
+} else if (!strcmp("--version", argv[k])) {
+  fprintf(stderr, "Brotli Version %s\n", BRO_VER);
+  exit(1);
 }
 if (k < argc - 1) {
   if (!strcmp("--input", argv[k]) ||
@@ -177,7 +182,8 @@ error:
   fprintf(stderr,
   "Usage: %s [--force] [--quality n] [--gap n] [--decompress]"
   " [--input filename] [--output filename] [--repeat iters]"
-  " [--verbose] [--window n] [--custom-dictionary filename]\n",
+  " [--verbose] [--window n] [--custom-dictionary filename]"
+  " [--version]\n",
   argv[0]);
   exit(1);
 }
-- 
2.10.2.windows.1

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


[edk2] [PATCH] MdeModulePkg: Fix BrotliCustomDecompressLib potential issue

2017-04-07 Thread Song, BinX
- Fix BrotliCustomDecompressLib potential issue

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 .../Library/BrotliCustomDecompressLib/BrotliDecompress.c |  1 +
 MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c  | 12 
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
index 2c2648a..a303921 100644
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
@@ -126,6 +126,7 @@ BrotliDecompress (
   BrotliState *  BroState;
   VOID * Temp;
 
+  TotalOut = 0;
   AvailableOut = FILE_BUFFER_SIZE;
   Result = BROTLI_RESULT_ERROR;
   BroState = BrotliCreateState(BrAlloc, BrFree, BuffInfo);
diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
index 1ebab3c..c49fab9 100644
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/dec/decode.c
@@ -802,6 +802,7 @@ static BROTLI_INLINE uint32_t ReadBlockLength(const 
HuffmanCode* table,
   uint32_t code;
   uint32_t nbits;
   code = ReadSymbol(table, br);
+  if (code >= BROTLI_NUM_BLOCK_LEN_SYMBOLS) code = 
BROTLI_NUM_BLOCK_LEN_SYMBOLS - 1;
   nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */
   return kBlockLengthPrefixCode[code].offset + BrotliReadBits(br, nbits);
 }
@@ -872,13 +873,13 @@ static BROTLI_NOINLINE void InverseMoveToFrontTransform(
   for (i = 0; i < v_len; ++i) {
 int index = v[i];
 uint8_t value = mtf[index];
-upper_bound |= v[i];
+upper_bound |= (uint32_t)v[i];
 v[i] = value;
 mtf[-1] = value;
-do {
+while (index > 0) {
   index--;
   mtf[index + 1] = mtf[index];
-} while (index >= 0);
+}
   }
   /* Remember amount of elements to be reinitialized. */
   state->mtf_upper_bound = upper_bound;
@@ -1498,6 +1499,7 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal(
   return BROTLI_FALSE;
 }
   }
+  if (cmd_code >= BROTLI_NUM_COMMAND_SYMBOLS) cmd_code = 
BROTLI_NUM_COMMAND_SYMBOLS - 1;
   v = kCmdLut[cmd_code];
   s->distance_code = v.distance_code;
   s->distance_context = v.context;
@@ -2209,7 +2211,9 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
 }
 s->max_distance = s->max_backward_distance;
 if (s->state == BROTLI_STATE_COMMAND_POST_WRITE_1) {
-  memcpy(s->ringbuffer, s->ringbuffer_end, (size_t)s->pos);
+  if (s->ringbuffer != 0) {
+memcpy(s->ringbuffer, s->ringbuffer_end, (size_t)s->pos);
+  }
   if (s->meta_block_remaining_len == 0) {
 /* Next metablock, if any */
 s->state = BROTLI_STATE_METABLOCK_DONE;
-- 
2.10.2.windows.1

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


[edk2] [PATCH] MdeModulePkg: Fix GCC48/GCC49 build error

2017-04-01 Thread Song, BinX
- Fix GCC48/GCC49 build error

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 .../Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf| 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
index 578f97f..4c9aff5 100644
--- 
a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
+++ 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
@@ -54,3 +54,6 @@
   DebugLib
   BaseMemoryLib
   ExtractGuidedSectionLib
+
+[BuildOptions]
+  GCC:*_*_*_CC_FLAGS = -fno-builtin
-- 
2.10.2.windows.1

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


[edk2] [PATCH V2] BaseTools: Update Brotli and BrotliCompress mode and format

2017-03-30 Thread Song, BinX
V2:
- Update correct patch info

V1:
- Add x mode for Brotli and BrotliCompress
- Change Brotli and BrotliCompress format from DOS to UNIX

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/Brotli | 58 +-
 BaseTools/BinWrappers/PosixLike/BrotliCompress | 84 +-
 2 files changed, 71 insertions(+), 71 deletions(-)
 mode change 100644 => 100755 BaseTools/BinWrappers/PosixLike/Brotli
 mode change 100644 => 100755 BaseTools/BinWrappers/PosixLike/BrotliCompress

diff --git a/BaseTools/BinWrappers/PosixLike/Brotli 
b/BaseTools/BinWrappers/PosixLike/Brotli
old mode 100644
new mode 100755
index a244ecc..0945d86
--- a/BaseTools/BinWrappers/PosixLike/Brotli
+++ b/BaseTools/BinWrappers/PosixLike/Brotli
@@ -1,29 +1,29 @@
-#!/usr/bin/env bash
-
-full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a 
discussion of why $0 is not a good choice here
-dir=$(dirname "$full_cmd")
-cmd=${full_cmd##*/}
-
-if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]
-then
-  exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"
-elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]
-then
-  if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]
-  then
-echo "BaseTools C Tool binary was not found ($cmd)"
-echo "You may need to run:"
-echo "  make -C $EDK_TOOLS_PATH/Source/C"
-  else
-exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"
-  fi
-elif [ -e "$dir/../../Source/C/bin/$cmd" ]
-then
-  exec "$dir/../../Source/C/bin/$cmd" "$@"
-else
-  echo "Unable to find the real '$cmd' to run"
-  echo "This message was printed by"
-  echo "  $0"
-  exit 127
-fi
-
+#!/usr/bin/env bash
+
+full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a 
discussion of why $0 is not a good choice here
+dir=$(dirname "$full_cmd")
+cmd=${full_cmd##*/}
+
+if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]
+then
+  exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"
+elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]
+then
+  if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]
+  then
+echo "BaseTools C Tool binary was not found ($cmd)"
+echo "You may need to run:"
+echo "  make -C $EDK_TOOLS_PATH/Source/C"
+  else
+exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"
+  fi
+elif [ -e "$dir/../../Source/C/bin/$cmd" ]
+then
+  exec "$dir/../../Source/C/bin/$cmd" "$@"
+else
+  echo "Unable to find the real '$cmd' to run"
+  echo "This message was printed by"
+  echo "  $0"
+  exit 127
+fi
+
diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
old mode 100644
new mode 100755
index a571ff6..59c6465
--- a/BaseTools/BinWrappers/PosixLike/BrotliCompress
+++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress
@@ -1,42 +1,42 @@
-#!/usr/bin/env bash
-#
-# This script will exec Brotli tool.
-#
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD 
License
-# which accompanies this distribution.  The full text of the license may be 
found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-LVL="--quality 9"
-
-while [ $# != 0 ];do
-  case $1 in
--d)
-  ARGS+="--decompress "
-;;
--e)
-;;
--g)
-  ARGS+="--gap $2 "
-  shift
-;;
--l)
-  LVL="--quality $2 "
-  shift
-;;
--o)
-  ARGS+="--output $2 "
-  shift
-;;
-*)
-  ARGS+="--input $1 "
-  esac
-
-shift
-done
-
-exec Brotli $ARGS $LVL
+#!/usr/bin/env bash
+#
+# This script will exec Brotli tool.
+#
+# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD 
License
+# which accompanies this distribution.  The full text of the license may be 
found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+LVL="--quality 9"
+
+while [ $# != 0 ];do
+  case $1 in
+-d)
+  ARGS+="--decompress "
+;;
+-e)
+;;
+-g)
+  ARGS+="--gap $2 "
+  shift
+;;
+-l)
+  LVL="--quality $2 "
+  shift
+;;
+-o)
+  ARGS+="--output $2 "
+  shift
+;;
+*)
+  ARGS+="--input $1 "
+  esac
+
+shift
+done
+
+exec Brotli $ARGS $LVL
-- 
2.10.2.windows.1

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


[edk2] [PATCH] BaseTools: Update Brotli and BrotliCompress mode and format

2017-03-30 Thread Song, BinX
- Add x mode for Brotli and BrotliCompress
- Change Brotli and BrotliCompress format from DOS to UNIX

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/Brotli | 0
 BaseTools/BinWrappers/PosixLike/BrotliCompress | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 BaseTools/BinWrappers/PosixLike/Brotli
 mode change 100644 => 100755 BaseTools/BinWrappers/PosixLike/BrotliCompress

diff --git a/BaseTools/BinWrappers/PosixLike/Brotli 
b/BaseTools/BinWrappers/PosixLike/Brotli
old mode 100644
new mode 100755
diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
old mode 100644
new mode 100755
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH 0/4] MdeModulePkg/BaseTools: Add Brotli algorithm support

2017-03-23 Thread Song, BinX
Hi All,

The code is also in https://github.com/binxsong/edk2/tree/Brotli_V1

Best Regards,
Bell Song

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Song,
> BinX
> Sent: Thursday, March 23, 2017 10:16 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming@intel.com>
> Subject: [edk2] [PATCH 0/4] MdeModulePkg/BaseTools: Add Brotli algorithm
> support
> 
> Brotli algorithm was released on the website https://github.com/google/brotli.
> It has a little less compress ratio than Lzma, but has better decompress
> performance than it.
> Add Brotli algorithm support, include Brotli decompression library and tool 
> set.
> 
> Tested on:
> OS: Windows
> Arch: IA32/X64
> Platform: Nt32Pkg
> ToolChain: VS2015x86
> Target: Release
> 
> OS: Ubuntu
> Arch: IA32/X64
> Platform: OvmfPkgIa32.dsc/OvmfPkgX64.dsc
> ToolChain: GCC5
> Target: Release
> 
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Bell Song <binx.s...@intel.com>
> 
> Bell Song (4):
>   MdeModulePkg: Copy Brotli algorithm 3rd party source code for library
>   MdeModulePkg: Add Brotli algorithm decompression library
>   BaseTools: Copy Brotli algorithm 3rd party source code for tool
>   BaseTools: Add Brotli algorithm tool
> 
>  BaseTools/BinWrappers/PosixLike/Brotli |29 +
>  BaseTools/BinWrappers/PosixLike/BrotliCompress |42 +
>  BaseTools/Conf/tools_def.template  | 6 +
>  .../Source/C/BrotliCompress/BrotliCompress.bat |48 +
>  BaseTools/Source/C/BrotliCompress/GNUmakefile  |43 +
>  BaseTools/Source/C/BrotliCompress/LICENSE  |19 +
>  BaseTools/Source/C/BrotliCompress/Makefile |60 +
>  BaseTools/Source/C/BrotliCompress/README.md|26 +
>  BaseTools/Source/C/BrotliCompress/ReadMe.txt   | 2 +
>  .../Source/C/BrotliCompress/common/constants.h |47 +
>  .../Source/C/BrotliCompress/common/dictionary.c|  9474
> 
>  .../Source/C/BrotliCompress/common/dictionary.h|29 +
>  BaseTools/Source/C/BrotliCompress/common/port.h|   107 +
>  BaseTools/Source/C/BrotliCompress/common/types.h   |58 +
>  BaseTools/Source/C/BrotliCompress/dec/bit_reader.c |48 +
>  BaseTools/Source/C/BrotliCompress/dec/bit_reader.h |   383 +
>  BaseTools/Source/C/BrotliCompress/dec/context.h|   251 +
>  BaseTools/Source/C/BrotliCompress/dec/decode.c |  2347 
>  BaseTools/Source/C/BrotliCompress/dec/decode.h |   188 +
>  BaseTools/Source/C/BrotliCompress/dec/huffman.c|   357 +
>  BaseTools/Source/C/BrotliCompress/dec/huffman.h|68 +
>  BaseTools/Source/C/BrotliCompress/dec/port.h   |   159 +
>  BaseTools/Source/C/BrotliCompress/dec/prefix.h |   751 ++
>  BaseTools/Source/C/BrotliCompress/dec/state.c  |   168 +
>  BaseTools/Source/C/BrotliCompress/dec/state.h  |   246 +
>  BaseTools/Source/C/BrotliCompress/dec/transform.h  |   300 +
>  .../docs/brotli-comparison-study-2015-09-22.pdf|   Bin 0 -> 215208 bytes
>  .../C/BrotliCompress/enc/backward_references.c |   892 ++
>  .../C/BrotliCompress/enc/backward_references.h |99 +
>  .../C/BrotliCompress/enc/backward_references_inc.h |   147 +
>  BaseTools/Source/C/BrotliCompress/enc/bit_cost.c   |35 +
>  BaseTools/Source/C/BrotliCompress/enc/bit_cost.h   |63 +
>  .../Source/C/BrotliCompress/enc/bit_cost_inc.h |   127 +
>  .../C/BrotliCompress/enc/block_encoder_inc.h   |33 +
>  .../Source/C/BrotliCompress/enc/block_splitter.c   |   197 +
>  .../Source/C/BrotliCompress/enc/block_splitter.h   |51 +
>  .../C/BrotliCompress/enc/block_splitter_inc.h  |   432 +
>  .../C/BrotliCompress/enc/brotli_bit_stream.c   |  1334 +++
>  .../C/BrotliCompress/enc/brotli_bit_stream.h   |   107 +
>  BaseTools/Source/C/BrotliCompress/enc/cluster.c|56 +
>  BaseTools/Source/C/BrotliCompress/enc/cluster.h|48 +
>  .../Source/C/BrotliCompress/enc/cluster_inc.h  |   315 +
>  BaseTools/Source/C/BrotliCompress/enc/command.h|   163 +
>  .../C/BrotliCompress/enc/compress_fragment.c   |   747 ++
>  .../C/BrotliCompress/enc/compress_fragment.h   |58 +
>  .../enc/compress_fragment_two_pass.c   |   557 +
>  .../enc/compress_fragment_two_pass.h   |51 +
>  BaseTools/Source/C/BrotliCompress/enc/compressor.h |   161 +
>  BaseTools/Source/C/BrotliCompress/enc/context.h|   184 +
>  .../Source/C/BrotliCompress/enc/dictionary_hash.h  |  4121 +++
>  BaseTools/Source/C/BrotliCompress/enc/encode.c |  1562 +++
>  BaseTools/Source/C/BrotliCompress/enc/encode.h |   221 +
&g

[edk2] [PATCH 2/4] MdeModulePkg: Add Brotli algorithm decompression library

2017-03-22 Thread Song, BinX
- Add Brotli algorithm decompression library support

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 .../BrotliCustomDecompressLib.inf  |  56 
 .../BrotliCustomDecompressLib/BrotliDecompress.c   | 321 +
 .../BrotliDecompressLib.uni|  21 ++
 .../BrotliDecompressLibInternal.h  |  71 +
 .../GuidedSectionExtraction.c  | 196 +
 .../Library/BrotliCustomDecompressLib/ReadMe.txt   |   2 +
 .../BrotliCustomDecompressLib/common/types.h   |  18 +-
 .../BrotliCustomDecompressLib/dec/bit_reader.c |   2 +-
 .../BrotliCustomDecompressLib/dec/bit_reader.h |   3 +-
 .../Library/BrotliCustomDecompressLib/dec/decode.c |   5 +-
 .../BrotliCustomDecompressLib/dec/huffman.c|   2 +-
 .../BrotliCustomDecompressLib/dec/huffman.h|   1 +
 .../Library/BrotliCustomDecompressLib/dec/state.c  |   3 +-
 MdeModulePkg/MdeModulePkg.dec  |   3 +
 MdeModulePkg/MdeModulePkg.dsc  |   1 +
 15 files changed, 697 insertions(+), 8 deletions(-)
 create mode 100644 
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
 create mode 100644 
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
 create mode 100644 
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLib.uni
 create mode 100644 
MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLibInternal.h
 create mode 100644 
MdeModulePkg/Library/BrotliCustomDecompressLib/GuidedSectionExtraction.c
 create mode 100644 MdeModulePkg/Library/BrotliCustomDecompressLib/ReadMe.txt

diff --git 
a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
new file mode 100644
index 000..578f97f
--- /dev/null
+++ 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliCustomDecompressLib.inf
@@ -0,0 +1,56 @@
+## @file
+#  BrotliCustomDecompressLib produces BROTLI custom decompression algorithm.
+#
+#  It is based on the Brotli v0.5.2.
+#  Brotli was released on the website https://github.com/google/brotli.
+#
+#  Copyright (c) 2017, Intel Corporation. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution. The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = BrotliDecompressLib
+  MODULE_UNI_FILE= BrotliDecompressLib.uni
+  FILE_GUID  = 69EC7DB2-B0DD-493A-963A-C5F330131BAA
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = NULL
+  CONSTRUCTOR= BrotliDecompressLibConstructor
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64
+#
+
+[Sources]
+  GuidedSectionExtraction.c
+  BrotliDecompress.c
+  BrotliDecompressLibInternal.h
+  common/dictionary.c
+  dec/bit_reader.c
+  dec/decode.c
+  dec/huffman.c
+  dec/state.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[Guids]
+  gBrotliCustomDecompressGuid  ## PRODUCES  ## UNDEFINED # specifies BROTLI 
custom decompress algorithm.
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  BaseMemoryLib
+  ExtractGuidedSectionLib
diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
new file mode 100644
index 000..2c2648a
--- /dev/null
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompress.c
@@ -0,0 +1,321 @@
+/** @file
+  Brotli Decompress interfaces
+
+  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+#include 
+
+/**
+  Dummy malloc function for compiler.
+**/
+VOID *
+malloc (
+  IN size_tSize
+  )
+{
+  ASSERT (FALSE);
+  return NULL;
+}
+
+/**
+  Dummy free function for compiler.
+**/
+VOID
+free (
+  IN VOID *Ptr
+  )
+{
+  ASSERT (FALSE);
+}
+
+/**
+  Allocation routine used by BROTLI decompression.
+
+  

[edk2] [PATCH 4/4] BaseTools: Add Brotli algorithm tool

2017-03-22 Thread Song, BinX
- Add Brotli algorithm tool support

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 BaseTools/BinWrappers/PosixLike/Brotli |  29 ++
 BaseTools/BinWrappers/PosixLike/BrotliCompress |  42 
 BaseTools/Conf/tools_def.template  |   6 ++
 .../Source/C/BrotliCompress/BrotliCompress.bat |  48 ++
 BaseTools/Source/C/BrotliCompress/GNUmakefile  |  43 +
 BaseTools/Source/C/BrotliCompress/Makefile |  60 
 BaseTools/Source/C/BrotliCompress/ReadMe.txt   |   2 +
 BaseTools/Source/C/BrotliCompress/tools/bro.c  | 106 +
 BaseTools/Source/C/GNUmakefile |   1 +
 BaseTools/Source/C/Makefile|   1 +
 10 files changed, 318 insertions(+), 20 deletions(-)
 create mode 100644 BaseTools/BinWrappers/PosixLike/Brotli
 create mode 100644 BaseTools/BinWrappers/PosixLike/BrotliCompress
 create mode 100644 BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
 create mode 100644 BaseTools/Source/C/BrotliCompress/GNUmakefile
 create mode 100644 BaseTools/Source/C/BrotliCompress/Makefile
 create mode 100644 BaseTools/Source/C/BrotliCompress/ReadMe.txt

diff --git a/BaseTools/BinWrappers/PosixLike/Brotli 
b/BaseTools/BinWrappers/PosixLike/Brotli
new file mode 100644
index 000..0945d86
--- /dev/null
+++ b/BaseTools/BinWrappers/PosixLike/Brotli
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a 
discussion of why $0 is not a good choice here
+dir=$(dirname "$full_cmd")
+cmd=${full_cmd##*/}
+
+if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]
+then
+  exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"
+elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]
+then
+  if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]
+  then
+echo "BaseTools C Tool binary was not found ($cmd)"
+echo "You may need to run:"
+echo "  make -C $EDK_TOOLS_PATH/Source/C"
+  else
+exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"
+  fi
+elif [ -e "$dir/../../Source/C/bin/$cmd" ]
+then
+  exec "$dir/../../Source/C/bin/$cmd" "$@"
+else
+  echo "Unable to find the real '$cmd' to run"
+  echo "This message was printed by"
+  echo "  $0"
+  exit 127
+fi
+
diff --git a/BaseTools/BinWrappers/PosixLike/BrotliCompress 
b/BaseTools/BinWrappers/PosixLike/BrotliCompress
new file mode 100644
index 000..59c6465
--- /dev/null
+++ b/BaseTools/BinWrappers/PosixLike/BrotliCompress
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+#
+# This script will exec Brotli tool.
+#
+# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD 
License
+# which accompanies this distribution.  The full text of the license may be 
found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+LVL="--quality 9"
+
+while [ $# != 0 ];do
+  case $1 in
+-d)
+  ARGS+="--decompress "
+;;
+-e)
+;;
+-g)
+  ARGS+="--gap $2 "
+  shift
+;;
+-l)
+  LVL="--quality $2 "
+  shift
+;;
+-o)
+  ARGS+="--output $2 "
+  shift
+;;
+*)
+  ARGS+="--input $1 "
+  esac
+
+shift
+done
+
+exec Brotli $ARGS $LVL
diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index aaae4fc..168e42a 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -7691,6 +7691,12 @@ RELEASE_RVCTCYGWIN_ARM_CC_FLAGS  = "$(CCPATH_FLAG)" 
$(ARCHCC_FLAGS) $(PLATFORM_F
 *_*_*_RSA2048SHA256SIGN_GUID = A7717414-C616-4977-9420-844712A735BF
 
 ##
+# BrotliCompress tool definitions
+##
+*_*_*_BROTLI_PATH= BrotliCompress
+*_*_*_BROTLI_GUID= 3D532050-5CDA-4FD0-879E-0F7F630D5AFB
+
+##
 # LzmaCompress tool definitions
 ##
 *_*_*_LZMA_PATH  = LzmaCompress
diff --git a/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat 
b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
new file mode 100644
index 000..62d10f7
--- /dev/null
+++ b/BaseTools/Source/C/BrotliCompress/BrotliCompress.bat
@@ -0,0 +1,48 @@
+@echo off
+@setlocal
+
+set LVL=--quality 9
+
+:Begin
+if "%1"=="" goto End
+
+if "%1"=="-d" (
+  set ARGS=%ARGS% --decompress
+  shift
+  goto Begin
+)
+
+if "%1"=="-e" (
+  shift
+  goto Begin
+)
+
+if "%1"=="-g" (
+  set ARGS=%ARGS% --gap %2
+  shift
+  shift
+  goto Begin
+)
+
+if "%1"=="-l" (
+  set LVL=--quality %2
+  shift
+  shift
+  goto Begin
+)
+
+if "%1"=="-o" (
+  set ARGS=%ARGS% --output %2
+  set INTMP=%2
+  shift
+  shift
+  goto Begin
+)
+
+set ARGS=%ARGS% --input %1
+shift
+goto Begin
+
+:End

[edk2] [PATCH 0/4] MdeModulePkg/BaseTools: Add Brotli algorithm support

2017-03-22 Thread Song, BinX
Brotli algorithm was released on the website https://github.com/google/brotli.
It has a little less compress ratio than Lzma, but has better decompress 
performance than it.
Add Brotli algorithm support, include Brotli decompression library and tool set.

Tested on:
OS: Windows
Arch: IA32/X64
Platform: Nt32Pkg
ToolChain: VS2015x86
Target: Release

OS: Ubuntu
Arch: IA32/X64
Platform: OvmfPkgIa32.dsc/OvmfPkgX64.dsc
ToolChain: GCC5
Target: Release

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 

Bell Song (4):
  MdeModulePkg: Copy Brotli algorithm 3rd party source code for library
  MdeModulePkg: Add Brotli algorithm decompression library
  BaseTools: Copy Brotli algorithm 3rd party source code for tool
  BaseTools: Add Brotli algorithm tool

 BaseTools/BinWrappers/PosixLike/Brotli |29 +
 BaseTools/BinWrappers/PosixLike/BrotliCompress |42 +
 BaseTools/Conf/tools_def.template  | 6 +
 .../Source/C/BrotliCompress/BrotliCompress.bat |48 +
 BaseTools/Source/C/BrotliCompress/GNUmakefile  |43 +
 BaseTools/Source/C/BrotliCompress/LICENSE  |19 +
 BaseTools/Source/C/BrotliCompress/Makefile |60 +
 BaseTools/Source/C/BrotliCompress/README.md|26 +
 BaseTools/Source/C/BrotliCompress/ReadMe.txt   | 2 +
 .../Source/C/BrotliCompress/common/constants.h |47 +
 .../Source/C/BrotliCompress/common/dictionary.c|  9474 
 .../Source/C/BrotliCompress/common/dictionary.h|29 +
 BaseTools/Source/C/BrotliCompress/common/port.h|   107 +
 BaseTools/Source/C/BrotliCompress/common/types.h   |58 +
 BaseTools/Source/C/BrotliCompress/dec/bit_reader.c |48 +
 BaseTools/Source/C/BrotliCompress/dec/bit_reader.h |   383 +
 BaseTools/Source/C/BrotliCompress/dec/context.h|   251 +
 BaseTools/Source/C/BrotliCompress/dec/decode.c |  2347 
 BaseTools/Source/C/BrotliCompress/dec/decode.h |   188 +
 BaseTools/Source/C/BrotliCompress/dec/huffman.c|   357 +
 BaseTools/Source/C/BrotliCompress/dec/huffman.h|68 +
 BaseTools/Source/C/BrotliCompress/dec/port.h   |   159 +
 BaseTools/Source/C/BrotliCompress/dec/prefix.h |   751 ++
 BaseTools/Source/C/BrotliCompress/dec/state.c  |   168 +
 BaseTools/Source/C/BrotliCompress/dec/state.h  |   246 +
 BaseTools/Source/C/BrotliCompress/dec/transform.h  |   300 +
 .../docs/brotli-comparison-study-2015-09-22.pdf|   Bin 0 -> 215208 bytes
 .../C/BrotliCompress/enc/backward_references.c |   892 ++
 .../C/BrotliCompress/enc/backward_references.h |99 +
 .../C/BrotliCompress/enc/backward_references_inc.h |   147 +
 BaseTools/Source/C/BrotliCompress/enc/bit_cost.c   |35 +
 BaseTools/Source/C/BrotliCompress/enc/bit_cost.h   |63 +
 .../Source/C/BrotliCompress/enc/bit_cost_inc.h |   127 +
 .../C/BrotliCompress/enc/block_encoder_inc.h   |33 +
 .../Source/C/BrotliCompress/enc/block_splitter.c   |   197 +
 .../Source/C/BrotliCompress/enc/block_splitter.h   |51 +
 .../C/BrotliCompress/enc/block_splitter_inc.h  |   432 +
 .../C/BrotliCompress/enc/brotli_bit_stream.c   |  1334 +++
 .../C/BrotliCompress/enc/brotli_bit_stream.h   |   107 +
 BaseTools/Source/C/BrotliCompress/enc/cluster.c|56 +
 BaseTools/Source/C/BrotliCompress/enc/cluster.h|48 +
 .../Source/C/BrotliCompress/enc/cluster_inc.h  |   315 +
 BaseTools/Source/C/BrotliCompress/enc/command.h|   163 +
 .../C/BrotliCompress/enc/compress_fragment.c   |   747 ++
 .../C/BrotliCompress/enc/compress_fragment.h   |58 +
 .../enc/compress_fragment_two_pass.c   |   557 +
 .../enc/compress_fragment_two_pass.h   |51 +
 BaseTools/Source/C/BrotliCompress/enc/compressor.h |   161 +
 BaseTools/Source/C/BrotliCompress/enc/context.h|   184 +
 .../Source/C/BrotliCompress/enc/dictionary_hash.h  |  4121 +++
 BaseTools/Source/C/BrotliCompress/enc/encode.c |  1562 +++
 BaseTools/Source/C/BrotliCompress/enc/encode.h |   221 +
 .../Source/C/BrotliCompress/enc/encode_parallel.h  |27 +
 .../Source/C/BrotliCompress/enc/entropy_encode.c   |   501 +
 .../Source/C/BrotliCompress/enc/entropy_encode.h   |   122 +
 .../C/BrotliCompress/enc/entropy_encode_static.h   |   539 +
 BaseTools/Source/C/BrotliCompress/enc/fast_log.h   |   145 +
 .../C/BrotliCompress/enc/find_match_length.h   |80 +
 BaseTools/Source/C/BrotliCompress/enc/hash.h   |   717 ++
 .../BrotliCompress/enc/hash_forgetful_chain_inc.h  |   249 +
 .../C/BrotliCompress/enc/hash_longest_match_inc.h  |   241 +
 .../enc/hash_longest_match_quickly_inc.h   |   230 +
 BaseTools/Source/C/BrotliCompress/enc/histogram.c  |95 +
 BaseTools/Source/C/BrotliCompress/enc/histogram.h  |60 +
 .../Source/C/BrotliCompress/enc/histogram_inc.h|51 +
 .../Source/C/BrotliCompress/enc/literal_cost.c |   178 +
 

[edk2] [PATCH V2] MdeModulePkg/BootLogoLib: Remove invalid if judgments

2016-11-10 Thread Song, BinX
FreePool (Blt) function will be called in while loop, cannot be removed.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c 
b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 2c1e8ea..8bd9985 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -142,10 +142,6 @@ BootLogoEnableLogo (
   break;
 }
 
-if (EFI_ERROR (Status)) {
-  continue;
-}
-
 if (Blt != NULL) {
   FreePool (Blt);
 }
-- 
2.10.2.windows.1

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


Re: [edk2] [PATCH] MdeModulePkg/BootLogoLib: Remove invalid if judgments

2016-11-09 Thread Song, BinX
Hi Liming,

In BootLogoEnableLogo() function, the FreePool(Blt) function will never be 
called, some Blt related code as below:

a. Blt = NULL;  -> Step 1, Blt was initialized.
..
b.if (Blt != NULL) {  \
  FreePool (Blt);  -- Step 2, Blt was checked, the judgment is always 
false.
}/

c.Blt = Image.Bitmap;  Step 3, Blt get an valid value.

>From above, I think we can remove this if judgment.

Best Regards,
Bell Song

> -Original Message-
> From: Gao, Liming
> Sent: Wednesday, November 9, 2016 10:25 AM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu...@intel.com>
> Subject: RE: [PATCH] MdeModulePkg/BootLogoLib: Remove invalid if
> judgments
> 
> Bin:
>   Why remove FreePool (Blt)? It is still used.
> 
> Thanks
> Liming
> > -Original Message-
> > From: Song, BinX
> > Sent: Tuesday, November 08, 2016 11:01 AM
> > To: edk2-devel@lists.01.org
> > Cc: Gao, Liming <liming@intel.com>
> > Subject: [PATCH] MdeModulePkg/BootLogoLib: Remove invalid if
> judgments
> >
> > There are two invalid if judgments in BootLogoEnableLogo() function,
> > remove them.
> >
> > Cc: Liming Gao <liming@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 8 
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> > b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> > index 2c1e8ea..b69dda8 100644
> > --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> > +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> > @@ -141,14 +141,6 @@ BootLogoEnableLogo (
> >  if (EFI_ERROR (Status)) {
> >break;
> >  }
> > -
> > -if (EFI_ERROR (Status)) {
> > -  continue;
> > -}
> > -
> > -if (Blt != NULL) {
> > -  FreePool (Blt);
> > -}
> >  Blt = Image.Bitmap;
> >
> >  //
> > --
> > 2.7.2.windows.1

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


[edk2] [PATCH] MdeModulePkg/BootLogoLib: Remove invalid if judgments

2016-11-07 Thread Song, BinX
There are two invalid if judgments in BootLogoEnableLogo() function,
remove them.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c 
b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 2c1e8ea..b69dda8 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -141,14 +141,6 @@ BootLogoEnableLogo (
 if (EFI_ERROR (Status)) {
   break;
 }
-
-if (EFI_ERROR (Status)) {
-  continue;
-}
-
-if (Blt != NULL) {
-  FreePool (Blt);
-}
 Blt = Image.Bitmap;
 
 //
-- 
2.7.2.windows.1

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


[edk2] [PATCH V3] MdePkg/BaseLib: Move CHAR_NULL definition to Base.h in BaseLib

2016-11-02 Thread Song, BinX
- Required unicode control chars -> Null character
- Remove CHAR_NULL definition in SimpleTextIn.h
- https://bugzilla.tianocore.org/show_bug.cgi?id=172

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdePkg/Include/Base.h  | 5 +
 MdePkg/Include/Protocol/SimpleTextIn.h | 1 -
 MdePkg/Library/BaseLib/FilePaths.c | 2 --
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 2217058..5e24b5d 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -338,6 +338,11 @@ struct _LIST_ENTRY {
 ///
 #define NULL  ((VOID *) 0)
 
+//
+// Null character
+//
+#define CHAR_NULL 0x
+
 ///
 /// Maximum values for common UEFI Data Types
 ///
diff --git a/MdePkg/Include/Protocol/SimpleTextIn.h 
b/MdePkg/Include/Protocol/SimpleTextIn.h
index 71dcb0b..ebe1c7e 100644
--- a/MdePkg/Include/Protocol/SimpleTextIn.h
+++ b/MdePkg/Include/Protocol/SimpleTextIn.h
@@ -46,7 +46,6 @@ typedef struct {
 //
 // Required unicode control chars
 //
-#define CHAR_NULL 0x
 #define CHAR_BACKSPACE0x0008
 #define CHAR_TAB  0x0009
 #define CHAR_LINEFEED 0x000A
diff --git a/MdePkg/Library/BaseLib/FilePaths.c 
b/MdePkg/Library/BaseLib/FilePaths.c
index c8da6bb..183b323 100644
--- a/MdePkg/Library/BaseLib/FilePaths.c
+++ b/MdePkg/Library/BaseLib/FilePaths.c
@@ -10,10 +10,8 @@
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/
-#include  
 #include  
 #include  
-#include  
 
 /**
   Removes the last directory or file entry in a path by changing the last
-- 
2.7.2.windows.1

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


Re: [edk2] [PATCH] MdePkg/BaseLib: Move CHAR_NULL definition to Base.h in BaseLib

2016-11-02 Thread Song, BinX
Hi Liming,

Got it, I will update again.

Best Regards,
Bell Song

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, November 3, 2016 9:56 AM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Subject: RE: [PATCH] MdePkg/BaseLib: Move CHAR_NULL definition to
> Base.h in BaseLib
> 
> Bin:
>   On CHAR_NULL definition in Base.h, its comment should be Null character.
> And, for the second version patch, you need change title to PATCH V2, and
> describe what changes in V2.
> 
> > +//
> > +// Required unicode control chars  ==> Null character
> > +//
> > +#define CHAR_NULL 0x0000
> 
> Thanks
> Liming
> > -Original Message-
> > From: Song, BinX
> > Sent: Thursday, November 03, 2016 9:31 AM
> > To: edk2-devel@lists.01.org
> > Cc: Gao, Liming <liming@intel.com>
> > Subject: [PATCH] MdePkg/BaseLib: Move CHAR_NULL definition to Base.h
> in
> > BaseLib
> >
> > - https://bugzilla.tianocore.org/show_bug.cgi?id=172
> >
> > Cc: Liming Gao <liming@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Bell Song <binx.s...@intel.com>
> > ---
> >  MdePkg/Include/Base.h  | 5 +
> >  MdePkg/Include/Protocol/SimpleTextIn.h | 1 -
> >  MdePkg/Library/BaseLib/FilePaths.c | 2 --
> >  3 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> > index 2217058..2441875 100644
> > --- a/MdePkg/Include/Base.h
> > +++ b/MdePkg/Include/Base.h
> > @@ -338,6 +338,11 @@ struct _LIST_ENTRY {
> >  ///
> >  #define NULL  ((VOID *) 0)
> >
> > +//
> > +// Required unicode control chars
> > +//
> > +#define CHAR_NULL 0x
> > +
> >  ///
> >  /// Maximum values for common UEFI Data Types
> >  ///
> > diff --git a/MdePkg/Include/Protocol/SimpleTextIn.h
> > b/MdePkg/Include/Protocol/SimpleTextIn.h
> > index 71dcb0b..ebe1c7e 100644
> > --- a/MdePkg/Include/Protocol/SimpleTextIn.h
> > +++ b/MdePkg/Include/Protocol/SimpleTextIn.h
> > @@ -46,7 +46,6 @@ typedef struct {
> >  //
> >  // Required unicode control chars
> >  //
> > -#define CHAR_NULL 0x
> >  #define CHAR_BACKSPACE0x0008
> >  #define CHAR_TAB  0x0009
> >  #define CHAR_LINEFEED 0x000A
> > diff --git a/MdePkg/Library/BaseLib/FilePaths.c
> > b/MdePkg/Library/BaseLib/FilePaths.c
> > index c8da6bb..183b323 100644
> > --- a/MdePkg/Library/BaseLib/FilePaths.c
> > +++ b/MdePkg/Library/BaseLib/FilePaths.c
> > @@ -10,10 +10,8 @@
> >THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> > BASIS,
> >WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> > EXPRESS OR IMPLIED.
> >  **/
> > -#include  
> >  #include  
> >  #include  
> > -#include  
> >
> >  /**
> >Removes the last directory or file entry in a path by changing the last
> > --
> > 2.7.2.windows.1

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


[edk2] [PATCH] MdePkg/BaseLib: Move CHAR_NULL definition to Base.h in BaseLib

2016-11-02 Thread Song, BinX
- https://bugzilla.tianocore.org/show_bug.cgi?id=172

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdePkg/Include/Base.h  | 5 +
 MdePkg/Include/Protocol/SimpleTextIn.h | 1 -
 MdePkg/Library/BaseLib/FilePaths.c | 2 --
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 2217058..2441875 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -338,6 +338,11 @@ struct _LIST_ENTRY {
 ///
 #define NULL  ((VOID *) 0)
 
+//
+// Required unicode control chars
+//
+#define CHAR_NULL 0x
+
 ///
 /// Maximum values for common UEFI Data Types
 ///
diff --git a/MdePkg/Include/Protocol/SimpleTextIn.h 
b/MdePkg/Include/Protocol/SimpleTextIn.h
index 71dcb0b..ebe1c7e 100644
--- a/MdePkg/Include/Protocol/SimpleTextIn.h
+++ b/MdePkg/Include/Protocol/SimpleTextIn.h
@@ -46,7 +46,6 @@ typedef struct {
 //
 // Required unicode control chars
 //
-#define CHAR_NULL 0x
 #define CHAR_BACKSPACE0x0008
 #define CHAR_TAB  0x0009
 #define CHAR_LINEFEED 0x000A
diff --git a/MdePkg/Library/BaseLib/FilePaths.c 
b/MdePkg/Library/BaseLib/FilePaths.c
index c8da6bb..183b323 100644
--- a/MdePkg/Library/BaseLib/FilePaths.c
+++ b/MdePkg/Library/BaseLib/FilePaths.c
@@ -10,10 +10,8 @@
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/
-#include  
 #include  
 #include  
-#include  
 
 /**
   Removes the last directory or file entry in a path by changing the last
-- 
2.7.2.windows.1

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


Re: [edk2] [PATCH] MdePkg/BaseLib: Re-define CHAR_NULL in BaseLib

2016-11-02 Thread Song, BinX
Hi Liming,

Thanks for your info, I will update.

Best Regards,
Bell Song

> -Original Message-
> From: Gao, Liming
> Sent: Wednesday, November 2, 2016 4:44 PM
> To: Song, BinX <binx.s...@intel.com>; edk2-devel@lists.01.org
> Subject: RE: [PATCH] MdePkg/BaseLib: Re-define CHAR_NULL in BaseLib
> 
> Bin:
>   I suggest move CHAR_NULL definition from Protocol\SimpleTextIn.h to
> Base.h
> 
> Thanks
> Liming
> -Original Message-
> From: Song, BinX
> Sent: Wednesday, November 2, 2016 4:27 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming@intel.com>
> Subject: [PATCH] MdePkg/BaseLib: Re-define CHAR_NULL in BaseLib
> 
> - https://bugzilla.tianocore.org/show_bug.cgi?id=172
> 
> Cc: Liming Gao <liming@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Bell Song <binx.s...@intel.com>
> ---
>  MdePkg/Include/Base.h  | 7 +++
>  MdePkg/Library/BaseLib/FilePaths.c | 2 --
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index 2217058..0c3318f 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -338,6 +338,13 @@ struct _LIST_ENTRY {
>  ///
>  #define NULL  ((VOID *) 0)
> 
> +//
> +// Required unicode control chars
> +//
> +#ifndef CHAR_NULL
> +#define CHAR_NULL  0x
> +#endif
> +
>  ///
>  /// Maximum values for common UEFI Data Types
>  ///
> diff --git a/MdePkg/Library/BaseLib/FilePaths.c
> b/MdePkg/Library/BaseLib/FilePaths.c
> index c8da6bb..183b323 100644
> --- a/MdePkg/Library/BaseLib/FilePaths.c
> +++ b/MdePkg/Library/BaseLib/FilePaths.c
> @@ -10,10 +10,8 @@
>THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
>WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
>  **/
> -#include  
>  #include  
>  #include  
> -#include  
> 
>  /**
>Removes the last directory or file entry in a path by changing the last
> --
> 2.7.2.windows.1

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


[edk2] [PATCH] MdePkg/BaseLib: Re-define CHAR_NULL in BaseLib

2016-11-02 Thread Song, BinX
- https://bugzilla.tianocore.org/show_bug.cgi?id=172

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdePkg/Include/Base.h  | 7 +++
 MdePkg/Library/BaseLib/FilePaths.c | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 2217058..0c3318f 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -338,6 +338,13 @@ struct _LIST_ENTRY {
 ///
 #define NULL  ((VOID *) 0)
 
+//
+// Required unicode control chars
+//
+#ifndef CHAR_NULL
+#define CHAR_NULL  0x
+#endif
+
 ///
 /// Maximum values for common UEFI Data Types
 ///
diff --git a/MdePkg/Library/BaseLib/FilePaths.c 
b/MdePkg/Library/BaseLib/FilePaths.c
index c8da6bb..183b323 100644
--- a/MdePkg/Library/BaseLib/FilePaths.c
+++ b/MdePkg/Library/BaseLib/FilePaths.c
@@ -10,10 +10,8 @@
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/
-#include  
 #include  
 #include  
-#include  
 
 /**
   Removes the last directory or file entry in a path by changing the last
-- 
2.7.2.windows.1

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


[edk2] [PATCH] MdeModulePkg/FrameBufferBltLib: Change module type to UEFI_DRIVER

2016-11-01 Thread Song, BinX
- BASE -> UEFI_DRIVER
- https://bugzilla.tianocore.org/show_bug.cgi?id=173

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf 
b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
index 57e4adb..2b8d4ae 100644
--- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
+++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
@@ -17,7 +17,7 @@
   INF_VERSION= 0x00010005
   BASE_NAME  = FrameBufferBltLib
   FILE_GUID  = 243D3E8C-2780-4A25-9693-A410475BFCEC
-  MODULE_TYPE= BASE
+  MODULE_TYPE= UEFI_DRIVER
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = FrameBufferBltLib
 
-- 
2.7.2.windows.1

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


[edk2] [PATCH] EdkCompatibilityPkg/PrintLite: Fix ErrorPrint() wrong NULL char check

2016-11-01 Thread Song, BinX
- '\0' -> NULL
- https://bugzilla.tianocore.org/show_bug.cgi?id=47

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song 
---
 EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c 
b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c
index e48cbe8..4abe14f 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c
@@ -101,7 +101,7 @@ Returns:
 return 0;
   }
 
-  if (ErrorString != '\0') {
+  if (ErrorString != NULL) {
 if (gST->StdErr != NULL) {
   //
   // To be extra safe make sure StdErr has been initialized
-- 
2.7.2.windows.1

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