public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* PCD EX interface.
@ 2020-01-23  1:37 Ken Taylor
  2020-01-23 11:21 ` [edk2-devel] " Laszlo Ersek
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Taylor @ 2020-01-23  1:37 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 4431 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-24 10:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-23  1:37 PCD EX interface Ken Taylor
2020-01-23 11:21 ` [edk2-devel] " Laszlo Ersek
2020-01-23 21:08   ` Andrew Fish
2020-01-24 10:14     ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox