public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"tim.lewis@insyde.com" <tim.lewis@insyde.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] How to assign NULL to a VOID* PCD?
Date: Wed, 16 Dec 2020 23:22:24 +0000	[thread overview]
Message-ID: <BL0PR11MB3236B2255E628B9AE6E5730BD2C50@BL0PR11MB3236.namprd11.prod.outlook.com> (raw)
In-Reply-To: <04b301d6d3f2$a107aef0$e3170cd0$@insyde.com>

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

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@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tim Lewis
Sent: Wednesday, December 16, 2020 1:30 PM
To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@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@intel.com<mailto:michael.d.kinney@intel.com>>
Sent: Wednesday, December 16, 2020 1:28 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; tim.lewis@insyde.com<mailto:tim.lewis@insyde.com>; Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@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@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Tim Lewis
Sent: Wednesday, December 16, 2020 11:06 AM
To: devel@edk2.groups.io<mailto:devel@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


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

  reply	other threads:[~2020-12-16 23:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 19:05 How to assign NULL to a VOID* PCD? Tim Lewis
2020-12-16 21:28 ` [edk2-devel] " Michael D Kinney
2020-12-16 21:30   ` Tim Lewis
2020-12-16 23:22     ` Michael D Kinney [this message]
2020-12-17  0:06       ` Tim Lewis
2020-12-17  0:56         ` 回复: " gaoliming
2020-12-17  1:03           ` Tim Lewis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL0PR11MB3236B2255E628B9AE6E5730BD2C50@BL0PR11MB3236.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox