Re: [edk2] [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI debug lib

2019-03-27 Thread Gao, Zhichao
Thanks for your comments. I will update base on 1, 2, 3.
I have tested on Nt32Pkg and OvmfPkg to replace the PEIM debug lib with the new 
one and add MdeModulePkg/Universal/DebugServicePei/DebugServicePei.inf with the 
original PEIM DebugLib to dsc and fdf file.
The PEIMs which use the DebugLib can output debug message fine.

Thanks,
Zhichao

> -Original Message-
> From: Gao, Liming
> Sent: Thursday, March 28, 2019 10:04 AM
> To: Gao, Zhichao ; edk2-devel@lists.01.org
> Cc: Wang, Jian J ; Wu, Hao A ;
> Ni, Ray ; Zeng, Star ; Sean Brogan
> ; Michael Turner
> ; Bret Barkelew
> 
> Subject: RE: [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add
> PEI debug lib
> 
> Zhichao:
>For new library instance, I have some comments.
> 
> 1) DebugPrint(). If DebugPpi is not found, directly return instead of
> CpuDeadLoop().
> 2) DebugAssert(). If DebugPpi is not found, bases on
> PcdDebugPropertyMask value to trig CpuDeadLoop() or CpuBreakPoint().
> 3) Please rename mDebugPpi as the specific prefix name to avoid the name
> confliction.
> 4) What test is done for this library instance?
> 
> Thanks
> Liming
> >-Original Message-
> >From: Gao, Zhichao
> >Sent: Thursday, March 21, 2019 10:05 PM
> >To: edk2-devel@lists.01.org
> >Cc: Gao, Liming ; Wang, Jian J
> >; Wu, Hao A ; Ni, Ray
> >; Zeng, Star ; Sean Brogan
> >; Michael Turner
> >; Bret Barkelew
> >
> >Subject: [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI
> >debug lib
> >
> >From: Liming Gao 
> >
> >REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
> >
> >Add a PEI debug library instance PeiDebugLibDebugPpi base on DebugPpi.
> >Using the combination of the DebugServicePei and this lib instance can
> >reduce the image size of PEI drivers.
> >
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Zhichao Gao 
> >Cc: Jian J Wang 
> >Cc: Hao Wu 
> >Cc: Ray Ni 
> >Cc: Star Zeng 
> >Cc: Liming Gao 
> >Cc: Sean Brogan 
> >Cc: Michael Turner 
> >Cc: Bret Barkelew 
> >---
> > .../Library/PeiDebugLibDebugPpi/DebugLib.c | 456
> >+
> > .../PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf|  55 +++
> > 2 files changed, 511 insertions(+)
> > create mode 100644
> >MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> > create mode 100644
> >MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
> >
> >diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> >b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> >new file mode 100644
> >index 00..75859163ae
> >--- /dev/null
> >+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> >@@ -0,0 +1,456 @@
> >+/** @file
> >+  PEI debug lib instance base on DebugPpi to save size
> >+
> >+  Copyright (c) 2019, Intel Corporation. All rights reserved.
> >+
> >+  This program and the accompanying materials  are licensed and made
> >+ available under the terms and conditions of the BSD
> >License
> >+  which accompanies this distribution.  The full text of the license
> >+ may be
> >found at
> >+  http://opensource.org/licenses/bsd-license.php
> >+
> >+  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 
> >+#include 
> >+#include 
> >+#include 
> >+
> >+EDKII_DEBUG_PPI *mDebugPpi = NULL;
> >+
> >+/**
> >+  Prints a debug message to the debug output device if the specified
> >+  error level is enabled.
> >+
> >+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib
> >+ function  GetDebugPrintErrorLevel (), then print the message
> >+ specified by Format
> >and
> >+  the associated variable argument list to the debug output device.
> >+
> >+  If Format is NULL, then ASSERT().
> >+
> >+  @param  ErrorLevelThe error level of the debug message.
> >+  @param  FormatFormat string for the debug message to print.
> >+  @param  ...   Variable argument list whose contents are accessed
> >+based on the format string specified by Format.
> >+
> >+**/
> >+VOID
> >+EFIAPI
> >+DebugPrint (
> >+  IN  UINTNErrorLevel,
> >+  IN  CONST CHAR8  *Format,
> >+  ...
> >+  )
> >+{
> >+  VA_LIST Marker;
> >+
> >+  VA_START (Marker, Format);
> >+  DebugVPrint (ErrorLevel, Format, Marker);
> >+  VA_END (Marker);
> >+}
> >+
> >+
> >+/**
> >+  Prints a debug message to the debug output device if the specified
> >+  error level is enabled.
> >+  This function use BASE_LIST which would provide a more compatible
> >+  service than VA_LIST.
> >+
> >+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib
> >+ function  GetDebugPrintErrorLevel (), then print the message
> >+ specified by Format
> >and
> >+  the associated variable argument list to the debug output device.
> >+
> >+  If Format is NULL, then ASSERT().
> >+
> >+  @param  ErrorLevel  The error level of the debug 

Re: [edk2] [PATCH 0/6] Add new APIs for BaseCryptLib

2019-03-27 Thread Gao, Zhichao
Sorry for late reply. I have write a very simple test case for these new APIs. 
And the test result is as expected.
Refer to 
https://github.com/ZhichaoGao/edk2/commit/31938b606c6a6a1fdb560e3d0dd4e41a78e1d7e9
The section to test VerifyEKUsInPkcs7Signature is refer to 
https://github.com/Microsoft/mu_tiano_plus/tree/release/201808/CryptoPkg/UnitTests/VerifyPkcs7EkuUnitTestApp

Thanks,
Zhichao

> -Original Message-
> From: Yao, Jiewen
> Sent: Monday, March 25, 2019 4:22 PM
> To: Gao, Zhichao ; edk2-devel@lists.01.org
> Cc: Ye, Ting ; Michael Turner
> ; Bret Barkelew
> ; Gao, Liming ;
> Gang Wei 
> Subject: RE: [edk2] [PATCH 0/6] Add new APIs for BaseCryptLib
> 
> Hi
> Would you please describe what unit test has been run for the new API ?
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Zhichao Gao
> > Sent: Monday, March 25, 2019 12:01 PM
> > To: edk2-devel@lists.01.org
> > Cc: Ye, Ting ; Michael Turner
> > ; Bret Barkelew
> > ; Gao, Liming ;
> > Gang Wei 
> > Subject: [edk2] [PATCH 0/6] Add new APIs for BaseCryptLib
> >
> > Add new API to get organization name
> > Add new API VerifyEKUsInPkcs7Signature Add PKCS1v2 (RSAES-OAEP)
> > support
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Zhichao Gao 
> > Cc: Ting Ye 
> > Cc: Gang Wei 
> > Cc: Wang Jian J 
> > Cc: Liming Gao 
> > Cc: Sean Brogan 
> > Cc: Michael Turner 
> > Cc: Bret Barkelew 
> >
> > Bret Barkelew (6):
> >   CryptoPkg/BaseCryptLib.h: Add new API to get organization name
> >   CryptoPkg/BaseCryptLib: Add new API to get organization name
> >   CryptoPkg/BaseCryptLib.h: Add new API VerifyEKUsInPkcs7Signature
> >   CryptoPkg/BaseCryptLib: Add new API VerifyEKUsInPkcs7Signature
> >   CryptoPkg/BaseCryptLib.h: Add PKCS1v2 (RSAES-OAEP) support.
> >   CryptoPkg/BaseCryptLib: Add PKCS1v2 (RSAES-OAEP) support.
> >
> >  CryptoPkg/Include/Library/BaseCryptLib.h   | 121 -
> >  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf|   2 +
> >  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf |   4 +-
> >  CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c | 218 +
> >  .../Library/BaseCryptLib/Pk/CryptPkcs1OaepNull.c   |  61 +++
> >  .../Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c  | 539
> > +
> >  .../BaseCryptLib/Pk/CryptPkcs7VerifyEkuRuntime.c   |  75 +++
> >  CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c  | 102 +++-
> >  CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c  |  32 ++
> >  CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf |   2 +
> >  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf |   2 +
> >  11 files changed, 1144 insertions(+), 14 deletions(-)  create mode
> > 100644 CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1Oaep.c
> >  create mode 100644
> > CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs1OaepNull.c
> >  create mode 100644
> > CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c
> >  create mode 100644
> > CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEkuRuntime.c
> >
> > --
> > 2.16.2.windows.1
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH V3] BaseTools:Trim will trig exception when input asl UTF8 format file

2019-03-27 Thread Fan, ZhijuX
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1641

The command trim --asl-file -o test.i UTF8.asl will trig the exception.
There's a problem with the encoding of the file,it only appears in python3.
I changed the way I opened it to support reading this file

Cc: Bob Feng 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Trim/Trim.py | 44 +---
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/BaseTools/Source/Python/Trim/Trim.py 
b/BaseTools/Source/Python/Trim/Trim.py
index 228779b5a9..05feab6abe 100644
--- a/BaseTools/Source/Python/Trim/Trim.py
+++ b/BaseTools/Source/Python/Trim/Trim.py
@@ -18,7 +18,7 @@ import Common.LongFilePathOs as os
 import sys
 import re
 from io import BytesIO
-
+import codecs
 from optparse import OptionParser
 from optparse import make_option
 from Common.BuildToolError import *
@@ -77,14 +77,11 @@ gIncludedAslFile = []
 def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
 CreateDirectory(os.path.dirname(Target))
 try:
-f = open (Source, 'r')
+with open(Source, "r") as File:
+Lines = File.readlines()
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
 
-# read whole file
-Lines = f.readlines()
-f.close()
-
 PreprocessedFile = ""
 InjectedFile = ""
 LineIndexOfOriginalFile = None
@@ -181,11 +178,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, 
TrimLong):
 
 # save to file
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(NewLines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
-f.writelines(NewLines)
-f.close()
 
 ## Trim preprocessed VFR file
 #
@@ -199,12 +195,11 @@ def TrimPreprocessedVfr(Source, Target):
 CreateDirectory(os.path.dirname(Target))
 
 try:
-f = open (Source, 'r')
+with open(Source, "r") as File:
+Lines = File.readlines()
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
 # read whole file
-Lines = f.readlines()
-f.close()
 
 FoundTypedef = False
 Brace = 0
@@ -248,11 +243,10 @@ def TrimPreprocessedVfr(Source, Target):
 
 # save all lines trimmed
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(Lines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
-f.writelines(Lines)
-f.close()
 
 ## Read the content  ASL file, including ASL included, recursively
 #
@@ -278,7 +272,12 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
LocalSearchPath=None):
 for IncludePath in SearchPathList:
 IncludeFile = os.path.join(IncludePath, Source)
 if os.path.isfile(IncludeFile):
-F = open(IncludeFile, "r")
+try:
+with open(IncludeFile, "r") as File:
+F = File.readlines()
+except:
+with codecs.open(IncludeFile, "r", encoding='utf-8') as 
File:
+F = File.readlines()
 break
 else:
 EdkLogger.error("Trim", "Failed to find include file %s" % Source)
@@ -313,7 +312,6 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
LocalSearchPath=None):
 NewFileContent.append("\n")
 
 gIncludedAslFile.pop()
-F.close()
 
 return NewFileContent
 
@@ -345,7 +343,9 @@ def TrimAslFile(Source, Target, IncludePathFile):
 if IncludePathFile:
 try:
 LineNum = 0
-for Line in open(IncludePathFile, 'r'):
+with open(IncludePathFile, 'r') as File:
+FileLines = File.readlines()
+for Line in FileLines:
 LineNum += 1
 if Line.startswith("/I") or Line.startswith ("-I"):
 IncludePathList.append(Line[2:].strip())
@@ -363,13 +363,11 @@ def TrimAslFile(Source, Target, IncludePathFile):
 
 # save all lines trimmed
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(Lines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
 
-f.writelines(Lines)
-f.close()
-
 def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
 VfrNameList = []
 if os.path.isdir(DebugDir):
@@ -389,7 +387,7 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
 return
 
 try:
-fInputfile = open(OutputFile, "wb+", 0)
+fInputfile = open(OutputFile, "wb+")
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, "File open failed for %s" 
%OutputFile, None)
 
-- 
2.14.1.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org

Re: [edk2] [PATCH V2] BaseTools:Trim will trig exception when input asl UTF8 format file

2019-03-27 Thread Gao, Liming
What error message is reported?

>-Original Message-
>From: Fan, ZhijuX
>Sent: Thursday, March 28, 2019 10:13 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Feng, Bob C 
>Subject: [edk2][PATCH V2] BaseTools:Trim will trig exception when input asl
>UTF8 format file
>
>BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1641
>
>The command trim --asl-file -o test.i UTF8.asl will trig the exception.
>Trim tool should report error message for unsupported UTF8 file instead
>of the exception.
>
>Cc: Bob Feng 
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhiju.Fan 
>---
> BaseTools/Source/Python/Trim/Trim.py | 44 +
>---
> 1 file changed, 21 insertions(+), 23 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Trim/Trim.py
>b/BaseTools/Source/Python/Trim/Trim.py
>index 228779b5a9..05feab6abe 100644
>--- a/BaseTools/Source/Python/Trim/Trim.py
>+++ b/BaseTools/Source/Python/Trim/Trim.py
>@@ -18,7 +18,7 @@ import Common.LongFilePathOs as os
> import sys
> import re
> from io import BytesIO
>-
>+import codecs
> from optparse import OptionParser
> from optparse import make_option
> from Common.BuildToolError import *
>@@ -77,14 +77,11 @@ gIncludedAslFile = []
> def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
> CreateDirectory(os.path.dirname(Target))
> try:
>-f = open (Source, 'r')
>+with open(Source, "r") as File:
>+Lines = File.readlines()
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
>
>-# read whole file
>-Lines = f.readlines()
>-f.close()
>-
> PreprocessedFile = ""
> InjectedFile = ""
> LineIndexOfOriginalFile = None
>@@ -181,11 +178,10 @@ def TrimPreprocessedFile(Source, Target,
>ConvertHex, TrimLong):
>
> # save to file
> try:
>-f = open (Target, 'w')
>+with open(Target, 'w') as File:
>+File.writelines(NewLines)
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
>-f.writelines(NewLines)
>-f.close()
>
> ## Trim preprocessed VFR file
> #
>@@ -199,12 +195,11 @@ def TrimPreprocessedVfr(Source, Target):
> CreateDirectory(os.path.dirname(Target))
>
> try:
>-f = open (Source, 'r')
>+with open(Source, "r") as File:
>+Lines = File.readlines()
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
> # read whole file
>-Lines = f.readlines()
>-f.close()
>
> FoundTypedef = False
> Brace = 0
>@@ -248,11 +243,10 @@ def TrimPreprocessedVfr(Source, Target):
>
> # save all lines trimmed
> try:
>-f = open (Target, 'w')
>+with open(Target, 'w') as File:
>+File.writelines(Lines)
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
>-f.writelines(Lines)
>-f.close()
>
> ## Read the content  ASL file, including ASL included, recursively
> #
>@@ -278,7 +272,12 @@ def DoInclude(Source, Indent='', IncludePathList=[],
>LocalSearchPath=None):
> for IncludePath in SearchPathList:
> IncludeFile = os.path.join(IncludePath, Source)
> if os.path.isfile(IncludeFile):
>-F = open(IncludeFile, "r")
>+try:
>+with open(IncludeFile, "r") as File:
>+F = File.readlines()
>+except:
>+with codecs.open(IncludeFile, "r", encoding='utf-8') as 
>File:
>+F = File.readlines()
> break
> else:
> EdkLogger.error("Trim", "Failed to find include file %s" % Source)
>@@ -313,7 +312,6 @@ def DoInclude(Source, Indent='', IncludePathList=[],
>LocalSearchPath=None):
> NewFileContent.append("\n")
>
> gIncludedAslFile.pop()
>-F.close()
>
> return NewFileContent
>
>@@ -345,7 +343,9 @@ def TrimAslFile(Source, Target, IncludePathFile):
> if IncludePathFile:
> try:
> LineNum = 0
>-for Line in open(IncludePathFile, 'r'):
>+with open(IncludePathFile, 'r') as File:
>+FileLines = File.readlines()
>+for Line in FileLines:
> LineNum += 1
> if Line.startswith("/I") or Line.startswith ("-I"):
> IncludePathList.append(Line[2:].strip())
>@@ -363,13 +363,11 @@ def TrimAslFile(Source, Target, IncludePathFile):
>
> # save all lines trimmed
> try:
>-f = open (Target, 'w')
>+with open(Target, 'w') as File:
>+File.writelines(Lines)
> except:
> EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
>
>-f.writelines(Lines)
>-f.close()
>-
> def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
> VfrNameList = []
> if os.path.isdir(DebugDir):
>@@ -389,7 +387,7 @@ def GenerateVfrBinSec(ModuleName, DebugDir,
>OutputFile):
> return
>
> 

[edk2] [PATCH V2] BaseTools:Trim will trig exception when input asl UTF8 format file

2019-03-27 Thread Fan, ZhijuX
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1641

The command trim --asl-file -o test.i UTF8.asl will trig the exception.
Trim tool should report error message for unsupported UTF8 file instead
of the exception.

Cc: Bob Feng 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Trim/Trim.py | 44 +---
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/BaseTools/Source/Python/Trim/Trim.py 
b/BaseTools/Source/Python/Trim/Trim.py
index 228779b5a9..05feab6abe 100644
--- a/BaseTools/Source/Python/Trim/Trim.py
+++ b/BaseTools/Source/Python/Trim/Trim.py
@@ -18,7 +18,7 @@ import Common.LongFilePathOs as os
 import sys
 import re
 from io import BytesIO
-
+import codecs
 from optparse import OptionParser
 from optparse import make_option
 from Common.BuildToolError import *
@@ -77,14 +77,11 @@ gIncludedAslFile = []
 def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
 CreateDirectory(os.path.dirname(Target))
 try:
-f = open (Source, 'r')
+with open(Source, "r") as File:
+Lines = File.readlines()
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
 
-# read whole file
-Lines = f.readlines()
-f.close()
-
 PreprocessedFile = ""
 InjectedFile = ""
 LineIndexOfOriginalFile = None
@@ -181,11 +178,10 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, 
TrimLong):
 
 # save to file
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(NewLines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
-f.writelines(NewLines)
-f.close()
 
 ## Trim preprocessed VFR file
 #
@@ -199,12 +195,11 @@ def TrimPreprocessedVfr(Source, Target):
 CreateDirectory(os.path.dirname(Target))
 
 try:
-f = open (Source, 'r')
+with open(Source, "r") as File:
+Lines = File.readlines()
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
 # read whole file
-Lines = f.readlines()
-f.close()
 
 FoundTypedef = False
 Brace = 0
@@ -248,11 +243,10 @@ def TrimPreprocessedVfr(Source, Target):
 
 # save all lines trimmed
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(Lines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
-f.writelines(Lines)
-f.close()
 
 ## Read the content  ASL file, including ASL included, recursively
 #
@@ -278,7 +272,12 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
LocalSearchPath=None):
 for IncludePath in SearchPathList:
 IncludeFile = os.path.join(IncludePath, Source)
 if os.path.isfile(IncludeFile):
-F = open(IncludeFile, "r")
+try:
+with open(IncludeFile, "r") as File:
+F = File.readlines()
+except:
+with codecs.open(IncludeFile, "r", encoding='utf-8') as 
File:
+F = File.readlines()
 break
 else:
 EdkLogger.error("Trim", "Failed to find include file %s" % Source)
@@ -313,7 +312,6 @@ def DoInclude(Source, Indent='', IncludePathList=[], 
LocalSearchPath=None):
 NewFileContent.append("\n")
 
 gIncludedAslFile.pop()
-F.close()
 
 return NewFileContent
 
@@ -345,7 +343,9 @@ def TrimAslFile(Source, Target, IncludePathFile):
 if IncludePathFile:
 try:
 LineNum = 0
-for Line in open(IncludePathFile, 'r'):
+with open(IncludePathFile, 'r') as File:
+FileLines = File.readlines()
+for Line in FileLines:
 LineNum += 1
 if Line.startswith("/I") or Line.startswith ("-I"):
 IncludePathList.append(Line[2:].strip())
@@ -363,13 +363,11 @@ def TrimAslFile(Source, Target, IncludePathFile):
 
 # save all lines trimmed
 try:
-f = open (Target, 'w')
+with open(Target, 'w') as File:
+File.writelines(Lines)
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Target)
 
-f.writelines(Lines)
-f.close()
-
 def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
 VfrNameList = []
 if os.path.isdir(DebugDir):
@@ -389,7 +387,7 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):
 return
 
 try:
-fInputfile = open(OutputFile, "wb+", 0)
+fInputfile = open(OutputFile, "wb+")
 except:
 EdkLogger.error("Trim", FILE_OPEN_FAILURE, "File open failed for %s" 
%OutputFile, None)
 
-- 
2.14.1.windows.1

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


Re: [edk2] [PATCH V4 12/17] IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs

2019-03-27 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Sean Brogan
>; Michael Turner
>; Bret Barkelew
>
>Subject: [PATCH V4 12/17]
>IntelFramworkModulePkg/PeiDxeDebugLibReportStatusCode: Add new APIs
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add new APIs' implementation (DebugVPrint, DebugBPrint)
>in the DebugLib instance. These APIs would expose print
>routines with VaList parameter and BaseList parameter.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../PeiDxeDebugLibReportStatusCode/DebugLib.c  | 173
>+
> 1 file changed, 145 insertions(+), 28 deletions(-)
>
>diff --git
>a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>index b0445115a9..7ae4edb40d 100644
>---
>a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>+++
>b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/De
>bugLib.c
>@@ -4,7 +4,7 @@
>   Note that if the debug message length is larger than the maximum allowable
>   record length, then the debug message will be ignored directly.
>
>-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
>+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD
>License
>   which accompanies this distribution.  The full text of the license may be
>found at
>@@ -27,6 +27,12 @@
> #include 
> #include 
>
>+//
>+// VA_LIST can not initialize to NULL for all compiler, so we use this to
>+// indicate a null VA_LIST
>+//
>+VA_LIST mVaListNull;
>+
> /**
>   Prints a debug message to the debug output device if the specified error
>level is enabled.
>
>@@ -52,13 +58,49 @@ DebugPrint (
>   IN  CONST CHAR8  *Format,
>   ...
>   )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled base on Null-terminated format string and a
>+  VA_LIST argument list or a BASE_LIST argument list.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  Only one list type is used.
>+  If BaseListMarker == NULL, then use VaListMarker.
>+  Otherwise use BaseListMarker and the VaListMarker should be initilized as
>+  mVaListNull.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  VaListMarkerVA_LIST marker for the variable argument list.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+DebugPrintMarker (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  VA_LIST   VaListMarker,
>+  IN  BASE_LIST BaseListMarker
>+  )
> {
>   UINT64  Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64))
>+ 1];
>   EFI_DEBUG_INFO  *DebugInfo;
>   UINTN   TotalSize;
>   UINTN   DestBufferSize;
>-  VA_LIST VaListMarker;
>-  BASE_LIST   BaseListMarker;
>+  BASE_LIST   BaseListMarkerPointer;
>   CHAR8   *FormatString;
>   BOOLEAN Long;
>
>@@ -79,25 +121,25 @@ DebugPrint (
>   // Note that the passing-in format string and variable parameters will be
>constructed to
>   // the following layout:
>   //
>-  // Buffer->||
>-  // | Padding| 4 bytes
>-  //  DebugInfo->||
>-  // |  EFI_DEBUG_INFO| sizeof(EFI_DEBUG_INFO)
>-  // BaseListMarker->||
>-  // |   ...  |
>-  // |   variable arguments   | 12 * sizeof (UINT64)
>-  // |   ...  |
>-  // ||
>-  // |   Format String|
>-  // ||<- (UINT8 *)Buffer + 
>sizeof(Buffer)
>+  //Buffer->||
>+  //| Padding| 4 bytes
>+  // DebugInfo->||
>+  //|  EFI_DEBUG_INFO| sizeof(EFI_DEBUG_INFO)
>+  // BaseListMarkerPointer->||
>+  //|   ...  |
>+  //|   variable arguments   | 

Re: [edk2] [PATCH V4 15/17] MdeModulePkg: Add a PEIM to install Debug PPI

2019-03-27 Thread Gao, Liming
Zhichao:
  One .c file is enough for this PEIM. You can implement all in one C file. 

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Wang, Jian J ; Wu, Hao A ;
>Ni, Ray ; Zeng, Star ; Gao, Liming
>; Sean Brogan ;
>Michael Turner ; Bret Barkelew
>
>Subject: [PATCH V4 15/17] MdeModulePkg: Add a PEIM to install Debug PPI
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add a PEIM to install Debug PPI so that PEI debug library
>instance can locate gEdkiiDebugPpiGuid to implement the
>debug functions. Using this PPI can reduce the size of
>PEIMs which consume the debug library.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../Universal/DebugServicePei/DebugService.c   | 60
>++
> .../Universal/DebugServicePei/DebugService.h   | 56
>
> .../Universal/DebugServicePei/DebugServicePei.c| 54
>+++
> .../Universal/DebugServicePei/DebugServicePei.inf  | 52
>+++
> .../Universal/DebugServicePei/DebugServicePei.uni  | 20 
> 5 files changed, 242 insertions(+)
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugService.c
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugService.h
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.c
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.inf
> create mode 100644
>MdeModulePkg/Universal/DebugServicePei/DebugServicePei.uni
>
>diff --git a/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>b/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>new file mode 100644
>index 00..a9ea14db81
>--- /dev/null
>+++ b/MdeModulePkg/Universal/DebugServicePei/DebugService.c
>@@ -0,0 +1,60 @@
>+/** @file
>+  Debug services instances for PEI phase.
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  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 
>+
>+/**
>+  Print a debug message to debug output device if the specified error level
>+  is enabled.
>+
>+  @param[in] ErrorLevel   The error level of the debug message.
>+  @param[in] Format   Format string for the debug message to 
>print.
>+  @param[in] Marker   BASE_LIST marker for the variable 
>argument
>list.
>+
>+**/
>+VOID
>+EFIAPI
>+PeiDebugBPrint(
>+  IN UINTN  ErrorLevel,
>+  IN CONST CHAR8*Format,
>+  IN BASE_LIST  Marker
>+  )
>+{
>+  DebugBPrint(ErrorLevel, Format, Marker);
>+}
>+
>+/**
>+  Print an assert message containing a filename, line number, and description.
>+  This may be followed by a breakpoint or a dead loop.
>+
>+  @param[in] FileName The pointer to the name of the source 
>file
>that
>+  generated the assert condition.
>+  @param[in] LineNumber   The line number in the source file that
>generated
>+  the assert condition
>+  @param[in] Description  The pointer to the description of the 
>assert
>condition.
>+
>+**/
>+VOID
>+EFIAPI
>+PeiDebugAssert(
>+  IN CONST CHAR8*FileName,
>+  IN UINTN  LineNumber,
>+  IN CONST CHAR8*Description
>+  )
>+{
>+  DebugAssert(FileName, LineNumber, Description);
>+}
>+
>diff --git a/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>b/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>new file mode 100644
>index 00..3e234f76b6
>--- /dev/null
>+++ b/MdeModulePkg/Universal/DebugServicePei/DebugService.h
>@@ -0,0 +1,56 @@
>+/** @file
>+  Header file of Debug services instances.
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
>BASIS,
>+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
>EXPRESS OR IMPLIED.
>+
>+**/
>+#ifndef __DEBUG_SERVICE_H__
>+#define __DEBUG_SERVICE_H__
>+
>+#include 
>+
>+/**
>+  Print a debug message to debug 

Re: [edk2] [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI debug lib

2019-03-27 Thread Gao, Liming
Zhichao:
   For new library instance, I have some comments. 

1) DebugPrint(). If DebugPpi is not found, directly return instead of 
CpuDeadLoop().
2) DebugAssert(). If DebugPpi is not found, bases on PcdDebugPropertyMask value 
to trig CpuDeadLoop() or CpuBreakPoint(). 
3) Please rename mDebugPpi as the specific prefix name to avoid the name 
confliction. 
4) What test is done for this library instance? 

Thanks
Liming
>-Original Message-
>From: Gao, Zhichao
>Sent: Thursday, March 21, 2019 10:05 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming ; Wang, Jian J
>; Wu, Hao A ; Ni, Ray
>; Zeng, Star ; Sean Brogan
>; Michael Turner
>; Bret Barkelew
>
>Subject: [PATCH V4 16/17] MdeModulePkg/PeiDebugLibDebugPpi: Add PEI
>debug lib
>
>From: Liming Gao 
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395
>
>Add a PEI debug library instance PeiDebugLibDebugPpi base on
>DebugPpi. Using the combination of the DebugServicePei and
>this lib instance can reduce the image size of PEI drivers.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Zhichao Gao 
>Cc: Jian J Wang 
>Cc: Hao Wu 
>Cc: Ray Ni 
>Cc: Star Zeng 
>Cc: Liming Gao 
>Cc: Sean Brogan 
>Cc: Michael Turner 
>Cc: Bret Barkelew 
>---
> .../Library/PeiDebugLibDebugPpi/DebugLib.c | 456
>+
> .../PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf|  55 +++
> 2 files changed, 511 insertions(+)
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
> create mode 100644
>MdeModulePkg/Library/PeiDebugLibDebugPpi/PeiDebugLibDebugPpi.inf
>
>diff --git a/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>new file mode 100644
>index 00..75859163ae
>--- /dev/null
>+++ b/MdeModulePkg/Library/PeiDebugLibDebugPpi/DebugLib.c
>@@ -0,0 +1,456 @@
>+/** @file
>+  PEI debug lib instance base on DebugPpi to save size
>+
>+  Copyright (c) 2019, Intel Corporation. All rights reserved.
>+
>+  This program and the accompanying materials
>+  are licensed and made available under the terms and conditions of the BSD
>License
>+  which accompanies this distribution.  The full text of the license may be
>found at
>+  http://opensource.org/licenses/bsd-license.php
>+
>+  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 
>+#include 
>+#include 
>+#include 
>+
>+EDKII_DEBUG_PPI *mDebugPpi = NULL;
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevelThe error level of the debug message.
>+  @param  FormatFormat string for the debug message to print.
>+  @param  ...   Variable argument list whose contents are accessed
>+based on the format string specified by Format.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugPrint (
>+  IN  UINTNErrorLevel,
>+  IN  CONST CHAR8  *Format,
>+  ...
>+  )
>+{
>+  VA_LIST Marker;
>+
>+  VA_START (Marker, Format);
>+  DebugVPrint (ErrorLevel, Format, Marker);
>+  VA_END (Marker);
>+}
>+
>+
>+/**
>+  Prints a debug message to the debug output device if the specified
>+  error level is enabled.
>+  This function use BASE_LIST which would provide a more compatible
>+  service than VA_LIST.
>+
>+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
>+  GetDebugPrintErrorLevel (), then print the message specified by Format
>and
>+  the associated variable argument list to the debug output device.
>+
>+  If Format is NULL, then ASSERT().
>+
>+  @param  ErrorLevel  The error level of the debug message.
>+  @param  Format  Format string for the debug message to print.
>+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.
>+
>+**/
>+VOID
>+EFIAPI
>+DebugBPrint (
>+  IN  UINTN ErrorLevel,
>+  IN  CONST CHAR8   *Format,
>+  IN  BASE_LIST BaseListMarker
>+  )
>+{
>+  EFI_STATUS  Status;
>+
>+  //
>+  // If Format is NULL, then ASSERT().
>+  //
>+  ASSERT (Format != NULL);
>+
>+  //
>+  // Check driver Debug Level value and global debug level
>+  //
>+  if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
>+return;
>+  }
>+
>+  if (mDebugPpi == NULL) {
>+Status = PeiServicesLocatePpi (
>+,
>+0,
>+NULL,
>+(VOID **)
>+);
>+if (EFI_ERROR (Status)) {
>+  CpuDeadLoop();
>+}
>+  }
>+
>+  mDebugPpi->DebugBPrint (
>+  ErrorLevel,
>+  Format,
>+  BaseListMarker
>+  

Re: [edk2] Build SCT with edk2

2019-03-27 Thread Richardson, Brian
Have you tried building with the most recent stable tag instead of the tip?
https://github.com/tianocore/edk2/releases/tag/edk2-stable201903 

Thanks ... br
---
Brian Richardson - brian.richard...@intel.com -- @intel_brian
Director of Ecosystem & Business Development, Firmware Integration & 
Development (FID)
https://software.intel.com/en-us/meet-the-developers/evangelists/team/brian-richardson
 

-Original Message-
From: edk2-devel  On Behalf Of Ashish Singhal
Sent: Wednesday, March 27, 2019 4:10 PM
To: edk2-devel@lists.01.org
Cc: Jin, Eric 
Subject: [edk2] Build SCT with edk2

Hello,

It seems building SCT is supported with edk2 UDK2017 and not something recent. 
When I tried building it with tip, it fails. Is someone already working on 
making sure SCT can be built with edk2 tip?

Thanks
Ashish

---
This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply email and destroy all copies of the original 
message.
---
___
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] Build SCT with edk2

2019-03-27 Thread Ashish Singhal
Hello,

It seems building SCT is supported with edk2 UDK2017 and not something recent. 
When I tried building it with tip, it fails. Is someone already working on 
making sure SCT can be built with edk2 tip?

Thanks
Ashish

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-staging 00/19] IntelUndiPkg/GigUndiDxe: build fixes for AARCH64/ARM/GCC

