> On May 5, 2015, at 11:26 AM, Duran, Leo <leo.du...@amd.com> wrote:
> 
> Of course, I meant:
>  
> I’m declaring a Pcd with some default value as 
> [PcdsPatchableInModule.common], and here are my observations:
> 1)      In PEIM module1 after PcdSetXX() with a new value and can read back 
> the new value with PcdGetXX()
> 2)      However, from PEIM module2 (which runs later) PcdGetXX() returns the 
> default declared value
>  
> Question: Is there a way to invoke PcdSetXX() so that the new value is 
> persistent across modules?
>  

PatchableInModule means patching a binary is supported. Dynamic means lookup 
the value in a database (via Pcd PPI, and Protocoli ) and sharing it across 
modules. 

As Tim mentioned by using Patchable you are scoping the PCD value to be 
compiled into your module, so a different location for every setting. Changing 
that value does not update other modules. 


https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Include/Library/PcdLib.h
#define PatchPcdSet8(TokenName, Value)      (_gPcd_BinaryPatch_##TokenName = 
(Value))

You need to define the PCD to a [PcdsDynamicDefault.common] in your DSC file. 
This means all the values come from this PEIM 
https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universal/PCD/Pei/  
and all the other modules will use the PCD PPI to get/set PCD values. The PCD 
macro in the PEIM ends up calling a library call that abstracts the PCD PPI 
call. 


Thanks,

Andrew Fish

> Thanks,
> Leo.
>  
>  
> From: Duran, Leo 
> Sent: Tuesday, May 05, 2015 12:49 PM
> To: 'edk2-devel@lists.sourceforge.net'
> Subject: Question about SetPcd
>  
> I’m declaring a Pcd with some default value as 
> [PcdsPatchableInModule.common], and here are my observations:
> 1)      In PEIM module1 after  SetPcdXX() with a new value and can read back 
> the new value with GetPcdXX()
> 2)      However, from PEIM module2 (which runs later) GetPcdXX() returns the 
> default declared value
>  
> Question: Is there a way to invoke SetPcdXX() so that the new value is 
> persistent across modules?
>  
> Thanks,
> Leo.
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to