Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and report error for EFI_D_*

2016-10-16 Thread Jordan Justen
On 2016-10-16 06:32:32, Zhu, Yonghong wrote:
> Thanks Jordan. I will separate the patches and send out the updated version.
> 

One other suggestion for the commit message on your patch. Can you add
this at the bottom before the Contributed-under?

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

What do you think?

Maybe we should update the commit message wiki page to suggest this as
well?

-Jordan

>
> -Original Message-
> From: Justen, Jordan L 
> Sent: Sunday, October 16, 2016 4:14 AM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and 
> report error for EFI_D_*
> 
> On 2016-10-13 02:29:46, Yonghong Zhu wrote:
> > This patch updates PatchCheck.py:
> 
> Can you split this into 3 separate patches?
> 
> > 1.Update max line length to 70 that describe in wiki
> 
> I think we should update PatchCheck.py and the wiki to say that:
> 
> 1. The subject line of the commit message should be < 72 characters.
> 
> This works well with git log --oneline to still produce output less than 80 
> characters.
> 
> 2. The other lines of the commit message should be < 76 characters.
> 
> When using git log, these lines are indented 4 characters, so once again this 
> will keep the log message readable and under 80 columns.
> 
> > 2.remove the two [] when do the char count calculation
> 
> How about instead we add a new regex to the class:
> 
> subject_prefix_re = \
> re.compile(r'''^
>\s* (\[
>[^\[\]]* # Allow all non-brackets
>\])? \s*
>''',
>re.VERBOSE)
> 
> 
> Then you can use it line this:
> 
>   self.commit_subject = \
>   self.subject_prefix_re.sub('', self.commit_subject, 1)
> 
> This will change:
> 
>   ' a' => 'a'
>   ' [patch 1] a' => 'a'
> 
> But, it will ignore this, because I don't think we should try to match 
> brackets here:
> 
>   ' [a [b]] a'
> 
> > 3.report error for EFI_D_* macro if it is used, recommend to use
> > DEBUG_* format.
> 
> This should definitely be a separate patch since we are starting to look at 
> code.
> 
> -Jordan
> 
> > 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Yonghong Zhu 
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 21 -
> >  1 file changed, 16 insertions(+), 5 deletions(-)
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py index 455c130..d423220 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -1,9 +1,9 @@
> >  ## @file
> >  #  Check a patch for various format issues  # -#  Copyright (c) 2015, 
> > Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2015 - 2016, Intel Corporation. All rights 
> > +reserved.
> >  #
> >  #  This program and the accompanying materials are licensed and made  
> > #  available under the terms and conditions of the BSD License which  
> > #  accompanies this distribution. The full text of the license may be  
> > #  found at http://opensource.org/licenses/bsd-license.php
> > @@ -14,11 +14,11 @@
> >  #
> >  
> >  from __future__ import print_function
> >  
> >  VersionNumber = '0.1'
> > -__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights 
> > reserved."
> > +__copyright__ = "Copyright (c) 2015 - 2016, Intel Corporation  All rights 
> > reserved."
> >  
> >  import email
> >  import argparse
> >  import os
> >  import re
> > @@ -195,11 +195,11 @@ class CommitMessageCheck:
> >  
> >  if count <= 0:
> >  self.error('Empty commit message!')
> >  return
> >  
> > -if count >= 1 and len(lines[0]) > 76:
> > +if count >= 1 and len(lines[0]) > 70:
> >  self.error('First line of commit message (subject line) ' +
> > 'is too long.')
> >  
> >  if count >= 1 and len(lines[0].strip()) == 0:
> >  self.error('First line of commit message (subject line) ' 
> > + @@ -208,11 +208,11 @@ class CommitMessageCheck:
> >  if count >= 2 and lines[1].strip() != '':
> >  self.error('Second line of commit message should be ' +
> > 'empty.')
> >  
> >  for i in range(2, count):
> > -if (len(lines[i]) > 76 and
> > +if (len(lines[i]) > 70 and
> >  len(lines[i].split()) > 1 and
> >  not lines[i].startswith('git-svn-id:')):
> >  self.error('Line %d of commit message is too long.' % 
> > (i + 1))
> >  
> >  last_sig_line = None
> > @@ -354,10 +354,12 @@ class GitDiffCheck:
> >line)
> >  if '' in line:
> >  self.added_line_error('Tab character used', 

Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and report error for EFI_D_*

2016-10-16 Thread Jordan Justen
On 2016-10-16 06:32:32, Zhu, Yonghong wrote:
> Thanks Jordan. I will separate the patches and send out the updated version.
> 
> Besides can you help to update the wiki ? 
> 

How does it look?

https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format

-Jordan

> 
> -Original Message-
> From: Justen, Jordan L 
> Sent: Sunday, October 16, 2016 4:14 AM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and 
> report error for EFI_D_*
> 
> On 2016-10-13 02:29:46, Yonghong Zhu wrote:
> > This patch updates PatchCheck.py:
> 
> Can you split this into 3 separate patches?
> 
> > 1.Update max line length to 70 that describe in wiki
> 
> I think we should update PatchCheck.py and the wiki to say that:
> 
> 1. The subject line of the commit message should be < 72 characters.
> 
> This works well with git log --oneline to still produce output less than 80 
> characters.
> 
> 2. The other lines of the commit message should be < 76 characters.
> 
> When using git log, these lines are indented 4 characters, so once again this 
> will keep the log message readable and under 80 columns.
> 
> > 2.remove the two [] when do the char count calculation
> 
> How about instead we add a new regex to the class:
> 
> subject_prefix_re = \
> re.compile(r'''^
>\s* (\[
>[^\[\]]* # Allow all non-brackets
>\])? \s*
>''',
>re.VERBOSE)
> 
> 
> Then you can use it line this:
> 
>   self.commit_subject = \
>   self.subject_prefix_re.sub('', self.commit_subject, 1)
> 
> This will change:
> 
>   ' a' => 'a'
>   ' [patch 1] a' => 'a'
> 
> But, it will ignore this, because I don't think we should try to match 
> brackets here:
> 
>   ' [a [b]] a'
> 
> > 3.report error for EFI_D_* macro if it is used, recommend to use
> > DEBUG_* format.
> 
> This should definitely be a separate patch since we are starting to look at 
> code.
> 
> -Jordan
> 
> > 
> > Cc: Liming Gao 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Yonghong Zhu 
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 21 -
> >  1 file changed, 16 insertions(+), 5 deletions(-)
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py index 455c130..d423220 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -1,9 +1,9 @@
> >  ## @file
> >  #  Check a patch for various format issues  # -#  Copyright (c) 2015, 
> > Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2015 - 2016, Intel Corporation. All rights 
> > +reserved.
> >  #
> >  #  This program and the accompanying materials are licensed and made  
> > #  available under the terms and conditions of the BSD License which  
> > #  accompanies this distribution. The full text of the license may be  
> > #  found at http://opensource.org/licenses/bsd-license.php
> > @@ -14,11 +14,11 @@
> >  #
> >  
> >  from __future__ import print_function
> >  
> >  VersionNumber = '0.1'
> > -__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights 
> > reserved."
> > +__copyright__ = "Copyright (c) 2015 - 2016, Intel Corporation  All rights 
> > reserved."
> >  
> >  import email
> >  import argparse
> >  import os
> >  import re
> > @@ -195,11 +195,11 @@ class CommitMessageCheck:
> >  
> >  if count <= 0:
> >  self.error('Empty commit message!')
> >  return
> >  
> > -if count >= 1 and len(lines[0]) > 76:
> > +if count >= 1 and len(lines[0]) > 70:
> >  self.error('First line of commit message (subject line) ' +
> > 'is too long.')
> >  
> >  if count >= 1 and len(lines[0].strip()) == 0:
> >  self.error('First line of commit message (subject line) ' 
> > + @@ -208,11 +208,11 @@ class CommitMessageCheck:
> >  if count >= 2 and lines[1].strip() != '':
> >  self.error('Second line of commit message should be ' +
> > 'empty.')
> >  
> >  for i in range(2, count):
> > -if (len(lines[i]) > 76 and
> > +if (len(lines[i]) > 70 and
> >  len(lines[i].split()) > 1 and
> >  not lines[i].startswith('git-svn-id:')):
> >  self.error('Line %d of commit message is too long.' % 
> > (i + 1))
> >  
> >  last_sig_line = None
> > @@ -354,10 +354,12 @@ class GitDiffCheck:
> >line)
> >  if '' in line:
> >  self.added_line_error('Tab character used', line)
> >  if len(stripped) < len(line):
> >  self.added_line_error('Trailing whitespace found', line)
> > +   

Re: [edk2] [Patch] BaseTools: Update sign tool to make MonotonicCount *after* Payload

2016-10-16 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Yao, Jiewen
> Sent: Friday, October 14, 2016 9:11 PM
> To: Zhu, Yonghong ; edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: RE: [edk2] [Patch] BaseTools: Update sign tool to make
> MonotonicCount *after* Payload
> 
> Reviewed-by: jiewen@intel.com
> Tested-by: jiewen@intel.com
> 
> 
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Yonghong Zhu
> > Sent: Friday, October 14, 2016 8:57 PM
> > To: edk2-devel@lists.01.org
> > Cc: Yao, Jiewen ; Gao, Liming
> > 
> > Subject: [edk2] [Patch] BaseTools: Update sign tool to make
> > MonotonicCount *after* Payload
> >
> > The WIN_CERTIFICATE_UEFI_GUID AuthInfo defined in the UEFI spec
> > mentioned that It is a signature across the image data and the
> > Monotonic Count value. After clarification, we do the signature
> > calculation, we put MonotonicCount after Payload.
> >
> > Cc: Liming Gao 
> > Cc: Jiewen Yao 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Yonghong Zhu 
> > ---
> >  BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py | 8
> > 
> >  BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py | 8
> > 
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
> > b/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
> > index b9f8c06..f0b2d8a 100644
> > --- a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
> > +++ b/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py
> > @@ -195,12 +195,12 @@ if __name__ == '__main__':
> >  args.OtherPublicCertFile.close()
> >except:
> >  print 'ERROR: test other public cert file %s missing' %
> > (args.OtherPublicCertFileName)
> >  sys.exit(1)
> >
> > -format = "Q%ds" % len(args.InputFileBuffer)
> > -FullInputFileBuffer = struct.pack(format,args.MonotonicCountValue,
> > args.InputFileBuffer)
> > +format = "%dsQ" % len(args.InputFileBuffer)
> > +FullInputFileBuffer = struct.pack(format, args.InputFileBuffer,
> > args.MonotonicCountValue)
> >
> >  #
> >  # Sign the input file using the specified private key and capture
> > signature from STDOUT
> >  #
> >  Process = subprocess.Popen('%s smime -sign -binary -signer "%s"
> > -outform DER -md sha256 -certfile "%s"' % (OpenSslCommand,
> > args.SignerPrivateCertFileName, args.OtherPublicCertFileName),
> > stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > @@ -259,12 +259,12 @@ if __name__ == '__main__':
> >  sys.exit(1)
> >
> >  args.SignatureBuffer = args.InputFileBuffer[0:SignatureSize]
> >  args.InputFileBuffer = args.InputFileBuffer[SignatureSize:]
> >
> > -format = "Q%ds" % len(args.InputFileBuffer)
> > -FullInputFileBuffer = struct.pack(format,args.MonotonicCountValue,
> > args.InputFileBuffer)
> > +format = "%dsQ" % len(args.InputFileBuffer)
> > +FullInputFileBuffer = struct.pack(format, args.InputFileBuffer,
> > args.MonotonicCountValue)
> >
> >  #
> >  # Save output file contents from input file
> >  #
> >  open(args.OutputFileName, 'wb').write(FullInputFileBuffer)
> > diff --git
> > a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py
> > b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py
> > index 3410668..199ebec 100644
> > --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py
> > +++
> b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py
> > @@ -167,12 +167,12 @@ if __name__ == '__main__':
> >  pass
> >
> >if args.Encode:
> >  FullInputFileBuffer = args.InputFileBuffer
> >  if args.MonotonicCountStr:
> > -  format = "Q%ds" % len(args.InputFileBuffer)
> > -  FullInputFileBuffer = struct.pack(format,args.MonotonicCountValue,
> > args.InputFileBuffer)
> > +  format = "%dsQ" % len(args.InputFileBuffer)
> > +  FullInputFileBuffer = struct.pack(format, args.InputFileBuffer,
> > args.MonotonicCountValue)
> >  #
> >  # Sign the input file using the specified private key and capture
> > signature from STDOUT
> >  #
> >  Process = subprocess.Popen('%s sha256 -sign "%s"' %
> > (OpenSslCommand, args.PrivateKeyFileName), stdin=subprocess.PIPE,
> > stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> >  Signature = Process.communicate(input=FullInputFileBuffer)[0]
> > @@ -210,12 +210,12 @@ if __name__ == '__main__':
> >print 'ERROR: Public key in input file does not match public key from
> > private key file'
> >sys.exit(1)
> >
> >  FullInputFileBuffer = args.InputFileBuffer
> >  if args.MonotonicCountStr:
> > -  format = "Q%ds" % len(args.InputFileBuffer)
> > -  FullInputFileBuffer 

[edk2] [PATCH] ArmPkg ArmVirtPkg: fix the GIC base address variables as 64-bit

2016-10-16 Thread Dennis Chen
Since ACPI spec defines the GIC base addresses (CPU interface,
Distributor and Redistributor*GICv3 only*) as 64-bit, so we
should define these corresponding base address variables as 64-bit
instead of 32-bit. This patch redefines them according to the
ACPI spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Signed-off-by: Dennis Chen 
---
 ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c| 4 ++--
 ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c 
b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
index b9ecd55..a4ba5cf 100644
--- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
+++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
@@ -30,8 +30,8 @@ Abstract:
 
 extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptV2Protocol;
 
-STATIC UINT32 mGicInterruptInterfaceBase;
-STATIC UINT32 mGicDistributorBase;
+STATIC UINTN mGicInterruptInterfaceBase;
+STATIC UINTN mGicDistributorBase;
 
 /**
   Enable interrupt source Source.
diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c 
b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
index 64afc4d..16683ef 100644
--- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
+++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c
@@ -79,11 +79,11 @@ ArmVirtGicArchLibConstructor (
 
 // RegProp[0..1] == { GICD base, GICD size }
 DistBase = SwapBytes64 (Reg[0]);
-ASSERT (DistBase < MAX_UINT32);
+ASSERT (DistBase < MAX_UINT64);
 
 // RegProp[2..3] == { GICR base, GICR size }
 RedistBase = SwapBytes64 (Reg[2]);
-ASSERT (RedistBase < MAX_UINT32);
+ASSERT (RedistBase < MAX_UINT64);
 
 PcdSet64 (PcdGicDistributorBase, DistBase);
 PcdSet64 (PcdGicRedistributorsBase, RedistBase);
@@ -117,8 +117,8 @@ ArmVirtGicArchLibConstructor (
 
 DistBase = SwapBytes64 (Reg[0]);
 CpuBase  = SwapBytes64 (Reg[2]);
-ASSERT (DistBase < MAX_UINT32);
-ASSERT (CpuBase < MAX_UINT32);
+ASSERT (DistBase < MAX_UINT64);
+ASSERT (CpuBase < MAX_UINT64);
 
 PcdSet64 (PcdGicDistributorBase, DistBase);
 PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase);
-- 
2.7.4

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


Re: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-endian MMIO

2016-10-16 Thread Kinney, Michael D
Bhupesh,

It is also possible to add an ARM specific PCD to select endianness and update
MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c to use that PCD in 
MmioRead/Write() 
APIs in that file to support both endian types.  You can use the SwapBytesxx()
functions from BaseLib(as Laszlo suggested) based on the setting of this ARM 
specific PCD.

Modules that link against this lib can select endianness by setting PCD in the 
scope of that module.

The IPF version of IoLib uses an IPF specific PCD to translate I/O port accesses
to MMIO accesses.  So there is already an example of an arch specific PCD in 
this
lib instance.

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
> Liming
> Sent: Monday, October 17, 2016 11:10 AM
> To: Bhupesh Sharma ; edk2-de...@ml01.01.org
> Subject: Re: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-endian MMIO
> 
> Bhupesh:
>   In this patch, five class APIs are new added. They are
> MmioReadBe16(),MmioWriteBe16(),MmioClearSetBe16(),MmioSetBitsBe16(),MmioClearBitsBe16
> (). In fact, they can map to the existing MMIO APIs. Below is their mapping. 
> And, I
> understand some hardware uses little-endian MMIO interfaces, other hardware 
> use big-
> endian MMIO interfaces. But, there are no hardware to require little-endian 
> and big-
> endian at the same time. If so, we don't need to expose MmioRead16() and
> MmioReadBe16() API both in the same library instances. For your case, I 
> suggest to
> add new IoLib library instance that implement the existing MMIO APIs with the 
> big-
> endian way. This library instance can be placed into ARM device package.
> 
> MmioReadBe16()  --> MmioRead16()
> MmioWriteBe16() --> MmioWrite16()
> MmioClearSetBe16() -->  MmioAndThenOr16()
> MmioSetBitsBe16() --> MmioOr16()
> MmioClearBitsBe16() -->  MmioAnd16()
> 
> Thanks
> Liming
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Bhupesh Sharma
> > Sent: Friday, October 14, 2016 5:34 PM
> > To: edk2-de...@ml01.01.org
> > Subject: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-endian
> > MMIO
> >
> > Various IPs on NXP/FSL SoCs having ARM64 cores have big-endian
> > MMIO interfaces.
> >
> > This implies that a byte-swap operation is needed to read/write
> > such BE MMIO registers from the LE ARM64 cores.
> >
> > This patch adds the support for the same.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Meenakshi Aggarwal 
> > Signed-off-by: Bhupesh Sharma 
> > ---
> >  MdePkg/Include/Library/IoLib.h   | 364 
> >  MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c | 479
> > +++
> >  2 files changed, 843 insertions(+)
> >
> > diff --git a/MdePkg/Include/Library/IoLib.h
> > b/MdePkg/Include/Library/IoLib.h
> > index a0dd16b..f5842e6 100644
> > --- a/MdePkg/Include/Library/IoLib.h
> > +++ b/MdePkg/Include/Library/IoLib.h
> > @@ -2658,6 +2658,370 @@ MmioWriteBuffer64 (
> >IN  CONST UINT64 *Buffer
> >);
> >
> > +/**
> > +  Reads a 16-bit MMIO register in Big Endian format.
> > +
> > +  Reads the 16-bit MMIO register specified by Address. The 16-bit read 
> > value
> > is
> > +  returned. This function must guarantee that all MMIO read and write
> > +  operations are serialized.
> > +
> > +  If 16-bit MMIO register operations are not supported, then ASSERT().
> > +
> > +  @param  Address The MMIO register to read.
> > +
> > +  @return The value read.
> > +
> > +**/
> > +UINT16
> > +EFIAPI
> > +MmioReadBe16 (
> > +  IN  UINTN Address
> > +  );
> > +
> > +/**
> > +  Writes a 16-bit MMIO register in Big Endian format.
> > +
> > +  Writes the 16-bit MMIO register specified by Address with the value
> > specified
> > +  by Value and returns Value. This function must guarantee that all MMIO
> > read
> > +  and write operations are serialized.
> > +
> > +  If 16-bit MMIO register operations are not supported, then ASSERT().
> > +
> > +  @param  Address The MMIO register to write.
> > +  @param  Value   The value to write to the MMIO register.
> > +
> > +**/
> > +UINT16
> > +EFIAPI
> > +MmioWriteBe16 (
> > +  IN  UINTN Address,
> > +  IN  UINT16Value
> > +  );
> > +
> > +/**
> > +  Reads a 32-bit MMIO register in Big Endian format.
> > +
> > +  Reads the 32-bit MMIO register specified by Address. The 32-bit read 
> > value
> > is
> > +  returned. This function must guarantee that all MMIO read and write
> > +  operations are serialized.
> > +
> > +  If 32-bit MMIO register operations are not supported, then ASSERT().
> > +
> > +  @param  Address The MMIO register to read.
> > +
> > +  @return The value read.
> > +
> > +**/
> > +UINT32
> > +EFIAPI
> > +MmioReadBe32 (
> > +  IN  UINTN Address
> > +  );
> > +
> > +/**
> > +  

Re: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-endian MMIO

2016-10-16 Thread Gao, Liming
Bhupesh:
  In this patch, five class APIs are new added. They are 
MmioReadBe16(),MmioWriteBe16(),MmioClearSetBe16(),MmioSetBitsBe16(),MmioClearBitsBe16().
 In fact, they can map to the existing MMIO APIs. Below is their mapping. And, 
I understand some hardware uses little-endian MMIO interfaces, other hardware 
use big-endian MMIO interfaces. But, there are no hardware to require 
little-endian and big-endian at the same time. If so, we don't need to expose 
MmioRead16() and MmioReadBe16() API both in the same library instances. For 
your case, I suggest to add new IoLib library instance that implement the 
existing MMIO APIs with the big-endian way. This library instance can be placed 
into ARM device package. 

MmioReadBe16()  --> MmioRead16()
MmioWriteBe16() --> MmioWrite16()
MmioClearSetBe16() -->  MmioAndThenOr16()
MmioSetBitsBe16() --> MmioOr16()
MmioClearBitsBe16() -->  MmioAnd16()

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Bhupesh Sharma
> Sent: Friday, October 14, 2016 5:34 PM
> To: edk2-de...@ml01.01.org
> Subject: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-endian
> MMIO
> 
> Various IPs on NXP/FSL SoCs having ARM64 cores have big-endian
> MMIO interfaces.
> 
> This implies that a byte-swap operation is needed to read/write
> such BE MMIO registers from the LE ARM64 cores.
> 
> This patch adds the support for the same.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Meenakshi Aggarwal 
> Signed-off-by: Bhupesh Sharma 
> ---
>  MdePkg/Include/Library/IoLib.h   | 364 
>  MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c | 479
> +++
>  2 files changed, 843 insertions(+)
> 
> diff --git a/MdePkg/Include/Library/IoLib.h
> b/MdePkg/Include/Library/IoLib.h
> index a0dd16b..f5842e6 100644
> --- a/MdePkg/Include/Library/IoLib.h
> +++ b/MdePkg/Include/Library/IoLib.h
> @@ -2658,6 +2658,370 @@ MmioWriteBuffer64 (
>IN  CONST UINT64 *Buffer
>);
> 
> +/**
> +  Reads a 16-bit MMIO register in Big Endian format.
> +
> +  Reads the 16-bit MMIO register specified by Address. The 16-bit read value
> is
> +  returned. This function must guarantee that all MMIO read and write
> +  operations are serialized.
> +
> +  If 16-bit MMIO register operations are not supported, then ASSERT().
> +
> +  @param  Address The MMIO register to read.
> +
> +  @return The value read.
> +
> +**/
> +UINT16
> +EFIAPI
> +MmioReadBe16 (
> +  IN  UINTN Address
> +  );
> +
> +/**
> +  Writes a 16-bit MMIO register in Big Endian format.
> +
> +  Writes the 16-bit MMIO register specified by Address with the value
> specified
> +  by Value and returns Value. This function must guarantee that all MMIO
> read
> +  and write operations are serialized.
> +
> +  If 16-bit MMIO register operations are not supported, then ASSERT().
> +
> +  @param  Address The MMIO register to write.
> +  @param  Value   The value to write to the MMIO register.
> +
> +**/
> +UINT16
> +EFIAPI
> +MmioWriteBe16 (
> +  IN  UINTN Address,
> +  IN  UINT16Value
> +  );
> +
> +/**
> +  Reads a 32-bit MMIO register in Big Endian format.
> +
> +  Reads the 32-bit MMIO register specified by Address. The 32-bit read value
> is
> +  returned. This function must guarantee that all MMIO read and write
> +  operations are serialized.
> +
> +  If 32-bit MMIO register operations are not supported, then ASSERT().
> +
> +  @param  Address The MMIO register to read.
> +
> +  @return The value read.
> +
> +**/
> +UINT32
> +EFIAPI
> +MmioReadBe32 (
> +  IN  UINTN Address
> +  );
> +
> +/**
> +  Writes a 32-bit MMIO register in Big Endian format.
> +
> +  Writes the 32-bit MMIO register specified by Address with the value
> specified
> +  by Value and returns Value. This function must guarantee that all MMIO
> read
> +  and write operations are serialized.
> +
> +  If 32-bit MMIO register operations are not supported, then ASSERT().
> +
> +  @param  Address The MMIO register to write.
> +  @param  Value   The value to write to the MMIO register.
> +
> +**/
> +UINT32
> +EFIAPI
> +MmioWriteBe32 (
> +  IN  UINTN Address,
> +  IN  UINT32Value
> +  );
> +
> +
> +/**
> +  Reads a 64-bit MMIO register in Big Endian format.
> +
> +  Reads the 64-bit MMIO register specified by Address. The 64-bit read value
> is
> +  returned. This function must guarantee that all MMIO read and write
> +  operations are serialized.
> +
> +  If 64-bit MMIO register operations are not supported, then ASSERT().
> +
> +  @param  Address The MMIO register to read.
> +
> +  @return The value read.
> +
> +**/
> +UINT64
> +EFIAPI
> +MmioReadBe64 (
> +  IN  UINTN Address
> +  );
> +
> +
> +/**
> +  Writes a 64-bit MMIO register in 

Re: [edk2] [PATCH 0/2] Fix typo 'Ihis' with 'This' in codes

2016-10-16 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Hao Wu
> Sent: Monday, October 17, 2016 9:33 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A 
> Subject: [edk2] [PATCH 0/2] Fix typo 'Ihis' with 'This' in codes
> 
> Hao Wu (2):
>   MdePkg/TrEEProtocol.h: Fix typo 'Ihis' with 'This' in comment
>   SecurityPkg: Fix typo 'Ihis' with 'This' in codes
> 
>  MdePkg/Include/Protocol/TrEEProtocol.h
> | 4 ++--
>  SecurityPkg/Include/Library/HashLib.h
> | 4 ++--
>  SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h   |
> 2 +-
>  SecurityPkg/Include/Library/Tcg2PpVendorLib.h
> | 4 ++--
>  SecurityPkg/Include/Library/TcgPhysicalPresenceLib.h|
> 4 ++--
>  SecurityPkg/Include/Library/TcgPpVendorLib.h
> | 4 ++--
>  SecurityPkg/Include/Library/TpmCommLib.h
> | 4 ++--
>  SecurityPkg/Include/Library/TrEEPhysicalPresenceLib.h   |
> 4 ++--
>  SecurityPkg/Include/Library/TrEEPpVendorLib.h
> | 4 ++--
>  SecurityPkg/Include/Ppi/FirmwareVolumeInfoMeasurementExcluded.h
> | 4 ++--
>  SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.c   |
> 4 ++--
>  SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.c   |
> 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.c
> | 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.h
> | 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.c
> | 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf  |
> 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.uni  |
> 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c|
> 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf  |
> 4 ++--
>  .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.uni  |
> 4 ++--
>  SecurityPkg/Library/HashLibTpm2/HashLibTpm2.c
> | 4 ++--
>  SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.c
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.c
> | 2 +-
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.c
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.uni
> | 6 +++---
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.c
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.inf  |
> 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.uni  |
> 6 +++---
>  SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c
> | 4 ++--
>  SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c
> | 4 ++--
>  32 files changed, 64 insertions(+), 64 deletions(-)
> 
> --
> 1.9.5.msysgit.0
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 1/2] MdePkg/TrEEProtocol.h: Fix typo 'Ihis' with 'This' in comment

2016-10-16 Thread Hao Wu
Cc: Jiewen Yao 
Cc: Liming Gao 
Cc: Michael Kinney 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu 
---
 MdePkg/Include/Protocol/TrEEProtocol.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Protocol/TrEEProtocol.h 
b/MdePkg/Include/Protocol/TrEEProtocol.h
index 96eadc2..9a43738 100644
--- a/MdePkg/Include/Protocol/TrEEProtocol.h
+++ b/MdePkg/Include/Protocol/TrEEProtocol.h
@@ -1,7 +1,7 @@
 /** @file
-  Ihis protocol is defined to abstract TPM2 hardware access in boot phase.
+  This protocol is defined to abstract TPM2 hardware access in boot phase.
 
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials 
 are licensed and made available under the terms and conditions of the BSD 
License 
 which accompanies this distribution.  The full text of the license may be 
found at 
-- 
1.9.5.msysgit.0

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


[edk2] [PATCH 0/2] Fix typo 'Ihis' with 'This' in codes

2016-10-16 Thread Hao Wu
Hao Wu (2):
  MdePkg/TrEEProtocol.h: Fix typo 'Ihis' with 'This' in comment
  SecurityPkg: Fix typo 'Ihis' with 'This' in codes

 MdePkg/Include/Protocol/TrEEProtocol.h  | 4 ++--
 SecurityPkg/Include/Library/HashLib.h   | 4 ++--
 SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h   | 2 +-
 SecurityPkg/Include/Library/Tcg2PpVendorLib.h   | 4 ++--
 SecurityPkg/Include/Library/TcgPhysicalPresenceLib.h| 4 ++--
 SecurityPkg/Include/Library/TcgPpVendorLib.h| 4 ++--
 SecurityPkg/Include/Library/TpmCommLib.h| 4 ++--
 SecurityPkg/Include/Library/TrEEPhysicalPresenceLib.h   | 4 ++--
 SecurityPkg/Include/Library/TrEEPpVendorLib.h   | 4 ++--
 SecurityPkg/Include/Ppi/FirmwareVolumeInfoMeasurementExcluded.h | 4 ++--
 SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.c   | 4 ++--
 SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.c   | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.c | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.h | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.c| 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.uni  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c| 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.uni  | 4 ++--
 SecurityPkg/Library/HashLibTpm2/HashLibTpm2.c   | 4 ++--
 SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.c | 2 +-
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.c| 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf  | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.uni  | 6 +++---
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.c| 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.inf  | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.uni  | 6 +++---
 SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c   | 4 ++--
 32 files changed, 64 insertions(+), 64 deletions(-)

-- 
1.9.5.msysgit.0

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


[edk2] [PATCH 2/2] SecurityPkg: Fix typo 'Ihis' with 'This' in codes

2016-10-16 Thread Hao Wu
Cc: Jiewen Yao 
Cc: Chao Zhang 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu 
---
 SecurityPkg/Include/Library/HashLib.h   | 4 ++--
 SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h   | 2 +-
 SecurityPkg/Include/Library/Tcg2PpVendorLib.h   | 4 ++--
 SecurityPkg/Include/Library/TcgPhysicalPresenceLib.h| 4 ++--
 SecurityPkg/Include/Library/TcgPpVendorLib.h| 4 ++--
 SecurityPkg/Include/Library/TpmCommLib.h| 4 ++--
 SecurityPkg/Include/Library/TrEEPhysicalPresenceLib.h   | 4 ++--
 SecurityPkg/Include/Library/TrEEPpVendorLib.h   | 4 ++--
 SecurityPkg/Include/Ppi/FirmwareVolumeInfoMeasurementExcluded.h | 4 ++--
 SecurityPkg/Library/HashInstanceLibSha1/HashInstanceLibSha1.c   | 4 ++--
 SecurityPkg/Library/HashInstanceLibSha256/HashInstanceLibSha256.c   | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.c | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterCommon.h | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.c| 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.inf  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterDxe.uni  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.c| 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf  | 4 ++--
 .../Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.uni  | 4 ++--
 SecurityPkg/Library/HashLibTpm2/HashLibTpm2.c   | 4 ++--
 SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2InstanceLibDTpm.c | 2 +-
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.c| 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.inf  | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterDxe.uni  | 6 +++---
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.c| 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.inf  | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibRouterPei.uni  | 6 +++---
 SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.c   | 4 ++--
 SecurityPkg/Library/Tpm2DeviceLibTrEE/Tpm2DeviceLibTrEE.c   | 4 ++--
 31 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/SecurityPkg/Include/Library/HashLib.h 
b/SecurityPkg/Include/Library/HashLib.h
index b857569..8be8b9c 100644
--- a/SecurityPkg/Include/Library/HashLib.h
+++ b/SecurityPkg/Include/Library/HashLib.h
@@ -1,9 +1,9 @@
 /** @file
-  Ihis library abstract TPM2 hash calculation.
+  This library abstract TPM2 hash calculation.
   The platform can choose multiply hash, while caller just need invoke these 
API.
   Then all hash value will be returned and/or extended.
 
-Copyright (c) 2013, Intel Corporation. All rights reserved. 
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
diff --git a/SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h 
b/SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h
index 1bee13a..696c7e8 100644
--- a/SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h
+++ b/SecurityPkg/Include/Library/Tcg2PhysicalPresenceLib.h
@@ -1,5 +1,5 @@
 /** @file
-  Ihis library is intended to be used by BDS modules.
+  This library is intended to be used by BDS modules.
   This library will execute TPM2 request.
 
 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
diff --git a/SecurityPkg/Include/Library/Tcg2PpVendorLib.h 
b/SecurityPkg/Include/Library/Tcg2PpVendorLib.h
index 2434750..5ae7413 100644
--- a/SecurityPkg/Include/Library/Tcg2PpVendorLib.h
+++ b/SecurityPkg/Include/Library/Tcg2PpVendorLib.h
@@ -1,5 +1,5 @@
 /** @file
-  Ihis library is to support TCG PC Client Platform Physical Presence 
Interface Specification
+  This library is to support TCG PC Client Platform Physical Presence 
Interface Specification
   Family "2.0" part, >= 128 Vendor Specific PPI Operation.
 
   The Vendor Specific PPI operation may change TPM state, BIOS TPM management
@@ -7,7 +7,7 @@
   
   Caution: This function may receive untrusted input.
 
-Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials 
 are licensed and made available under the terms and conditions of the BSD 
License 
 which accompanies this distribution.  The full text of the 

Re: [edk2] [PATCH] GPT Shell Application/Library

2016-10-16 Thread Laszlo Ersek
On 10/16/16 07:23, Vladimir Olovyannikov wrote:
> This allows managing (create, delete, modify, fat format) of GPT
> partitions from within UEFI Shell.
> Syntax:
> gpt  [device_mapped_name] [parameters...]
> See usage examples in the .uni file
> ---
>  .../Library/UefiShellGptCommandLib/FatFormat.c |  611 +++
>  .../Library/UefiShellGptCommandLib/FatFormat.h |  111 ++
>  .../Library/UefiShellGptCommandLib/GptWorker.c | 1902 
> 
>  .../Library/UefiShellGptCommandLib/GptWorker.h |  186 ++
>  .../UefiShellGptCommandLib.c   | 1135 
>  .../UefiShellGptCommandLib.inf |   79 +
>  .../UefiShellGptCommandLib.uni |  117 ++
>  ShellPkg/ShellPkg.dec  |1 +
>  ShellPkg/ShellPkg.dsc  |4 +
>  9 files changed, 4146 insertions(+)
>  create mode 100644 ShellPkg/Library/UefiShellGptCommandLib/FatFormat.c
>  create mode 100644 ShellPkg/Library/UefiShellGptCommandLib/FatFormat.h
>  create mode 100644 ShellPkg/Library/UefiShellGptCommandLib/GptWorker.c
>  create mode 100644 ShellPkg/Library/UefiShellGptCommandLib/GptWorker.h
>  create mode 100644 
> ShellPkg/Library/UefiShellGptCommandLib/UefiShellGptCommandLib.c
>  create mode 100644 
> ShellPkg/Library/UefiShellGptCommandLib/UefiShellGptCommandLib.inf
>  create mode 100644 
> ShellPkg/Library/UefiShellGptCommandLib/UefiShellGptCommandLib.uni

This looks like a supremely welcome, long-awaited addition (latest
request:
),
but it really needs your Signed-off-by, and the Contributed-under line
above it:

ShellPkg/Contributions.txt

I would also suggest (simply based on what I've seen elsewhere in edk2)
to keep the copyright notices tightly collected in the file headings.

Someone will have to go over all the licenses too -- does the "Marvell
BSD License Option" for example correspond to the 3-clause BSDL?

On the technical side, I believe that as long as a shell command (or a
command option) is not standardized (in the shell spec), it usually
starts with an underscore (_), so as to prevent future name collisions.
(I could be wrong about this -- I now recall the TFTP command, which is
also not in the 2.2 spec.)

Just my two cents.

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


Re: [edk2] [PATCH 0/5] OvmfPkg/QemuVideoDxe: cleanups and tweaks

2016-10-16 Thread Laszlo Ersek
On 10/15/16 22:25, Jordan Justen wrote:
> Series Reviewed-by: Jordan Justen 

Commit range 5b54c92a6537..4dd8787a20e2.

Thank you!
Laszlo

> On 2016-10-12 03:09:00, Laszlo Ersek wrote:
>> Reviewing (part of) Ray's recent FrameBufferBltLib changes gave me the
>> idea for this. The patches are really small.
>>
>> Public branch: .
>>
>> Cc: Jordan Justen 
>>
>> Thanks
>> Laszlo
>>
>> Laszlo Ersek (5):
>>   OvmfPkg/QemuVideoDxe: drop useless QEMU_VIDEO_MODE_DATA.RefreshRate
>>   OvmfPkg/QemuVideoDxe: drop QEMU_VIDEO_CIRRUS_MODES.RefreshRate
>>   OvmfPkg/QemuVideoDxe: remove useless
>> QEMU_VIDEO_PRIVATE_DATA.CurrentMode
>>   OvmfPkg/QemuVideoDxe: remove useless
>> QEMU_VIDEO_PRIVATE_DATA.LineBuffer
>>   OvmfPkg/QemuVideoDxe: upgrade VERBOSE debug messages to INFO
>>
>>  OvmfPkg/QemuVideoDxe/Qemu.h   |  9 ++
>>  OvmfPkg/QemuVideoDxe/Gop.c| 16 ---
>>  OvmfPkg/QemuVideoDxe/Initialize.c | 30 +---
>>  OvmfPkg/QemuVideoDxe/VbeShim.c|  4 +--
>>  4 files changed, 17 insertions(+), 42 deletions(-)
>>
>> -- 
>> 2.9.2
>>

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


Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and report error for EFI_D_*

2016-10-16 Thread Zhu, Yonghong
Thanks Jordan. I will separate the patches and send out the updated version.

Besides can you help to update the wiki ? 

Best Regards,
Zhu Yonghong


-Original Message-
From: Justen, Jordan L 
Sent: Sunday, October 16, 2016 4:14 AM
To: Zhu, Yonghong ; edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: Re: [edk2] [Patch] BaseTools: PatchCheck to align with wiki and report 
error for EFI_D_*

On 2016-10-13 02:29:46, Yonghong Zhu wrote:
> This patch updates PatchCheck.py:

Can you split this into 3 separate patches?

> 1.Update max line length to 70 that describe in wiki

I think we should update PatchCheck.py and the wiki to say that:

1. The subject line of the commit message should be < 72 characters.

This works well with git log --oneline to still produce output less than 80 
characters.

2. The other lines of the commit message should be < 76 characters.

When using git log, these lines are indented 4 characters, so once again this 
will keep the log message readable and under 80 columns.

> 2.remove the two [] when do the char count calculation

How about instead we add a new regex to the class:

subject_prefix_re = \
re.compile(r'''^
   \s* (\[
   [^\[\]]* # Allow all non-brackets
   \])? \s*
   ''',
   re.VERBOSE)


Then you can use it line this:

  self.commit_subject = \
  self.subject_prefix_re.sub('', self.commit_subject, 1)

This will change:

  ' a' => 'a'
  ' [patch 1] a' => 'a'

But, it will ignore this, because I don't think we should try to match brackets 
here:

  ' [a [b]] a'

> 3.report error for EFI_D_* macro if it is used, recommend to use
> DEBUG_* format.

This should definitely be a separate patch since we are starting to look at 
code.

-Jordan

> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Scripts/PatchCheck.py | 21 -
>  1 file changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py 
> b/BaseTools/Scripts/PatchCheck.py index 455c130..d423220 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -1,9 +1,9 @@
>  ## @file
>  #  Check a patch for various format issues  # -#  Copyright (c) 2015, 
> Intel Corporation. All rights reserved.
> +#  Copyright (c) 2015 - 2016, Intel Corporation. All rights 
> +reserved.
>  #
>  #  This program and the accompanying materials are licensed and made  
> #  available under the terms and conditions of the BSD License which  
> #  accompanies this distribution. The full text of the license may be  
> #  found at http://opensource.org/licenses/bsd-license.php
> @@ -14,11 +14,11 @@
>  #
>  
>  from __future__ import print_function
>  
>  VersionNumber = '0.1'
> -__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights reserved."
> +__copyright__ = "Copyright (c) 2015 - 2016, Intel Corporation  All rights 
> reserved."
>  
>  import email
>  import argparse
>  import os
>  import re
> @@ -195,11 +195,11 @@ class CommitMessageCheck:
>  
>  if count <= 0:
>  self.error('Empty commit message!')
>  return
>  
> -if count >= 1 and len(lines[0]) > 76:
> +if count >= 1 and len(lines[0]) > 70:
>  self.error('First line of commit message (subject line) ' +
> 'is too long.')
>  
>  if count >= 1 and len(lines[0].strip()) == 0:
>  self.error('First line of commit message (subject line) ' 
> + @@ -208,11 +208,11 @@ class CommitMessageCheck:
>  if count >= 2 and lines[1].strip() != '':
>  self.error('Second line of commit message should be ' +
> 'empty.')
>  
>  for i in range(2, count):
> -if (len(lines[i]) > 76 and
> +if (len(lines[i]) > 70 and
>  len(lines[i].split()) > 1 and
>  not lines[i].startswith('git-svn-id:')):
>  self.error('Line %d of commit message is too long.' % 
> (i + 1))
>  
>  last_sig_line = None
> @@ -354,10 +354,12 @@ class GitDiffCheck:
>line)
>  if '' in line:
>  self.added_line_error('Tab character used', line)
>  if len(stripped) < len(line):
>  self.added_line_error('Trailing whitespace found', line)
> +if 'EFI_D_' in line:
> +self.added_line_error('EFI_D_* used, Please use DEBUG_* 
> + format', line)
>  
>  split_diff_re = re.compile(r'''
> (?P
> ^ diff \s+ --git \s+ a/.+ \s+ b/.+ $
> )
> @@ -471,11 +473,20 @@ class CheckOnePatch:
>  self.commit_msg =