Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

2015-10-12 Thread Wang, Sunny (HPS SW)
Hi Ruiyu, 

Thanks for the quick response.  
It is because of that we need to do same thing as what BmFindLoadOption 
function did in our PlatformBootManagerLib to check/find specific boot option 
from the boot options array which is got from EfiBootManagerGetLoadOptions 
function. I also think other developers may have the same need.  Therefore, it 
would be better to make BmFindLoadOption public to reduce the maintenance 
effort caused by duplicating the function into other BDS libraries like 
PlatformBootManagerLib. Is it reasonable and acceptable?  If so, I will rename 
the BmFindLoadOption function to EfiBootManagerFindLoadOption and resend the 
patch.   

Regards,
Sunny Wang

-Original Message-
From: Ni, Ruiyu [mailto:ruiyu...@intel.com] 
Sent: Monday, October 12, 2015 3:29 PM
To: Wang, Sunny (HPS SW); edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
public
Importance: High

Sunny,
Why do you want to expose this function?
Bm* needs to change to EfiBootManager* if it's public.

Thanks,
Ray

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sunny 
Wang
Sent: Monday, October 12, 2015 3:15 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang 
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h | 21 +
 1 file changed, 21 insertions(+)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index 5538d90..e86b589 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -222,6 +223,26 
@@ EfiBootManagerSortLoadOptionVariable (
   IN SORT_COMPARE  CompareFunction
   );
 
