On Wed, Oct 22, 2014 at 07:42:21PM +0200, Laszlo Ersek wrote:
> On 10/22/14 18:24, Gabriel Somlo wrote:
> > I managed to add (and write to) a dynamic PCD from OVMF PEI:
> > 
> > 
> > OvmfPkg/OvmfPkg.dec:
> >  [PcdsDynamic, PcdsDynamicEx]
> >    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0|UINT16|0x1b
> > 
> > 
> > OvmfPkg/OvmfPkgX64.dsc:
> >  [PcdsDynamicDefault]
> >    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId|0
> > 
> > 
> > OvmfPkg/PlatformPei/PlatformPei.inf
> >  [Pcd]
> >    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
> > 
> > 
> > OvmfPkg/PlatformPei/Platform.c
> > 
> >   UINT16 HostBridgeDevId;
> >   ...
> >   PcdSet16 (PcdOvmfHostBridgePciDevId, HostBridgeDevId);
> > 
> > 
> > 
> > After doing this, things build just fine. But after further adding:
> > 
> > 
> > OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf:
> >  [Pcd]
> >    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
> > 
> > 
> > OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c:
> >   ...
> >   HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId);
> >   ...
> > 
> > 
> > I now get this error:
> > /home/somlo/KVM-OSX/SCRATCH/edk2/MdePkg/Include/Library/PcdLib.h:377:45:
> > error: `_PCD_GET_MODE_16_PcdOvmfHostBridgePciDevId' undeclared (first
> > use in this function)
> >  #define PcdGet16(TokenName)
> > _PCD_GET_MODE_16_##TokenName
> 
> Did you add PcdLib under [LibraryClasses] in
> "OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf"?
> 
> The PcdGet16() macro should expand to a library call -- LibPcdGet16() --
> which would internally use the PCD protocol. This macro definition would
> be generated by "BaseTools/Source/Python/AutoGen/GenC.py" during the build.

Doing that didn't help, getting the exact same error.

Besides, PcdGet16 (PcdAcpiPmBaseAddress) in the current version of
AcpiTimerLib.c seems to work fine with no PcdLib in AcpiTimerLib.inf, 
and now I wonder how come :)

Thanks,
--Gabriel

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

Reply via email to