2019-03-27 Thread Ard Biesheuvel
On Tue, 29 Jan 2019 at 14:55, Ryszard Knop  wrote:
>
> +Team
>

As it turns out, this driver is still broken for non-1:1 mapped DMA.

In particular, I am hitting a crash on

  E1000MemCopy (
(UINT8 *) (UINTN) CpbReceive->BufferAddr,
(UINT8 *) (UINTN) ReceiveDescriptor->buffer_addr,
TempLen
  );

(around line 676 in e1000.c), which uses the DMA address
'ReceiveDescriptor->buffer_addr' in a memory copy operation performed
by the CPU. This causes a crash on systems where the DMA address is
not also a valid CPU address.





> On Tue, 2019-01-29 at 14:13 +0100, Ryszard Knop wrote:
> > Hi Ard,
> >
> > I've finally got some time to review and merge all of this. A bit
> > problematic thing is that we internally have a separate tree that we
> > need to merge those commits into, then generate the open source tree
> > and related commits from that. This will result in somewhat broken
> > history, so sorry about that in advance - we're still figuring out
> > the
> > proper way to handle multiple source trees on our end without messing
> > it up. I'll push these changes to edk2-staging once we've got it all
> > ready.
> >
> > On Tue, 2018-11-06 at 18:58 +0100, ard.biesheuvela wrote:
> > > This series fixes the GigUndiDxe in the edk2-staging/Intel_UNDI
> > > branch
> > > at github.com/tianocore so it can be built with GCC on Linux for
> > > ARM
> > > and AARCH64 (as well as X64)
> > >
> > > Ard Biesheuvel (19):
> > >   IntelOpenSourceUndiPkg.dsc: add AARCH64 and ARM to supported
> > > architectures
> > >   IntelUndiPkg: remove EOF markers
> > >   IntelUndiPkg/GigUndiDxe: consistently use lowercase for e1000 in
> > > filenames
> > >   IntelUndiPkg/GigUndiDxe: consistently use forward slashes as path
> > > separators
> > >   IntelUndiPkg/GigUndiDxe: move BRAND_STRUCT declaration after type
> > > definition
> > >   IntelUndiPkg/GigUndiDxe: use intermediate UINTN casts for
> > > pointers
> > >   IntelUndiPkg/GigUndiDxe: create GCC alternatives for MSFT build
> > > options
> > >   IntelUndiPkg/GigUndiDxe: add missing VOID** cast
> > >   IntelUndiPkg/GigUndiDxe: add missing UINT8* cast
> > >   IntelUndiPkg/GigUndiDxe: add missing braces to GUID literals
> > >   IntelUndiPkg/GigUndiDxe: fix incorrect use of CPP token pasting
> > >   IntelUndiPkg/GigUndiDxe: cast E1000MemCopy () args to correct
> > > pointer
> > > type
> > >   IntelUndiPkg/GigUndiDxe: don't take address of cast expression
> > >   IntelUndiPkg/GigUndiDxe: redefine UNREFERENCED_nPARAMETER macros
> > > for
> > > GCC
> > >   IntelUndiPkg/GigUndiDxe: remove forward declaration of non-
> > > existent
> > > function
> > >   IntelUndiPkg/GigUndiDxe: fix incorrect indentation
> > >   IntelUndiPkg/GigUndiDxe: move MSFT warning overrides to INF file
> > >   IntelUndiPkg/GigUndiDxe: add missing EFIAPI modifiers
> > >   IntelUndiPkg/GigUndiDxe: remove or reorganize unused variables
> > >
> > >  IntelUndiPkg/GigUndiDxe/AdapterInformation.c  |  6 ++-
> > >  IntelUndiPkg/GigUndiDxe/AdapterInformation.h  |  1 -
> > >  IntelUndiPkg/GigUndiDxe/Brand.c   |  1 -
> > >  IntelUndiPkg/GigUndiDxe/ComponentName.c   |  5 ++-
> > >  IntelUndiPkg/GigUndiDxe/ComponentName.h   |  2 +-
> > >  IntelUndiPkg/GigUndiDxe/Decode.c  |  5 +--
> > >  IntelUndiPkg/GigUndiDxe/Decode.h  |  1 -
> > >  IntelUndiPkg/GigUndiDxe/DeviceSupport.c   |  1 -
> > >  IntelUndiPkg/GigUndiDxe/DeviceSupport.h   |  9 ++---
> > >  IntelUndiPkg/GigUndiDxe/Dma.c | 11 +++---
> > >  IntelUndiPkg/GigUndiDxe/Dma.h |  1 -
> > >  IntelUndiPkg/GigUndiDxe/DriverConfiguration.c |  6 ++-
> > >  IntelUndiPkg/GigUndiDxe/DriverConfiguration.h |  1 -
> > >  IntelUndiPkg/GigUndiDxe/DriverDiagnostics.c   | 12 +++---
> > >  IntelUndiPkg/GigUndiDxe/DriverDiagnostics.h   |  1 -
> > >  IntelUndiPkg/GigUndiDxe/DriverHealth.c|  5 ++-
> > >  IntelUndiPkg/GigUndiDxe/EepromConfig.c|  1 -
> > >  IntelUndiPkg/GigUndiDxe/EepromConfig.h|  3 +-
> > >  IntelUndiPkg/GigUndiDxe/GigUndiDxe.inf| 39 +--
> > > 
> > >  IntelUndiPkg/GigUndiDxe/Hii.c | 11 +++---
> > >  IntelUndiPkg/GigUndiDxe/Hii.h |  1 -
> > >  IntelUndiPkg/GigUndiDxe/HiiInternalLib.c  |  3 --
> > >  IntelUndiPkg/GigUndiDxe/HiiInternalLib.h  |  1 -
> > >  IntelUndiPkg/GigUndiDxe/Init.c| 11 +++---
> > >  IntelUndiPkg/GigUndiDxe/Init.h|  1 -
> > >  IntelUndiPkg/GigUndiDxe/Inventory.vfr |  1 -
> > >  IntelUndiPkg/GigUndiDxe/NVDataStruc.h |  7 ++--
> > >  IntelUndiPkg/GigUndiDxe/StartStop.c   |  5 ++-
> > >  IntelUndiPkg/GigUndiDxe/StartStop.h   |  7 ++--
> > >  IntelUndiPkg/GigUndiDxe/Version.h |  1 -
> > >  IntelUndiPkg/GigUndiDxe/{E1000.c => e1000.c}  | 37 ---
> > > --
> > > -
> > >  IntelUndiPkg/GigUndiDxe/{E1000.h => e1000.h}  |  5 +--
> > >  