+/**
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the  
+ OptionType, Attributes, Description, FilePath and OptionalData are equal.
+
+  @param KeyPointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1  Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+BmFindLoadOption (
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
+  IN UINTN  Count
+  );
+
 //
 // Boot Manager hot key library functions.
 //
--
2.5.0.windows.1

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


Re: [edk2] Cross compiling EDK2 for Aarch64

2015-10-12 Thread Ard Biesheuvel
On 11 October 2015 at 09:34, Yehuda Yitschak  wrote:
> Hi Laszlo
>
>> -Original Message-
>> From: Laszlo Ersek [mailto:ler...@redhat.com]
>> Sent: Thursday, October 08, 2015 22:21
>> To: Yehuda Yitschak
>> Cc: edk2-devel@lists.01.org; leif.lindh...@linaro.org
>> Subject: Re: [edk2] Cross compiling EDK2 for Aarch64
>>
>> Obviously I forgot one command (because it need not be reissued every
>> time):
>>
>> On 10/08/15 21:17, Laszlo Ersek wrote:
>> > On 10/08/15 10:24, Yehuda Yitschak wrote:
>> >> Hello everyone
>> >>
>> >> I am new to the EDK2 projects and for starters I am trying to cross
>> >> compile the project for aarch64 on an x86_64 host
>> >>
>> >> I looked around in Linaro website and Tiano-core website but couldn't
>> >> find any instruction on how to _cross_ compile
>> >>
>> >> I tried to follow the instruction here:
>> >> https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build
>> >> but when I try to compile using the "build" command the build script
>> >> uses the x86 compiler and naturally it fails I tried working around
>> >> this by setting the environment variable GCC48_BIN however then the
>> >> build system tries to call "make" from the path in GCC48_BIN which
>> >> off course fails
>> >>
>> >> I also found these instructions
>> >> https://github.com/tianocore/tianocore.github.io/wiki/Unix-like_syste
>> >> ms#Build_gcc_x64_UEFI_cross_compiler
>> >> But I'm not sure they apply to aarch64.
>> >>
>> >> I appreciate any suggestions you can offer
>> >
>> > Here's how I do it:
>> >
>> > - download & install the latest cross-compiler toolchain from Linaro's
>> > website, for example:
>> >
>> > https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/aa
>> > rch64-linux-gnu/
>> >
>> > The tarball you most probably want is
>> >
>> > gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz
>> >
>> > assuming you use Linux. If you use Windows, I guess you need:
>> >
>> > gcc-linaro-4.8-2015.06-i686-mingw32_aarch64-linux-gnu.tar.xz
>> >
>> > Now extract this somewhere, and put its "bin" directory on your PATH.
>> > Notice that it has filenames like "aarch64-linux-gnu-gcc".
>> >
>> > Once this is done, you can build ArmVirtQemu.dsc (for getting AARCH64
>> > firmware that runs on "qemu-system-aarch64 -M virt") like this:
>> >
>> > $ source edksetup.sh
>>
>> after this:
>>
>> $ make -C "$EDK_TOOLS_PATH"
>>
>> Thanks
>> Laszlo
>>
>> >
>> > $ export GCC48_AARCH64_PREFIX=aarch64-linux-gnu-
>> >
>> > $ build \
>> > -a AARCH64 \
>> > -t GCC48 \
>> > -p ArmVirtPkg/ArmVirtQemu.dsc \
>> > -n 8 \
>> > --report-file=.../build.aa64virt.report \
>> > --log=.../build.aa64virt.log \
>> > -b DEBUG \
>> > -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F \
>> > -D SECURE_BOOT_ENABLE
>> >
>> > (See "build --help" for what's what.)
>> >
>> > The final firmware image is somewhere under the Build directory,
>> > you'll have to consult the FDF file referenced with FLASH_DEFINITION
>> > in the DSC file for finding out its name.
>> >
>> > For example, "ArmVirtPkg/ArmVirtQemu.dsc" references
>> > "ArmVirtPkg/ArmVirtQemu.fdf", and the latter has a section called
>> > [FD.QEMU_EFI], so the file you'd look for under Build is "QEMU_EFI.fd".
>> >
>> > For installing and/or running the firmware binary, further actions may
>> > be necessary, of course. (In case of QEMU, the QEMU_EFI.fd file needs
>> > to be padded to 64MB, etc etc, you can google the instructions in the
>> > Linaro and Fedora wikis.)
>
> I tried following this guide on Linaro's website 
> https://wiki.linaro.org/LEG/UEFIforQEMU
> I built qemu-system-aarch64 myself using qemu-2.4 since it cannot be 
> installed using apt-get on Ubuntu-14.04.
>
> I managed to get to the boot phase with the message "the default boot 
> selection will start in 3 seconds"
> But when I press enter to get to the boot menu (or even if don't press 
> anything) I get:
> ASSERT_EFI_ERROR (Status = Not Found)
> ASSERT 
> /home/yehuday/projects/uefi/linaro-edk2/ArmPlatformPkg/Bds/BootMenu.c(1014): 
> !EFI_ERROR (Status)
> Which seems like the bootMenu package is somehow missing or misconfigured

Indeed, you are using the ARM BDS but are missing the LinuxLoader EFI
app. This is a known issue, and was fixed here:
https://github.com/tianocore/edk2/commit/1c51e601a0514a60dcdf48faba00b89deaff456a

> I got a few other error messages. Not sure they are related:
> - InstallProtocolInterface: 09576E91-6D3F-11D2-8E39-00A0C969723B 
> 7B8F2858
>   VirtioMmioInit: Warning: The VendorId (0x554D4551) does not match 
> the VirtIo VendorId (0x1AF4).
> - ValidateFvHeader: No Firmware Volume header present
>NorFlashFvbInitialize: ERROR - The FVB Header is not valid. 
> Installing a correct one for this volume.
>
> I followed the steps on linaro's page one by one except I used my own build 
> of qemu.
> Did I miss any step in the way  ?
>
> Thanks
>
> Yehuda
>
>> >
>> > Thanks
>> > Laszlo
>> > 

Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

2015-10-12 Thread Ni, Ruiyu
Sunny,
Why do you want to expose this function?
Bm* needs to change to EfiBootManager* if it's public.

Thanks,
Ray

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sunny 
Wang
Sent: Monday, October 12, 2015 3:15 PM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang 
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h | 21 +
 1 file changed, 21 insertions(+)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index 5538d90..e86b589 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -222,6 +223,26 @@ EfiBootManagerSortLoadOptionVariable (
   IN SORT_COMPARE  CompareFunction
   );
 
+/** 
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the 
+  OptionType, Attributes, Description, FilePath and OptionalData are equal.
+
+  @param KeyPointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1  Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+BmFindLoadOption (
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
+  IN UINTN  Count
+  );
+
 //
 // Boot Manager hot key library functions.
 //
-- 
2.5.0.windows.1

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


Re: [edk2] Cross compiling EDK2 for Aarch64

2015-10-12 Thread Leif Lindholm
On Mon, Oct 12, 2015 at 08:50:53AM +, Yehuda Yitschak wrote:
> Thanks. It worked fine. 
> I assumed the linaro-edk2 GIT should be more up to date with ARM
> fixes but I think this is not the case here.

No, that will never be the case - we work upstream, so fixes only go
into linaro-edk2 after they are in Tianocore.

linaro-edk2 is only for us to be able to track Linaro releases
separately, and add support for additional platforms (until such a
time as the Tianocore platform support story is resolved).

> Just wondering,  do you know why this fix isn't in linaro-edk2 ?
> I'm just considering which GIT to use

Unless you're specifically developing for a platform that is only
supported in linaro-edk2, always use Tianocore. And even then,
locally importing OpenPlatformPkg into a Tianocore checkout is still a
better solution, but documentation is lagging.

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


Re: [edk2] [PATCH 6/7] UefiCpiPkg: Add PiSmmCpuDxeSmm module

2015-10-12 Thread Paolo Bonzini


On 05/10/2015 01:57, Michael Kinney wrote:
> Add module that initializes a CPU for the SMM envirnment and
> installs the first level SMI handler.  This module along with the
> SMM IPL and SMM Core provide the services required for
> DXE_SMM_DRIVERS to register hardware and software SMI handlers.
> 
> CPU specific features are abstracted through the SmmCpuFeaturesLib
> 
> Platform specific features are abstracted through the
> SmmCpuPlatformHookLib
> 
> Several PCDs are added to enable/disable features and configure
> settings for the PiSmmCpuDxeSmm module
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney 

Hi Michael,

I'm happy to report the first bug! :)

InitPaging() is setting a page directory entry before initializing the
corresponding page table.  This works on real hardware (including KVM),
but the TLB of QEMU's emulation mode is different (possibly it has
different  associativity, I don't really know) so at some point
execution goes to nowhere's land.

The fix is really simple:

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index 9463e97..6ee9256 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -555,12 +555,12 @@ InitPaging (
   Pt = AllocatePages (1);
   ASSERT (Pt != NULL);

-  *Pte = (UINTN)Pt | IA32_PG_RW | IA32_PG_P;
-
   // Split it
-  for (Level4 = 0; Level4 < SIZE_4KB / sizeof(*Pt); Level4++,
Pt++) {
-*Pt = Address + ((Level4 << 12) | IA32_PG_RW | IA32_PG_P);
+  for (Level4 = 0; Level4 < SIZE_4KB / sizeof(*Pt); Level4++) {
+Pt[Level4] = Address + ((Level4 << 12) | IA32_PG_RW |
IA32_PG_P);
   } // end for PT
+
+  *Pte = (UINTN)Pt | IA32_PG_RW | IA32_PG_P;
 } // end if IsAddressSplit
   } // end for PTE
 } // end for PDE

Thanks,

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


Re: [edk2] [PATCH] BaseTools/Scripts: Add PatchCheck.py script

2015-10-12 Thread Bjorge, Erik C
I think it may have been outlook messing with me when applying the patch.  The 
whitespace notice was about some of the copyright lines.  I will pull from your 
public repo/branch and see if I have the same issue.

Thanks,
-Erik

-Original Message-
From: Justen, Jordan L 
Sent: Friday, October 9, 2015 11:11 AM
To: Laszlo Ersek ; Bjorge, Erik C ; 
edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: Re: [edk2] [PATCH] BaseTools/Scripts: Add PatchCheck.py script

On 2015-10-09 10:57:40, Laszlo Ersek wrote:
> On 10/09/15 19:13, Bjorge, Erik C wrote:
> > The patch has some trailing white spaces
> 
> Apparently, Jordan forgot to run the script on the patch that adds the 
> script! ;)

I ran the script on the patch, and it didn't flag any trailing whitespace. So, 
if there is trailing whitespace in the patch, then there is a bug in the script.

I also tried using my editor to cleanup any tailing whitespace, and it didn't 
seem to locate any.

Can either of you point out a line with trailing whitespace in the patch?

-Jordan

> > but other than that it works fine.
> > 
> > Reviewed-by: Erik Bjorge 
> > 
> > -Original Message-
> > From: Justen, Jordan L
> > Sent: Wednesday, October 7, 2015 7:53 PM
> > To: edk2-devel@lists.01.org
> > Cc: Justen, Jordan L ; Bjorge, Erik C 
> > ; Zhu, Yonghong ; 
> > Gao, Liming 
> > Subject: [PATCH] BaseTools/Scripts: Add PatchCheck.py script
> > 
> > This script can be used to check some expected rules for EDK II patches. It 
> > only works on git formatted patches.
> > 
> > It checks both the commit message and the lines that are added in the patch 
> > diff.
> > 
> > In the commit message it verifies line lengths, signature formats, and the 
> > Contributed-under tag.
> > 
> > In the patch, it checks that line endings are CRLF for all files that don't 
> > have a .sh extension. It verifies that no trailing whitespace is present 
> > and that tab characters are not used.
> > 
> > Patch contributors should use this script prior to submitting their 
> > patches. Package maintainers can also use it to verify incoming patches.
> > 
> > It can also be run by specifying a git revision list, so actual patch files 
> > are not always required.
> > 
> > For example, to checkout this last 5 patches in your git branch you can run:
> > 
> >   python PatchCheck.py HEAD~5..
> > 
> > Or, a shortcut (like git log):
> > 
> >   python PatchCheck.py -5
> > 
> > The --oneline option works similar to git log --oneline.
> > 
> > The --silent option enables silent operation.
> > 
> > The script supports python 2.7 and python 3.
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Jordan Justen 
> > Cc: Erik Bjorge 
> > Cc: Yonghong Zhu 
> > Cc: Liming Gao 
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 607 
> > 
> >  1 file changed, 607 insertions(+)
> >  create mode 100644 BaseTools/Scripts/PatchCheck.py
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py new file mode 100644 index 
> > 000..340a997
> > --- /dev/null
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -0,0 +1,607 @@
> > +## @file
> > +#  Check a patch for various format issues # #  Copyright (c) 2015, 
> > +Intel Corporation. All rights reserved. # #  This program and 
> > +the accompanying materials are licensed and made #  available under 
> > +the terms and conditions of the BSD License 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.
> > +#
> > +
> > +from __future__ import print_function
> > +
> > +VersionNumber = '0.1'
> > +__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights 
> > reserved."
> > +
> > +import email
> > +import argparse
> > +import os
> > +import re
> > +import subprocess
> > +import sys
> > +
> > +class Verbose:
> > +SILENT, ONELINE, NORMAL = range(3)
> > +level = NORMAL
> > +
> > +class CommitMessageCheck:
> > +"""Checks the contents of a git commit message."""
> > +
> > +def __init__(self, subject, message):
> > +self.ok = True
> > +
> > +if subject is None and  message is None:
> > +self.error('Commit message is missing!')
> > +return
> > +
> > +self.subject = subject
> > +self.msg = message
> > +
> > +self.check_contributed_under()
> > +self.check_signed_off_by()
> > +self.check_misc_signatures()
> > +

Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

2015-10-12 Thread El-Haj-Mahmoud, Samer
Reviewed-by: Samer El-Haj-Mahmoud    


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Wang, 
Sunny (HPS SW)
Sent: Monday, October 12, 2015 2:15 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang 
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h | 21 +
 1 file changed, 21 insertions(+)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index 5538d90..e86b589 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -222,6 +223,26 
@@ EfiBootManagerSortLoadOptionVariable (
   IN SORT_COMPARE  CompareFunction
   );
 
+/**
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the  
+ OptionType, Attributes, Description, FilePath and OptionalData are equal.
+
+  @param KeyPointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1  Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+BmFindLoadOption (
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
+  IN UINTN  Count
+  );
+
 //
 // Boot Manager hot key library functions.
 //
--
2.5.0.windows.1

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


Re: [edk2] [Patch] BaseTools: Fixed an error reported during generating report

2015-10-12 Thread Laszlo Ersek
On 10/12/15 04:39, Gao, Liming wrote:
> Reviewed-by: Liming Gao 

Let's hope my comment arrives before this gets committed -- Yonghong,
can you please state specific details in the subject and/or the body of
the commit message? What is the error? What circumstances trigger it?
How is it being fixed?

"Fix an error" is one of the most generic terms for describing what
software developers do.

Thanks
Laszlo

> 
> -Original Message-
> From: Zhu, Yonghong 
> Sent: Monday, October 12, 2015 9:52 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming
> Subject: [Patch] BaseTools: Fixed an error reported during generating report
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu 
> ---
>  Source/Python/build/BuildReport.py | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/Source/Python/build/BuildReport.py 
> b/Source/Python/build/BuildReport.py
> index 60e976c..bf5bb8f 100644
> --- a/Source/Python/build/BuildReport.py
> +++ b/Source/Python/build/BuildReport.py
> @@ -1234,16 +1234,17 @@ class FdRegionReport(object):
>  for Package in Pa.PackageList:
>  for (TokenCName, TokenSpaceGuidCName, DecType) in 
> Package.Pcds:
>  DecDefaultValue = Package.Pcds[TokenCName, 
> TokenSpaceGuidCName, DecType].DefaultValue
>  PlatformPcds[(TokenCName, TokenSpaceGuidCName)] = 
> DecDefaultValue
>  #
> -# Collect PCDs defined in DSC common section
> +# Collect PCDs defined in DSC file
>  #
> -Platform = Wa.BuildDatabase[Wa.MetaFile, 'COMMON']
> -for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:
> -DscDefaultValue = Platform.Pcds[(TokenCName, 
> TokenSpaceGuidCName)].DefaultValue
> -PlatformPcds[(TokenCName, TokenSpaceGuidCName)] = DscDefaultValue
> +for arch in Wa.ArchList:
> +Platform = Wa.BuildDatabase[Wa.MetaFile, arch]
> +for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:
> +DscDefaultValue = Platform.Pcds[(TokenCName, 
> TokenSpaceGuidCName)].DefaultValue
> +PlatformPcds[(TokenCName, TokenSpaceGuidCName)] = 
> DscDefaultValue
>  
>  #
>  # Add PEI and DXE a priori files GUIDs defined in PI specification.
>  #
>  self._GuidsDb["1B45CC0A-156A-428A-AF62-49864DA0E6E6"] = "PEI Apriori"
> 

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


Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

2015-10-12 Thread Laszlo Ersek
On 10/12/15 09:45, Wang, Sunny (HPS SW) wrote:
> Hi Ruiyu, 
> 
> Thanks for the quick response.
> It is because of that we need to do same thing as what
> BmFindLoadOption function did in our PlatformBootManagerLib to
> check/find specific boot option from the boot options array which is
> got from EfiBootManagerGetLoadOptions function. I also think other
> developers may have the same need.  Therefore, it would be better to
> make BmFindLoadOption public to reduce the maintenance effort caused
> by duplicating the function into other BDS libraries like
> PlatformBootManagerLib. Is it reasonable and acceptable?  If so, I
> will rename the BmFindLoadOption function to
> EfiBootManagerFindLoadOption and resend the patch.

On a similar note: in the message

http://thread.gmane.org/gmane.comp.bios.edk2.devel/759/focus=1153

point (10), I requested that the function BmGetLoadOptionBuffer() be
made public.

Looks like there are now at least two Bm*() functions that see outside
demand! :)

Thanks
Laszlo

> 
> Regards,
> Sunny Wang
> 
> -Original Message-
> From: Ni, Ruiyu [mailto:ruiyu...@intel.com] 
> Sent: Monday, October 12, 2015 3:29 PM
> To: Wang, Sunny (HPS SW); edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
> public
> Importance: High
> 
> Sunny,
> Why do you want to expose this function?
> Bm* needs to change to EfiBootManager* if it's public.
> 
> Thanks,
> Ray
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Sunny 
> Wang
> Sent: Monday, October 12, 2015 3:15 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
> public
> 
> Make the BmFindLoadOption function public
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> 
> Signed-off-by: Sunny Wang 
> ---
>  MdeModulePkg/Include/Library/UefiBootManagerLib.h | 21 +
>  1 file changed, 21 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
> b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> index 5538d90..e86b589 100644
> --- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> +++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
> @@ -2,6 +2,7 @@
>Provide Boot Manager related library APIs.
>  
>  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
> +(C) Copyright 2015 Hewlett Packard Enterprise Development LP
>  This program and the accompanying materials  are licensed and made available 
> under the terms and conditions of the BSD License  which accompanies this 
> distribution.  The full text of the license may be found at @@ -222,6 +223,26 
> @@ EfiBootManagerSortLoadOptionVariable (
>IN SORT_COMPARE  CompareFunction
>);
>  
> +/**
> +  Return the index of the load option in the load option array.
> +
> +  The function consider two load options are equal when the  
> + OptionType, Attributes, Description, FilePath and OptionalData are equal.
> +
> +  @param KeyPointer to the load option to be found.
> +  @param Array  Pointer to the array of load options to be found.
> +  @param Count  Number of entries in the Array.
> +
> +  @retval -1  Key wasn't found in the Array.
> +  @retval 0 ~ Count-1 The index of the Key in the Array.
> +**/
> +INTN
> +BmFindLoadOption (
> +  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
> +  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
> +  IN UINTN  Count
> +  );
> +
>  //
>  // Boot Manager hot key library functions.
>  //
> --
> 2.5.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 

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


Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function public

