It is because the PCD PcdMemoryProfilePropertyMask is only essentially used in 
SmramProfileRecord.c.
So move the include PcdLib.h from SmmBaseHelper.c to SmramProfileRecord.c.

Thanks,
Star
-----Original Message-----
From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org] 
Sent: Wednesday, June 10, 2015 2:02 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [PATCH 3/3] EdkCompatibilityPkg SmmBaseHelper: Unregister 
profile image correctly.

On 9 June 2015 at 04:10, Star Zeng <star.z...@intel.com> wrote:
> Call UnregisterSmramProfileImage() before image buffer freed.
>
> Cc: Jiewen Yao <jiewen....@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng <star.z...@intel.com>
> ---
>  EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c      | 5 
> ++---
>  EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c 
> | 3 ++-
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git 
> a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c 
> b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
> index 2b94e4d..1d16449 100644
> --- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
> +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
> @@ -11,7 +11,7 @@
>
>    SmmHandlerEntry() will receive untrusted input and do validation.
>
> -  Copyright (c) 2009 - 2013, Intel Corporation. All rights 
> reserved.<BR>
> +  Copyright (c) 2009 - 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 @@ -34,7 +34,6 @@  #include 
> <Library/MemoryAllocationLib.h>  #include 
> <Library/SynchronizationLib.h>  #include <Library/CpuLib.h> -#include 
> <Library/PcdLib.h>

What is this change for? It is not mentioned in the commit log.

>  #include <Guid/SmmBaseThunkCommunication.h>
>  #include <Protocol/SmmBaseHelperReady.h>  #include 
> <Protocol/SmmCpu.h> @@ -734,10 +733,10 @@ LoadImage (
>      RegisterSmramProfileImage (FilePath, DstBuffer, PageCount);
>      Status = gBS->StartImage (*ImageHandle, NULL, NULL);
>      if (EFI_ERROR (Status)) {
> +      UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);
>        mLoadPe32Image->UnLoadPeImage (mLoadPe32Image, *ImageHandle);
>        *ImageHandle = NULL;
>        FreePages ((VOID *)(UINTN)DstBuffer, PageCount);
> -      UnregisterSmramProfileImage (FilePath, DstBuffer, PageCount);
>      }
>    }
>
> diff --git 
> a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c 
> b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c
> index 84eba48..a1797ea 100644
> --- 
> a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileRecord.c
> +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmramProfileReco
> +++ rd.c
> @@ -1,6 +1,6 @@
>  /** @file
>
> -  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2014 - 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 @@ -20,6 +20,7 @@  #include <Library/DevicePathLib.h>  
> #include <Library/BaseMemoryLib.h>  #include <Library/DebugLib.h>
> +#include <Library/PcdLib.h>

And this one?

>  #include <Protocol/SmmCommunication.h>
>
>  #include <Guid/MemoryProfile.h>
> --
> 1.9.5.msysgit.0
>
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to