Re: [edk2] [Patch] MdePkg: Add more DataBits support to Port80 output

2015-11-08 Thread Yao, Jiewen
Reviewed by jiewen@intel.com

Do you think we can add ASSERT for invalid port width?


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zeng, 
Star
Sent: Monday, November 09, 2015 1:37 PM
To: Gao, Liming; edk2-devel@lists.01.org
Subject: Re: [edk2] [Patch] MdePkg: Add more DataBits support to Port80 output

On 2015/11/2 18:30, Liming Gao wrote:
> The BasePostCodeLibPort80 instance just prints UINT8 to IoPort 80. 
> Some boards may support 16bit or 32bit. To support them, new PCD 
> PcdPort80DataWidth is introduced to specify the width of data bits to Port80.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao 
> ---
>   .../BasePostCodeLibPort80/BasePostCodeLibPort80.inf |   4 ++--
>   MdePkg/Library/BasePostCodeLibPort80/PostCode.c |  19 
> ---
>   MdePkg/MdePkg.dec   |   5 +
>   MdePkg/MdePkg.uni   | Bin 69604 -> 70116 
> bytes
>   4 files changed, 23 insertions(+), 5 deletions(-)

Reviewed-by: Star Zeng 

How about to put this PCD declaration near with PcdPostCodePropertyMask?