2015-10-12 Thread Ni, Ruiyu
Sunny,
Your bitmask idea works. But I think it might introduce unnecessary complexity. 
Keeping current implementation is good enough I think.

Thanks,
Ray

-Original Message-
From: Wang, Sunny (HPS SW) [mailto:sunnyw...@hpe.com] 
Sent: Tuesday, October 13, 2015 12:15 PM
To: Ni, Ruiyu ; Laszlo Ersek 
Cc: edk2-devel@lists.01.org ; Wang, Sunny (HPS SW) 

Subject: RE: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
public

Laszlo,
Would you like to make GetLoadOptionBuffer() public as well with my 
next patch?  I can help to do the passing change and add you into Signed-off-by 
as well. If you need it, let me know by end of today.  
Ruiyu,
OK, got it. I will update the patch and send it out. 
I just get an idea from your reply for enhancing the 
EfiBootManagerFindLoadOption, we may add a input parameter called IgnoreMember 
like the following for all the use cases so that all the consumers of this API 
don't need to create their own version. What do you think? If it works, I will 
send the other patch for this. 

typedef enum {
  IgnoreOptionType   = 0x01,// BIT0
  IgnoreAttributes  = 0x02,// BIT1
  IgnoreDescription   = 0x04, // BIT2
  IgnoreFilePath  = 0x08, // BIT3
  IgnoreOptionalData= 0x10, // BIT4
  IgnoreOptionalDataSize = 0x20 // BIT5
} IGNORE_MEMBER_OF_ LOAD_OPTION;

