> Date: Tue, 05 May 2015 13:50:38 -0700
> From: Andrew Fish <af...@apple.com>
> Subject: Re: [edk2] Question about SetPcd
> To: edk2-devel@lists.sourceforge.net
> Message-ID: <ec8e3d68-c63d-4aa7-8f3e-f86ac9c78...@apple.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> 
> > On May 5, 2015, at 1:16 PM, Duran, Leo <leo.du...@amd.com> wrote:
> >
> > Thanks Tim & Andrew.
> >
> 
> The PCD lingo can be a confusing.
> 
> > 1) The .DEC file declares the PCD as:
> > [PcdsFixedAtBuild.common, PcdsDynamic.common,
> > PcdsPatchableInModule.common]
> >
> 
> The .DEC declares the existence of the PCD and the mappings that are legal.
> It also contains a default value that is used if it is not set in the 
> platform .DSC
> file.
> 
> The INF file really matches the form of the library APIs that are used. It is
> usually best to use the PCD from that is generic. Basically let the .DSC file 
> pick
> the form. You can also add an optional default, it overrides the one in the
> .DEC file
> 
> > 2) As suggested, in my .DSC file I define it as:
> > [PcdsDynamicDefault.common]
> >
> > 3) But now (at PEIM init-time), when I invoke PcdSet64 () I get an
> > ASSERT ... PcdLib.c(131)
> >
> 
> If your DSC points at
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Library/BasePcd
> LibNull/BasePcdLibNull.inf you are going to ASSERT when you try to make the
> library calls. You need to point at
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdePkg/Library/PeiPcdLi
> b/PeiPcdLib.inf that will depend on a PPI published by this PEIM
> https://svn.code.sf.net/p/edk2/code/trunk/edk2/MdeModulePkg/Universa
> l/PCD/Pei/
> 
> The flexibility in the edk2 can be confusing. I find it useful to make the
> build.exe command generate a log file.
>   -y REPORTFILE, --report-file=REPORTFILE
>                         Create/overwrite the report to the specified filename.
>   -Y REPORTTYPE, --report-type=REPORTTYPE
>                         Flags that control the type of build report to
>                         generate.  Must be one of: [PCD, LIBRARY, FLASH,
>                         DEPEX, BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER].
>                         To specify more than one flag, repeat this option on
>                         the command line and the default flag set is [PCD,
>                         LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS]
> 
>  The log file will show you a global view of what the PCDs got set to, and a 
> per
> driver view. It will also show the set of specific libraries linked into a 
> module.
> 
> Thanks,
> 
> Andrew Fish
> 
> 
> > Anyway, it seems like I've done the proper declaration (.DSC file
> > wise) Thanks again for the feedback.
> 

Bingo!
Under [LibraryClasses.common.PEIM], I now have:
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

Great tips on the .log file.
Thanks a bunch Andrew.
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

Reply via email to