[edk2-devel] How to assign NULL to a VOID* PCD?

Michael D Kinney michael.d.kinney at intel.com
Wed Dec 16 23:22:24 UTC 2020


Hi Tim,

With the current design the smallest possible VOID* PCD is 1 byte.  PcdGetSize() can be used the determine the size.  Does that work or do you need some new fetures?

You are welcome to enter some feature requests for this and we can see if this can be supported by the build tools in a backwards compatible manner.

Best regards,

Mike

From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Tim Lewis
Sent: Wednesday, December 16, 2020 1:30 PM
To: Kinney, Michael D <michael.d.kinney at intel.com>; devel at edk2.groups.io
Subject: Re: [edk2-devel] How to assign NULL to a VOID* PCD?

Mike –
I understand, but this just adds another layer of complexity. For example, we had a list of exception numbers (0x00-0xff) and then had to move away from UINT8 because it couldn’t hold a terminating or illegal value. We prefer to use PcdGetSize. It may be something we will change in our own codebase.

Tim

From: Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>
Sent: Wednesday, December 16, 2020 1:28 PM
To: devel at edk2.groups.io<mailto:devel at edk2.groups.io>; tim.lewis at insyde.com<mailto:tim.lewis at insyde.com>; Kinney, Michael D <michael.d.kinney at intel.com<mailto:michael.d.kinney at intel.com>>
Subject: RE: [edk2-devel] How to assign NULL to a VOID* PCD?

Hi Tim,

Assigning NULL to a VOID* PCD is not supported.

I recommend you design the structure that the VOID* type PCD points to be self describing.  You can put a count field or if it is an array, use can use a tag in a field to mark the end of the array.

Mike

From: devel at edk2.groups.io<mailto:devel at edk2.groups.io> <devel at edk2.groups.io<mailto:devel at edk2.groups.io>> On Behalf Of Tim Lewis
Sent: Wednesday, December 16, 2020 11:06 AM
To: devel at edk2.groups.io<mailto:devel at edk2.groups.io>
Subject: [edk2-devel] How to assign NULL to a VOID* PCD?

I want the PCD database to contain a NULL to a PCD that is of type VOID* but this does not seem to be allowed in the .dsc files.

In .dec files, I can assign an <Expression> for the value, which lets me put a 0. But the syntax for .dsc files only lets me put data. So for array cases where I want 0 entries, I am always forced to put at least 1 dummy entry. Normally, I would like to use PcdGetSize to get the total array size.

Any pointers?

Thanks,

Tim



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69063): https://edk2.groups.io/g/devel/message/69063
Mute This Topic: https://groups.io/mt/79019311/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20201216/fcf13313/attachment.htm>


More information about the edk2-devel-archive mailing list