Hi all,

I'm trying to access a PCD in a build independent manner.  Specifically, moving 
forward, I want to write a PCD value in my BIOS code during PEI phase, and then 
read back the value of that PCD in a build independent shell utility (or 
identify and report situations in which the PCD is not found).  I figure this 
is a good time to use [PcdsDynamicEx] in the build, because standard PCDs are 
assigned a build specific token, which kind of defeats my purpose.

At first, everything seemed to be working okay.  A call to PcdGetEx8 returned 0 
on a build in which the PCD was undefined.  Then I tried a build in which I 
wrote the PCD, and I got back a random number other than 0 or what I'd written 
to the PCD in the BIOS.  Then, I decided to try PcdGetExSize to see if the PCD 
was even defined properly defined... at which point my shell utility locked up.

So a little debugging later, and I discover that I'm hitting an ASSERT because 
the GUID my utility is passing to the DXE PCD service isn't being found in the 
list of GUIDs.  Probably an error in my build or build tool configuration, so 
I'll have to sort that out.  That's on me.

But now I've got a problem:

If I try to get the size of a DynamicEx PCD in the context of a BIOS build for 
which that PCD is undefined, the call locks up.  I expected to just get a size 
of 0, since the PCD is not defined in the build context of the PCD DXE service. 
 Is this a problem that's been fixed since my BIOS source code was cut?  What 
can I do for older builds that haven't been fixed (and probably never will)?  
Do I have to just accept that I'm going to get garbage or lockup if I run my 
shell utility on some builds?  Do I have to write a DXE driver and expose a 
protocol, just so I can know if that PCD exists and is properly defined?

Is the idea that I might want to do this unreasonable?  Should I just give up 
and use a HOB or a variable?

Regards,
-Ken.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53435): https://edk2.groups.io/g/devel/message/53435
Mute This Topic: https://groups.io/mt/70044584/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to