Tim:
   Yes. This is an issue. We have a patch for it. After we finalize it, we will 
send it for code review. 

Thanks
Liming
-----Original Message-----
From: Tim Lewis [mailto:[email protected]] 
Sent: Tuesday, August 06, 2013 1:36 AM
To: [email protected]
Subject: [edk2] PCD Database Issue #2: Same PCD Name, Different GUID C Name 
Collision

When multiple PCDs (DynamicEx) exist in the PCD database which have different 
GUIDs but the same C name (i.e. GuidCName1.PcdName and GuidCName2.PcdName) and 
there is an attempt to access both from inside the same driver's INF, the 
generated .h file contains name collision.

For example, in one .dec we create three different VOID * structures. Below 
that is the generated .h file. Notice that 
_PCD_GET_MODE_PTR_PcdAtmelAt26df041Spi is defined three times. 

But the PI PCD specification says that the token number is unique within the 
GUID name space. And the EDK2 specification document makes no mention of any 
such restriction, saying rather that: "Every PCD (PcdName) is identified by a 
two part definition - the PCD's Token Space Guid CName and the PCD CName. These 
two parts are separated by a period "." character."

Furthermore, the tools do not generate an error in this case. It is only 
discovered during compilation of the source files.

Tim

  gH2OFlashDeviceMfrNameGuid.PcdAtmelAt26df041Spi|"Atmel"|VOID*|0x0000441F
  gH2OFlashDevicePartNameGuid.PcdAtmelAt26df041Spi|"AT26DF041"|VOID*|0x0000441F
  gH2OFlashDeviceConfigGuid.PcdAtmelAt26df041Spi|{0}|VOID*|0x0000441F           
    # to be defined in DSC

#define _PCD_TOKEN_PcdAtmelAt26df041Spi  17439U #define 
_PCD_GET_MODE_PTR_PcdAtmelAt26df041Spi  
LibPcdGetExPtr(&gH2OFlashDeviceMfrNameGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi) 
#define _PCD_SET_MODE_PTR_PcdAtmelAt26df041Spi(SizeOfBuffer, Buffer)  
LibPcdSetExPtr(&gH2OFlashDeviceMfrNameGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi, 
(SizeOfBuffer), (Buffer))

#define _PCD_TOKEN_PcdAtmelAt26df041Spi  17439U #define 
_PCD_GET_MODE_PTR_PcdAtmelAt26df041Spi  
LibPcdGetExPtr(&gH2OFlashDevicePartNameGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi) 
#define _PCD_SET_MODE_PTR_PcdAtmelAt26df041Spi(SizeOfBuffer, Buffer)  
LibPcdSetExPtr(&gH2OFlashDevicePartNameGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi, 
(SizeOfBuffer), (Buffer))

#define _PCD_TOKEN_PcdAtmelAt26df041Spi  17439U #define 
_PCD_GET_MODE_PTR_PcdAtmelAt26df041Spi  
LibPcdGetExPtr(&gH2OFlashDeviceConfigGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi) 
#define _PCD_SET_MODE_PTR_PcdAtmelAt26df041Spi(SizeOfBuffer, Buffer)  
LibPcdSetExPtr(&gH2OFlashDeviceConfigGuid, _PCD_TOKEN_PcdAtmelAt26df041Spi, 
(SizeOfBuffer), (Buffer))



------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent caught 
up. So what steps can you take to put your SQL databases under version control? 
Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to