Re: [edk2] [Patch 3/4] NetworkPkg: Revert git 'eb213f2f' fix

2016-02-29 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 




> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, February 25, 2016 12:22 PM
> To: edk2-devel@lists.01.org
> Cc: Subramanian Sriram ; El-Haj-Mahmoud Samer
> ; Ye, Ting ; Fu,
> Siyuan 
> Subject: [Patch 3/4] NetworkPkg: Revert git 'eb213f2f' fix
> 
> 'eb213f2f' is associated with '3d0a49ad' commit. So, this patch is
> used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
> policy update.
> 
> Cc: Subramanian Sriram 
> Cc: El-Haj-Mahmoud Samer 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  NetworkPkg/DnsDxe/DnsDhcp.c  | 158 
> +--
>  NetworkPkg/DnsDxe/DnsDxe.inf |   4 +-
>  2 files changed, 2 insertions(+), 160 deletions(-)
> 
> diff --git a/NetworkPkg/DnsDxe/DnsDhcp.c b/NetworkPkg/DnsDxe/DnsDhcp.c
> index 6b409ba..00fc0ef 100644
> --- a/NetworkPkg/DnsDxe/DnsDhcp.c
> +++ b/NetworkPkg/DnsDxe/DnsDhcp.c
> @@ -1,9 +1,9 @@
>  /** @file
>  Functions implementation related with DHCPv4/v6 for DNS driver.
> 
> -Copyright (c) 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at
>  http://opensource.org/licenses/bsd-license.php
> 
> @@ -13,156 +13,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF
> ANY KIND, EITHER EXPRESS OR IMPLIED.
>  **/
> 
>  #include "DnsImpl.h"
> 
>  /**
> -  The callback function for the timer event used to get map.
> -
> -  @param[in] EventThe event this function is registered to.
> -  @param[in] Context  The context registered to the event.
> -**/
> -VOID
> -EFIAPI
> -TimeoutToGetMap (
> -  IN EFI_EVENT  Event,
> -  IN VOID   *Context
> -  )
> -{
> -  *((BOOLEAN *) Context) = TRUE;
> -  return ;
> -}
> -
> -/**
> -  Create an IP child, use it to start the auto configuration, then destroy 
> it.
> -
> -  @param[in] Controller   The controller which has the service installed.
> -  @param[in] ImageThe image handle used to open service.
> -
> -  @retval EFI_SUCCESS The configuration is done.
> -  @retval Others  Other errors as indicated.
> -**/
> -EFI_STATUS
> -EFIAPI
> -DnsStartIp4(
> -  IN  EFI_HANDLEController,
> -  IN  EFI_HANDLEImage
> -  )
> -{
> -  EFI_IP4_PROTOCOL  *Ip4;
> -  EFI_HANDLEIp4Handle;
> -  EFI_EVENT TimerToGetMap;
> -  EFI_IP4_CONFIG_DATA   Ip4ConfigData;
> -  EFI_IP4_MODE_DATA Ip4Mode;
> -  EFI_STATUSStatus;
> -
> -  BOOLEAN   Timeout;
> -
> -  //
> -  // Get the Ip4ServiceBinding Protocol
> -  //
> -  Ip4Handle = NULL;
> -  Ip4   = NULL;
> -  TimerToGetMap = NULL;
> -
> -  Timeout  = FALSE;
> -
> -  Status = NetLibCreateServiceChild (
> - Controller,
> - Image,
> - ,
> - 
> - );
> -
> -  if (EFI_ERROR (Status)) {
> -return Status;
> -  }
> -
> -  Status = gBS->OpenProtocol (
> - Ip4Handle,
> - ,
> - (VOID **) ,
> - Controller,
> - Image,
> - EFI_OPEN_PROTOCOL_GET_PROTOCOL
> - );
> -
> -  if (EFI_ERROR (Status)) {
> -goto ON_EXIT;
> -  }
> -
> -  Ip4ConfigData.DefaultProtocol  = EFI_IP_PROTO_ICMP;
> -  Ip4ConfigData.AcceptAnyProtocol= FALSE;
> -  Ip4ConfigData.AcceptIcmpErrors = FALSE;
> -  Ip4ConfigData.AcceptBroadcast  = FALSE;
> -  Ip4ConfigData.AcceptPromiscuous= FALSE;
> -  Ip4ConfigData.UseDefaultAddress= TRUE;
> -  ZeroMem (, sizeof (EFI_IPv4_ADDRESS));
> -  ZeroMem (, sizeof (EFI_IPv4_ADDRESS));
> -  Ip4ConfigData.TypeOfService= 0;
> -  Ip4ConfigData.TimeToLive   = 1;
> -  Ip4ConfigData.DoNotFragment= FALSE;
> -  Ip4ConfigData.RawData  = FALSE;
> -  Ip4ConfigData.ReceiveTimeout   = 0;
> -  Ip4ConfigData.TransmitTimeout  = 0;
> -
> -  Status = Ip4->Configure (Ip4, );
> -
> -  if (Status == EFI_NO_MAPPING) {
> -Status  = gBS->CreateEvent (
> -EVT_NOTIFY_SIGNAL | EVT_TIMER,
> -TPL_CALLBACK,
> -TimeoutToGetMap,
> -,
> -
> -);
> -
> -if (EFI_ERROR (Status)) {
> -  goto ON_EXIT;
> -}
> -
> -Status = gBS->SetTimer (
> -   TimerToGetMap,
> -   

Re: [edk2] [Patch 4/4] ShellPkg: Revert git 'd6cf1af9' fix

2016-02-29 Thread Fu, Siyuan
Reviewed-by: Fu Siyuan 



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Thursday, February 25, 2016 12:22 PM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan 
> Subject: [edk2] [Patch 4/4] ShellPkg: Revert git 'd6cf1af9' fix
> 
> 'd6cf1af9' is associated with '3d0a49ad' commit. So, this patch is
> used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
> policy update.
> 
> Cc: Subramanian Sriram 
> Cc: El-Haj-Mahmoud Samer 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  .../UefiShellNetwork1CommandsLib/Ifconfig.c| 119 
> +++--
>  1 file changed, 15 insertions(+), 104 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> index f8dbc88..f02281d 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> @@ -1,10 +1,10 @@
>  /** @file
>The implementation for Shell command ifconfig based on IP4Config2
> protocol.
> 
>(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
> 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
>http://opensource.org/licenses/bsd-license.php.
> @@ -271,90 +271,10 @@ IfConfigManualAddressNotify (
>)
>  {
>*((BOOLEAN *) Context) = TRUE;
>  }
> 
> -
> -/**
> -  Create an IP child, use it to start the auto configuration, then destroy 
> it.
> -
> -  @param[in] Controller   The controller which has the service installed.
> -  @param[in] ImageThe image handle used to open service.
> -
> -  @retval EFI_SUCCESS The configuration is done.
> -**/
> -EFI_STATUS
> -EFIAPI
> -IfConfigStartIp4(
> -  IN  EFI_HANDLEController,
> -  IN  EFI_HANDLEImage
> -  )
> -{
> -  EFI_IP4_PROTOCOL  *Ip4;
> -  EFI_HANDLEIp4Handle;
> -  EFI_IP4_CONFIG_DATA   Ip4ConfigData;
> -  EFI_STATUSStatus;
> -
> -  //
> -  // Get the Ip4ServiceBinding Protocol
> -  //
> -  Ip4Handle = NULL;
> -  Ip4   = NULL;
> -
> -  Status = NetLibCreateServiceChild (
> - Controller,
> - Image,
> - ,
> - 
> - );
> -
> -  if (EFI_ERROR (Status)) {
> -return Status;
> -  }
> -
> -  Status = gBS->OpenProtocol (
> - Ip4Handle,
> - ,
> - (VOID **) ,
> - Controller,
> - Image,
> - EFI_OPEN_PROTOCOL_GET_PROTOCOL
> - );
> -
> -  if (EFI_ERROR (Status)) {
> -goto ON_EXIT;
> -  }
> -
> -  Ip4ConfigData.DefaultProtocol  = EFI_IP_PROTO_ICMP;
> -  Ip4ConfigData.AcceptAnyProtocol= FALSE;
> -  Ip4ConfigData.AcceptIcmpErrors = FALSE;
> -  Ip4ConfigData.AcceptBroadcast  = FALSE;
> -  Ip4ConfigData.AcceptPromiscuous= FALSE;
> -  Ip4ConfigData.UseDefaultAddress= TRUE;
> -  ZeroMem (, sizeof (EFI_IPv4_ADDRESS));
> -  ZeroMem (, sizeof (EFI_IPv4_ADDRESS));
> -  Ip4ConfigData.TypeOfService= 0;
> -  Ip4ConfigData.TimeToLive   = 1;
> -  Ip4ConfigData.DoNotFragment= FALSE;
> -  Ip4ConfigData.RawData  = FALSE;
> -  Ip4ConfigData.ReceiveTimeout   = 0;
> -  Ip4ConfigData.TransmitTimeout  = 0;
> -
> -  Ip4->Configure (Ip4, );
> -
> -ON_EXIT:
> -  NetLibDestroyServiceChild (
> -Controller,
> -Image,
> -,
> -Ip4Handle
> -);
> -
> -  return Status;
> -}
> -
> -
>  /**
>Print MAC address.
> 
>@param[in]NodeThe pointer of MAC address buffer.
>@param[in]SizeThe size of MAC address buffer.
> @@ -972,33 +892,24 @@ IfConfigSetInterfaceInfo (
> 
>  //
>  // Process valid variables.
>  //
>  if (StrCmp(VarArg->Arg, L"dhcp") == 0) {
> -  if (IfCb->Policy == Ip4Config2PolicyDhcp) {
> -Status = IfConfigStartIp4 (IfCb->NicHandle, gImageHandle);
> -if (EFI_ERROR(Status)) {
> -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
> -  ShellStatus = SHELL_ACCESS_DENIED;
> -  goto ON_EXIT;
> -}
> -  } else {
> -//
> -// Set dhcp config policy
> -//
> -Policy = Ip4Config2PolicyDhcp;
> -

[edk2] [patch v2 2/2] MdeModulePkg/UfsPassThru: Fix uninitialized field in QueryReqest UPIU

2016-02-29 Thread Feng Tian
The DataSegmentLength field of Query Request UPIU doesn't set correctly, which 
causes a 0 value rather than right data length is set to this field

Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c 
b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index a9fde30..75970d6 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -2,7 +2,7 @@
   UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol 
interface
   for upper layer application to execute UFS-supported SCSI cmds.
 
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -455,8 +455,11 @@ UfsInitQueryRequestUpiu (
 {
   ASSERT (QueryReq != NULL);
 
-  QueryReq->TransCode = 0x16;
-  QueryReq->TaskTag   = TaskTag;
+  QueryReq->TransCode  = 0x16;
+  QueryReq->TaskTag= TaskTag;
+  QueryReq->DataSegLen = (UINT16)DataSize;
+  SwapLittleEndianToBigEndian ((UINT8*)>DataSegLen, sizeof 
(QueryReq->DataSegLen));
+
   if ((Opcode == UtpQueryFuncOpcodeRdDesc) || (Opcode == 
UtpQueryFuncOpcodeRdFlag) || (Opcode == UtpQueryFuncOpcodeRdAttr)) {
 QueryReq->QueryFunc = QUERY_FUNC_STD_READ_REQ;
   } else {
-- 
2.7.1.windows.2

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


[edk2] [patch v2 0/2] Fix uninitialized field in QueryRequest UPIU in EDKII UFS stack

2016-02-29 Thread Feng Tian
Changes made compared with v1 of the patch:
1. Fix the same bug in UfsBlockIoPei

Feng Tian (2):
  MdeModulePkg/UfsBlockIoPei: Fix uninitialized field in QueryRequest
UPIU
  MdeModulePkg/UfsPassThru: Fix uninitialized field in QueryReqest UPIU

 MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c  | 9 ++---
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 9 ++---
 2 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.7.1.windows.2

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


[edk2] [patch v2 1/2] MdeModulePkg/UfsBlockIoPei: Fix uninitialized field in QueryRequest UPIU

2016-02-29 Thread Feng Tian
The DataSegmentLength field of Query Request UPIU doesn't set correctly, which 
causes a 0 value rather than right data length is set to this field

Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian 
---
 MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c 
b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
index 6880057..8e028bd 100644
--- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2014, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -384,8 +384,11 @@ UfsInitQueryRequestUpiu (
 {
   ASSERT (QueryReq != NULL);
 
-  QueryReq->TransCode = 0x16;
-  QueryReq->TaskTag   = TaskTag;
+  QueryReq->TransCode  = 0x16;
+  QueryReq->TaskTag= TaskTag;
+  QueryReq->DataSegLen = (UINT16)DataSize;
+  SwapLittleEndianToBigEndian ((UINT8*)>DataSegLen, sizeof 
(QueryReq->DataSegLen));
+
   if ((Opcode == UtpQueryFuncOpcodeRdDesc) || (Opcode == 
UtpQueryFuncOpcodeRdFlag) || (Opcode == UtpQueryFuncOpcodeRdAttr)) {
 QueryReq->QueryFunc = QUERY_FUNC_STD_READ_REQ;
   } else {
-- 
2.7.1.windows.2

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


Re: [edk2] [PATCH 07/17] OvmfPkg: PciHostBridgeLib: convert main loop from PciHostBridgeDxe

2016-02-29 Thread Jordan Justen
On 2016-02-26 16:23:26, Laszlo Ersek wrote:
> In this patch we import the scan for extra root buses from the
> InitializePciHostBridge() function, in file
> "OvmfPkg/PciHostBridgeDxe/PciHostBridge.c".
> 
> For the time being, the InitRootBridge() and UninitRootBridge() functions
> are just placeholders.
> 
> The PciHostBridgeGetRootBridges() API expects us to return the
> PCI_ROOT_BRIDGE structures in a contiguous array, instead of a linked
> list. Therefore the following bits have to be converted manually:
> 
> (1) The array is allocated in advance, in a single step.
> 
> (2) The calculation of the array size depends on an explicit
> multiplication, which we must check against overflow. Since more than
> 255 extra root bridges make no sense anyway, we use (1 + 255) as the
> limit on the main plus all extra root bridges. This also ensures that
> the UINTN multiplication doesn't overflow.
> 
> (3) The PciHostBridgeDxe code decrements "ExtraRootBridgesLeft" to
> terminate the scanning early. Here we need track the increasing count
> of used array elements as well, so we employ "ExtraRootBridges" as a
> constant limit, and increment the new local variable "Initialized".
> 
> (4) The prototypes of InitRootBridge() and UninitRootBridge() reflect that
> the PCI_ROOT_BRIDGE structure is allocated by the caller; only
> in-place initialization is necessary.
> 
> Additionally, MAX_PCI_DEVICE_NUMBER is open coded as 31 (decimal) form
> "OvmfPkg/PciHostBridgeDxe/PciHostBridge.h".
> 

Do we need a different macro than PCI_MAX_DEVICE?

-Jordan

> Cc: Jordan Justen 
> Cc: Ruiyu Ni 
> Cc: Marcel Apfelbaum 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
>  OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf |   9 +-
>  OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c   | 165 
> +++-
>  2 files changed, 172 insertions(+), 2 deletions(-)
> 
> diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf 
> b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
> index 1f3930195a1d..b83693191261 100644
> --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
> +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
> @@ -34,5 +34,12 @@ [Sources]
>PciHostBridgeLib.c
>  
>  [Packages]
> -  MdePkg/MdePkg.dec
>MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  OvmfPkg/OvmfPkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  MemoryAllocationLib
> +  PciLib
> +  QemuFwCfgLib
> diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
> b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
> index 3752993f65aa..b1f7e50ce781 100644
> --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
> +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
> @@ -14,14 +14,77 @@
>  
>  **/
>  #include 
> -#include 
> +
> +#include 
> +
>  #include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define MAX_PCI_DEVICE_NUMBER 31
> +
>  
>  GLOBAL_REMOVE_IF_UNREFERENCED
>  CHAR16 *mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {
>L"Mem", L"I/O", L"Bus"
>  };
>  
> +
> +/**
> +  Initialize a PCI_ROOT_BRIDGE structure.
> +
> +  param[in]  RootBusNumber The bus number to store in RootBus.
> +
> +  param[in]  MaxSubBusNumber   The inclusive maximum bus number that can be
> +   assigned to any subordinate bus found behind 
> any
> +   PCI bridge hanging off this root bus.
> +
> +   The caller is repsonsible for ensuring that
> +   RootBusNumber <= MaxSubBusNumber. If
> +   RootBusNumber equals MaxSubBusNumber, then the
> +   root bus has no room for subordinate buses.
> +
> +  param[out] RootBus   The PCI_ROOT_BRIDGE structure (allocated by 
> the
> +   caller) that should be filled in by this
> +   function.
> +
> +  @retval EFI_SUCCESS   Initialization successful. A device path
> +consisting of an ACPI device path node, with
> +UID = RootBusNumber, has been allocated and
> +linked into RootBus.
> +
> +  @retval EFI_OUT_OF_RESOURCES  Memory allocation failed.
> +**/
> +STATIC
> +EFI_STATUS
> +InitRootBridge (
> +  IN  UINT8   RootBusNumber,
> +  IN  UINT8   MaxSubBusNumber,
> +  OUT PCI_ROOT_BRIDGE *RootBus
> +  )
> +{
> +  return EFI_OUT_OF_RESOURCES;
> +}
> +
> +
> +/**
> +  Uninitialize a PCI_ROOT_BRIDGE structure set up with InitRootBridge().
> +
> +  param[in] RootBus  The PCI_ROOT_BRIDGE structure, allocated by the caller 
> and
> + initialized with InitRootBridge(), that should be
> + uninitialized. This function 

Re: [edk2] [PATCH 05/17] OvmfPkg: factor the MMIO aperture shared by all PCI root bridges into PCDs

2016-02-29 Thread Jordan Justen
On 2016-02-26 16:23:24, Laszlo Ersek wrote:
> Going forward, two modules will need to know about the aperture:
> PlatformPei (as before), and OVMF's upcoming PciHostBridgeLib instance
> (because the core PciHostBridgeDxe driver requires the library to state
> the exact apertures for all root bridges).
> 
> On QEMU, all root bridges share the same MMIO aperture, hence one pair of
> PCDs suffices.
> 
> Cc: Jordan Justen 
> Cc: Ruiyu Ni 
> Cc: Marcel Apfelbaum 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
>  OvmfPkg/OvmfPkg.dec | 5 +
>  OvmfPkg/OvmfPkgIa32.dsc | 2 ++
>  OvmfPkg/OvmfPkgIa32X64.dsc  | 2 ++
>  OvmfPkg/OvmfPkgX64.dsc  | 2 ++
>  OvmfPkg/PlatformPei/PlatformPei.inf | 2 ++
>  OvmfPkg/PlatformPei/Platform.c  | 8 +++-
>  6 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
> index 77c1f568afb0..784542f62368 100644
> --- a/OvmfPkg/OvmfPkg.dec
> +++ b/OvmfPkg/OvmfPkg.dec
> @@ -125,6 +125,11 @@ [PcdsDynamic, PcdsDynamicEx]
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0|UINT16|0x1b
>gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE|BOOLEAN|0x21
>  
> +  ## The 32-bit MMIO aperture shared by all PCI root bridges.
> +  #
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT64|0x24
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT64|0x25
> +
>  [PcdsFeatureFlag]
>gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|FALSE|BOOLEAN|3
>gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0x1c
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 1482b228f9dd..1441cd7190c6 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -406,6 +406,8 @@ [PcdsDynamicDefault]
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
>  
>gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
>  
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index 1c346a2ad03d..5a7c83d3f3b2 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -412,6 +412,8 @@ [PcdsDynamicDefault]
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
>  
>gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
>  
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 9f8fa15eb23f..ca1950613071 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -411,6 +411,8 @@ [PcdsDynamicDefault]
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800
>gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base|0x0
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size|0x0
>  
>gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0
>  
> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf 
> b/OvmfPkg/PlatformPei/PlatformPei.inf
> index 22250c061c47..8480839efc8e 100644
> --- a/OvmfPkg/PlatformPei/PlatformPei.inf
> +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
> @@ -77,6 +77,8 @@ [Pcd]
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
>gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase
>gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base
> +  gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size
>gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDecompressionScratchEnd
>gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes
>gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize
> diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
> index 1df0f383bca3..659fffe9ee49 100644
> --- a/OvmfPkg/PlatformPei/Platform.c
> +++ b/OvmfPkg/PlatformPei/Platform.c
> @@ -240,7 +240,13 @@ MemMapInitialization (
>  // 0xFED2gap  896 KB
>  // 0xFEE0LAPIC  1 MB
>  //
> -AddIoMemoryRangeHob (PciBase, 0xFC00);
> +PcdSet64 (PcdPciMmio32Base, PciBase);
> +PcdSet64 (PcdPciMmio32Size, 0xFC00 - PciBase);
> +AddIoMemoryBaseSizeHob (
> +  PcdGet64 (PcdPciMmio32Base),
> +  PcdGet64 (PcdPciMmio32Size)
> +  );

I think we should just leave the AddIoMemoryRangeHob since the
PcdGet64 calls for a dynamic PCD don't seem to gain us anything.

I guess you could add a local variable for the size, and then use it
to both 

Re: [edk2] UnicodeError: UTF-16 stream does not start with BOM error when update from UDK2015 to latest Github trunk

2016-02-29 Thread Gao, Liming
Do you get the latest BaseTools binary win32?

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> wang xiaofeng
> Sent: Tuesday, March 01, 2016 2:04 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] UnicodeError: UTF-16 stream does not start with BOM error
> when update from UDK2015 to latest Github trunk
> 
> Hi All Edk2 developer,
>  I meet a build error when update code from UDK2015 to latest Github
> trunk. Do anyone meet similar issue before? I sync NetworkPkg seperately to
> latest code but find the following error:
> 
> 
> build...
>  : error C0DE: Unknown fatal error when processing
> [e:\code\cl174\NetworkPkg\Ip6Dxe\Ip6Dxe.inf]
> (Please send email to edk2-de...@lists.sourceforge.net for help, attaching
> following call stack trace!)
> 
> 
> (Python 2.7.3 on win32) Traceback (most recent call last):
>   File "build.py", line 2032, in Main
>   File "build.py", line 1788, in Launch
>   File "build.py", line 1618, in _MultiThreadBuildPlatform
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\AutoGen.py", line 3446, in CreateCodeFile
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\AutoGen.py", line 2854, in _GetAutoGenFileList
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\GenC.py", line 1552, in CreateCode
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\GenC.py", line 1456, in CreateUnicodeStringCode
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\StrGather.py", line 600, in GetStringFiles
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\UniClassObject.py", line 203, in __init__
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\UniClassObject.py", line 463, in LoadUniFiles
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\UniClassObject.py", line 377, in LoadUniFile
>   File
> "c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\Aut
> oGen\UniClassObject.py", line 318, in PreProcess
>   File "C:\Python\32-bit\2.7\lib\codecs.py", line 684, in next
>   File "C:\Python\32-bit\2.7\lib\codecs.py", line 615, in next
>   File "C:\Python\32-bit\2.7\lib\codecs.py", line 530, in readline
>   File "C:\Python\32-bit\2.7\lib\codecs.py", line 477, in read
>   File "C:\Python\32-bit\2.7\lib\encodings\utf_16.py", line 112, in decode
> UnicodeError: UTF-16 stream does not start with BOM
> ___
> 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] UnicodeError: UTF-16 stream does not start with BOM error when update from UDK2015 to latest Github trunk

2016-02-29 Thread wang xiaofeng
Hi All Edk2 developer,
 I meet a build error when update code from UDK2015 to latest Github trunk. 
Do anyone meet similar issue before? I sync NetworkPkg seperately to latest 
code but find the following error:


build...
 : error C0DE: Unknown fatal error when processing 
[e:\code\cl174\NetworkPkg\Ip6Dxe\Ip6Dxe.inf]
(Please send email to edk2-de...@lists.sourceforge.net for help, attaching 
following call stack trace!)


(Python 2.7.3 on win32) Traceback (most recent call last):
  File "build.py", line 2032, in Main
  File "build.py", line 1788, in Launch
  File "build.py", line 1618, in _MultiThreadBuildPlatform
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\AutoGen.py",
 line 3446, in CreateCodeFile
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\AutoGen.py",
 line 2854, in _GetAutoGenFileList
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\GenC.py",
 line 1552, in CreateCode
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\GenC.py",
 line 1456, in CreateUnicodeStringCode
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\StrGather.py",
 line 600, in GetStringFiles
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\UniClassObject.py",
 line 203, in __init__
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\UniClassObject.py",
 line 463, in LoadUniFiles
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\UniClassObject.py",
 line 377, in LoadUniFile
  File 
"c:\Users\Public\Documents\BuildPool\BaseTools\build\Source\Python\AutoGen\UniClassObject.py",
 line 318, in PreProcess
  File "C:\Python\32-bit\2.7\lib\codecs.py", line 684, in next
  File "C:\Python\32-bit\2.7\lib\codecs.py", line 615, in next
  File "C:\Python\32-bit\2.7\lib\codecs.py", line 530, in readline
  File "C:\Python\32-bit\2.7\lib\codecs.py", line 477, in read
  File "C:\Python\32-bit\2.7\lib\encodings\utf_16.py", line 112, in decode
UnicodeError: UTF-16 stream does not start with BOM
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] MdeModulePkg: Fixed incorrect Regular expression protocol MatchString return value.

2016-02-29 Thread Cecil Sheng
According to UEFI2.6, CapturePtr in the Captures array returned by 
MatchString() should be separatedly allocated so that they can be freed by the 
caller.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cecil Sheng 
Reviewed-by: Samer El-Haj-Mahmoud 
---
 .../RegularExpressionDxe/RegularExpressionDxe.c| 32 ++
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
index cffbcb8..c6354b6 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.c
@@ -2,7 +2,7 @@
 
   EFI_REGULAR_EXPRESSION_PROTOCOL Implementation
 
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2015-2016 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 that accompanies this
@@ -91,6 +91,8 @@ OnigurumaMatch (
   CHAR8   ErrorMessage[ONIG_MAX_ERROR_MESSAGE_LEN];
   UINT32  Index;
   OnigUChar   *Start;
+  EFI_STATUS  Status;
+
 
   //
   // Detemine the internal syntax type
@@ -102,7 +104,7 @@ OnigurumaMatch (
 OnigSyntax = ONIG_SYNTAX_PERL;
   } else {
 DEBUG ((DEBUG_ERROR, "Unsupported regex syntax - using default\n"));
-ASSERT (FALSE);
+return EFI_UNSUPPORTED;
   }
 
   //
@@ -143,6 +145,8 @@ OnigurumaMatch (
  Region,
  ONIG_OPTION_NONE
  );
+
+  Status = EFI_SUCCESS;
   if (OnigResult >= 0) {
 *Result = TRUE;
   } else {
@@ -150,6 +154,9 @@ OnigurumaMatch (
 if (OnigResult != ONIG_MISMATCH) {
   onig_error_code_to_str (ErrorMessage, OnigResult);
   DEBUG ((DEBUG_ERROR, "Regex match failed: %a\n", ErrorMessage));
+  onig_region_free (Region, 1);
+  onig_free (OnigRegex);
+  return EFI_DEVICE_ERROR;
 }
   }
 
@@ -158,14 +165,29 @@ OnigurumaMatch (
   //
   if (*Result && Captures != NULL) {
 *CapturesCount = Region->num_regs;
-*Captures = AllocatePool (*CapturesCount * sizeof(**Captures));
+*Captures = AllocateZeroPool (*CapturesCount * sizeof(**Captures));
 if (*Captures != NULL) {
   for (Index = 0; Index < *CapturesCount; ++Index) {
 //
 // Region beg/end values represent bytes, not characters
 //
-(*Captures)[Index].CapturePtr = (CHAR16*)((UINTN)String + 
Region->beg[Index]);
 (*Captures)[Index].Length = (Region->end[Index] - Region->beg[Index]) 
/ sizeof(CHAR16);
+(*Captures)[Index].CapturePtr = AllocateCopyPool (
+  ((*Captures)[Index].Length) * sizeof 
(CHAR16),
+  (CHAR16*)((UINTN)String + 
Region->beg[Index])
+  );
+if ((*Captures)[Index].CapturePtr == NULL) {
+  Status = EFI_OUT_OF_RESOURCES;
+  break;
+}
+  }
+
+  if (EFI_ERROR (Status)) {
+for (Index = 0; Index < *CapturesCount; ++Index) {
+  if ((*Captures)[Index].CapturePtr != NULL) {
+FreePool ((CHAR16*)(*Captures)[Index].CapturePtr);
+  }
+}
   }
 }
   }
@@ -173,7 +195,7 @@ OnigurumaMatch (
   onig_region_free (Region, 1);
   onig_free (OnigRegex);
 
-  return EFI_SUCCESS;
+  return Status;
 }
 
 /**
-- 
2.6.3.windows.1

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


[edk2] [patch] MdeModulePkg: Add ASSERT to make sure pointers are not NULL

2016-02-29 Thread Dandan Bi
Cc: Qiu Shumin 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c 
b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 9714dbc..f985b44 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -578,10 +578,11 @@ LibIsSupportedFileType (
   if (InputFileType == NULL) {
 return TRUE;
   }
 
   TmpStr = AllocateCopyPool (StrSize (InputFileType), InputFileType);
+  ASSERT(TmpStr != NULL);
   LibToLowerString(TmpStr);
 
   IsSupported = (StrStr (gFileExplorerPrivate.FileType, TmpStr) == NULL ? 
FALSE : TRUE);
 
   FreePool (TmpStr);
@@ -1355,10 +1356,11 @@ ChooseFile (
 
   gFileExplorerPrivate.RetDevicePath = NULL;
   gFileExplorerPrivate.ChooseHandler = ChooseHandler;
   if (FileType != NULL) {
 gFileExplorerPrivate.FileType = AllocateCopyPool (StrSize (FileType), 
FileType);
+ASSERT(gFileExplorerPrivate.FileType != NULL);
 LibToLowerString(gFileExplorerPrivate.FileType);
   } else {
 gFileExplorerPrivate.FileType = 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] MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h

2016-02-29 Thread Ye, Ting
Reviewed-by: Ye Ting  


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu Siyuan
Sent: Monday, February 29, 2016 1:52 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Wu, Jiaxin 
Subject: [edk2] [Patch] MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h

This patch is to add a new interface to get the "Path" component according to 
the URI parse result, it would be helpful for the library user to extract the 
file path value in a URI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan 
Cc: Wu Jiaxin 
Cc: Ye Ting 
---
 MdeModulePkg/Include/Library/HttpLib.h   | 26 +++-
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 61 +++-
 2 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Include/Library/HttpLib.h 
b/MdeModulePkg/Include/Library/HttpLib.h
index ce5a839..cd97b64 100644
--- a/MdeModulePkg/Include/Library/HttpLib.h
+++ b/MdeModulePkg/Include/Library/HttpLib.h
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -164,6 
+164,30 @@ HttpUrlGetPort (
   );
 
 /**
+  Get the Path from a HTTP URL.
+
+  This function will return the Path according to the Url and previous 
+ parse result,and  it is the caller's responsibility to free the buffer 
returned in *Path.
+
+  @param[in]UrlThe pointer to a HTTP URL string.
+  @param[in]UrlParser  URL Parse result returned by 
NetHttpParseUrl().
+  @param[out]   Path   Pointer to a buffer to store the Path.
+
+  @retval EFI_SUCCESS  Successfully get the required component.
+  @retval EFI_INVALID_PARAMETERUri is NULL or HostName is NULL or 
UrlParser is invalid.
+  @retval EFI_NOT_FOUNDNo hostName component in the URL.
+  @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
+  
+**/
+EFI_STATUS
+EFIAPI
+HttpUrlGetPath (
+  IN  CHAR8  *Url,
+  IN  VOID   *UrlParser,
+ OUT  CHAR8  **Path
+  );
+
+/**
   Release the resource of the URL parser.
 
   @param[in]UrlParserPointer to the parser.
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c 
b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index 040d874..49c2b9c 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at @@ -785,6 
+785,65 @@ HttpUrlGetPort (  }
 
 /**
+  Get the Path from a HTTP URL.
+
+  This function will return the Path according to the Url and previous 
+ parse result,and  it is the caller's responsibility to free the buffer 
returned in *Path.
+
+  @param[in]UrlThe pointer to a HTTP URL string.
+  @param[in]UrlParser  URL Parse result returned by 
NetHttpParseUrl().
+  @param[out]   Path   Pointer to a buffer to store the Path.
+
+  @retval EFI_SUCCESS  Successfully get the required component.
+  @retval EFI_INVALID_PARAMETERUri is NULL or HostName is NULL or 
UrlParser is invalid.
+  @retval EFI_NOT_FOUNDNo hostName component in the URL.
+  @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
+  
+**/
+EFI_STATUS
+EFIAPI
+HttpUrlGetPath (
+  IN  CHAR8  *Url,
+  IN  VOID   *UrlParser,
+ OUT  CHAR8  **Path
+  )
+{
+  CHAR8*PathStr;
+  EFI_STATUS   Status;
+  UINT32   ResultLength;
+  HTTP_URL_PARSER  *Parser;
+
+  if (Url == NULL || UrlParser == NULL || Path == NULL) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  Parser = (HTTP_URL_PARSER*) UrlParser;
+
+  if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_PATH)) == 0) {
+return EFI_NOT_FOUND;
+  }
+
+  PathStr = AllocatePool (Parser->FieldData[HTTP_URI_FIELD_PATH].Length 
+ + 1);  if (PathStr == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
+  
+  Status = 

Re: [edk2] [PATCH v2 6/6] Nt32Pkg: Enable Nt32Pkg platform HTTPS boot feature.

2016-02-29 Thread Wu, Jiaxin
Thanks Laszlo, below patch did miss that point to avoid the build performance 
impact. 

I will update it to introduce HTTPS_BOOT_ENABLE flag for TlsDxe.

Thanks.
Jiaxin

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Monday, February 29, 2016 11:26 PM
> To: Wu, Jiaxin ; edk2-de...@ml01.01.org
> Cc: Ye, Ting ; Ni, Ruiyu ; Fu, Siyuan
> ; Long, Qin 
> Subject: Re: [edk2] [PATCH v2 6/6] Nt32Pkg: Enable Nt32Pkg platform HTTPS
> boot feature.
> 
> On 02/29/16 02:37, Jiaxin Wu wrote:
> > v2:
> > *Update to remove 'SECURE_BOOT_ENABLE' flag for all library defined in
> > CryptoPkg.
> >
> > This path is used to enable HTTPS boot feature.
> >
> > Cc: Ye Ting 
> > Cc: Fu Siyuan 
> > Cc: Long Qin 
> > Cc: Ruiyu Ni 
> > Cc: El-Haj-Mahmoud Samer 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Jiaxin Wu 
> > ---
> >  Nt32Pkg/Nt32Pkg.dsc | 15 ++-  Nt32Pkg/Nt32Pkg.fdf |  4
> > +++-
> >  2 files changed, 9 insertions(+), 10 deletions(-)
> >
> > diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index
> > 87a08c0..d297812 100644
> > --- a/Nt32Pkg/Nt32Pkg.dsc
> > +++ b/Nt32Pkg/Nt32Pkg.dsc
> > @@ -2,11 +2,11 @@
> >  # EFI/Framework Emulation Platform with UEFI HII interface supported.
> >  #
> >  # The Emulation Platform can be used to debug individual modules, prior
> to creating
> >  #a real platform. This also provides an example for how an DSC is 
> > created.
> >  #
> > -# Copyright (c) 2006 - 2015, Intel Corporation. All rights
> > reserved.
> > +# Copyright (c) 2006 - 2016, Intel Corporation. All rights
> > +reserved.
> >  # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
> > # (C) Copyright 2016 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
> > @@ -132,15 +132,16 @@
> >
> DebugPrintErrorLevelLib|MdeModulePkg/Library/DxeDebugPrintErrorLevelL
> ib/DxeDebugPrintErrorLevelLib.inf
> >
> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanc
> eLibNull.inf
> >
> DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLi
> bNull.inf
> >
> CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibN
> ull/CpuExceptionHandlerLibNull.inf
> >LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
> > +  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> > +  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> > +  OpensslTlsLib|CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
> >
> >  !if $(SECURE_BOOT_ENABLE) == TRUE
> >
> > PlatformSecureLib|Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.
> > inf
> > -  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
> > -  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
> >
> TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTp
> mMeasurementLib.inf
> >
> > AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.in
> > f
> >  !else
> >
> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp
> mMeasurementLibNull.inf
> >
> >
> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableL
> > ibNull.inf
> > @@ -174,13 +175,11 @@
> >
> >
> OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibN
> ull/Oem
> > HookStatusCodeLibNull.inf
> >
> >  [LibraryClasses.common.PEIM]
> >PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
> >
> >
> OemHookStatusCodeLib|Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/
> PeiNt
> > 32OemHookStatusCodeLib.inf
> > -!if $(SECURE_BOOT_ENABLE) == TRUE
> >BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> > -!endif
> >
> >  [LibraryClasses.common]
> >#
> ># DXE phase common
> >#
> > @@ -191,13 +190,12 @@
> >
> ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/Dx
> eReportStatusCodeLib.inf
> >
> OemHookStatusCodeLib|Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/
> DxeNt32OemHookStatusCodeLib.inf
> >
> PeCoffExtraActionLib|Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt
> 32PeCoffExtraActionLib.inf
> >
> ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeE
> xtractGuidedSectionLib.inf
> >WinNtLib|Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
> > -!if $(SECURE_BOOT_ENABLE) == TRUE
> >BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
> > -!endif
> > +  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
> >
> >  [LibraryClasses.common.DXE_CORE]
> >HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
> >
> MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLi
> b/DxeCoreMemoryAllocationLib.inf
> >PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> > @@ -214,13 +212,11 @@
> >
> >  

Re: [edk2] [Patch] BaseTools: update the mail address for stack trace info

2016-02-29 Thread Andrew Fish

> On Feb 28, 2016, at 7:51 PM, Gao, Liming  wrote:
> 
> Reviewed-by: Liming Gao 
> 

Reviewed-by: Andrew Fish 

Thanks,

Andrew Fish


>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> Yonghong Zhu
>> Sent: Monday, February 29, 2016 11:24 AM
>> To: edk2-devel@lists.01.org
>> Subject: [edk2] [Patch] BaseTools: update the mail address for stack trace
>> info
>> 
>> Update the mail address from edk2-de...@lists.sourceforge.net to
>> edk2-devel@lists.01.org.
>> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Yonghong Zhu 
>> ---
>> BaseTools/Source/Python/GenFds/GenFds.py  | 4 ++--
>> BaseTools/Source/Python/Trim/Trim.py  | 2 +-
>> BaseTools/Source/Python/UPT/Logger/StringTable.py | 2 +-
>> BaseTools/Source/Python/build/build.py| 2 +-
>> 4 files changed, 5 insertions(+), 5 deletions(-)
>> 
>> diff --git a/BaseTools/Source/Python/GenFds/GenFds.py
>> b/BaseTools/Source/Python/GenFds/GenFds.py
>> index 4fa4eda..d97fc28 100644
>> --- a/BaseTools/Source/Python/GenFds/GenFds.py
>> +++ b/BaseTools/Source/Python/GenFds/GenFds.py
>> @@ -1,9 +1,9 @@
>> ## @file
>> # generate flash image
>> #
>> -#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
>> +#  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
>> #
>> #  This program and the accompanying materials
>> #  are licensed and made available under the terms and conditions of the
>> BSD License
>> #  which accompanies this distribution.  The full text of the license may be
>> found at
>> #  http://opensource.org/licenses/bsd-license.php
>> @@ -298,11 +298,11 @@ def main():
>> import traceback
>> EdkLogger.error(
>> "\nPython",
>> CODE_ERROR,
>> "Tools code failure",
>> -ExtraData="Please send email to edk2-
>> de...@lists.sourceforge.net for help, attaching following call stack 
>> trace!\n",
>> +ExtraData="Please send email to edk2-devel@lists.01.org 
>> for help,
>> attaching following call stack trace!\n",
>> RaiseError=False
>> )
>> EdkLogger.quiet(traceback.format_exc())
>> ReturnCode = CODE_ERROR
>> finally:
>> diff --git a/BaseTools/Source/Python/Trim/Trim.py
>> b/BaseTools/Source/Python/Trim/Trim.py
>> index e5fe730..9ccc027 100644
>> --- a/BaseTools/Source/Python/Trim/Trim.py
>> +++ b/BaseTools/Source/Python/Trim/Trim.py
>> @@ -623,11 +623,11 @@ def Main():
>> import platform
>> EdkLogger.error(
>> "\nTrim",
>> CODE_ERROR,
>> "Unknown fatal error when trimming [%s]" % InputFile,
>> -ExtraData="\n(Please send email to edk2-
>> de...@lists.sourceforge.net for help, attaching following call stack 
>> trace!)\n",
>> +ExtraData="\n(Please send email to 
>> edk2-devel@lists.01.org for
>> help, attaching following call stack trace!)\n",
>> RaiseError=False
>> )
>> EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(),
>> sys.platform) + traceback.format_exc())
>> return 1
>> 
>> diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py
>> b/BaseTools/Source/Python/UPT/Logger/StringTable.py
>> index c543073..34afd6e 100644
>> --- a/BaseTools/Source/Python/UPT/Logger/StringTable.py
>> +++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py
>> @@ -321,11 +321,11 @@ MSG_INSTALL_MODULE = _("Installing
>> module ... %s")
>> MSG_NEW_FILE_NAME_FOR_DIST  = _(
>> "Provide new filename for distribution file to be saved:\n")
>> MSG_UPDATE_PACKAGE_DATABASE= _("Update Distribution Package
>> Database ...")
>> MSG_PYTHON_ON  = _("(Python %s on %s) ")
>> MSG_SEARCH_FOR_HELP= _(
>> -"\n(Please send email to edk2-de...@lists.sourceforge.net for\n"
>> +"\n(Please send email to edk2-devel@lists.01.org for\n"
>> " help, attach the following call stack trace.)\n")
>> MSG_REMOVE_TEMP_FILE_STARTED   = _("Removing temp files started ... ")
>> MSG_REMOVE_TEMP_FILE_DONE   = _("Removing temp files ... Done.")
>> MSG_FINISH = _("Successfully Done.")
>> MSG_COMPRESS_DISTRIBUTION_PKG  = _("Compressing Distribution
>> Package File ...")
>> diff --git a/BaseTools/Source/Python/build/build.py
>> b/BaseTools/Source/Python/build/build.py
>> index 5253cb4..23ca76e 100644
>> --- a/BaseTools/Source/Python/build/build.py
>> +++ b/BaseTools/Source/Python/build/build.py
>> @@ -2090,11 +2090,11 @@ def Main():
>> Tb = Tb.tb_next
>> EdkLogger.error(
>> "\nbuild",
>> CODE_ERROR,
>> "Unknown fatal error when processing [%s]" % MetaFile,
>> -  

Re: [edk2] [PATCH] MdePkg: fix comment typo in DebugLib.h

2016-02-29 Thread Kinney, Michael D
Reviewed-by: Michael Kinney 

Mike


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Monday, February 29, 2016 11:43 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Gao, Liming 
> 
> Subject: [PATCH] MdePkg: fix comment typo in DebugLib.h
> 
> The definition of DEBUG_LOADFILE was incorrectly described as "UNDI
> Driver". Correct this to align with MdePkg.dec.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm 
> ---
>  MdePkg/Include/Library/DebugLib.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Library/DebugLib.h 
> b/MdePkg/Include/Library/DebugLib.h
> index 219d147..86bb71f 100644
> --- a/MdePkg/Include/Library/DebugLib.h
> +++ b/MdePkg/Include/Library/DebugLib.h
> @@ -48,7 +48,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
> EXPRESS OR
> IMPLIED.
>  #define DEBUG_BLKIO 0x1000  // BlkIo Driver
>  #define DEBUG_NET   0x4000  // SNI Driver
>  #define DEBUG_UNDI  0x0001  // UNDI Driver
> -#define DEBUG_LOADFILE  0x0002  // UNDI Driver
> +#define DEBUG_LOADFILE  0x0002  // LoadFile
>  #define DEBUG_EVENT 0x0008  // Event messages
>  #define DEBUG_GCD   0x0010  // Global Coherency Database changes
>  #define DEBUG_CACHE 0x0020  // Memory range cachability changes
> --
> 2.1.4

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


[edk2] [PATCH] MdeModulePkg: DxeCore: fully initialize image context before passing it on

2016-02-29 Thread Ard Biesheuvel
When the DXE core is loaded, it invokes the PeCoffExtraActionLib library
function 'PeCoffLoaderRelocateImageExtraAction' explicitly, which may be
in addition to the same function having been called by the DxeIpl PE/COFF
loader instance.

The ImageContext that DXE core presents to this function is only partially
initialized, which may result in the following output on AArch64 systems:

add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226240

add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226000

This is caused by incorrect data in the ImageContext structure, which means
the start of the .text section is calculated incorrectly. In general, it is
the duty of the caller to present a valid ImageContext structure, so let's
add the missing values before invoking PeCoffLoaderRelocateImageExtraAction().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c 
b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 0a34711b22a4..20ff02f663b2 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -247,6 +247,7 @@ DxeMain (
   EFI_HOB_GUID_TYPE *GuidHob;
   EFI_VECTOR_HANDOFF_INFO   *VectorInfoList;
   EFI_VECTOR_HANDOFF_INFO   *VectorInfo;
+  VOID  *EntryPoint;
 
   //
   // Setup the default exception handlers
@@ -293,8 +294,13 @@ DxeMain (
   // Report DXE Core image information to the PE/COFF Extra Action Library
   //
   ZeroMem (, sizeof (ImageContext));
-  ImageContext.ImageAddress = 
(EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
-  ImageContext.PdbPointer   = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) 
ImageContext.ImageAddress);
+  ImageContext.ImageAddress   = 
(EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;
+  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer 
((VOID*)(UINTN)ImageContext.ImageAddress);
+  ImageContext.SizeOfHeaders  = PeCoffGetSizeOfHeaders 
((VOID*)(UINTN)ImageContext.ImageAddress);
+  Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, 
);
+  if (Status == EFI_SUCCESS) {
+ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
+  }
   PeCoffLoaderRelocateImageExtraAction ();
 
   //
-- 
2.5.0

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


Re: [edk2] [PATCH 0/9] enhance mmc

2016-02-29 Thread Leif Lindholm
On Mon, Feb 29, 2016 at 01:46:42PM +, Ryan Harkin wrote:
> >> This is a substantial contribution, and on inspection it looks fine.
> >> However, it does change bits of MmcDxe substantially - so I would
> >> really like to see some Tested-by:s for existing platforms.
> >>
> >> Ryan?
> 
> I'd love to, but the only platform I have with an MMC card slot is
> TC2.  And MMC support as been broken in EDK2 on TC2 for some time.
> 
> The last time I saw it working was at this point:
> 
> 203bead  2015-07-01  There needs to be a space between the output
> section name and the colon, i.e., [Ard Biesheuvel]
> 
> But that point doesn't boot on TC2 unless you revert this patch:
> 
> d340ef7  2014-08-26  ArmPkg/ArmArchTimerLib: Remove non required
> [depex] and IoLib  [Olivier Martin]
> 
> I'll add it to my list of other things someone else broke that I have to fix.

Evan, you mentioned you still use TC2 from time to time?

Ryan: Other than that - does this break MMC on the virtual platforms you
look after?

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


Re: [edk2] [PATCH] EmbeddedPkg/AndroidFastboot: fix size with 64bit

2016-02-29 Thread Leif Lindholm
On Mon, Feb 29, 2016 at 04:36:00PM +0800, Haojian Zhuang wrote:
> 在 02/27/2016 04:42 AM, Leif Lindholm 写道:
> >On Fri, Feb 26, 2016 at 05:34:50PM +0800, Haojian Zhuang wrote:
> >>Since there's percentage calcution, multiply on 32bit variable
> >>will cause overflow. So fix the variables as 64bit.
> >
> >So, this is not technically what it does - it changes the variables to
> >be native integer size, meaning this does not fix anything on AArch32.
> >
> >Given that the existing code already populates one of these by calling
> >AsciiStrHexToUint64, it would seem the correct fix would be to follow
> >the commit message and actually change them to UINT64.
> 
> mNumDataBytes = AsciiStrHexToUnit64 (NumBytesString);
> Although AsciiStrHexToUnit64 () is used, the value is still stored as 32-bit
> long. Since mNumDataBytes is declared as UINT32.
> 
> I don't agree that it doesn't fix on AArch32. UINT64 is also supported
> in AArch32. For example, unsigned long long int is 64-bit long on AArch32,
> and we could do 64-bit calculation on AArch32.

Yes, UINT64 is also supported on AArch32 - but the patch turns the
variables into UINTN, not UINT64. UINTN is 32-bit on AArch32.

Regards,

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


Re: [edk2] [Patch] NetworkPkg: Add URI configuration form to HTTP boot driver.

2016-02-29 Thread Fu, Siyuan
You are right, I will update it.

From: Wu, Jiaxin
Sent: Monday, February 29, 2016 3:40 PM
To: Fu, Siyuan ; edk2-devel@lists.01.org
Cc: Ye, Ting 
Subject: RE: [Patch] NetworkPkg: Add URI configuration form to HTTP boot driver.

Siyuan,

Seems unreasonable to only accept http and https URI. If the user input Http or 
HTTP or HTTPS, it will failed to add those reasonable URI. How about use the 
ignore case check?

Thanks.
Jiaxin


> -Original Message-
> From: Fu, Siyuan
> Sent: Wednesday, February 24, 2016 1:27 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin >; Ye, Ting 
> >
> Subject: [Patch] NetworkPkg: Add URI configuration form to HTTP boot
> driver.
>
> This patch updates the HTTP boot driver to produce a setup page for the
> boot
> file URI configuration. A new boot option will be created for the manual
> configured URI address. This change is made to support the HTTP boot usage
> in home environment.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan >
> Cc: Wu Jiaxin >
> Cc: Ye Ting >
> ---
>  NetworkPkg/HttpBootDxe/HttpBootClient.c|  99 +--
>  NetworkPkg/HttpBootDxe/HttpBootConfig.c| 711
> +
>  NetworkPkg/HttpBootDxe/HttpBootConfig.h|  78 +++
>  NetworkPkg/HttpBootDxe/HttpBootConfigNVDataStruc.h |  43 ++
>  NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni   | Bin 0 -> 2926 bytes
>  NetworkPkg/HttpBootDxe/HttpBootConfigVfr.vfr   |  53 ++
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.c | 111 ++--
>  NetworkPkg/HttpBootDxe/HttpBootDhcp4.h |   9 +-
>  NetworkPkg/HttpBootDxe/HttpBootDhcp6.c |   6 +-
>  NetworkPkg/HttpBootDxe/HttpBootDxe.c   |  44 +-
>  NetworkPkg/HttpBootDxe/HttpBootDxe.h   |  33 +-
>  NetworkPkg/HttpBootDxe/HttpBootDxe.inf |  17 +-
>  NetworkPkg/HttpBootDxe/HttpBootImpl.c  |  71 +-
>  NetworkPkg/HttpBootDxe/HttpBootSupport.c   |  55 ++
>  NetworkPkg/HttpBootDxe/HttpBootSupport.h   |  18 +
>  NetworkPkg/Include/Guid/HttpBootConfigHii.h|  25 +
>  NetworkPkg/NetworkPkg.dec  |   5 +-
>  17 files changed, 1268 insertions(+), 110 deletions(-)
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootConfig.c
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootConfig.h
>  create mode 100644
> NetworkPkg/HttpBootDxe/HttpBootConfigNVDataStruc.h
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni
>  create mode 100644 NetworkPkg/HttpBootDxe/HttpBootConfigVfr.vfr
>  create mode 100644 NetworkPkg/Include/Guid/HttpBootConfigHii.h
>
> diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> index dd835c4..37333ee 100644
> --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
> +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
> @@ -167,18 +167,35 @@ HttpBootDhcp4ExtractUriInfo (
>// HttpOffer contains the boot file URL.
>//
>SelectOffer = >OfferBuffer[SelectIndex].Dhcp4;
> -  if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) || (SelectOffer-
> >OfferType == HttpOfferTypeDhcpNameUriDns)) {
> -HttpOffer = SelectOffer;
> +  if (Private->FilePathUri == NULL) {
> +//
> +// In Corporate environment, we need a HttpOffer.
> +//
> +if ((SelectOffer->OfferType == HttpOfferTypeDhcpIpUri) ||
> +(SelectOffer->OfferType == HttpOfferTypeDhcpIpUriDns) ||
> +(SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns)) {
> +  HttpOffer = SelectOffer;
> +} else {
> +  ASSERT (Private->SelectProxyType != HttpOfferTypeMax);
> +  ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];
> +  HttpOffer = >OfferBuffer[ProxyIndex].Dhcp4;
> +}
> +Private->BootFileUriParser = HttpOffer->UriParser;
> +Private->BootFileUri = (CHAR8*) HttpOffer-
> >OptList[HTTP_BOOT_DHCP4_TAG_INDEX_BOOTFILE]->Data;
>} else {
> -ASSERT (Private->SelectProxyType != HttpOfferTypeMax);
> -ProxyIndex = Private->OfferIndex[Private->SelectProxyType][0];
> -HttpOffer = >OfferBuffer[ProxyIndex].Dhcp4;
> +//
> +// In Home environment the BootFileUri comes from the FilePath.
> +//
> +Private->BootFileUriParser = Private->FilePathUriParser;
> +Private->BootFileUri = Private->FilePathUri;
>}
>
>//
>// Configure the default DNS server if server assigned.
>//
> -  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
> (SelectOffer->OfferType == HttpOfferTypeDhcpDns)) {
> +  if ((SelectOffer->OfferType == HttpOfferTypeDhcpNameUriDns) ||
> +  (SelectOffer->OfferType == HttpOfferTypeDhcpDns) ||
> +  (SelectOffer->OfferType ==