EfiBootManagerFindLoadOption (
  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
  IN UINTN  
  Count,
  IN IGNORE_MEMBER_OF_ LOAD_OPTION IgnoreMember
  )

Regards,
Sunny Wang

-Original Message-
From: Ni, Ruiyu [mailto:ruiyu...@intel.com] 
Sent: Tuesday, October 13, 2015 10:35 AM
To: Laszlo Ersek; Wang, Sunny (HPS SW)
Cc: edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
public
Importance: High

Sunny,
Yes it's acceptable. Currently the implementation of *FindLoadOption does an 
exactly match. If other consumers of this API need to just match partially, 
they need to provide their own version instead of using this exposed one.

Laszlo,
Sorry I missed your comments. I am thinking about whether exposing the 
*GetLoadOptionBuffer() breaks the orthogonality because we already have 
EfiBootManagerProcessLoadOption() API. The latter one not only loads the buffer 
but also treats the buffer as a PECOFF buffer to start it.
The *GetLoadOptionBuffer() seems to do part of the job.
Anyway I think your request also makes sense. Just want to know if there is 
other better idea to not break the orthogonality.

Thanks,
Ray

-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: Monday, October 12, 2015 8:11 PM
To: Wang, Sunny (HPS SW) ; Ni, Ruiyu 
Cc: edk2-devel@lists.01.org 
Subject: Re: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption function 
public

