Re: [edk2] [Patch 3/6] BaseTools: Update SetPcdPtr in AutoGen Code

2015-08-20 Thread Zeng, Star

On 2015/8/18 17:25, Liming Gao wrote:

For patchable PCD, map SetPcdPtr() to LibPatchPcdSetPtrAndSize(),
then the size of the updated VOID* value can be cached.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao liming@intel.com


Reviewed-by: Star Zeng star.z...@intel.com


---
  BaseTools/Source/Python/AutoGen/GenC.py | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
b/BaseTools/Source/Python/AutoGen/GenC.py
index c4d3307..b76d315 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1010,12 +1010,12 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
  AutoGenH.Append('extern %s  %s  %s%s;\n' % (Const, Pcd.DatumType, 
PcdVariableName, Array))
  AutoGenH.Append('#define %s  %s%s\n' % (GetModeName, Type, 
PcdVariableName))

  if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
  if Pcd.DatumType == 'VOID*':
-AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtr((VOID *)_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, 
(SizeOfBuffer), (Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName))
-AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrS((VOID *)_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, 
(SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, Pcd.TokenCName, 
Pcd.TokenCName))
+AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, 
_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), 
(Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))
+AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, 
_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), 
(Buffer))\n' % (SetModeStatusName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))
  else:
  AutoGenH.Append('#define %s(Value)  (%s = (Value))\n' % 
(SetModeName, PcdVariableName))
  AutoGenH.Append('#define %s(Value)  ((%s = (Value)), 
RETURN_SUCCESS) \n' % (SetModeStatusName, PcdVariableName))
  else:
  AutoGenH.Append('//#define %s  ASSERT(FALSE)  // It is not 
allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)
@@ -1133,12 +1133,12 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
  if PcdItemType == TAB_PCDS_PATCHABLE_IN_MODULE:
  PcdVariableName = '_gPcd_' + 
gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + '_' + TokenCName
  AutoGenH.Append('extern volatile %s _gPcd_BinaryPatch_%s%s;\n' 
%(DatumType, TokenCName, Array) )
  AutoGenH.Append('#define %s  %s_gPcd_BinaryPatch_%s\n' %(GetModeName, 
Type, TokenCName))
  if Pcd.DatumType == 'VOID*':
-AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtr((VOID *)_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, 
(SizeOfBuffer), (Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName))
-AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrS((VOID *)_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, 
(SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, Pcd.TokenCName, 
Pcd.TokenCName))
+AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, 
_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), 
(Buffer))\n' % (SetModeName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))
+AutoGenH.Append('#define %s(SizeOfBuffer, Buffer)  
LibPatchPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, 
_gPcd_BinaryPatch_Size_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), 
(Buffer))\n' % (SetModeStatusName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))
  else:
  AutoGenH.Append('#define %s(Value)  (%s = (Value))\n' % 
(SetModeName, PcdVariableName))
  AutoGenH.Append('#define %s(Value)  ((%s = (Value)), 
RETURN_SUCCESS)\n' % (SetModeStatusName, PcdVariableName))

  PcdDataSize = GetPcdSize(Pcd)



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