Thanks,
Star
>
> diff --git 
> a/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf 
> b/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
> index e2f0be5..441c4c5 100644
> --- a/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
> +++ b/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
> @@ -3,7 +3,7 @@
>   #
>   #  Post Code Library that writes post code values to I/O port 0x80.
>   #
> -#  Copyright (c) 2007 - 2014, Intel Corporation. All rights 
> reserved.
> +#  Copyright (c) 2007 - 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 @@ -44,4 +44,4 @@
>
>   [Pcd]
> gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask  ## CONSUMES
> -
> +  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth ## CONSUMES
> diff --git a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c 
> b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
> index 925c740..4d572db 100644
> --- a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
> +++ b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
> @@ -1,7 +1,7 @@
>   /** @file
> Post Code Library instance that writes post code values to I/O port 0x80.
>
> -  Copyright (c) 2006 - 2010, Intel Corporation. All rights 
> reserved.
> +  Copyright (c) 2006 - 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 @@ -42,7 +42,20 @@ PostCode (
> IN UINT32  Value
> )
>   {
> -  IoWrite8 (0x80, (UINT8)(Value));
> +  switch (PcdGet8 (PcdPort80DataWidth)) {  case 8:
> +IoWrite8 (0x80, (UINT8)(Value));
> +break;
> +  case 16:
> +IoWrite16 (0x80, (UINT16)(Value));
> +break;
> +  case 32:
> +IoWrite32 (0x80, Value);
> +break;
> +  default:
> +break;
> +  }
> +
> return Value;
>   }
>
> @@ -78,7 +91,7 @@ PostCodeWithDescription (
> IN CONST CHAR8  *Description  OPTIONAL
> )
>   {
> -  IoWrite8 (0x80, (UINT8)(Value));
> +  PostCode (Value);
> return Value;
>   }
>
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 
> 337059a..30f29d3 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -1965,6 +1965,11 @@
> # @Prompt Memory Address of GuidedExtractHandler Table.
> 
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x100
> |UINT64|0x30001015
>
> +  ## The bit width of data to be written to Port80. The default value is 8.
> +  # @Prompt Port80 Data Width
> +  # @ValidList  0x8001 | 8, 16, 32
> +  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth|8|UINT8|0x30001017
> +
>   [PcdsFixedAtBuild.IPF, PcdsPatchableInModule.IPF]
> ## The base address of IO port space for IA64 arch.
> # @Prompt IA64 IO Port Space Base Address.
> diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index 
> 38211344e0ae01e984d5d9b916e42f4f8b4c1c66..5a5126213e4f72ea8c47772aebf5
> e31e007bbc46 100644 GIT binary patch delta 257
> zcmaDdpXJG7mWC~iPxvRx?GKO*V8~}EVklv-U@%~CVMqkB5*fl7G8s~Utc=NqV&?J)
> zc?Gx%1tc|&YvM(*nlSl%is|GHt2pYDfaaAjC@_@6%muRZ8Pb4c3e-jgpnN`%pTv*~
> zR#ybpQ3B-U0r?O)WS8mzMMD@ez^YS#WE#+%QidF`EoDG<4v+^jDU+d?L4g J23`g(1^^oLG@}3j
>
> delta 11
> ScmaE|nB~cQmWC~iPxt{N6a_l~
>

___
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] BaseTools/GenFw: add new option to not zero PE/COFF optional header fields

2015-11-08 Thread Yonghong Zhu
Add new option --keepoptionalheader and that flag does not zero PE/COFF
optional header fields including the version fields. It can support the
case that the PE/COFF optional header would be kept.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu 
---
 Source/C/GenFw/GenFw.c | 82 +-
 1 file changed, 48 insertions(+), 34 deletions(-)

diff --git a/Source/C/GenFw/GenFw.c b/Source/C/GenFw/GenFw.c
index 4756c52..9ddd18e 100644
--- a/Source/C/GenFw/GenFw.c
+++ b/Source/C/GenFw/GenFw.c
@@ -1,9 +1,9 @@
 /** @file
 Converts a pe32+ image to an FW, Te image type, or other specific image.
 
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 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
 
@@ -166,11 +166,11 @@ Returns:
   fprintf (stdout, "\nUsage: %s [options] \n\n", UTILITY_NAME);
 
   //
   // Copyright declaration
   //
-  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights 
reserved.\n\n");
+  fprintf (stdout, "Copyright (c) 2007 - 2015, Intel Corporation. All rights 
reserved.\n\n");
 
   //
   // Details Option
   //
   fprintf (stdout, "Options:\n");
@@ -182,23 +182,23 @@ Returns:
 SEC, DXE_SAL_DRIVER, UEFI_DRIVER, 
DXE_RUNTIME_DRIVER,\n\
 DXE_SMM_DRIVER, SECURITY_CORE, COMBINED_PEIM_DRIVER,\n\
 PIC_PEIM, RELOCATABLE_PEIM, BS_DRIVER, RT_DRIVER,\n\
 APPLICATION, SAL_RT_DRIVER to support all module 
types\n\
 It can only be used together with 
--keepexceptiontable,\n\
---keepzeropending, -r, -o option.It is a action 
option.\n\
-If it is combined with other action options, the 
later\n\
-input action option will override the previous 
one.\n");
+--keepzeropending, --keepoptionalheader, -r, -o 
option.\n\
+It is a action option. If it is combined with other 
action options,\n\
+the later input action option will override the 
previous one.\n");
   fprintf (stdout, "  -c, --acpiCreate Acpi table.\n\
 It can't be combined with other action options\n\
 except for -o, -r option. It is a action option.\n\
 If it is combined with other action options, the 
later\n\
 input action option will override the previous 
one.\n");
   fprintf (stdout, "  -t, --terse   Create Te Image.\n\
 It can only be used together with 
--keepexceptiontable,\n\
---keepzeropending, -r, -o option.It is a action 
option.\n\
-If it is combined with other action options, the 
later\n\
-input action option will override the previous 
one.\n");
+--keepzeropending, --keepoptionalheader, -r, -o 
option.\n\
+It is a action option. If it is combined with other 
action options,\n\
+the later input action option will override the 
previous one.\n");
   fprintf (stdout, "  -u, --dumpDump TeImage Header.\n\
 It can't be combined with other action options\n\
 except for -o, -r option. It is a action option.\n\
 If it is combined with other action options, the 
later\n\
 input action option will override the previous 
one.\n");
@@ -244,10 +244,13 @@ Returns:
   fprintf (stdout, "  -p NUM, --pad NUM NUM is one HEX or DEC format 
padding value.\n\
 This option is only used together with -j option.\n");
   fprintf (stdout, "  --keepexceptiontable  Don't clear exception table.\n\
 This option can be used together with -e or -t.\n\
 It doesn't work for other options.\n");
+  fprintf (stdout, "  --keepoptionalheader  Don't zero PE/COFF optional header 
fields.\n\
+This option can be used together with -e or -t.\n\
+It doesn't work for other options.\n");
   fprintf (stdout, "  --keepzeropending Don't strip zero pending of 
.reloc.\n\
 This option can be used together with -e or -t.\n\
 It doesn't work for other options.\n");
   fprintf (stdout, "  -r, --replace Overwrite the input file with the 
output content.\n\
 If more input files are specified,\n\
@@ -1077,10 +1080,11 @@ Returns:
   RUNTIME_FUNCTION 

Re: [edk2] Strange behavior of the DS-5 debugger on AARCH64 with step-by-step debugging in uefi

2015-11-08 Thread Ard Biesheuvel
On 6 November 2015 at 21:32, Vladimir Olovyannikov
 wrote:
> Hello Ard, Eugene,
> Thank you for explanation.
>
> Ard, I tried the patch, but it cannot be applied to the latest (pulled a 
> minute ago, git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18732 
> 6f19259b-4bc3-4df7-8a09-765794883524)
> tree: all 3 hunks failed. Which commit should I be based on to apply the 
> patch?
>
> Anyway I found the lines manually and changed them. However, when I try to
>
> source /uefi/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f 
> (0x8500,0x0028) -m (0x8000,0x4000) -a
> I am getting
>
> ERROR(?): ValueError: need more than 1 value to unpack
>   File " /uefi/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py", line 94, in 
> 
> armplatform_debugger.load_all_symbols()
> ERROR(CMD656):
> # in /uefi/BroadcomPlatformPkg/NS2Pkg/Scripts/armpkg_syms.ds:2 while 
> executing: source /uefi/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py -f 
> (0x8500,0x0028) -m (0x8000,0x4000) -a
> ! The script /uefi/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py failed to 
> complete due to an error during execution of the script
>
> Replacing the script with the older version makes it work as before, but 
> again the debugger is useless.
>
> Any idea what is wrong?
>

No, not a clue. But could you please share the diff between the
version of the script that works for you and the version that doesn't?
I don't think the patch I sent could trigger the error you are seeing,
so it must be something else that changed.

> Eugene, so you do not use the so convenient cmd_load_symbols.py script to 
> load all symbols?
> I dumped efi and dll as you suggested. The .text and .data sections in 
> PE-COFF and ELF match 1:1 for me. Still the debugger is useless as it points 
> to non-relevant code.
>

Indeed, this is expected. The PE/COFF and ELF versions of the binary
should look entirely the same, it's only the DS-5 scripts that needs
to have the hack removed to deal with the difference.

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


Re: [edk2] [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.

2015-11-08 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 

-Original Message-
From: Zhang, Lubo 
Sent: Monday, November 9, 2015 1:26 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan ; Ye, Ting ; Wu, Jiaxin 
; Gary Ching-Pang Lin 
Subject: [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address 
correctly.

If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6 
address from the host name, because the host name contains left and right 
bracket which cannot be used to configure the Tcp6 connection.

Cc: Fu Siyuan 
Cc: Ye Ting 
CC: Wu Jiaxin 
CC: Gary Ching-Pang Lin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
index c527da0..2f4ce89 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -388,11 +388,11 @@ EfiHttpRequest (
 // Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
 //
 if (!HttpInstance->LocalAddressIsIPv6) {
   Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
 } else {
-  Status = NetLibAsciiStrToIp6 (HostName, &HttpInstance->RemoteIpv6Addr);
+  Status = HttpUrlGetIp6 (Url, UrlParser, 
+ &HttpInstance->RemoteIpv6Addr);
 }
 
 if (EFI_ERROR (Status)) {
   HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
(CHAR16));
   if (HostNameStr == NULL) {
--
1.9.5.msysgit.1

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


Re: [edk2] edk2 build failure on GCC44

2015-11-08 Thread Ard Biesheuvel
On 9 November 2015 at 06:51, Hao, Xudong  wrote:
>> -Original Message-
>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>> Sent: Monday, November 9, 2015 1:43 PM
>> To: Hao, Xudong 
>> Cc: edk2-devel@lists.01.org
>> Subject: Re: [edk2] edk2 build failure on GCC44
>>
>> On 9 November 2015 at 02:34, Hao, Xudong  wrote:
>> > Hi, all
>> >
>> > I'm using edk2 as Xen HVM guest firmware, but the edk2 build fail with GCC
>> 4.4.7 (RHEL6.5). I clone the edk2 source from
>> git://git.code.sf.net/p/tianocore/edk2, and the commit is
>> a100d0073b365bc4f0ac95d30934e639e31175ac.
>> >
>> > Command: OvmfPkg/build.sh -a X64 -b RELEASE -n 4 The whole compile log
>> > attached, the simple error log is:
>> > ...
>> > /home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds:1:
>> > undefined symbol `PECOFF_HEADER_SIZE' referenced in expression
>> > make: ***
>> > [/home/hao/src/tianocore-
>> edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/Sec
>> Main.dll] Error 1 ...
>> >
>>
>> I don't see the attachment. Could you paste the ld command line (the one that
>> references PECOFF_HEADER_SIZE') from the build log?
>>
>
> Ard,
>
> Thanks response. The command line is:
> "ld" -o 
> /home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/SecMain.dll
>  -nostdlib -n -q --gc-sections -z common-page-size=0x20 --entry 
> _ModuleEntryPoint -u _ModuleEntryPoint -Map 
> /home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg
> /Sec/SecMain/DEBUG/SecMain.map -melf_x86_64 --oformat=elf64-x86-64 
> --start-group  @/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X
> 64/OvmfPkg/Sec/SecMain/OUTPUT/static_library_files.lst --end-group 
> --script=/home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds --defs
> ym=PECOFF_HEADER_SIZE=0x228
>

Could you try the following patch? Don't forget to remove
Conf/tools_def.tx and re-run 'source edksetup.sh' after apply it.


-8<-
diff --git a/BaseTools/Conf/tools_def.template
b/BaseTools/Conf/tools_def.template
index 1fef6af5464a..db08e252d2b9 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -3844,9 +3844,9 @@ DEFINE GCC44_X64_CC_FLAGS=
DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-p
 DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections
-z common-page-size=0x20
 DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS =
DEF(GCC44_IA32_X64_DLINK_COMMON) --entry ReferenceAcpiTable -u
ReferenceAcpiTable
 DEFINE GCC44_IA32_X64_DLINK_FLAGS=
DEF(GCC44_IA32_X64_DLINK_COMMON) --entry $(IMAGE_ENTRY_POINT) -u
$(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
-DEFINE GCC44_IA32_DLINK2_FLAGS   = DEF(GCC_DLINK2_FLAGS_COMMON)
--defsym=PECOFF_HEADER_SIZE=0x220
+DEFINE GCC44_IA32_DLINK2_FLAGS   =
--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
 DEFINE GCC44_X64_DLINK_FLAGS =
DEF(GCC44_IA32_X64_DLINK_FLAGS)  -melf_x86_64 --oformat=elf64-x86-64
-DEFINE GCC44_X64_DLINK2_FLAGS= DEF(GCC_DLINK2_FLAGS_COMMON)
--defsym=PECOFF_HEADER_SIZE=0x228
+DEFINE GCC44_X64_DLINK2_FLAGS=
--defsym=PECOFF_HEADER_SIZE=0x228 DEF(GCC_DLINK2_FLAGS_COMMON)
 DEFINE GCC44_ASM_FLAGS   = DEF(GCC_ASM_FLAGS)

 DEFINE GCC45_IA32_CC_FLAGS   = DEF(GCC44_IA32_CC_FLAGS)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [patch] MdeModulePkg:Modify the pointer type.

2015-11-08 Thread Dandan Bi
Previously the pointer type is EFI_IFR_FORM_SET, it is incorrect when
do pointer addition without conversion.Now change it to UINT8 type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
Reviewed-by: Eric Dong 
---
 MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 
b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index 1aa0edc..74ccd02 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -404,12 +404,12 @@ HiiGetFormSetFromHiiHandle(
   UINTNPackageListSize;
   UINTNTempSize;
   EFI_HII_PACKAGE_LIST_HEADER  *HiiPackageList;
   UINT8*Package;
   UINT8*OpCodeData;
-  EFI_IFR_FORM_SET *FormSetBuffer;
-  EFI_IFR_FORM_SET *TempBuffer;
+  UINT8*FormSetBuffer;
+  UINT8*TempBuffer;
   UINT32   Offset;
   UINT32   Offset2;
   UINT32   PackageListLength;
   EFI_HII_PACKAGE_HEADER   PackageHeader;
 
@@ -481,11 +481,11 @@ HiiGetFormSetFromHiiHandle(
 }
   }
   FreePool (HiiPackageList);
 
   *BufferSize = TempSize;
-  *Buffer = FormSetBuffer;
+  *Buffer = (EFI_IFR_FORM_SET *)FormSetBuffer;
 
   return Status;
 }
 
 /**
-- 
1.9.5.msysgit.1

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


Re: [edk2] edk2 build failure on GCC44

2015-11-08 Thread Hao, Xudong
> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Monday, November 9, 2015 1:43 PM
> To: Hao, Xudong 
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] edk2 build failure on GCC44
> 
> On 9 November 2015 at 02:34, Hao, Xudong  wrote:
> > Hi, all
> >
> > I'm using edk2 as Xen HVM guest firmware, but the edk2 build fail with GCC
> 4.4.7 (RHEL6.5). I clone the edk2 source from
> git://git.code.sf.net/p/tianocore/edk2, and the commit is
> a100d0073b365bc4f0ac95d30934e639e31175ac.
> >
> > Command: OvmfPkg/build.sh -a X64 -b RELEASE -n 4 The whole compile log
> > attached, the simple error log is:
> > ...
> > /home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds:1:
> > undefined symbol `PECOFF_HEADER_SIZE' referenced in expression
> > make: ***
> > [/home/hao/src/tianocore-
> edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/Sec
> Main.dll] Error 1 ...
> >
> 
> I don't see the attachment. Could you paste the ld command line (the one that
> references PECOFF_HEADER_SIZE') from the build log?
> 

Ard, 

Thanks response. The command line is:
"ld" -o 
/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/SecMain.dll
 -nostdlib -n -q --gc-sections -z common-page-size=0x20 --entry 
_ModuleEntryPoint -u _ModuleEntryPoint -Map 
/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg
/Sec/SecMain/DEBUG/SecMain.map -melf_x86_64 --oformat=elf64-x86-64 
--start-group  @/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X
64/OvmfPkg/Sec/SecMain/OUTPUT/static_library_files.lst --end-group 
--script=/home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds --defs
ym=PECOFF_HEADER_SIZE=0x228


> I think this was reported at the time, and a fix was proposed and incorporated
> into the patch (as far as I remember) but perhaps we missed something there.
> 
> --
> Ard.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.

2015-11-08 Thread Ye, Ting
Reviewed-by: Ye Ting  

-Original Message-
From: Zhang, Lubo 
Sent: Monday, November 09, 2015 1:26 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan; Ye, Ting; Wu, Jiaxin; Gary Ching-Pang Lin
Subject: [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address 
correctly.

If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6
address from the host name, because the host name contains left and right 
bracket
which cannot be used to configure the Tcp6 connection.

Cc: Fu Siyuan 
Cc: Ye Ting 
CC: Wu Jiaxin 
CC: Gary Ching-Pang Lin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index c527da0..2f4ce89 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -388,11 +388,11 @@ EfiHttpRequest (
 // Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
 //
 if (!HttpInstance->LocalAddressIsIPv6) {
   Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
 } else {
-  Status = NetLibAsciiStrToIp6 (HostName, &HttpInstance->RemoteIpv6Addr);
+  Status = HttpUrlGetIp6 (Url, UrlParser, &HttpInstance->RemoteIpv6Addr);
 }
 
 if (EFI_ERROR (Status)) {
   HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
(CHAR16));
   if (HostNameStr == NULL) {
-- 
1.9.5.msysgit.1

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


Re: [edk2] edk2 build failure on GCC44

2015-11-08 Thread Ard Biesheuvel
On 9 November 2015 at 02:34, Hao, Xudong  wrote:
> Hi, all
>
> I'm using edk2 as Xen HVM guest firmware, but the edk2 build fail with GCC 
> 4.4.7 (RHEL6.5). I clone the edk2 source from 
> git://git.code.sf.net/p/tianocore/edk2, and the commit is 
> a100d0073b365bc4f0ac95d30934e639e31175ac.
>
> Command: OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> The whole compile log attached, the simple error log is:
> ...
> /home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds:1: undefined 
> symbol `PECOFF_HEADER_SIZE' referenced in expression
> make: *** 
> [/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/SecMain.dll]
>  Error 1
> ...
>

I don't see the attachment. Could you paste the ld command line (the
one that references PECOFF_HEADER_SIZE') from the build log?

I think this was reported at the time, and a fix was proposed and
incorporated into the patch (as far as I remember) but perhaps we
missed something there.

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


Re: [edk2] [Patch 0/4] AppPkg/Python: Port Python 2.7.10 to EDK II

2015-11-08 Thread Gao, Liming
Scott:
  Thanks for your suggestion. I can select all and copy them, but I still miss 
the mail header. Do you mean to get the mail header from the saved as txt file?

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Scott 
> Duplichan
> Sent: Friday, November 06, 2015 10:38 PM
> To: Gao, Liming; 'Daryl McDaniel'
> Cc: edk2-de...@ml01.01.org
> Subject: Re: [edk2] [Patch 0/4] AppPkg/Python: Port Python 2.7.10 to EDK II
> 
> Hello Liming,
> 
> I see what you mean. With Microsoft Outlook File->Save as->Save as Txt,
> a tab is added after from:, sent:, to:, and subject:. Worse yet, the
> lines are wrapped to 78 or so columns. The only solution I have found
> is to avoid File->SaveAs altogether and instead use:
> 
>  Select All
>  Copy
> 
> ... then paste the patch into a text editor and save it that way.
> It is truly frightening to see how many data corruption methods
> Microsoft has invented.
> 
> Thanks,
> Scott
> 
> 
> -Original Message-
> From: Gao, Liming [mailto:liming@intel.com]
> Sent: Friday, November 06, 2015 01:46 AM
> To: Scott Duplichan ; 'Daryl McDaniel' 
> 
> Cc: edk2-de...@ml01.01.org
> Subject: RE: [edk2] [Patch 0/4] AppPkg/Python: Port Python 2.7.10 to EDK II
> 
> Scott:
>   When I get the mail in outlook, how I save this mail as Git patch?
> 
>   I try saving the mail by File->Save as->Save as Txt. I find the saved txt 
> file includes Tab in header and the wrapped line. It can't be
> applied as the git patch.
> 
> Thanks
> Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Scott 
> Duplichan
> Sent: Friday, November 06, 2015 10:35 AM
> To: 'Daryl McDaniel'
> Cc: edk2-de...@ml01.01.org
> Subject: Re: [edk2] [Patch 0/4] AppPkg/Python: Port Python 2.7.10 to EDK II
> 
> Jordan Justen [mailto:jordan.l.jus...@intel.com] wrote:
> 
> ]Sent: Thursday, November 05, 2015 07:35 PM
> ]To: Daryl McDaniel ; edk2-de...@ml01.01.org; 
> Jaben Carsey (Intel) ]; Erik
> Bjorge (Intel) 
> ]Subject: Re: [edk2] [Patch 0/4] AppPkg/Python: Port Python 2.7.10 to EDK II
> ]
> ]Have you considered using git?
> ]
> ]For one, EDK II is moving to git.
> ]
> ]It would have enabled you to easily generate and send the patch files
> ]for your patch series. (I am guessing you spend considerable time
> ]generating these emails, and yet, I don't think they are usable to
> ]actually apply to a tree.)
> ]
> ]I think Outlook may have munged some of the lines in your file. Some
> ]of the lines seem to have been wrapped.
> 
> Correct. Daryl is using Outlook 2013, same as me. Here is a partial
> solution: In File, Options, Mail, Message Format...
> Automatically wrap text at character [Set to maximum (132)]
> Remove extra line breaks in plain text messages [Uncheck]
> Then be sure to select FORMAT TEXT, Plain Text for messages to the
> list. When typing text, put in line breaks manually.
> 
> Amazing Microsoft doesn't allow disabling line wrapping altogether.
> If I remember correctly, Outlook 2007 is better. Next time I rebuild
> my drive, I am switching back to Outlook 2007.
> 
> So anyway, this is not a rock solid solution. But EDK2 code doesn't
> have lines long enough to make the patch fail from wrapping to 132
> columns.
> 
> Here is a test line of length 131:
> 00 0 0 0 0 0 0
>  0 0 1 1 1 1
> 01 2 3 4 5 6 7
>  8 9 0 1 2 3
> 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
> 456789012345678901
> 
> Thanks,
> Scott
> 
> 
> ]You also could easily post a branch of your patches (for example, on
> ]github).
> ]
> ]Also, git send-email nicely uses the In-Reply-To email header to
> ]thread all the patches of your series together.
> ]
> ]-Jordan
> ]
> <...>
> 
> 
> ___
> 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] NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.

2015-11-08 Thread Wu, Jiaxin
Reviewed-by: Wu Jiaxin 

-Original Message-
From: Zhang, Lubo 
Sent: Monday, November 9, 2015 1:26 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan; Ye, Ting; Wu, Jiaxin; Gary Ching-Pang Lin
Subject: [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address 
correctly.

If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6 
address from the host name, because the host name contains left and right 
bracket which cannot be used to configure the Tcp6 connection.

Cc: Fu Siyuan 
Cc: Ye Ting 
CC: Wu Jiaxin 
CC: Gary Ching-Pang Lin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
index c527da0..2f4ce89 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -388,11 +388,11 @@ EfiHttpRequest (
 // Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
 //
 if (!HttpInstance->LocalAddressIsIPv6) {
   Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
 } else {
-  Status = NetLibAsciiStrToIp6 (HostName, &HttpInstance->RemoteIpv6Addr);
+  Status = HttpUrlGetIp6 (Url, UrlParser, 
+ &HttpInstance->RemoteIpv6Addr);
 }
 
 if (EFI_ERROR (Status)) {
   HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
(CHAR16));
   if (HostNameStr == NULL) {
--
1.9.5.msysgit.1

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


Re: [edk2] [Patch] MdePkg: Add more DataBits support to Port80 output

2015-11-08 Thread Zeng, Star

On 2015/11/2 18:30, Liming Gao wrote:

The BasePostCodeLibPort80 instance just prints UINT8 to IoPort 80. Some boards
may support 16bit or 32bit. To support them, new PCD PcdPort80DataWidth is
introduced to specify the width of data bits to Port80.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao 
---
  .../BasePostCodeLibPort80/BasePostCodeLibPort80.inf |   4 ++--
  MdePkg/Library/BasePostCodeLibPort80/PostCode.c |  19 ---
  MdePkg/MdePkg.dec   |   5 +
  MdePkg/MdePkg.uni   | Bin 69604 -> 70116 bytes
  4 files changed, 23 insertions(+), 5 deletions(-)


Reviewed-by: Star Zeng 

How about to put this PCD declaration near with PcdPostCodePropertyMask?

Thanks,
Star


diff --git a/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf 
b/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
index e2f0be5..441c4c5 100644
--- a/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
+++ b/MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
@@ -3,7 +3,7 @@
  #
  #  Post Code Library that writes post code values to I/O port 0x80.
  #
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+#  Copyright (c) 2007 - 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
@@ -44,4 +44,4 @@

  [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask  ## CONSUMES
-
+  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth ## CONSUMES
diff --git a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c 
b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
index 925c740..4d572db 100644
--- a/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
+++ b/MdePkg/Library/BasePostCodeLibPort80/PostCode.c
@@ -1,7 +1,7 @@
  /** @file
Post Code Library instance that writes post code values to I/O port 0x80.

-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+  Copyright (c) 2006 - 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
@@ -42,7 +42,20 @@ PostCode (
IN UINT32  Value
)
  {
-  IoWrite8 (0x80, (UINT8)(Value));
+  switch (PcdGet8 (PcdPort80DataWidth)) {
+  case 8:
+IoWrite8 (0x80, (UINT8)(Value));
+break;
+  case 16:
+IoWrite16 (0x80, (UINT16)(Value));
+break;
+  case 32:
+IoWrite32 (0x80, Value);
+break;
+  default:
+break;
+  }
+
return Value;
  }

@@ -78,7 +91,7 @@ PostCodeWithDescription (
IN CONST CHAR8  *Description  OPTIONAL
)
  {
-  IoWrite8 (0x80, (UINT8)(Value));
+  PostCode (Value);
return Value;
  }

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 337059a..30f29d3 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1965,6 +1965,11 @@
# @Prompt Memory Address of GuidedExtractHandler Table.

gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x100|UINT64|0x30001015

+  ## The bit width of data to be written to Port80. The default value is 8.
+  # @Prompt Port80 Data Width
+  # @ValidList  0x8001 | 8, 16, 32
+  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth|8|UINT8|0x30001017
+
  [PcdsFixedAtBuild.IPF, PcdsPatchableInModule.IPF]
## The base address of IO port space for IA64 arch.
# @Prompt IA64 IO Port Space Base Address.
diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni
index 
38211344e0ae01e984d5d9b916e42f4f8b4c1c66..5a5126213e4f72ea8c47772aebf5e31e007bbc46
 100644
GIT binary patch
delta 257
zcmaDdpXJG7mWC~iPxvRx?GKO*V8~}EVklv-U@%~CVMqkB5*fl7G8s~Utc=NqV&?J)
zc?Gx%1tc|&YvM(*nlSl%is|GHt2pYDfaaAjC@_@6%muRZ8Pb4c3e-jgpnN`%pTv*~
zR#ybpQ3B-U0r?O)WS8mzMMD@ez^YS#WE#+%QidF`EoDG<4v+^jDU+d?L4g

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


[edk2] [patch] NetworkPkg:Fix the issue that cannot parse ipv6 address correctly.

2015-11-08 Thread Zhang Lubo
If there is a ipv6 expressed url, the NetLibAsciiStrToIp6 cannot get the Ipv6
address from the host name, because the host name contains left and right 
bracket
which cannot be used to configure the Tcp6 connection.

Cc: Fu Siyuan 
Cc: Ye Ting 
CC: Wu Jiaxin 
CC: Gary Ching-Pang Lin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/HttpDxe/HttpImpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index c527da0..2f4ce89 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -388,11 +388,11 @@ EfiHttpRequest (
 // Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
 //
 if (!HttpInstance->LocalAddressIsIPv6) {
   Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
 } else {
-  Status = NetLibAsciiStrToIp6 (HostName, &HttpInstance->RemoteIpv6Addr);
+  Status = HttpUrlGetIp6 (Url, UrlParser, &HttpInstance->RemoteIpv6Addr);
 }
 
 if (EFI_ERROR (Status)) {
   HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
(CHAR16));
   if (HostNameStr == NULL) {
-- 
1.9.5.msysgit.1

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


[edk2] [Patch V2 2/5] MdeModulePkg: Add ImageDecoderLib to provide image decoding service.

2015-11-08 Thread Ruiyu Ni
The library itself doesn't provide any image decoding capabilities but
manages the different image decoders.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Feng Tian 
---
 MdeModulePkg/Include/Library/ImageDecoderLib.h |  76 +
 .../Library/ImageDecoderLib/ImageDecoderLib.c  | 121 +
 .../Library/ImageDecoderLib/ImageDecoderLib.inf|  42 +++
 MdeModulePkg/MdeModulePkg.dec  |   4 +
 MdeModulePkg/MdeModulePkg.dsc  |   2 +
 5 files changed, 245 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/ImageDecoderLib.h
 create mode 100644 MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.c
 create mode 100644 MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.inf

diff --git a/MdeModulePkg/Include/Library/ImageDecoderLib.h 
b/MdeModulePkg/Include/Library/ImageDecoderLib.h
new file mode 100644
index 000..928a094
--- /dev/null
+++ b/MdeModulePkg/Include/Library/ImageDecoderLib.h
@@ -0,0 +1,76 @@
+/** @file
+  This library provides image decoding service by managing the different
+  image decoding libraries.
+
+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 that 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 __IMAGE_DECODER_LIB_H__
+#define __IMAGE_DECODER_LIB_H__
+#include 
+
+typedef
+EFI_STATUS
+(EFIAPI *DECODE_IMAGE)(
+  IN  IMAGE_FORMAT  ImageFormat,
+  IN  UINT8 *Image,
+  IN  UINTN ImageSize,
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
+  OUT UINTN *GopBltSize,
+  OUT UINTN *PixelWidth,
+  OUT UINTN *PixelHeight
+  );
+
+/**
+  Convert a graphics image to a callee allocated GOP blt buffer.
+
+  @param  ImageFormat   Format of the image file.
+  @param  Image Pointer to image file.
+  @param  ImageSize Number of bytes in Image.
+  @param  GopBltBuffer containing GOP version of Image.
+  @param  GopBltSizeSize of GopBlt in bytes.
+  @param  PixelWidthWidth of GopBlt/Image in pixels.
+  @param  PixelHeight   Height of GopBlt/Image in pixels.
+
+  @retval EFI_SUCCESS   GopBlt and GopBltSize are returned.
+  @retval EFI_INVALID_PARAMETER GopBlt or GopBltSize is NULL.
+  @retval EFI_INVALID_PARAMETER Image is NULL or ImageSize is 0.
+  @retval EFI_UNSUPPORTED   Image is not supported.
+  @retval EFI_OUT_OF_RESOURCES  No enough buffer to allocate.
+
+**/
+EFI_STATUS
+EFIAPI
+DecodeImage (
+  IN  IMAGE_FORMAT  ImageFormat,
+  IN  UINT8 *Image,
+  IN  UINTN ImageSize,
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
+  OUT UINTN *GopBltSize,
+  OUT UINTN *PixelWidth,
+  OUT UINTN *PixelHeight
+  );
+
+/**
+  Register an image decoder.
+
+  @param Decoder  An image decoder.
+
+  @retval EFI_SUCCESS  The decoder was successfully registered.
+  @retval EFI_OUT_OF_RESOURCES No enough resource to register the decoder.
+
+**/
+EFI_STATUS
+EFIAPI
+RegisterImageDecoder (
+  IN  DECODE_IMAGE Decoder
+  );
+
+#endif
diff --git a/MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.c 
b/MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.c
new file mode 100644
index 000..4a6219b
--- /dev/null
+++ b/MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.c
@@ -0,0 +1,121 @@
+/** @file
+  This library provides image decoding service by managing the different
+  image decoding libraries.
+
+Copyright (c) 2011 - 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 that 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 
+
+typedef struct {
+  UINT32   Signature;
+  DECODE_IMAGE Decoder;
+  LIST_ENTRY   Link;
+} IMAGE_DECODER_ENTRY;
+#define IMAGE_DECODER_ENTRY_SIGNATURE  SIGNATURE_32 ('i', 'm', 'g', 'd')
+#define IMAGE_DECODER_ENTRY_FROM_LINK(Link) \
+CR (Link, IMAGE_DECODER_ENTRY, Link, IMAGE_DECODER_ENTRY_SIGNATURE)
+
+LIST_ENTRY mImageDecoderLibDecoders = INITIALIZE_LIST_HEAD_VARIABLE 
(mImageDecoderLibDecoders);
+
+/**
+  Convert a graphics image to a callee al

[edk2] [Patch V2 0/5] Create BootLogoLib to provide common interfaces for LOGO drawing

2015-11-08 Thread Ruiyu Ni
Ruiyu Ni (5):
  MdeModulePkg: Add EdkiiPlatformLogo protocol definition.
  MdeModulePkg: Add ImageDecoderLib to provide image decoding service.
  MdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding
capability
  MdeModulePkg: Add BootLogoLib to provide interfaces about logo
display.
  Nt32Pkg: Use LogoLib for LOGO and progress bar drawing.

 MdeModulePkg/Include/Library/BootLogoLib.h |  82 ++
 MdeModulePkg/Include/Library/ImageDecoderLib.h |  76 ++
 MdeModulePkg/Include/Protocol/PlatformLogo.h   |  86 +++
 .../BmpImageDecoderLib/BmpImageDecoderLib.c| 272 +++
 .../BmpImageDecoderLib/BmpImageDecoderLib.inf  |  42 ++
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 584 +++
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf   |  59 ++
 .../Library/ImageDecoderLib/ImageDecoderLib.c  | 121 +++
 .../Library/ImageDecoderLib/ImageDecoderLib.inf|  42 ++
 MdeModulePkg/MdeModulePkg.dec  |  11 +
 MdeModulePkg/MdeModulePkg.dsc  |   4 +
 .../Library/PlatformBootManagerLib/MemoryTest.c| 833 +
 .../PlatformBootManagerLib/PlatformBootManager.c   |   6 +-
 .../PlatformBootManagerLib/PlatformBootManager.h   |   6 +-
 .../PlatformBootManagerLib.inf |   2 +-
 Nt32Pkg/Nt32Pkg.dsc|   7 +-
 16 files changed, 1393 insertions(+), 840 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/BootLogoLib.h
 create mode 100644 MdeModulePkg/Include/Library/ImageDecoderLib.h
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformLogo.h
 create mode 100644 MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.c
 create mode 100644 
MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.inf
 create mode 100644 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
 create mode 100644 MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
 create mode 100644 MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.c
 create mode 100644 MdeModulePkg/Library/ImageDecoderLib/ImageDecoderLib.inf

-- 
1.9.5.msysgit.1

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


[edk2] [Patch V2 3/5] MdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding capability

2015-11-08 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Feng Tian 
---
 .../BmpImageDecoderLib/BmpImageDecoderLib.c| 272 +
 .../BmpImageDecoderLib/BmpImageDecoderLib.inf  |  42 
 MdeModulePkg/MdeModulePkg.dsc  |   1 +
 3 files changed, 315 insertions(+)
 create mode 100644 MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.c
 create mode 100644 
MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.inf

diff --git a/MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.c 
b/MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.c
new file mode 100644
index 000..86dcc91
--- /dev/null
+++ b/MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.c
@@ -0,0 +1,272 @@
+/** @file
+  This library provides BMP image decoding capability.
+
+Copyright (c) 2011 - 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 that 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 
+
+/**
+  Convert a *.BMP graphics image to a callee allocated GOP blt buffer.
+
+  @param  ImageFormat   Format of the image file.
+  @param  BmpImage  Pointer to BMP file
+  @param  BmpImageSize  Number of bytes in BmpImage
+  @param  GopBltBuffer containing GOP version of BmpImage.
+  @param  GopBltSizeSize of GopBlt in bytes.
+  @param  PixelHeight   Height of GopBlt/BmpImage in pixels
+  @param  PixelWidthWidth of GopBlt/BmpImage in pixels
+
+  @retval EFI_SUCCESS   GopBlt and GopBltSize are returned.
+  @retval EFI_INVALID_PARAMETER GopBlt or GopBltSize is NULL.
+  @retval EFI_UNSUPPORTED   BmpImage is not a valid *.BMP image
+  @retval EFI_OUT_OF_RESOURCES  No enough buffer to allocate.
+
+**/
+EFI_STATUS
+EFIAPI
+BmpImageDecoderLibConvertBmpToGopBlt (
+  IN  IMAGE_FORMAT  ImageFormat,
+  IN  UINT8 *BmpImage,
+  IN  UINTN BmpImageSize,
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt,
+  OUT UINTN *GopBltSize,
+  OUT UINTN *PixelWidth,
+  OUT UINTN *PixelHeight
+  )
+{
+  UINT8 *Image;
+  UINT8 *ImageHeader;
+  BMP_IMAGE_HEADER  *BmpHeader;
+  BMP_COLOR_MAP *BmpColorMap;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
+  UINT64BltBufferSize;
+  UINTN Index;
+  UINTN Height;
+  UINTN Width;
+  UINTN ImageIndex;
+  UINT32DataSizePerLine;
+  UINT32ColorMapNum;
+
+  ASSERT ((GopBlt != NULL) && (GopBltSize != NULL));
+
+  if (ImageFormat != ImageFormatBmp) {
+return EFI_UNSUPPORTED;
+  }
+
+  if (sizeof (BMP_IMAGE_HEADER) > BmpImageSize) {
+return EFI_UNSUPPORTED;
+  }
+
+  BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;
+
+  if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {
+return EFI_UNSUPPORTED;
+  }
+
+  //
+  // Doesn't support compress.
+  //
+  if (BmpHeader->CompressionType != 0) {
+return EFI_UNSUPPORTED;
+  }
+
+  //
+  // Only support BITMAPINFOHEADER format.
+  // BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER
+  //
+  if (BmpHeader->HeaderSize != sizeof (BMP_IMAGE_HEADER) - 
OFFSET_OF(BMP_IMAGE_HEADER, HeaderSize)) {
+return EFI_UNSUPPORTED;
+  }
+
+  //
+  // The data size in each line must be 4 byte alignment.
+  //
+  DataSizePerLine = ((BmpHeader->PixelWidth * BmpHeader->BitPerPixel + 31) >> 
3) & (~0x3);
+  BltBufferSize = MultU64x32 (DataSizePerLine, BmpHeader->PixelHeight);
+  if (BltBufferSize > (UINT32) ~0) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  if ((BmpHeader->Size != BmpImageSize) || 
+  (BmpHeader->Size < BmpHeader->ImageOffset) ||
+  (BmpHeader->Size - BmpHeader->ImageOffset !=  BmpHeader->PixelHeight * 
DataSizePerLine)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Calculate Color Map offset in the image.
+  //
+  Image   = BmpImage;
+  BmpColorMap = (BMP_COLOR_MAP *) (Image + sizeof (BMP_IMAGE_HEADER));
+  if (BmpHeader->ImageOffset < sizeof (BMP_IMAGE_HEADER)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
+switch (BmpHeader->BitPerPixel) {
+  case 1:
+ColorMapNum = 2;
+break;
+  case 4:
+ColorMapNum = 16;
+break;
+  case 8:
+ColorMapNum = 256;
+break;
+  defau

[edk2] [Patch V2 5/5] Nt32Pkg: Use LogoLib for LOGO and progress bar drawing.

2015-11-08 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Eric Dong 
---
 .../Library/PlatformBootManagerLib/MemoryTest.c| 833 +
 .../PlatformBootManagerLib/PlatformBootManager.c   |   6 +-
 .../PlatformBootManagerLib/PlatformBootManager.h   |   6 +-
 .../PlatformBootManagerLib.inf |   2 +-
 Nt32Pkg/Nt32Pkg.dsc|   7 +-
 5 files changed, 14 insertions(+), 840 deletions(-)

diff --git a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c 
b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
index 9f57466..93ecc7d 100644
--- a/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
+++ b/Nt32Pkg/Library/PlatformBootManagerLib/MemoryTest.c
@@ -23,179 +23,6 @@ EFI_GUID   mPlatformBootManagerStringPackGuid = {
 //
 // BDS Platform Functions
 //
-/**
-
-  Show progress bar with title above it. It only works in Graphics mode.
-
-
-  @param TitleForeground Foreground color for Title.
-  @param TitleBackground Background color for Title.
-  @param Title   Title above progress bar.
-  @param ProgressColor   Progress bar color.
-  @param ProgressProgress (0-100)
-  @param PreviousValue   The previous value of the progress.
-
-  @retval  EFI_STATUS   Success update the progress bar
-
-**/
-EFI_STATUS
-PlatformBootManagerShowProgress (
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
-  IN CHAR16*Title,
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
-  IN UINTN Progress,
-  IN UINTN PreviousValue
-  )
-{
-  EFI_STATUS Status;
-  EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;
-  EFI_UGA_DRAW_PROTOCOL  *UgaDraw;
-  UINT32 SizeOfX;
-  UINT32 SizeOfY;
-  UINT32 ColorDepth;
-  UINT32 RefreshRate;
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Color;
-  UINTN  BlockHeight;
-  UINTN  BlockWidth;
-  UINTN  BlockNum;
-  UINTN  PosX;
-  UINTN  PosY;
-  UINTN  Index;
-
-  if (Progress > 100) {
-return EFI_INVALID_PARAMETER;
-  }
-
-  UgaDraw = NULL;
-  Status = gBS->HandleProtocol (
-  gST->ConsoleOutHandle,
-  &gEfiGraphicsOutputProtocolGuid,
-  (VOID **) &GraphicsOutput
-  );
-  if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
-GraphicsOutput = NULL;
-
-Status = gBS->HandleProtocol (
-gST->ConsoleOutHandle,
-&gEfiUgaDrawProtocolGuid,
-(VOID **) &UgaDraw
-);
-  }
-  if (EFI_ERROR (Status)) {
-return EFI_UNSUPPORTED;
-  }
-
-  SizeOfX = 0;
-  SizeOfY = 0;
-  if (GraphicsOutput != NULL) {
-SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
-SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
-  } else if (UgaDraw != NULL) {
-Status = UgaDraw->GetMode (
-UgaDraw,
-&SizeOfX,
-&SizeOfY,
-&ColorDepth,
-&RefreshRate
-);
-if (EFI_ERROR (Status)) {
-  return EFI_UNSUPPORTED;
-}
-  } else {
-return EFI_UNSUPPORTED;
-  }
-
-  BlockWidth  = SizeOfX / 100;
-  BlockHeight = SizeOfY / 50;
-
-  BlockNum= Progress;
-
-  PosX= 0;
-  PosY= SizeOfY * 48 / 50;
-
-  if (BlockNum == 0) {
-//
-// Clear progress area
-//
-SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
-
-if (GraphicsOutput != NULL) {
-  Status = GraphicsOutput->Blt (
-  GraphicsOutput,
-  &Color,
-  EfiBltVideoFill,
-  0,
-  0,
-  0,
-  PosY - EFI_GLYPH_HEIGHT - 1,
-  SizeOfX,
-  SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
-  SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
-  );
-} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
-  Status = UgaDraw->Blt (
-  UgaDraw,
-  (EFI_UGA_PIXEL *) &Color,
-  EfiUgaVideoFill,
-  0,
-  0,
-  0,
-  PosY - EFI_GLYPH_HEIGHT - 1,
-  SizeOfX,
-  SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
-  SizeOfX * sizeof (EFI_UGA_PIXEL)
-  );
-} else {
-  return EFI_UNSUPPORTED;
-}
-  }
-  //
-  // Show progress by 

[edk2] [Patch V2 4/5] MdeModulePkg: Add BootLogoLib to provide interfaces about logo display.

2015-11-08 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Feng Tian 
---
 MdeModulePkg/Include/Library/BootLogoLib.h   |  82 
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c   | 584 +++
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf |  59 +++
 MdeModulePkg/MdeModulePkg.dec|   4 +
 MdeModulePkg/MdeModulePkg.dsc|   1 +
 5 files changed, 730 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/BootLogoLib.h
 create mode 100644 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
 create mode 100644 MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf

diff --git a/MdeModulePkg/Include/Library/BootLogoLib.h 
b/MdeModulePkg/Include/Library/BootLogoLib.h
new file mode 100644
index 000..3637405
--- /dev/null
+++ b/MdeModulePkg/Include/Library/BootLogoLib.h
@@ -0,0 +1,82 @@
+/** @file
+  This library is only intended to be used by PlatformBootManagerLib
+  to show progress bar and LOGO.
+
+Copyright (c) 2011 - 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 that 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 _BOOT_LOGO_LIB_H_
+#define _BOOT_LOGO_LIB_H_
+
+#include 
+
+/**
+  Show LOGO on all consoles.
+
+  @param[in]  ImageFormat Format of the image file.
+  @param[in]  LogoFileThe file name of logo to display.
+  @param[in]  Attribute   The display attributes of the image returned.
+  @param[in]  CoordinateX The X coordinate of the image.
+  @param[in]  CoordinateY The Y coordinate of the image.
+
+  @retval EFI_SUCCESS Logo was displayed.
+  @retval EFI_UNSUPPORTED Logo was not found or cannot be displayed.
+**/
+EFI_STATUS
+EFIAPI
+BootLogoEnableLogo (
+  IN  IMAGE_FORMAT  ImageFormat,
+  IN  EFI_GUID  *Logo,
+  IN  EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute,
+  IN  UINTN CoordinateX,
+  IN  UINTN CoordinateY
+  );
+
+
+/**
+  Use SystemTable ConOut to turn on video based Simple Text Out consoles. The 
+  Simple Text Out screens will now be synced up with all non-video output 
devices.
+
+  @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+
+**/
+EFI_STATUS
+EFIAPI
+BootLogoDisableLogo (
+  VOID
+  );
+
+/**
+
+  Update progress bar with title above it. It only works in Graphics mode.
+
+  @param TitleForeground Foreground color for Title.
+  @param TitleBackground Background color for Title.
+  @param Title   Title above progress bar.
+  @param ProgressColor   Progress bar color.
+  @param ProgressProgress (0-100)
+  @param PreviousValue   The previous value of the progress.
+
+  @retval  EFI_STATUSSuccessly update the progress bar
+
+**/
+EFI_STATUS
+EFIAPI
+BootLogoUpdateProgress (
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
+  IN CHAR16*Title,
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
+  IN UINTN Progress,
+  IN UINTN PreviousValue
+  );
+
+#endif
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c 
b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
new file mode 100644
index 000..312adb0
--- /dev/null
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -0,0 +1,584 @@
+/** @file
+  This library is only intended to be used by PlatformBootManagerLib
+  to show progress bar and LOGO.
+
+Copyright (c) 2011 - 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 that 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Show LOGO on all consoles.
+
+  @param[in]  ImageFormat Format of the image file.
+  @param[in]  LogoFileThe file name of logo to display.
+  @param[in]  Attribute   The display attributes of the image returned.
+  @param[in]  CoordinateX The X coordinate of the image.
+  @param[in]  CoordinateY The Y coordinate of the image.
+
+  @retval EFI_SUCCESS Logo was displayed.
+  @retval EFI_UNSUPPORTED Logo was not found or cannot be displayed.
+**/
+EFI_STATUS
+EFIAPI
+BootLogoEnabl

[edk2] [Patch V2 1/5] MdeModulePkg: Add EdkiiPlatformLogo protocol definition.

2015-11-08 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Feng Tian 
---
 MdeModulePkg/Include/Protocol/PlatformLogo.h | 86 
 MdeModulePkg/MdeModulePkg.dec|  3 +
 2 files changed, 89 insertions(+)
 create mode 100644 MdeModulePkg/Include/Protocol/PlatformLogo.h

diff --git a/MdeModulePkg/Include/Protocol/PlatformLogo.h 
b/MdeModulePkg/Include/Protocol/PlatformLogo.h
new file mode 100644
index 000..aa8b398
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/PlatformLogo.h
@@ -0,0 +1,86 @@
+/** @file
+  The Platform Logo Protocol defines the interface to get the Platform logo
+  image with the display attribute.
+
+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 that 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 __EDKII_PLATFORM_LOGO__
+#define __EDKII_PLATFORM_LOGO__
+
+//
+// GUID for EDKII Platform Logo Protocol
+//
+#define EDKII_PLATFORM_LOGO_PROTOCOL_GUID \
+  { 0x9b517978, 0xeba1, 0x44e7, { 0xba, 0x65, 0x7c, 0x2c, 0xd0, 0x8b, 0xf8, 
0xe9 } }
+
+typedef struct _EDKII_PLATFORM_LOGO_PROTOCOL EDKII_PLATFORM_LOGO_PROTOCOL;
+
+typedef enum {
+  ImageFormatBmp,
+  ImageFormatJpeg,
+  ImageFormatTiff,
+  ImageFormatGif,
+  ImageFormatUnknown
+} IMAGE_FORMAT;
+
+typedef enum {
+  EdkiiPlatformLogoDisplayAttributeLeftTop,
+  EdkiiPlatformLogoDisplayAttributeCenterTop,
+  EdkiiPlatformLogoDisplayAttributeRightTop,
+  EdkiiPlatformLogoDisplayAttributeCenterRight,
+  EdkiiPlatformLogoDisplayAttributeRightBottom,
+  EdkiiPlatformLogoDisplayAttributeCenterBottom,
+  EdkiiPlatformLogoDisplayAttributeLeftBottom,
+  EdkiiPlatformLogoDisplayAttributeCenterLeft,
+  EdkiiPlatformLogoDisplayAttributeCenter
+} EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE;
+
+/**
+
+  Load a platform logo image and return its data and attributes.
+
+  @param This  The pointer to this protocol instance.
+  @param Instance  The visible image instance is found.
+  @param FormatThe format of the image. Examples: BMP, JPEG.
+  @param ImageData The image data for the badge file. Currently only 
+   supports the .bmp file format. 
+  @param ImageSize The size of the image returned.
+  @param Attribute The display attributes of the image returned.
+  @param CoordinateX   The X coordinate of the image.
+  @param CoordinateY   The Y coordinate of the image.
+
+  @retval EFI_SUCCESS  The image was fetched successfully.
+  @retval EFI_NOT_FOUNDThe specified image could not be found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_PLATFORM_LOGO_GET_IMAGE)(
+  IN EDKII_PLATFORM_LOGO_PROTOCOL  *This,
+  IN OUT UINT32*Instance,
+ OUT IMAGE_FORMAT  *Format,
+ OUT UINT8 **ImageData,
+ OUT UINTN *ImageSize,
+ OUT EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE *Attribute,
+ OUT UINTN *CoordinateX,
+ OUT UINTN *CoordinateY
+);
+
+
+struct _EDKII_PLATFORM_LOGO_PROTOCOL {
+  EDKII_PLATFORM_LOGO_GET_IMAGE GetImage;
+};
+
+
+extern EFI_GUID gEdkiiPlatformLogoProtocolGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 3dfcd6a..08148e3 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -449,6 +449,9 @@
   ## Include/Protocol/SmmReadyToBoot.h
   gEdkiiSmmReadyToBootProtocolGuid = { 0x6e057ecf, 0xfa99, 0x4f39, { 0x95, 
0xbc, 0x59, 0xf9, 0x92, 0x1d, 0x17, 0xe4 } }
 
+  ## Include/Protocol/PlatformLogo.h
+  gEdkiiPlatformLogoProtocolGuid = { 0x9b517978, 0xeba1, 0x44e7, { 0xba, 0x65, 
0x7c, 0x2c, 0xd0, 0x8b, 0xf8, 0xe9 } }
+
 #
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]
 #   0x8001 | Invalid value provided.
-- 
1.9.5.msysgit.1

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


Re: [edk2] [PATCH v2] NetworkPkg:Enable Http Boot over Ipv6 stack

2015-11-08 Thread Zhang, Lubo
Hi Gary Lin
I have notice this issue when I  modify the DxeHttpLib, and another patch to 
fix this issue is already and will be sent out soon.
 
Thanks  


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gary 
Ching-Pang Lin
Sent: Monday, November 09, 2015 12:56 PM
To: Zhang, Lubo
Cc: Ye, Ting; edk2-devel@lists.01.org; Wu, Jiaxin; Fu, Siyuan
Subject: Re: [edk2] [PATCH v2] NetworkPkg:Enable Http Boot over Ipv6 stack

On Tue, Nov 03, 2015 at 04:13:27PM +0800, Zhang Lubo wrote:
> v2:
> *Rewrite the logic of setting ipv6 gateway in httpboot driver and update some 
> comment.
> 
> Fix a potential bug which can cause assert when setting ipv6 Gateway. 
> If there is no router in network environment, it will fail to find out 
> the gateway address which can route the message to Http Server Ip . 
> When it check the IP6 route table again 1 seconds later, it will 
> assert while the router table structure had been freed last time without 
> retrieve new relevant data form ip6 driver.
> 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> CC: Wu Jiaxin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo 
> ---
>  NetworkPkg/HttpBootDxe/HttpBootClient.c|  234 -
>  NetworkPkg/HttpBootDxe/HttpBootComponentName.c |5 +-
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.c |   12 +-
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.h |   11 +
>  NetworkPkg/HttpBootDxe/HttpBootDhcp6.c |  984 +++
>  NetworkPkg/HttpBootDxe/HttpBootDhcp6.h |  198 
>  NetworkPkg/HttpBootDxe/HttpBootDxe.c   |  903 +++---
>  NetworkPkg/HttpBootDxe/HttpBootDxe.h   |  159 +++-
>  NetworkPkg/HttpBootDxe/HttpBootDxe.inf |9 +
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c  |  109 ++-
>  NetworkPkg/HttpBootDxe/HttpBootImpl.h  |2 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.c   |  292 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.h   |   70 ++
>  NetworkPkg/HttpDxe/HttpDns.c   |  207 +++-
>  NetworkPkg/HttpDxe/HttpDns.h   |   20 +
>  NetworkPkg/HttpDxe/HttpDriver.c|  806 +++-
>  NetworkPkg/HttpDxe/HttpDriver.h|  143 ++-
>  NetworkPkg/HttpDxe/HttpDxe.inf |5 +
>  NetworkPkg/HttpDxe/HttpImpl.c  |  358 +++
>  NetworkPkg/HttpDxe/HttpImpl.h  |1 -
>  NetworkPkg/HttpDxe/HttpProto.c | 1210 
> 
>  NetworkPkg/HttpDxe/HttpProto.h |  182 +++-
>  22 files changed, 5017 insertions(+), 903 deletions(-)  create mode 
> 100644 NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootDhcp6.h
> 
--8<--
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c 
> b/NetworkPkg/HttpDxe/HttpImpl.c index 588e1bb..f5df660 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
--8<--
> @@ -377,28 +383,39 @@ EfiHttpRequest (
>  }
>}
>  
>if (Configure) {
>  //
> -// Parse Url for IPv4 address, if failed, perform DNS resolution.
> +// Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
>  //
> -Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
> +if (!HttpInstance->LocalAddressIsIPv6) {
> +  Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
> +} else {
> +  Status = NetLibAsciiStrToIp6 (HostName, 
> + &HttpInstance->RemoteIpv6Addr);
The 'HostName' shouldn't be passed to NetLibAsciiStrToIp6 directly since it 
contains '[' and ']' and NetLibAsciiStrToIp6 doesn't expect that, and
HttpInitTcp() would complain that the IP address cannot be found.

Gary Lin

> +}
> +
>  if (EFI_ERROR (Status)) {
> -  HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
> (UINT16));
> +  HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * 
> + sizeof (CHAR16));
>if (HostNameStr == NULL) {
>  Status = EFI_OUT_OF_RESOURCES;
>  goto Error1;
>}
> -
> +  
>AsciiStrToUnicodeStr (HostName, HostNameStr);
> -  Status = HttpDns4 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteAddr);
> +  if (!HttpInstance->LocalAddressIsIPv6) {
> +Status = HttpDns4 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteAddr);
> +  } else {
> +Status = HttpDns6 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteIpv6Addr);
> +  }
> +  
>FreePool (HostNameStr);
>if (EFI_ERROR (Status)) {
>  goto Error1;
>}
>  }
>  
> +
>  //
>  // Save the RemotePort and RemoteHost.
>  //
>  ASSERT (HttpInstance->RemoteHost == NULL);
>  HttpInstance->RemotePort = RemotePort;

--8<--

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

Re: [edk2] [PATCH v2] NetworkPkg:Enable Http Boot over Ipv6 stack

2015-11-08 Thread Gary Ching-Pang Lin
On Tue, Nov 03, 2015 at 04:13:27PM +0800, Zhang Lubo wrote:
> v2:
> *Rewrite the logic of setting ipv6 gateway in httpboot driver and update some 
> comment.
> 
> Fix a potential bug which can cause assert when setting ipv6 Gateway. If 
> there is no
> router in network environment, it will fail to find out the gateway address 
> which can
> route the message to Http Server Ip . When it check the IP6 route table again 
> 1 seconds
> later, it will assert while the router table structure had been freed last 
> time without
> retrieve new relevant data form ip6 driver.
> 
> Cc: Fu Siyuan 
> Cc: Ye Ting 
> CC: Wu Jiaxin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo 
> ---
>  NetworkPkg/HttpBootDxe/HttpBootClient.c|  234 -
>  NetworkPkg/HttpBootDxe/HttpBootComponentName.c |5 +-
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.c |   12 +-
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.h |   11 +
>  NetworkPkg/HttpBootDxe/HttpBootDhcp6.c |  984 +++
>  NetworkPkg/HttpBootDxe/HttpBootDhcp6.h |  198 
>  NetworkPkg/HttpBootDxe/HttpBootDxe.c   |  903 +++---
>  NetworkPkg/HttpBootDxe/HttpBootDxe.h   |  159 +++-
>  NetworkPkg/HttpBootDxe/HttpBootDxe.inf |9 +
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c  |  109 ++-
>  NetworkPkg/HttpBootDxe/HttpBootImpl.h  |2 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.c   |  292 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.h   |   70 ++
>  NetworkPkg/HttpDxe/HttpDns.c   |  207 +++-
>  NetworkPkg/HttpDxe/HttpDns.h   |   20 +
>  NetworkPkg/HttpDxe/HttpDriver.c|  806 +++-
>  NetworkPkg/HttpDxe/HttpDriver.h|  143 ++-
>  NetworkPkg/HttpDxe/HttpDxe.inf |5 +
>  NetworkPkg/HttpDxe/HttpImpl.c  |  358 +++
>  NetworkPkg/HttpDxe/HttpImpl.h  |1 -
>  NetworkPkg/HttpDxe/HttpProto.c | 1210 
> 
>  NetworkPkg/HttpDxe/HttpProto.h |  182 +++-
>  22 files changed, 5017 insertions(+), 903 deletions(-)
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootDhcp6.c
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootDhcp6.h
> 
--8<--
> diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
> index 588e1bb..f5df660 100644
> --- a/NetworkPkg/HttpDxe/HttpImpl.c
> +++ b/NetworkPkg/HttpDxe/HttpImpl.c
--8<--
> @@ -377,28 +383,39 @@ EfiHttpRequest (
>  }
>} 
>  
>if (Configure) {
>  //
> -// Parse Url for IPv4 address, if failed, perform DNS resolution.
> +// Parse Url for IPv4 or IPv6 address, if failed, perform DNS resolution.
>  //
> -Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
> +if (!HttpInstance->LocalAddressIsIPv6) {
> +  Status = NetLibAsciiStrToIp4 (HostName, &HttpInstance->RemoteAddr);
> +} else {
> +  Status = NetLibAsciiStrToIp6 (HostName, &HttpInstance->RemoteIpv6Addr);
The 'HostName' shouldn't be passed to NetLibAsciiStrToIp6 directly since it
contains '[' and ']' and NetLibAsciiStrToIp6 doesn't expect that, and
HttpInitTcp() would complain that the IP address cannot be found.

Gary Lin

> +}
> +
>  if (EFI_ERROR (Status)) {
> -  HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
> (UINT16));
> +  HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof 
> (CHAR16));
>if (HostNameStr == NULL) {
>  Status = EFI_OUT_OF_RESOURCES;
>  goto Error1;
>}
> -
> +  
>AsciiStrToUnicodeStr (HostName, HostNameStr);
> -  Status = HttpDns4 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteAddr);
> +  if (!HttpInstance->LocalAddressIsIPv6) {
> +Status = HttpDns4 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteAddr);
> +  } else {
> +Status = HttpDns6 (HttpInstance, HostNameStr, 
> &HttpInstance->RemoteIpv6Addr);
> +  }
> +  
>FreePool (HostNameStr);
>if (EFI_ERROR (Status)) {
>  goto Error1;
>}
>  }
>  
> +
>  //
>  // Save the RemotePort and RemoteHost.
>  //
>  ASSERT (HttpInstance->RemoteHost == NULL);
>  HttpInstance->RemotePort = RemotePort;

--8<--

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


Re: [edk2] [Patch] BaseTools: Allow decimal values in the EDK II meta-data file.

2015-11-08 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Zhu, Yonghong
> Sent: Tuesday, November 03, 2015 1:01 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming
> Subject: [Patch] BaseTools: Allow decimal values in the EDK II meta-data file.
> 
> Because the EDK II meta-data specifications already allow using decimal
> values in the EDK II Meta-data file [Defines] section, this patch update
> code to allow this usage.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu 
> ---
>  Source/Python/Workspace/MetaFileParser.py| 11 ---
>  Source/Python/Workspace/WorkspaceDatabase.py |  8 +++-
>  2 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/Source/Python/Workspace/MetaFileParser.py 
> b/Source/Python/Workspace/MetaFileParser.py
> index fe1f7fd..e7d6df6 100644
> --- a/Source/Python/Workspace/MetaFileParser.py
> +++ b/Source/Python/Workspace/MetaFileParser.py
> @@ -341,13 +341,18 @@ class MetaFileParser(object):
> 
>  self._ValueList = [ReplaceMacro(Value, self._Macros) for Value in 
> self._ValueList]
>  Name, Value = self._ValueList[1], self._ValueList[2]
>  # Sometimes, we need to make differences between EDK and EDK2 modules
>  if Name == 'INF_VERSION':
> -try:
> -self._Version = int(Value, 0)
> -except:
> +if re.match(r'0[xX][\da-f-A-F]{5,8}', Value):
> +self._Version = int(Value, 0)
> +elif re.match(r'\d+\.\d+', Value):
> +ValueList = Value.split('.')
> +Major = '%04o' % int(ValueList[0], 0)
> +Minor = '%04o' % int(ValueList[1], 0)
> +self._Version = int('0x' + Major + Minor, 0)
> +else:
>  EdkLogger.error('Parser', FORMAT_INVALID, "Invalid version 
> number",
>  ExtraData=self._CurrentLine, 
> File=self.MetaFile, Line=self._LineIndex + 1)
> 
>  if type(self) == InfParser and self._Version < 0x00010005:
>  # EDK module allows using defines as macros
> diff --git a/Source/Python/Workspace/WorkspaceDatabase.py 
> b/Source/Python/Workspace/WorkspaceDatabase.py
> index c84d192..46eb5d3 100644
> --- a/Source/Python/Workspace/WorkspaceDatabase.py
> +++ b/Source/Python/Workspace/WorkspaceDatabase.py
> @@ -1953,11 +1953,17 @@ class InfBuildData(ModuleBuildClassObject):
>  def _GetInfVersion(self):
>  if self._AutoGenVersion == None:
>  RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, 
> self._Platform]
>  for Record in RecordList:
>  if Record[1] == TAB_INF_DEFINES_INF_VERSION:
> -self._AutoGenVersion = int(Record[2], 0)
> +if '.' in Record[2]:
> +ValueList = Record[2].split('.')
> +Major = '%04o' % int(ValueList[0], 0)
> +Minor = '%04o' % int(ValueList[1], 0)
> +self._AutoGenVersion = int('0x' + Major + Minor, 0)
> +else:
> +self._AutoGenVersion = int(Record[2], 0)
>  break
>  if self._AutoGenVersion == None:
>  self._AutoGenVersion = 0x0001
>  return self._AutoGenVersion
> 
> --
> 2.6.1.windows.1

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


[edk2] edk2 build failure on GCC44

2015-11-08 Thread Hao, Xudong
Hi, all

I'm using edk2 as Xen HVM guest firmware, but the edk2 build fail with GCC 
4.4.7 (RHEL6.5). I clone the edk2 source from 
git://git.code.sf.net/p/tianocore/edk2, and the commit is 
a100d0073b365bc4f0ac95d30934e639e31175ac.

Command: OvmfPkg/build.sh -a X64 -b RELEASE -n 4
The whole compile log attached, the simple error log is:
...
/home/hao/src/tianocore-edk2/BaseTools/Scripts/GccBase.lds:1: undefined symbol 
`PECOFF_HEADER_SIZE' referenced in expression
make: *** 
[/home/hao/src/tianocore-edk2/Build/OvmfX64/RELEASE_GCC44/X64/OvmfPkg/Sec/SecMain/DEBUG/SecMain.dll]
 Error 1
...

Looking forward to you expert's help.

Best Regards,
Xudong

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


Re: [edk2] [patch] MdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 address correctly.

2015-11-08 Thread Wu, Jiaxin
The patch looks good to me.

Reviewed-by: Wu Jiaxin 


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang 
Lubo
Sent: Friday, November 6, 2015 4:12 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Fu, Siyuan; Wu, Jiaxin; Gary Ching-Pang Lin
Subject: [edk2] [patch] MdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 
address correctly.

v2:
*Add a Url Parse state machine to indicate the host is ipv6 expressed url and 
can parse the ipv6 address correctly.

Cc: Fu Siyuan 
Cc: Ye Ting 
CC: Wu Jiaxin 
CC: Gary Ching-Pang Lin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 33 
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index aeb52d0..500b3c7 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -68,10 +68,11 @@ typedef enum {
   UrlParserFragmentStart, // "#"
   UrlParserFragment,
   UrlParserUserInfo,
   UrlParserHostStart, // "@"
   UrlParserHost,
+  UrlParserHostIpv6,  // "["(Ipv6 address) "]"
   UrlParserPortStart, // ":"
   UrlParserPort,
   UrlParserStateMax
 } HTTP_URL_PARSE_STATE;
 
@@ -136,17 +137,20 @@ UriPercentDecode (
   This function return the updated state accroding to the input state and next 
character of
   the authority.
 
   @param[in]   Char   Next character.
   @param[in]   State  Current value of the parser state machine.
+  @param[in]   IsRightBracket TRUE if there is an sign ']' in the 
authority component and 
+  indicates the next part is ':' before Port.  
  
 
   @return  Updated state value.
 **/
 HTTP_URL_PARSE_STATE
 NetHttpParseAuthorityChar (
   IN  CHAR8  Char,
-  IN  HTTP_URL_PARSE_STATE   State
+  IN  HTTP_URL_PARSE_STATE   State,
+  IN  BOOLEAN*IsRightBracket
   )
 {
 
   //
   // RFC 3986:
@@ -167,16 +171,31 @@ NetHttpParseAuthorityChar (
   return UrlParserHostStart;
 }
 break;
 
   case UrlParserHost:
-  case UrlParserHostStart:
+  case UrlParserHostStart:  
+if (Char == '[') {
+  return UrlParserHostIpv6;
+}
+
 if (Char == ':') {
   return UrlParserPortStart;
 }
+
 return UrlParserHost;
-
+
+  case UrlParserHostIpv6:  
+if (Char == ']') {
+  *IsRightBracket = TRUE;
+}
+
+if (Char == ':' && *IsRightBracket == TRUE) {
+  return UrlParserPortStart;
+}
+return UrlParserHostIpv6;
+
   case UrlParserPort:
   case UrlParserPortStart:
 return UrlParserPort;
 
   default:
@@ -208,10 +227,11 @@ NetHttpParseAuthority (
   CHAR8 *Authority;
   UINT32Length;
   HTTP_URL_PARSE_STATE  State;
   UINT32Field;
   UINT32OldField;
+  BOOLEAN   IsrightBracket;
   
   ASSERT ((UrlParser->FieldBitMap & BIT (HTTP_URI_FIELD_AUTHORITY)) != 0);
 
   //
   // authority   = [ userinfo "@" ] host [ ":" port ]
@@ -220,16 +240,17 @@ NetHttpParseAuthority (
 State = UrlParserUserInfo;
   } else {
 State = UrlParserHost;
   }
 
+  IsrightBracket = FALSE;
   Field = HTTP_URI_FIELD_MAX;
   OldField = Field;
   Authority = Url + UrlParser->FieldData[HTTP_URI_FIELD_AUTHORITY].Offset;
   Length = UrlParser->FieldData[HTTP_URI_FIELD_AUTHORITY].Length;
   for (Char = Authority; Char < Authority + Length; Char++) {
-State = NetHttpParseAuthorityChar (*Char, State);
+State = NetHttpParseAuthorityChar (*Char, State, &IsrightBracket);
 switch (State) {
 case UrlParserStateMax:
   return EFI_INVALID_PARAMETER;
 
 case UrlParserHostStart:
@@ -241,10 +262,14 @@ NetHttpParseAuthority (
   break;
   
 case UrlParserHost:
   Field = HTTP_URI_FIELD_HOST;
   break;
+
+case UrlParserHostIpv6:
+  Field = HTTP_URI_FIELD_HOST;
+  break;
   
 case UrlParserPort:
   Field = HTTP_URI_FIELD_PORT;
   break;
 
--
1.9.5.msysgit.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] MdeModulePkg: PeiCore: fix issue where AuthenticationStatus is not propagated correctly to encapsulated FVs by ensuring that the FvInfo2 PPI is installed before the FvInfo PPI

2015-11-08 Thread Tian, Feng
Pardon, where is the patch?

And the commit log is too long. It should be < 72 characters in each line.

Feng

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cohen, 
Eugene
Sent: Sunday, November 08, 2015 00:22
To: edk2-devel@lists.01.org
Cc: Thompson, Mark L. (Boise IPG); Dellaquila, Katie
Subject: [edk2] [PATCH] MdeModulePkg: PeiCore: fix issue where 
AuthenticationStatus is not propagated correctly to encapsulated FVs by 
ensuring that the FvInfo2 PPI is installed before the FvInfo PPI

Dear MdeModulePkg maintainer,

MdeModulePkg: PeiCore: fix issue where AuthenticationStatus is not propagated 
correctly to encapsulated FVs by ensuring that the FvInfo2 PPI is installed 
before the FvInfo PPI

This patch fixes an issue in PEI with encapsulated FV images where the 
AuthenticationStatus is not correctly propagated down to child FV handles.  The 
PEI core registers for callbacks for both FvInfo and FvInfo2 PPIs.  These 
callbacks process the FVs which will recurse as necessary to find more 
encapsulated FVs.  (FvInfo2 is an updated PPI that includes an 
AuthenticationStatus field - the original FvInfo did not include this.)

When encapsulated FV processing occurs the PEI core installs both FvInfo and 
FvInfo2 PPIs.  The original implementation installs FvInfo first and FvInfo2 
second.  As soon as the FvInfo PPI is installed the notification callback 
handler immediately fires causing recursive FV processing to occur.  Since 
there is no AuthenticationStatus provided for the original FvInfo the callback 
assumes AuthenticationStatus is zero (unsigned / unverified) even though the 
parent FV may have been verified.

This patch simply changes the order of FvInfo and FvInfo2 installs to ensure 
that the notification callback occurs for FvInfo2 first and appropriate 
AuthenticationStatus data can be propagated from parent FV to child FV.


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen eug...@hp.com

---


Thanks,

Eugene
___
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] Add error handling for TPM in S3 resume failure.

2015-11-08 Thread Yao, Jiewen
Good suggestion. I will update.

-Original Message-
From: Zhang, Chao B 
Sent: Monday, November 09, 2015 9:00 AM
To: Yao, Jiewen; edk2-de...@ml01.01.org
Subject: RE: [patch] Add error handling for TPM in S3 resume failure.

Jiewen:
   Should we do HashLogExtendEvent after SetTpm2HashMask? 





Thanks & Best regards
Chao Zhang

-Original Message-
From: Yao, Jiewen 
Sent: Friday, November 06, 2015 8:09 PM
To: edk2-de...@ml01.01.org
Cc: Yao, Jiewen; Zhang, Chao B
Subject: [patch] Add error handling for TPM in S3 resume failure.

If TPM2_Startup(TPM_SU_STATE) to return an error, the system  firmware that 
resumes from S3 MUST deal with a TPM2_Startup  error appropriately.
For example, issuing a TPM2_Startup(TPM_SU_CLEAR) command and  configuring the 
device securely by taking actions like extending  a separator with an error 
digest (0x01) into PCRs 0 through 7.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao, Jiewen 
Cc: Zhang, Chao B 
---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c 
b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 4ecfbe3..2e4ad53 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -829,6 +829,33 @@ PeimEntryMP (
 }
 
 /**
+  Measure and log Separator event with error, and extend the measurement 
result into a specific PCR.
+
+  @param[in] PCRIndex PCR index.  
+
+  @retval EFI_SUCCESS Operation completed successfully.
+  @retval EFI_DEVICE_ERRORThe operation was unsuccessful.
+
+**/
+EFI_STATUS
+MeasureSeparatorEventWithError (
+  IN  TPM_PCRINDEX  PCRIndex
+  )
+{
+  TCG_PCR_EVENT_HDR TcgEvent;
+  UINT32EventData;
+
+  //
+  // Use EventData 0x1 to indicate there is error.
+  //
+  EventData = 0x1;
+  TcgEvent.PCRIndex  = PCRIndex;
+  TcgEvent.EventType = EV_SEPARATOR;
+  TcgEvent.EventSize = (UINT32)sizeof (EventData);
+  return HashLogExtendEvent(0,(UINT8 *)&EventData, TcgEvent.EventSize, 
+&TcgEvent,(UINT8 *)&EventData); }
+
+/**
   Entry point of this module.
 
   @param[in] FileHandle   Handle of the file being invoked.
@@ -847,6 +874,7 @@ PeimEntryMA (
   EFI_STATUSStatus;
   EFI_STATUSStatus2;
   EFI_BOOT_MODE BootMode;
+  TPM_PCRINDEX  PcrIndex;
 
   if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), 
&gEfiTpmDeviceInstanceNoneGuid) ||
   CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), 
&gEfiTpmDeviceInstanceTpm12Guid)){
@@ -889,7 +917,22 @@ PeimEntryMA (
   if (BootMode == BOOT_ON_S3_RESUME) {
 Status = Tpm2Startup (TPM_SU_STATE);
 if (EFI_ERROR (Status) ) {
+  //
+  // The system firmware that resumes from S3 MUST deal with a
+  // TPM2_Startup error appropriately.
+  // For example, issue a TPM2_Startup(TPM_SU_CLEAR) command and
+  // configuring the device securely by taking actions like extending a
+  // separator with an error digest (0x01) into PCRs 0 through 7.
+  //
   Status = Tpm2Startup (TPM_SU_CLEAR);
+  if (!EFI_ERROR(Status)) {
+for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) {
+  Status = MeasureSeparatorEventWithError (PcrIndex);
+  if (EFI_ERROR (Status)) {
+DEBUG ((EFI_D_ERROR, "Seperator Event with Error not Measured. 
Error!\n"));
+  }
+}
+  }
 }
   } else {
 Status = Tpm2Startup (TPM_SU_CLEAR);
--
1.9.5.msysgit.0

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


Re: [edk2] [patch] Add error handling for TPM in S3 resume failure.

2015-11-08 Thread Zhang, Chao B
Jiewen:
   Should we do HashLogExtendEvent after SetTpm2HashMask? 





Thanks & Best regards
Chao Zhang

-Original Message-
From: Yao, Jiewen 
Sent: Friday, November 06, 2015 8:09 PM
To: edk2-de...@ml01.01.org
Cc: Yao, Jiewen; Zhang, Chao B
Subject: [patch] Add error handling for TPM in S3 resume failure.

If TPM2_Startup(TPM_SU_STATE) to return an error, the system  firmware that 
resumes from S3 MUST deal with a TPM2_Startup  error appropriately.
For example, issuing a TPM2_Startup(TPM_SU_CLEAR) command and  configuring the 
device securely by taking actions like extending  a separator with an error 
digest (0x01) into PCRs 0 through 7.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao, Jiewen 
Cc: Zhang, Chao B 
---
 SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c 
b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
index 4ecfbe3..2e4ad53 100644
--- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
+++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
@@ -829,6 +829,33 @@ PeimEntryMP (
 }
 
 /**
+  Measure and log Separator event with error, and extend the measurement 
result into a specific PCR.
+
+  @param[in] PCRIndex PCR index.  
+
+  @retval EFI_SUCCESS Operation completed successfully.
+  @retval EFI_DEVICE_ERRORThe operation was unsuccessful.
+
+**/
+EFI_STATUS
+MeasureSeparatorEventWithError (
+  IN  TPM_PCRINDEX  PCRIndex
+  )
+{
+  TCG_PCR_EVENT_HDR TcgEvent;
+  UINT32EventData;
+
+  //
+  // Use EventData 0x1 to indicate there is error.
+  //
+  EventData = 0x1;
+  TcgEvent.PCRIndex  = PCRIndex;
+  TcgEvent.EventType = EV_SEPARATOR;
+  TcgEvent.EventSize = (UINT32)sizeof (EventData);
+  return HashLogExtendEvent(0,(UINT8 *)&EventData, TcgEvent.EventSize, 
+&TcgEvent,(UINT8 *)&EventData); }
+
+/**
   Entry point of this module.
 
   @param[in] FileHandle   Handle of the file being invoked.
@@ -847,6 +874,7 @@ PeimEntryMA (
   EFI_STATUSStatus;
   EFI_STATUSStatus2;
   EFI_BOOT_MODE BootMode;
+  TPM_PCRINDEX  PcrIndex;
 
   if (CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), 
&gEfiTpmDeviceInstanceNoneGuid) ||
   CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), 
&gEfiTpmDeviceInstanceTpm12Guid)){
@@ -889,7 +917,22 @@ PeimEntryMA (
   if (BootMode == BOOT_ON_S3_RESUME) {
 Status = Tpm2Startup (TPM_SU_STATE);
 if (EFI_ERROR (Status) ) {
+  //
+  // The system firmware that resumes from S3 MUST deal with a
+  // TPM2_Startup error appropriately.
+  // For example, issue a TPM2_Startup(TPM_SU_CLEAR) command and
+  // configuring the device securely by taking actions like extending a
+  // separator with an error digest (0x01) into PCRs 0 through 7.
+  //
   Status = Tpm2Startup (TPM_SU_CLEAR);
+  if (!EFI_ERROR(Status)) {
+for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) {
+  Status = MeasureSeparatorEventWithError (PcrIndex);
+  if (EFI_ERROR (Status)) {
+DEBUG ((EFI_D_ERROR, "Seperator Event with Error not Measured. 
Error!\n"));
+  }
+}
+  }
 }
   } else {
 Status = Tpm2Startup (TPM_SU_CLEAR);
--
1.9.5.msysgit.0

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