On 10/12/15 09:45, Wang, Sunny (HPS SW) wrote:
> Hi Ruiyu,
> 
> Thanks for the quick response.
> It is because of that we need to do same thing as what 
> BmFindLoadOption function did in our PlatformBootManagerLib to 
> check/find specific boot option from the boot options array which is 
> got from EfiBootManagerGetLoadOptions function. I also think other 
> developers may have the same need.  Therefore, it would be better to 
> make BmFindLoadOption public to reduce the maintenance effort caused 
> by duplicating the function into other BDS libraries like 
> PlatformBootManagerLib. Is it reasonable and acceptable?  If so, I 
> will rename the BmFindLoadOption function to 
> EfiBootManagerFindLoadOption and resend the patch.

On a similar note: in the message

http://thread.gmane.org/gmane.comp.bios.edk2.devel/759/focus=1153

point (10), I requested that the function BmGetLoadOptionBuffer() be made 
public.

Looks like there are now at least two Bm*() functions that see outside demand! 
:)

Thanks
Laszlo

> 
> Regards,
> Sunny Wang
> 
> -Original Message-
> From: Ni, Ruiyu [mailto:ruiyu...@intel.com]
> Sent: Monday, October 12, 2015 3:29 PM
> To: Wang, Sunny (HPS SW); edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption 
> function public
> Importance: High
> 
> Sunny,
> Why do you want to expose this function?
> Bm* needs to change to EfiBootManager* if it's public.
> 
> Thanks,
> Ray
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> Sunny Wang
> Sent: Monday, October 12, 2015 3:15 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] MdeModulePkg: Make the BmFindLoadOption 
> function public
> 
> Make the BmFindLoadOption function public
> 
> Contributed-under: TianoCore