Re: [edk2] [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request URL

2015-08-20 Thread Gary Ching-Pang Lin
On Thu, Aug 20, 2015 at 05:04:38AM +, Fu, Siyuan wrote:
 The patch is good, do you have access authority of edk2? Or I can help to 
 commit this patch.
 
 Reviewed-by: Fu Siyuan siyuan...@intel.com
 
I don't have the access right. That would be great if you can help me.

Thanks,

Gary Lin

 
 
 
 -Original Message-
 From: Gary Ching-Pang Lin [mailto:g...@suse.com] 
 Sent: Thursday, August 20, 2015 11:49 AM
 To: edk2-devel@lists.01.org
 Cc: Laszlo Ersek; Justen, Jordan L; Fu, Siyuan
 Subject: [PATCH v3 1/2] NetworkPkg: Remove the hostname from the http request 
 URL
 
 Per RFC7230, the URL must be a absolute-path when making a request directly 
 to the server. Since proxy is not supported now, all requests to the HTTP 
 driver are actually direct requests. This commit removes the scheme and the 
 hostname from the URL in the http request if the URL is an absolute-URI so 
 that the HTTP server can interpret the request properly.
 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Gary Ching-Pang Lin g...@suse.com
 Reviewed-by: Ye Ting ting...@intel.com
 ---
  NetworkPkg/HttpDxe/HttpImpl.c | 19 ++-
  1 file changed, 18 insertions(+), 1 deletion(-)
 
 diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c 
 index 545fe42..6684f77 100644
 --- a/NetworkPkg/HttpDxe/HttpImpl.c
 +++ b/NetworkPkg/HttpDxe/HttpImpl.c
 @@ -227,6 +227,7 @@ EfiHttpRequest (
CHAR16*HostNameStr;
HTTP_TOKEN_WRAP   *Wrap;
HTTP_TCP_TOKEN_WRAP   *TcpWrap;
 +  CHAR8 *FileUrl;
  
if ((This == NULL) || (Token == NULL)) {
  return EFI_INVALID_PARAMETER;
 @@ -450,7 +451,23 @@ EfiHttpRequest (
//
// Create request message.
//
 -  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, Url);
 +  FileUrl = Url;
 +  if (*FileUrl != '/') {
 +//
 +// Convert the absolute-URI to the absolute-path
 +//
 +while (*FileUrl != ':')
 +  FileUrl++;
 +if ((*(FileUrl+1) == '/')  (*(FileUrl+2) == '/')) {
 +  FileUrl += 3;
 +  while (*FileUrl != '/')
 +FileUrl++;
 +} else {
 +  Status = EFI_INVALID_PARAMETER;
 +  goto Error3;
 +}
 +  }
 +  RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);
if (RequestStr == NULL) {
  Status = EFI_OUT_OF_RESOURCES;
  goto Error3;
 --
 2.1.4
 
 ___
 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 5/6] MdePkg: Add two PcdApi for Patch VOID* PCD set operation.

2015-08-20 Thread Zeng, Star

Liming,

Minor comments inline below.

Reviewed-by: Star Zeng star.z...@intel.com

On 2015/8/18 17:25, Liming Gao wrote:

Two new APIs LibPatchPcdSetPtrAndSize() and LibPatchPcdSetPtrAndSizeS()
are added to catch the size of the updated VOID* PCD value buffer, then
PcdGetSize() API can return the actual size.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao liming@intel.com
---
  MdePkg/Include/Library/PcdLib.h  |  75 ++-
  MdePkg/Library/DxePcdLib/DxePcdLib.c | 111 +++
  MdePkg/Library/PeiPcdLib/PeiPcdLib.c | 111 +++
  3 files changed, 295 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h
index 962d442..0bbccb3 100644
--- a/MdePkg/Include/Library/PcdLib.h
+++ b/MdePkg/Include/Library/PcdLib.h
@@ -340,12 +340,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.

@return Return the pointer to the Buffer that was set.

  **/
  #define PatchPcdSetPtr(TokenName, Size, Buffer) \
-LibPatchPcdSetPtr (
\
-  _gPcd_BinaryPatch_##TokenName,   
\
+LibPatchPcdSetPtrAndSize ( 
\
+  (VOID 
*)_gPcd_BinaryPatch_##TokenName,   \
+  
_gPcd_BinaryPatch_Size_##TokenName, \

(UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
(Size), 
 \
(Buffer)
 \
)
  /**
@@ -2104,10 +2105,80 @@ LibPatchPcdSetPtrS (
IN   UINTNMaximumDatumSize,
IN OUT   UINTN*SizeOfBuffer,
IN CONST VOID *Buffer
);

+/**
+  Sets a value and size of a patchable PCD entry that is type pointer.
+
+  Sets the PCD entry specified by PatchVariable to the value specified by 
Buffer
+  and SizeOfBuffer. Buffer is returned.  If SizeOfBuffer is greater than
+  MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
+  NULL to indicate that the set operation was not actually performed.
+  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
+  MaximumDatumSize and NULL must be returned.
+
+  If PatchVariable is NULL, then ASSERT().
+  If SizeOfPatchVariable is NULL, then ASSERT().
+  If SizeOfBuffer is NULL, then ASSERT().
+  If SizeOfBuffer  0 and Buffer is NULL, then ASSERT().
+
+  @param[out] PatchVariable A pointer to the global variable in a module 
that is
+the target of the set operation.
+  @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of 
PatchVariable.
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry 
specified by PatchVariable.
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
+  @param[in] Buffer A pointer to the buffer to used to set the 
target variable.
+
+  @return Return the pointer to the Buffer that was set.
+
+**/
+VOID *
+EFIAPI
+LibPatchPcdSetPtrAndSize (
+  OUT   VOID*PatchVariable,
+  OUT   UINTN   *SizeOfPatchVariable,
+  INUINTN   MaximumDatumSize,
+  IN OUTUINTN   *SizeOfBuffer,
+  IN CONST  VOID*Buffer
+  );
+
+/**
+  Sets a value and size of a patchable PCD entry that is type pointer.
+
+  Sets the PCD entry specified by PatchVariable to the value specified
+  by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
+  then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
+  to indicate that the set operation was not actually performed.
+  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
+  MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
+
+  If PatchVariable is NULL, then ASSERT().
+  If SizeOfPatchVariable is NULL, then ASSERT().
+  If SizeOfBuffer is NULL, then ASSERT().
+  If SizeOfBuffer  0 and Buffer is NULL, then ASSERT().
+
+  @param[in] PatchVariable  A pointer to the global variable in a module 
that is
+the target of the set operation.


The in should be out actually to be same with LibPatchPcdSetPtrAndSize()?
And should we also update LibPatchPcdSetPtr() and LibPatchPcdSetPtrS() 
to align with this?



+  @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of 
PatchVariable.
+  @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry 
specified by PatchVariable.
+  @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
+  @param[in] Buffer A pointer to the buffer to used to set the 
target 

[edk2] [patch 4/4] CryptoPkg: Add a missed include file to fix the possible build issue.

2015-08-20 Thread Qin Long
Add a missed include file (UefiBaseType.h) into BaseCryptLib.h, since
EFI_TIME was introduced in the new crypto API (ImageTimestampVerify).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long qin.l...@intel.com
---
 CryptoPkg/Include/Library/BaseCryptLib.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CryptoPkg/Include/Library/BaseCryptLib.h 
b/CryptoPkg/Include/Library/BaseCryptLib.h
index d3b211b..95b75c9 100644
--- a/CryptoPkg/Include/Library/BaseCryptLib.h
+++ b/CryptoPkg/Include/Library/BaseCryptLib.h
@@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #ifndef __BASE_CRYPT_LIB_H__
 #define __BASE_CRYPT_LIB_H__
 
+#include Uefi/UefiBaseType.h
+
 ///
 /// MD4 digest size in bytes
 ///
-- 
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 1/6] BaseTools: Generate macro for the size of PCD value

2015-08-20 Thread Zeng, Star

Another minor below inline.

On 2015/8/20 15:35, Zeng, Star wrote:

Liming  Bob,

Comments inline.

On 2015/8/18 17:25, Liming Gao wrote:

PcdLib introduces new APIs to get the size of PCD value.
BaseTools generates those macros in AutoGen code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bob Feng bob.c.f...@intel.com
---
  BaseTools/Source/Python/AutoGen/GenC.py | 70
++---
  1 file changed, 65 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
b/BaseTools/Source/Python/AutoGen/GenC.py
index 84bd607..d706574 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -730,10 +730,25 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH):
  #  COMPAREGUID() will only be used if the Guid
passed in is local to the module.
  AutoGenH.Append('#define
_PCD_TOKEN_EX_%s(GuidPtr)   __PCD_%s_ADDR_CMP(GuidPtr) ?
__PCD_%s_ADDR_CMP(GuidPtr) : __PCD_%s_VAL_CMP(GuidPtr)  \n'
  % (Pcd.TokenCName,
Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))
  TokenCNameList.append(TokenCName)

+def GetPcdSize(Pcd):
+if Pcd.DatumType == 'VOID*':
+return Pcd.MaxDatumSize


Should it return the current data size, but not max data size?


+if Pcd.DatumType == 'UINT64':
+return 8
+if Pcd.DatumType == 'UINT32':
+return 4
+if Pcd.DatumType == 'UINT16':
+return 2
+if Pcd.DatumType == 'UINT8':
+return 1
+if Pcd.DatumType == 'BOOLEAN':
+return 1
+
+
  ## Create code for module PCDs
  #
  #   @param  InfoThe ModuleAutoGen object
  #   @param  AutoGenCThe TemplateString object for C code
  #   @param  AutoGenHThe TemplateString object for header file
@@ -744,10 +759,14 @@ def CreateModulePcdCode(Info, AutoGenC,
AutoGenH, Pcd):
  PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
  #
  # Write PCDs
  #
  PcdTokenName = '_PCD_TOKEN_' + Pcd.TokenCName
+PatchPcdSizeTokenName = '_PCD_PATCHABLE_' + Pcd.TokenCName +'_SIZE'
+PatchPcdSizeVariableName = '_gPcd_BinaryPatch_Size_' +
Pcd.TokenCName
+FixPcdSizeTokenName = '_PCD_SIZE_' + Pcd.TokenCName
+
  if Pcd.Type in gDynamicExPcd:
  TokenNumber = int(Pcd.TokenValue, 0)
  # Add TokenSpaceGuidValue value to PcdTokenName to
discriminate the DynamicEx PCDs with
  # different Guids but same TokenCName
  PcdExTokenName = '_PCD_TOKEN_' + Pcd.TokenSpaceGuidCName +
'_' + Pcd.TokenCName
@@ -785,11 +804,12 @@ def CreateModulePcdCode(Info, AutoGenC,
AutoGenH, Pcd):
  DatumSize = gDatumSizeStringDatabase[Pcd.DatumType]
  DatumSizeLib = gDatumSizeStringDatabaseLib[Pcd.DatumType]
  GetModeName = '_PCD_GET_MODE_' +
gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
  SetModeName = '_PCD_SET_MODE_' +
gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
  SetModeStatusName = '_PCD_SET_MODE_' +
gDatumSizeStringDatabaseH[Pcd.DatumType] + '_S_' + Pcd.TokenCName
-
+GetModeSizeName = '_PCD_GET_MODE_SIZE' + '_' + Pcd.TokenCName
+
  PcdExCNameList  = []
  if Pcd.Type in gDynamicExPcd:
  if Info.IsLibrary:
  PcdList = Info.LibraryPcdList
  else:
@@ -802,27 +822,30 @@ def CreateModulePcdCode(Info, AutoGenC,
AutoGenH, Pcd):
  # If PcdToken and PcdGet/Set used in the Pcds with different
Guids but same CName, it should failed to build.
  if PcdExCNameList.count(Pcd.TokenCName)  1:
  AutoGenH.Append('// Disabled the macros, as PcdToken and
PcdGet/Set are not allowed in the case that more than one DynamicEx
Pcds are different Guids but same CName.\n')
  AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName,
PcdExTokenName))
  AutoGenH.Append('// #define %s  LibPcdGetEx%s(%s,
%s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName,
PcdTokenName))
+AutoGenH.Append('#define %s LibPcdGetExSize(%s, %s)\n' %
(GetModeSizeName,Pcd.TokenSpaceGuidCName, PcdTokenName))
  if Pcd.DatumType == 'VOID*':
  AutoGenH.Append('// #define %s(SizeOfBuffer,
Buffer)  LibPcdSetEx%s(%s, %s, (SizeOfBuffer), (Buffer))\n' %
(SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
  AutoGenH.Append('// #define %s(SizeOfBuffer,
Buffer)  LibPcdSetEx%sS(%s, %s, (SizeOfBuffer), (Buffer))\n' %
(SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
  else:
  AutoGenH.Append('// #define %s(Value)
LibPcdSetEx%s(%s, %s, (Value))\n' % (SetModeName, DatumSizeLib,
Pcd.TokenSpaceGuidCName, PcdTokenName))
  AutoGenH.Append('// #define %s(Value)
LibPcdSetEx%sS(%s, %s, (Value))\n' % (SetModeStatusName,
DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
  else:
  AutoGenH.Append('#define %s  %s\n' % (PcdTokenName,

Re: [edk2] [Patch 6/6] SecurityPkg: Use PcdGetSize to get the size of VOID* PCD value.

2015-08-20 Thread Zeng, Star

On 2015/8/18 17:25, Liming Gao wrote:

PcdLib introduces generic API to get the size of VOID* PCD value.
Update Pei and Dxe RsaGuidedLib to use generic PCD API instead of GetEx API.
This change can remove PCD type limitation in these two libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao liming@intel.com


Reviewed-by: Star Zeng star.z...@intel.com


---
  .../DxeRsa2048Sha256GuidedSectionExtractLib.c | 4 ++--
  .../DxeRsa2048Sha256GuidedSectionExtractLib.inf   | 4 ++--
  .../PeiRsa2048Sha256GuidedSectionExtractLib.c | 4 ++--
  .../PeiRsa2048Sha256GuidedSectionExtractLib.inf   | 2 +-
  4 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
 
b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
index 2b61014..1f7a299 100644
--- 
a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
+++ 
b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
@@ -2,11 +2,11 @@

This library registers RSA 2048 SHA 256 guided section handler
to parse RSA 2048 SHA 256 encapsulation section and extract raw data.
It uses the BaseCrypyLib based on OpenSSL to authenticate the signature.

-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.BR
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.BR
  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

@@ -270,11 +270,11 @@ Rsa2048Sha256GuidedSectionHandler (
//
PublicKey = (UINT8 *)PcdGetPtr (PcdRsa2048Sha256PublicKeyBuffer);
DEBUG ((DEBUG_VERBOSE, DxePcdRsa2048Sha256: PublicKeyBuffer = %p\n, 
PublicKey));
ASSERT (PublicKey != NULL);
DEBUG ((DEBUG_VERBOSE, DxePcdRsa2048Sha256: PublicKeyBuffer Token = 
%08x\n, PcdToken (PcdRsa2048Sha256PublicKeyBuffer)));
-  PublicKeyBufferSize = LibPcdGetExSize (gEfiSecurityPkgTokenSpaceGuid, 
PcdToken (PcdRsa2048Sha256PublicKeyBuffer));
+  PublicKeyBufferSize = PcdGetSize (PcdRsa2048Sha256PublicKeyBuffer);
DEBUG ((DEBUG_VERBOSE, DxePcdRsa2048Sha256: PublicKeyBuffer Size = 
%08x\n, PublicKeyBufferSize));
ASSERT ((PublicKeyBufferSize % SHA256_DIGEST_SIZE) == 0);
CryptoStatus = FALSE;
while (PublicKeyBufferSize != 0) {
  if (CompareMem (Digest, PublicKey, SHA256_DIGEST_SIZE) == 0) {
diff --git 
a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.inf
 
b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.inf
index f1777f4..4681f08 100644
--- 
a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.inf
+++ 
b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.inf
@@ -48,13 +48,13 @@
MemoryAllocationLib
BaseCryptLib
PcdLib
PerformanceLib

-[PcdEx]
+[Pcd]
gEfiSecurityPkgTokenSpaceGuid.PcdRsa2048Sha256PublicKeyBuffer## 
SOMETIMES_CONSUMES
-
+
  [Protocols]
gEfiSecurityPolicyProtocolGuid   ## SOMETIMES_CONSUMES (Set 
platform override AUTH status if exist)

  [Guids]
gEfiCertTypeRsa2048Sha256Guid  ## PRODUCES   ## UNDEFINED  # Specifies 
RSA 2048 SHA 256 authentication algorithm.
diff --git 
a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
 
b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
index 8c0047e..e2a0fb6 100644
--- 
a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
+++ 
b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
@@ -2,11 +2,11 @@

This library registers RSA 2048 SHA 256 guided section handler
to parse RSA 2048 SHA 256 encapsulation section and extract raw data.
It uses the BaseCrypyLib based on OpenSSL to authenticate the signature.

-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.BR
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.BR
  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

@@ -254,11 +254,11 @@ Rsa2048Sha256GuidedSectionHandler (
//
PublicKey = (UINT8 *)PcdGetPtr (PcdRsa2048Sha256PublicKeyBuffer);
DEBUG ((DEBUG_VERBOSE, 

Re: [edk2] [Patch 4/6] MdePkg: Add four PcdGetSize() API in PcdLib

2015-08-20 Thread Zeng, Star

Liming,

Minor comments inline below.

Reviewed-by: Star Zeng star.z...@intel.com

On 2015/8/18 17:25, Liming Gao wrote:

Add below four PcdGetSize() API in PcdLib header file. They can be used
to get the size of PCD value.
FixedPcdGetSize()
PatchPcdGetSize()
PcdGetSize()
PcdGetExSize()

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao liming@intel.com
---
  MdePkg/Include/Library/PcdLib.h | 58 -
  1 file changed, 57 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h
index a7e1e62..962d442 100644
--- a/MdePkg/Include/Library/PcdLib.h
+++ b/MdePkg/Include/Library/PcdLib.h
@@ -346,11 +346,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
_gPcd_BinaryPatch_##TokenName,  
 \

(UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
(Size), 
 \
(Buffer)
 \
)
-
  /**
Retrieves an 8-bit PCD token value based on a token name.

Returns the 8-bit value for the token specified by TokenName.
If TokenName is not a valid token in the token space, then the module will 
not build.
@@ -431,10 +430,67 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.

  **/
  #define PcdGetBool(TokenName)   _PCD_GET_MODE_BOOL_##TokenName


+/**
+  Retrieves the size of a fixed PCD token based on a token name.
+
+  Returns the size of the token specified by TokenName.
+  If TokenName is not a valid token in the token space, then the module will 
not build.
+
+  @param[in]  TokenName  The name of the PCD token to retrieve a current value 
size for.
+
+  @return Return the size
+
+**/
+#define FixedPcdGetSize(TokenName)_PCD_SIZE_##TokenName
+
+
+/**
+  Retrieves the size of a binary patchable PCD token based on a token name.
+
+  Returns the size of the token specified by TokenName.
+  If TokenName is not a valid token in the token space, then the module will 
not build.
+
+  @param[in]  TokenName  The name of the PCD token to retrieve a current value 
size for.
+
+  @return Return the size
+
+**/
+#define PatchPcdGetSize(TokenName)_gPcd_BinaryPatch_Size_##TokenName
+
+
+/**
+  Retrieves the size of the PCD token based on a token name.
+
+  Returns the size of the token specified by TokenName.
+  If TokenName is not a valid token in the token space, then the module will 
not build.
+
+  @param[in]   TokenName  The name of the PCD token to retrieve a current 
value size for.
+
+  @return  Return the size
+
+**/
+#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName
+
+
+/**
+  Retrieve the size of a given PCD token.
+
+  Returns the size of the token specified by TokenNumber and Guid.
+  If Guid is NULL, then ASSERT().
+
+  @param[in]  Guid  Pointer to a 128-bit unique value that designates
+which namespace to retrieve a value from.
+  @param[in]  TokenNumber   The PCD token number to retrieve a current value 
for.


The sentence needs to be updated to The PCD token number to retrieve a 
current value size for.?



+
+  @return Return the size.
+
+**/
+#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), 
PcdTokenEx(Guid,TokenName))
+
  #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
  /**
Sets an 8-bit PCD token value based on a token name.

Sets the 8-bit value for the token specified by TokenName. Value is 
returned.



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


Re: [edk2] [Patch 3/3] Nt32Pkg: Add HttpUtilitiesDxe module

2015-08-20 Thread Ye, Ting
Reviewed-by: Ye Ting ting...@intel.com


-Original Message-
From: Wu, Jiaxin 
Sent: Friday, August 21, 2015 9:37 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Fu, Siyuan; Ni, Ruiyu
Subject: [Patch 3/3] Nt32Pkg: Add HttpUtilitiesDxe module

This patch is used to add HttpUtilitiesDxe module.

Cc: Ye Ting ting...@intel.com
Cc: Siyuan Fu siyuan...@intel.com
Cc: Ruiyu Ni ruiyu...@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu jiaxin...@intel.com
---
 Nt32Pkg/Nt32Pkg.dsc | 1 +
 Nt32Pkg/Nt32Pkg.fdf | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 2b1d8c0..74011bf 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -432,10 +432,11 @@
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 
   NetworkPkg/HttpBootDxe/HttpBootDxe.inf
   NetworkPkg/DnsDxe/DnsDxe.inf
   NetworkPkg/HttpDxe/HttpDxe.inf
+  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/UiApp/UiApp.inf
   MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
index c68909c..e0d93b9 100644
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ b/Nt32Pkg/Nt32Pkg.fdf
@@ -258,10 +258,11 @@ INF  Nt32Pkg/SnpNt32Dxe/SnpNt32Dxe.inf
 INF  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
 INF  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
 INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 INF  NetworkPkg/DnsDxe/DnsDxe.inf
 INF  NetworkPkg/HttpDxe/HttpDxe.inf
+INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 

 #
 # FILE statements are provided so that a platform integrator can include
 # complete EFI FFS files, as well as a method for constructing FFS files
 # using curly {} brace scoping. The following three FILEs are
-- 
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 2/3] NetworkPkg: Add HTTP utilities driver

2015-08-20 Thread Ye, Ting
I think the below protocol attribute is incorrect. Should be updated to 
PRODUCES.

gEfiHttpUtilitiesProtocolGuid   ## BY_START

Also, I expect a following patch to update HttpDxe driver to remove internal 
functions and consume this protocol.

Other parts are good to me.

Reviewed-by: Ye Ting ting...@intel.com

Best Regards,
Ye Ting

-Original Message-
From: Wu, Jiaxin 
Sent: Friday, August 21, 2015 9:37 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Fu, Siyuan
Subject: [Patch 2/3] NetworkPkg: Add HTTP utilities driver

This patch is used to add HTTP utilities driver.

Cc: Ye Ting ting...@intel.com
Cc: Siyuan Fu siyuan...@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu jiaxin...@intel.com
---
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c | 126 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.h | 212 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf   |  51 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesImpl.c| 279 +++
 .../HttpUtilitiesDxe/HttpUtilitiesProtocol.c   | 393 +
 NetworkPkg/NetworkPkg.dsc  |   2 +
 6 files changed, 1063 insertions(+)
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.h
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesImpl.c
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c

diff --git a/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c 
b/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c
new file mode 100644
index 000..6bd5b6c
--- /dev/null
+++ b/NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c
@@ -0,0 +1,126 @@
+/** @file
+  The DriverEntryPoint and Unload for HttpUtilities driver.
+
+  Copyright (c) 2015, Intel Corporation. All rights reserved.BR
+
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution.  The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include HttpUtilitiesDxe.h
+
+
+/**
+  Unloads an image.
+
+  @param  ImageHandle   Handle that identifies the image to be 
unloaded.
+
+  @retval EFI_SUCCESS   The image has been unloaded.
+  @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
+
+**/
+EFI_STATUS 
+EFIAPI
+HttpUtilitiesDxeUnload (
+  IN EFI_HANDLE  ImageHandle
+  )
+{
+  EFI_STATUS  Status;
+  UINTN   HandleNum;
+  EFI_HANDLE  *HandleBuffer;
+  UINT32  Index;
+  EFI_HTTP_UTILITIES_PROTOCOL *HttpUtilitiesProtocol;
+
+
+  HandleBuffer   = NULL;
+
+  //
+  // Locate all the handles with HttpUtilities protocol.
+  //
+  Status = gBS-LocateHandleBuffer (
+  ByProtocol,
+  gEfiHttpUtilitiesProtocolGuid,
+  NULL,
+  HandleNum,
+  HandleBuffer
+  );
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  for (Index = 0; Index  HandleNum; Index++) {
+//
+// Firstly, find HttpUtilitiesProtocol interface
+//
+Status = gBS-OpenProtocol (
+HandleBuffer[Index], 
+gEfiHttpUtilitiesProtocolGuid, 
+(VOID **) HttpUtilitiesProtocol, 
+ImageHandle, 
+NULL, 
+EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL
+);
+if (EFI_ERROR (Status)) {
+  return Status;
+}
+
+//
+// Then, uninstall HttpUtilities interface
+// 
+Status = gBS-UninstallMultipleProtocolInterfaces (
+HandleBuffer[Index],
+gEfiHttpUtilitiesProtocolGuid, HttpUtilitiesProtocol,
+NULL
+);
+if (EFI_ERROR (Status)) {
+  return Status;
+}
+  }
+
+  return EFI_SUCCESS;
+}
+
+
+/**
+  This is the declaration of an EFI image entry point. This entry point is
+  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
+  both device drivers and bus drivers.
+
+  @param  ImageHandle   The firmware allocated handle for the UEFI 
image.
+  @param  SystemTable   A pointer to the EFI System Table.
+
+  @retval EFI_SUCCESS   The operation completed successfully.
+  @retval OthersAn unexpected error occurred.
+**/
+EFI_STATUS
+EFIAPI
+HttpUtilitiesDxeDriverEntryPoint (
+  IN EFI_HANDLEImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS Status;
+
+  EFI_HANDLE Handle;
+
+  Handle = NULL;
+
+  //
+  

[edk2] Adding a new BoardPkg to edk2 tree: Licensing

2015-08-20 Thread Sharma Bhupesh
Hi Experts,

We are considering adding the support for a Freescale ARM64 based platform in 
the EDK2
tree and upstreaming the same.

Since EDK2 is compliant with the BSD - Clause 2 licensing terms
(see reference : http://opensource.org/licenses/bsd-license.php), we are 
contemplating the
licensing terms required to upstream the same.

So far the ARM platforms present in EDK2 tree (submitted by ARM and Texas 
Instruments) follow
this License version 
(https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/License.txt).

So, can are planning to add a Freescale specific Copyright information on this 
overall license and use it for
the Freescale specific packages while upstreaming the code. Or should we keep 
only the line
specifying the Freescale license and remove the lines related to Apple and ARM?

Modified License:
-

Copyright (c) 2009-2010, Apple Inc. All rights reserved.
Copyright (c) 2011-2012, ARM Limited. All rights reserved.
Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved.


Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in
  the documentation and/or other materials provided with the
  distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Please share your views. Since this is our step in the direction of
upstreaming code to the EDK2 tree, we might be missing stuff here.

If there is any other pre-requisites to keep in mind for upstreaming
a new SoC support in EDK2 tree, please share the same as well.

Thanks for your help.

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


Re: [edk2] Adding a new BoardPkg to edk2 tree: Licensing

2015-08-20 Thread Leif Lindholm
Hi Bhupesh,

On Thu, Aug 20, 2015 at 11:03:07AM +, Sharma Bhupesh wrote:
 We are considering adding the support for a Freescale ARM64 based
 platform in the EDK2 tree and upstreaming the same.

As much as I would like to see more open source platform code, I
really want to get some structure in place to deal with it. Adding a
new top-level vendor package for everyone will quickly get out of
hand.

But since this discussion never seems to get off the ground on this
list, I am currently doing this in my own tree - which I intend to be
migrating all of the remaining ARM Ltd. platform support to over time.

 Since EDK2 is compliant with the BSD - Clause 2 licensing terms 
 (see reference : http://opensource.org/licenses/bsd-license.php), we
 are contemplating the licensing terms required to upstream the same.
 
 So far the ARM platforms present in EDK2 tree (submitted by ARM and
 Texas Instruments) follow this License version 
 (https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/License.txt).

 So, can are planning to add a Freescale specific Copyright
 information on this overall license and use it for the Freescale
 specific packages while upstreaming the code. Or should we keep only
 the line specifying the Freescale license and remove the lines
 related to Apple and ARM?

 Modified License:
 -
 
 Copyright (c) 2009-2010, Apple Inc. All rights reserved.
 Copyright (c) 2011-2012, ARM Limited. All rights reserved.
 Copyright (c) 2015, Freescale Semiconductor, Inc. All rights reserved.

I must confess to some confusion around these bits myself.
For example, the Tianocore contribution agreement is quite explicit
that edk2 is handed to you by Intel, regardless of who wrote a
particular piece of code.

From my point of view, I see no reason for a License.txt in a
Freescale package to carry the Apple/ARM Copyright statements - unless
it is derived from a different package that held those.

I interpret the Copyright in a License.txt simply as a default
statement that applies if nothing else is stated in each file.

But in accordance with the contribution agreement, binary images
should be distributed accompanied by a document specifying the various
copyrights of all of the source code the images were generated from.

There is also a bit of a different behaviour, I would say rooted in
cultural differences, with regards to the updating/addition of
Copyright statements. By which I mean majority Linux/free software
developers versus majority non-free software developers. 
Certainly, I would say that most Linaro contributions that modify
existing files do not add Linaro copyright statements. Basically
adhering to
http://www.gnu.org/prep/maintain/maintain.html#Legally-Significant
Is that bad of us?

Sorry, I may have accidentally hijacked this thread...

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 
 * Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in
   the documentation and/or other materials provided with the
   distribution.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
 Please share your views. Since this is our step in the direction of
 upstreaming code to the EDK2 tree, we might be missing stuff here.
 
 If there is any other pre-requisites to keep in mind for upstreaming
 a new SoC support in EDK2 tree, please share the same as well.

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


[edk2] [Patch 0/3] Add header file and driver module for HTTP utilities

2015-08-20 Thread Jiaxin Wu
Those patches are used to add header file and driver module for HTTP utilities

Jiaxin Wu (3):
  MdePkg: Add header files for HTTP utilities protocol.
  NetworkPkg: Add HTTP utilities driver.
  Nt32Pkg: Add HttpUtilitiesDxe module.

 MdePkg/Include/Protocol/HttpUtilities.h| 124 +++
 MdePkg/MdePkg.dec  |   3 +
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c | 126 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.h | 212 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf   |  51 +++
 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesImpl.c| 279 +++
 .../HttpUtilitiesDxe/HttpUtilitiesProtocol.c   | 393 +
 NetworkPkg/NetworkPkg.dsc  |   2 +
 Nt32Pkg/Nt32Pkg.dsc|   1 +
 Nt32Pkg/Nt32Pkg.fdf|   1 +
 10 files changed, 1192 insertions(+)
 create mode 100644 MdePkg/Include/Protocol/HttpUtilities.h
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.c
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.h
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesImpl.c
 create mode 100644 NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesProtocol.c

-- 
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] BaseTools: Add NULL pointer check in AutoGen code

2015-08-20 Thread Zeng, Star

On 2015/8/19 16:12, Liming Gao wrote:

For DynamicEx PCD, if NULL pointer is specified as token space GUID,
it will directly be used to compare GUID value in AutoGen code.
To avoid access NULL pointer, NULL pointer will be checked first.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao liming@intel.com


Reviewed-by: Star Zeng star.z...@intel.com


---
  BaseTools/Source/Python/AutoGen/GenC.py | 1 +
  1 file changed, 1 insertion(+)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py 
b/BaseTools/Source/Python/AutoGen/GenC.py
index b76d315..66756a3 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -715,10 +715,11 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH):
  for Pcd in PcdExList:
  if Pcd.Type in gDynamicExPcd and Pcd.TokenCName == TokenCName:
  Index = Index + 1
  if Index == 1:
  AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr)  (' 
% (Pcd.TokenCName))
+AutoGenH.Append('\\\n  (GuidPtr == NULL) ? 0:')
  AutoGenH.Append('\\\n  COMPAREGUID (GuidPtr, %s) ? 
_PCD_TOKEN_%s_%s:'
  % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
  else:
  AutoGenH.Append('\\\n  COMPAREGUID (GuidPtr, %s) ? 
_PCD_TOKEN_%s_%s:'
  % (Pcd.TokenSpaceGuidCName, 
Pcd.TokenSpaceGuidCName, Pcd.TokenCName))



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


Re: [edk2] [Patch 1/3] MdePkg: Add header file for HTTP utilities protocol

2015-08-20 Thread Ye, Ting
Reviewed-by: Ye Ting ting...@intel.com 

-Original Message-
From: Wu, Jiaxin 
Sent: Friday, August 21, 2015 9:37 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting; Fu, Siyuan; Gao, Liming
Subject: [Patch 1/3] MdePkg: Add header file for HTTP utilities protocol

This patch is used to add header files for HTTP utilities protocol.

Cc: Ye Ting ting...@intel.com
Cc: Siyuan Fu siyuan...@intel.com
Cc: Liming Gao liming@intel.com
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu jiaxin...@intel.com
---
 MdePkg/Include/Protocol/HttpUtilities.h | 124 
 MdePkg/MdePkg.dec   |   3 +
 2 files changed, 127 insertions(+)
 create mode 100644 MdePkg/Include/Protocol/HttpUtilities.h

diff --git a/MdePkg/Include/Protocol/HttpUtilities.h 
b/MdePkg/Include/Protocol/HttpUtilities.h
new file mode 100644
index 000..59c1ea2
--- /dev/null
+++ b/MdePkg/Include/Protocol/HttpUtilities.h
@@ -0,0 +1,124 @@
+/** @file
+  EFI HTTP Utilities protocol provides a platform independent abstraction for 
HTTP
+  message comprehension.
+
+  Copyright (c) 2015, Intel Corporation. All rights reserved.BR
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution. The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN AS IS BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_HTTP_UTILITIES_PROTOCOL_H__
+#define __EFI_HTTP_UTILITIES_PROTOCOL_H__
+
+#include Protocol/Http.h
+
+#define EFI_HTTP_UTILITIES_PROTOCOL_GUID  \
+  { \
+0x3e35c163, 0x4074, 0x45dd, {0x43, 0x1e, 0x23, 0x98, 0x9d, 0xd8, 0x6b, 
0x32 } \
+  }
+
+typedef struct _EFI_HTTP_UTILITIES_PROTOCOL EFI_HTTP_UTILITIES_PROTOCOL;
+
+
+/**
+  Create HTTP header based on a combination of seed header, fields
+  to delete, and fields to append.
+
+  The Build() function is used to manage the headers portion of an
+  HTTP message by providing the ability to add, remove, or replace
+  HTTP headers.
+
+  @param[in]  ThisPointer to EFI_HTTP_UTILITIES_PROTOCOL 
instance.
+  @param[in]  SeedMessageSize Size of the initial HTTP header. This can be 
zero.
+  @param[in]  SeedMessage Initial HTTP header to be used as a base for
+  building a new HTTP header. If NULL,
+  SeedMessageSize is ignored.
+  @param[in]  DeleteCount Number of null-terminated HTTP header field 
names
+  in DeleteList.
+  @param[in]  DeleteList  List of null-terminated HTTP header field 
names to
+  remove from SeedMessage. Only the field 
names are
+  in this list because the field values are 
irrelevant
+  to this operation.
+  @param[in]  AppendCount Number of header fields in AppendList.
+  @param[in]  AppendList  List of HTTP headers to populate NewMessage 
with.
+  If SeedMessage is not NULL, AppendList will 
be
+  appended to the existing list from 
SeedMessage in
+  NewMessage.
+  @param[out] NewMessageSize  Pointer to number of header fields in 
NewMessage.
+  @param[out] NewMessage  Pointer to a new list of HTTP headers based 
on.
+
+  @retval EFI_SUCCESS Add, remove, and replace operations 
succeeded.
+  @retval EFI_OUT_OF_RESOURCESCould not allocate memory for NewMessage.
+  @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
+  This is NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HTTP_UTILS_BUILD) (
+  IN  EFI_HTTP_UTILITIES_PROTOCOL  *This,
+  IN  UINTNSeedMessageSize,
+  IN  VOID *SeedMessage,   OPTIONAL
+  IN  UINTNDeleteCount,
+  IN  CHAR8*DeleteList[],  OPTIONAL
+  IN  UINTNAppendCount,
+  IN  EFI_HTTP_HEADER  *AppendList[],  OPTIONAL
+  OUT UINTN*NewMessageSize,
+  OUT VOID **NewMessage
+  );
+
+/**
+  Parses HTTP header and produces an array of key/value pairs.
+
+  The Parse() function is used to transform data stored in HttpHeader
+  into a list of fields paired with their corresponding values.
+
+  @param[in]  ThisPointer to EFI_HTTP_UTILITIES_PROTOCOL 
instance.
+  @param[in]  HttpMessage Contains raw unformatted HTTP header string.
+  @param[in]  HttpMessageSize Size of HTTP header.
+  @param[out] HeaderFieldsArray of