Re: [edk2] [PATCH edk2-platforms] Platform/Hisilicon: update D06 system firmware description

2019-03-27 Thread Ard Biesheuvel
On Tue, 26 Mar 2019 at 21:22, Leif Lindholm  wrote:
>
> Since the D06 port now depends on updated IMP firmware to function
> properly, there needs to be a one-way upgrade path. Upgrade to the
> current state of things must happen via .hpm. Subsequent capsule updates
> cannot be permitted to go below this version.
>
> So update the firmware descriptor to Version: 3 and
> LowestSupportedFirmwareVersion: 3.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 

Acked-by: Ard Biesheuvel 

> ---
>
> Ming: I would also be cherry-picking this patch into RPF 19.03.
>
>  
> Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
>  | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git 
> a/Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
>  
> b/Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
> index 36175338dd..1287dfd834 100644
> --- 
> a/Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
> +++ 
> b/Platform/Hisilicon/D06/Drivers/SystemFirmwareDescriptor/SystemFirmwareDescriptor.aslc
> @@ -22,9 +22,9 @@
>  #define PACKAGE_VERSION 0x
>  #define PACKAGE_VERSION_STRING  L"Unknown"
>
> -#define CURRENT_FIRMWARE_VERSION0x0002
> -#define CURRENT_FIRMWARE_VERSION_STRING L"0x0002"
> -#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x0001
> +#define CURRENT_FIRMWARE_VERSION0x0003
> +#define CURRENT_FIRMWARE_VERSION_STRING L"0x0003"
> +#define LOWEST_SUPPORTED_FIRMWARE_VERSION   0x0003
>
>  #define IMAGE_IDSIGNATURE_64('H','W','A', 'R', 
> 'M', '_', 'F', 'd')
>  #define IMAGE_ID_STRING L"ARMPlatformFd"
> --
> 2.11.0
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel