VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Pcd.c

    r58459 r58466  
    2323
    2424///
    25 /// PCD_PROTOCOL the EDKII native implementation which support dynamic 
     25/// PCD_PROTOCOL the EDKII native implementation which support dynamic
    2626/// type and dynamicEx type PCDs.
    2727///
     
    113113/**
    114114  Main entry for PCD DXE driver.
    115  
     115
    116116  This routine initialize the PCD database and install PCD_PROTOCOL.
    117  
     117
    118118  @param ImageHandle     Image handle for PCD DXE driver.
    119119  @param SystemTable     Pointer to SystemTable.
     
    130130{
    131131  EFI_STATUS Status;
    132  
     132
    133133  //
    134134  // Make sure the Pcd Protocol is not already installed in the system
     
    152152
    153153  //
    154   // Only install PcdInfo PROTOCOL when PCD info content is present. 
     154  // Only install PcdInfo PROTOCOL when PCD info content is present.
    155155  //
    156156  if (mPcdDatabase.DxeDb->PcdNameTableOffset != 0) {
     
    238238  Sets the SKU value for subsequent calls to set or get PCD token values.
    239239
    240   SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. 
     240  SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
    241241  SetSku() is normally called only once by the system.
    242242
    243   For each item (token), the database can hold a single value that applies to all SKUs, 
    244   or multiple values, where each value is associated with a specific SKU Id. Items with multiple, 
    245   SKU-specific values are called SKU enabled. 
    246  
    247   The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. 
    248   For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the 
    249   single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the 
    250   last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, 
    251   the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been 
     243  For each item (token), the database can hold a single value that applies to all SKUs,
     244  or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
     245  SKU-specific values are called SKU enabled.
     246
     247  The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
     248  For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
     249  single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
     250  last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
     251  the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
    252252  set for that Id, the results are unpredictable.
    253253
    254   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and 
     254  @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and
    255255              set values associated with a PCD token.
    256256
     
    263263{
    264264  mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId;
    265  
     265
    266266  return;
    267267}
     
    270270  Retrieves an 8-bit value for a given PCD token.
    271271
    272   Retrieves the current byte-sized value for a PCD token number. 
     272  Retrieves the current byte-sized value for a PCD token number.
    273273  If the TokenNumber is invalid, the results are unpredictable.
    274  
    275   @param[in]  TokenNumber The PCD token number. 
     274
     275  @param[in]  TokenNumber The PCD token number.
    276276
    277277  @return The UINT8 value.
    278  
     278
    279279**/
    280280UINT8
     
    290290  Retrieves an 16-bit value for a given PCD token.
    291291
    292   Retrieves the current 16-bits value for a PCD token number. 
     292  Retrieves the current 16-bits value for a PCD token number.
    293293  If the TokenNumber is invalid, the results are unpredictable.
    294  
    295   @param[in]  TokenNumber The PCD token number. 
     294
     295  @param[in]  TokenNumber The PCD token number.
    296296
    297297  @return The UINT16 value.
    298  
     298
    299299**/
    300300UINT16
     
    310310  Retrieves an 32-bit value for a given PCD token.
    311311
    312   Retrieves the current 32-bits value for a PCD token number. 
     312  Retrieves the current 32-bits value for a PCD token number.
    313313  If the TokenNumber is invalid, the results are unpredictable.
    314  
    315   @param[in]  TokenNumber The PCD token number. 
     314
     315  @param[in]  TokenNumber The PCD token number.
    316316
    317317  @return The UINT32 value.
    318  
     318
    319319**/
    320320UINT32
     
    330330  Retrieves an 64-bit value for a given PCD token.
    331331
    332   Retrieves the current 64-bits value for a PCD token number. 
     332  Retrieves the current 64-bits value for a PCD token number.
    333333  If the TokenNumber is invalid, the results are unpredictable.
    334  
    335   @param[in]  TokenNumber The PCD token number. 
     334
     335  @param[in]  TokenNumber The PCD token number.
    336336
    337337  @return The UINT64 value.
    338  
     338
    339339**/
    340340UINT64
     
    350350  Retrieves a pointer to a value for a given PCD token.
    351351
    352   Retrieves the current pointer to the buffer for a PCD token number. 
    353   Do not make any assumptions about the alignment of the pointer that 
    354   is returned by this function call.  If the TokenNumber is invalid, 
     352  Retrieves the current pointer to the buffer for a PCD token number.
     353  Do not make any assumptions about the alignment of the pointer that
     354  is returned by this function call.  If the TokenNumber is invalid,
    355355  the results are unpredictable.
    356356
    357   @param[in]  TokenNumber The PCD token number. 
     357  @param[in]  TokenNumber The PCD token number.
    358358
    359359  @return The pointer to the buffer to be retrived.
    360  
     360
    361361**/
    362362VOID *
     
    372372  Retrieves a Boolean value for a given PCD token.
    373373
    374   Retrieves the current boolean value for a PCD token number. 
    375   Do not make any assumptions about the alignment of the pointer that 
    376   is returned by this function call.  If the TokenNumber is invalid, 
     374  Retrieves the current boolean value for a PCD token number.
     375  Do not make any assumptions about the alignment of the pointer that
     376  is returned by this function call.  If the TokenNumber is invalid,
    377377  the results are unpredictable.
    378378
    379   @param[in]  TokenNumber The PCD token number. 
     379  @param[in]  TokenNumber The PCD token number.
    380380
    381381  @return The Boolean value.
    382  
     382
    383383**/
    384384BOOLEAN
     
    394394  Retrieves the size of the value for a given PCD token.
    395395
    396   Retrieves the current size of a particular PCD token. 
     396  Retrieves the current size of a particular PCD token.
    397397  If the TokenNumber is invalid, the results are unpredictable.
    398398
    399   @param[in]  TokenNumber The PCD token number. 
     399  @param[in]  TokenNumber The PCD token number.
    400400
    401401  @return The size of the value for the PCD token.
    402  
     402
    403403**/
    404404UINTN
     
    422422  //
    423423  // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
    424   // 
     424  //
    425425  TmpTokenNumber = TokenNumber;
    426426
    427427  // EBC compiler is very choosy. It may report warning about comparison
    428   // between UINTN and 0 . So we add 1 in each size of the 
     428  // between UINTN and 0 . So we add 1 in each size of the
    429429  // comparison.
    430430  ASSERT (TokenNumber + 1 < mPcdTotalTokenCount + 1);
    431431
    432432  // EBC compiler is very choosy. It may report warning about comparison
    433   // between UINTN and 0 . So we add 1 in each size of the 
     433  // between UINTN and 0 . So we add 1 in each size of the
    434434  // comparison.
    435435  IsPeiDb = (BOOLEAN) (TokenNumber + 1 < mPeiLocalTokenCount + 1);
    436  
    437   TokenNumber = IsPeiDb ? TokenNumber : 
     436
     437  TokenNumber = IsPeiDb ? TokenNumber :
    438438                          (TokenNumber - mPeiLocalTokenCount);
    439439
    440   LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) 
     440  LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset)
    441441                                  : (UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
    442442
     
    457457  Retrieves an 8-bit value for a given PCD token.
    458458
    459   Retrieves the 8-bit value of a particular PCD token. 
     459  Retrieves the 8-bit value of a particular PCD token.
    460460  If the TokenNumber is invalid or the token space
    461   specified by Guid does not exist, the results are 
     461  specified by Guid does not exist, the results are
    462462  unpredictable.
    463463
    464464  @param[in]  Guid          The token space for the token number.
    465   @param[in]  ExTokenNumber The PCD token number. 
     465  @param[in]  ExTokenNumber The PCD token number.
    466466
    467467  @return The size 8-bit value for the PCD token.
    468  
     468
    469469**/
    470470UINT8
     
    481481  Retrieves an 16-bit value for a given PCD token.
    482482
    483   Retrieves the 16-bit value of a particular PCD token. 
     483  Retrieves the 16-bit value of a particular PCD token.
    484484  If the TokenNumber is invalid or the token space
    485   specified by Guid does not exist, the results are 
     485  specified by Guid does not exist, the results are
    486486  unpredictable.
    487487
    488488  @param[in]  Guid The token space for the token number.
    489   @param[in]  ExTokenNumber The PCD token number. 
     489  @param[in]  ExTokenNumber The PCD token number.
    490490
    491491  @return The size 16-bit value for the PCD token.
    492  
     492
    493493**/
    494494UINT16
     
    505505  Retrieves an 32-bit value for a given PCD token.
    506506
    507   Retrieves the 32-bit value of a particular PCD token. 
     507  Retrieves the 32-bit value of a particular PCD token.
    508508  If the TokenNumber is invalid or the token space
    509   specified by Guid does not exist, the results are 
     509  specified by Guid does not exist, the results are
    510510  unpredictable.
    511511
    512512  @param[in]  Guid The token space for the token number.
    513   @param[in]  ExTokenNumber The PCD token number. 
     513  @param[in]  ExTokenNumber The PCD token number.
    514514
    515515  @return The size 32-bit value for the PCD token.
    516  
     516
    517517**/
    518518UINT32
     
    529529  Retrieves an 64-bit value for a given PCD token.
    530530
    531   Retrieves the 64-bit value of a particular PCD token. 
     531  Retrieves the 64-bit value of a particular PCD token.
    532532  If the TokenNumber is invalid or the token space
    533   specified by Guid does not exist, the results are 
     533  specified by Guid does not exist, the results are
    534534  unpredictable.
    535535
    536536  @param[in]  Guid The token space for the token number.
    537   @param[in]  ExTokenNumber The PCD token number. 
     537  @param[in]  ExTokenNumber The PCD token number.
    538538
    539539  @return The size 64-bit value for the PCD token.
    540  
     540
    541541**/
    542542UINT64
     
    553553  Retrieves a pointer to a value for a given PCD token.
    554554
    555   Retrieves the current pointer to the buffer for a PCD token number. 
    556   Do not make any assumptions about the alignment of the pointer that 
    557   is returned by this function call.  If the TokenNumber is invalid, 
     555  Retrieves the current pointer to the buffer for a PCD token number.
     556  Do not make any assumptions about the alignment of the pointer that
     557  is returned by this function call.  If the TokenNumber is invalid,
    558558  the results are unpredictable.
    559559
    560560  @param[in]  Guid The token space for the token number.
    561   @param[in]  ExTokenNumber The PCD token number. 
     561  @param[in]  ExTokenNumber The PCD token number.
    562562
    563563  @return The pointer to the buffer to be retrived.
    564  
     564
    565565**/
    566566VOID *
     
    577577  Retrieves an Boolean value for a given PCD token.
    578578
    579   Retrieves the Boolean value of a particular PCD token. 
     579  Retrieves the Boolean value of a particular PCD token.
    580580  If the TokenNumber is invalid or the token space
    581   specified by Guid does not exist, the results are 
     581  specified by Guid does not exist, the results are
    582582  unpredictable.
    583583
    584584  @param[in]  Guid The token space for the token number.
    585   @param[in]  ExTokenNumber The PCD token number. 
     585  @param[in]  ExTokenNumber The PCD token number.
    586586
    587587  @return The size Boolean value for the PCD token.
    588  
     588
    589589**/
    590590BOOLEAN
     
    601601  Retrieves the size of the value for a given PCD token.
    602602
    603   Retrieves the current size of a particular PCD token. 
     603  Retrieves the current size of a particular PCD token.
    604604  If the TokenNumber is invalid, the results are unpredictable.
    605605
    606606  @param[in]  Guid The token space for the token number.
    607   @param[in]  ExTokenNumber The PCD token number. 
     607  @param[in]  ExTokenNumber The PCD token number.
    608608
    609609  @return The size of the value for the PCD token.
    610  
     610
    611611**/
    612612UINTN
     
    623623  Sets an 8-bit value for a given PCD token.
    624624
    625   When the PCD service sets a value, it will check to ensure that the 
    626   size of the value being set is compatible with the Token's existing definition. 
     625  When the PCD service sets a value, it will check to ensure that the
     626  size of the value being set is compatible with the Token's existing definition.
    627627  If it is not, an error will be returned.
    628628
    629   @param[in]  TokenNumber The PCD token number. 
     629  @param[in]  TokenNumber The PCD token number.
    630630  @param[in]  Value The value to set for the PCD token.
    631631
    632632  @retval EFI_SUCCESS  Procedure returned successfully.
    633   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    634                                   being set was incompatible with a call to this function. 
     633  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     634                                  being set was incompatible with a call to this function.
    635635                                  Use GetSize() to retrieve the size of the target data.
    636636  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    637  
     637
    638638**/
    639639EFI_STATUS
     
    650650  Sets an 16-bit value for a given PCD token.
    651651
    652   When the PCD service sets a value, it will check to ensure that the 
    653   size of the value being set is compatible with the Token's existing definition. 
     652  When the PCD service sets a value, it will check to ensure that the
     653  size of the value being set is compatible with the Token's existing definition.
    654654  If it is not, an error will be returned.
    655655
    656   @param[in]  TokenNumber The PCD token number. 
     656  @param[in]  TokenNumber The PCD token number.
    657657  @param[in]  Value The value to set for the PCD token.
    658658
    659659  @retval EFI_SUCCESS  Procedure returned successfully.
    660   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    661                                   being set was incompatible with a call to this function. 
     660  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     661                                  being set was incompatible with a call to this function.
    662662                                  Use GetSize() to retrieve the size of the target data.
    663663  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    664  
     664
    665665**/
    666666EFI_STATUS
     
    677677  Sets an 32-bit value for a given PCD token.
    678678
    679   When the PCD service sets a value, it will check to ensure that the 
    680   size of the value being set is compatible with the Token's existing definition. 
     679  When the PCD service sets a value, it will check to ensure that the
     680  size of the value being set is compatible with the Token's existing definition.
    681681  If it is not, an error will be returned.
    682682
    683   @param[in]  TokenNumber The PCD token number. 
     683  @param[in]  TokenNumber The PCD token number.
    684684  @param[in]  Value The value to set for the PCD token.
    685685
    686686  @retval EFI_SUCCESS  Procedure returned successfully.
    687   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    688                                   being set was incompatible with a call to this function. 
     687  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     688                                  being set was incompatible with a call to this function.
    689689                                  Use GetSize() to retrieve the size of the target data.
    690690  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    691  
     691
    692692**/
    693693EFI_STATUS
     
    704704  Sets an 64-bit value for a given PCD token.
    705705
    706   When the PCD service sets a value, it will check to ensure that the 
    707   size of the value being set is compatible with the Token's existing definition. 
     706  When the PCD service sets a value, it will check to ensure that the
     707  size of the value being set is compatible with the Token's existing definition.
    708708  If it is not, an error will be returned.
    709709
    710   @param[in]  TokenNumber The PCD token number. 
     710  @param[in]  TokenNumber The PCD token number.
    711711  @param[in]  Value The value to set for the PCD token.
    712712
    713713  @retval EFI_SUCCESS  Procedure returned successfully.
    714   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    715                                   being set was incompatible with a call to this function. 
     714  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     715                                  being set was incompatible with a call to this function.
    716716                                  Use GetSize() to retrieve the size of the target data.
    717717  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    718  
     718
    719719**/
    720720EFI_STATUS
     
    731731  Sets a value of a specified size for a given PCD token.
    732732
    733   When the PCD service sets a value, it will check to ensure that the 
    734   size of the value being set is compatible with the Token's existing definition. 
     733  When the PCD service sets a value, it will check to ensure that the
     734  size of the value being set is compatible with the Token's existing definition.
    735735  If it is not, an error will be returned.
    736736
    737   @param[in]  TokenNumber The PCD token number. 
    738   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    739                               On input, if the SizeOfValue is greater than the maximum size supported 
    740                               for this TokenNumber then the output value of SizeOfValue will reflect 
     737  @param[in]  TokenNumber The PCD token number.
     738  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     739                              On input, if the SizeOfValue is greater than the maximum size supported
     740                              for this TokenNumber then the output value of SizeOfValue will reflect
    741741                              the maximum size supported for this TokenNumber.
    742742  @param[in]  Buffer The buffer to set for the PCD token.
    743743
    744744  @retval EFI_SUCCESS  Procedure returned successfully.
    745   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    746                                   being set was incompatible with a call to this function. 
     745  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     746                                  being set was incompatible with a call to this function.
    747747                                  Use GetSize() to retrieve the size of the target data.
    748748  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    749  
     749
    750750**/
    751751EFI_STATUS
     
    763763  Sets an Boolean value for a given PCD token.
    764764
    765   When the PCD service sets a value, it will check to ensure that the 
    766   size of the value being set is compatible with the Token's existing definition. 
     765  When the PCD service sets a value, it will check to ensure that the
     766  size of the value being set is compatible with the Token's existing definition.
    767767  If it is not, an error will be returned.
    768768
    769   @param[in]  TokenNumber The PCD token number. 
     769  @param[in]  TokenNumber The PCD token number.
    770770  @param[in]  Value The value to set for the PCD token.
    771771
    772772  @retval EFI_SUCCESS  Procedure returned successfully.
    773   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    774                                   being set was incompatible with a call to this function. 
     773  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     774                                  being set was incompatible with a call to this function.
    775775                                  Use GetSize() to retrieve the size of the target data.
    776776  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    777  
     777
    778778**/
    779779EFI_STATUS
     
    790790  Sets an 8-bit value for a given PCD token.
    791791
    792   When the PCD service sets a value, it will check to ensure that the 
    793   size of the value being set is compatible with the Token's existing definition. 
     792  When the PCD service sets a value, it will check to ensure that the
     793  size of the value being set is compatible with the Token's existing definition.
    794794  If it is not, an error will be returned.
    795795
    796796  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    797   @param[in]  ExTokenNumber The PCD token number. 
     797  @param[in]  ExTokenNumber The PCD token number.
    798798  @param[in]  Value The value to set for the PCD token.
    799799
    800800  @retval EFI_SUCCESS  Procedure returned successfully.
    801   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    802                                   being set was incompatible with a call to this function. 
     801  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     802                                  being set was incompatible with a call to this function.
    803803                                  Use GetSize() to retrieve the size of the target data.
    804804  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    805  
     805
    806806**/
    807807EFI_STATUS
     
    819819  Sets an 16-bit value for a given PCD token.
    820820
    821   When the PCD service sets a value, it will check to ensure that the 
    822   size of the value being set is compatible with the Token's existing definition. 
     821  When the PCD service sets a value, it will check to ensure that the
     822  size of the value being set is compatible with the Token's existing definition.
    823823  If it is not, an error will be returned.
    824824
    825825  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    826   @param[in]  ExTokenNumber The PCD token number. 
     826  @param[in]  ExTokenNumber The PCD token number.
    827827  @param[in]  Value The value to set for the PCD token.
    828828
    829829  @retval EFI_SUCCESS  Procedure returned successfully.
    830   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    831                                   being set was incompatible with a call to this function. 
     830  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     831                                  being set was incompatible with a call to this function.
    832832                                  Use GetSize() to retrieve the size of the target data.
    833833  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    834  
     834
    835835**/
    836836EFI_STATUS
     
    848848  Sets an 32-bit value for a given PCD token.
    849849
    850   When the PCD service sets a value, it will check to ensure that the 
    851   size of the value being set is compatible with the Token's existing definition. 
     850  When the PCD service sets a value, it will check to ensure that the
     851  size of the value being set is compatible with the Token's existing definition.
    852852  If it is not, an error will be returned.
    853853
    854854  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    855   @param[in]  ExTokenNumber The PCD token number. 
     855  @param[in]  ExTokenNumber The PCD token number.
    856856  @param[in]  Value The value to set for the PCD token.
    857857
    858858  @retval EFI_SUCCESS  Procedure returned successfully.
    859   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    860                                   being set was incompatible with a call to this function. 
     859  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     860                                  being set was incompatible with a call to this function.
    861861                                  Use GetSize() to retrieve the size of the target data.
    862862  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    863  
     863
    864864**/
    865865EFI_STATUS
     
    877877  Sets an 64-bit value for a given PCD token.
    878878
    879   When the PCD service sets a value, it will check to ensure that the 
    880   size of the value being set is compatible with the Token's existing definition. 
     879  When the PCD service sets a value, it will check to ensure that the
     880  size of the value being set is compatible with the Token's existing definition.
    881881  If it is not, an error will be returned.
    882882
    883883  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    884   @param[in]  ExTokenNumber The PCD token number. 
     884  @param[in]  ExTokenNumber The PCD token number.
    885885  @param[in]  Value The value to set for the PCD token.
    886886
    887887  @retval EFI_SUCCESS  Procedure returned successfully.
    888   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    889                                   being set was incompatible with a call to this function. 
     888  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     889                                  being set was incompatible with a call to this function.
    890890                                  Use GetSize() to retrieve the size of the target data.
    891891  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    892  
     892
    893893**/
    894894EFI_STATUS
     
    906906  Sets a value of a specified size for a given PCD token.
    907907
    908   When the PCD service sets a value, it will check to ensure that the 
    909   size of the value being set is compatible with the Token's existing definition. 
     908  When the PCD service sets a value, it will check to ensure that the
     909  size of the value being set is compatible with the Token's existing definition.
    910910  If it is not, an error will be returned.
    911911
    912912  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    913   @param[in]  ExTokenNumber The PCD token number. 
    914   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    915                               On input, if the SizeOfValue is greater than the maximum size supported 
    916                               for this TokenNumber then the output value of SizeOfValue will reflect 
     913  @param[in]  ExTokenNumber The PCD token number.
     914  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     915                              On input, if the SizeOfValue is greater than the maximum size supported
     916                              for this TokenNumber then the output value of SizeOfValue will reflect
    917917                              the maximum size supported for this TokenNumber.
    918918  @param[in]  Buffer The buffer to set for the PCD token.
    919919
    920920  @retval EFI_SUCCESS  Procedure returned successfully.
    921   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    922                                   being set was incompatible with a call to this function. 
     921  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     922                                  being set was incompatible with a call to this function.
    923923                                  Use GetSize() to retrieve the size of the target data.
    924924  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    925  
     925
    926926**/
    927927EFI_STATUS
     
    940940  Sets an Boolean value for a given PCD token.
    941941
    942   When the PCD service sets a value, it will check to ensure that the 
    943   size of the value being set is compatible with the Token's existing definition. 
     942  When the PCD service sets a value, it will check to ensure that the
     943  size of the value being set is compatible with the Token's existing definition.
    944944  If it is not, an error will be returned.
    945945
    946946  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    947   @param[in]  ExTokenNumber The PCD token number. 
     947  @param[in]  ExTokenNumber The PCD token number.
    948948  @param[in]  Value The value to set for the PCD token.
    949949
    950950  @retval EFI_SUCCESS  Procedure returned successfully.
    951   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    952                                   being set was incompatible with a call to this function. 
     951  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     952                                  being set was incompatible with a call to this function.
    953953                                  Use GetSize() to retrieve the size of the target data.
    954954  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    955  
     955
    956956**/
    957957EFI_STATUS
     
    970970
    971971  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    972   @param[in]  TokenNumber The PCD token number. 
    973   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    974 
    975   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     972  @param[in]  TokenNumber The PCD token number.
     973  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     974
     975  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    976976                        for the CallBackToken requested.
    977977  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    987987{
    988988  EFI_STATUS Status;
    989  
     989
    990990  if (CallBackFunction == NULL) {
    991991    return EFI_INVALID_PARAMETER;
     
    999999
    10001000  EfiReleaseLock (&mPcdDatabaseLock);
    1001  
     1001
    10021002  return Status;
    10031003}
     
    10071007
    10081008  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    1009   @param[in]  TokenNumber The PCD token number. 
    1010   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    1011 
    1012   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     1009  @param[in]  TokenNumber The PCD token number.
     1010  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     1011
     1012  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    10131013                        for the CallBackToken requested.
    10141014  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    10241024{
    10251025  EFI_STATUS Status;
    1026  
     1026
    10271027  if (CallBackFunction == NULL) {
    10281028    return EFI_INVALID_PARAMETER;
     
    10331033  //
    10341034  EfiAcquireLock (&mPcdDatabaseLock);
    1035  
     1035
    10361036  Status = DxeUnRegisterCallBackWorker (TokenNumber, Guid, CallBackFunction);
    10371037
    10381038  EfiReleaseLock (&mPcdDatabaseLock);
    1039  
     1039
    10401040  return Status;
    10411041}
    10421042
    10431043/**
    1044   Retrieves the next valid token number in a given namespace. 
    1045  
    1046   This is useful since the PCD infrastructure contains a sparse list of token numbers, 
    1047   and one cannot a priori know what token numbers are valid in the database. 
    1048  
    1049   If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. 
    1050   If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. 
    1051   If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. 
    1052   If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. 
    1053   The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. 
    1054   If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. 
    1055   If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. 
     1044  Retrieves the next valid token number in a given namespace.
     1045
     1046  This is useful since the PCD infrastructure contains a sparse list of token numbers,
     1047  and one cannot a priori know what token numbers are valid in the database.
     1048
     1049  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
     1050  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
     1051  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
     1052  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
     1053  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
     1054  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
     1055  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    10561056  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    10571057
    10581058
    1059   @param[in]      Guid    The 128-bit unique value that designates the namespace from which to retrieve the next token. 
    1060                           This is an optional parameter that may be NULL.  If this parameter is NULL, then a request is 
     1059  @param[in]      Guid    The 128-bit unique value that designates the namespace from which to retrieve the next token.
     1060                          This is an optional parameter that may be NULL.  If this parameter is NULL, then a request is
    10611061                          being made to retrieve tokens from the default token space.
    1062   @param[in, out] TokenNumber 
    1063                           A pointer to the PCD token number to use to find the subsequent token number. 
     1062  @param[in, out] TokenNumber
     1063                          A pointer to the PCD token number to use to find the subsequent token number.
    10641064
    10651065  @retval EFI_SUCCESS   The PCD service has retrieved the next valid token number.
     
    10871087  if (Guid == NULL) {
    10881088    // EBC compiler is very choosy. It may report warning about comparison
    1089     // between UINTN and 0 . So we add 1 in each size of the 
     1089    // between UINTN and 0 . So we add 1 in each size of the
    10901090    // comparison.
    10911091    if (((*TokenNumber + 1 > mPeiNexTokenCount + 1) && (*TokenNumber + 1 <= mPeiLocalTokenCount + 1)) ||
     
    10931093      return EFI_NOT_FOUND;
    10941094    }
    1095    
     1095
    10961096    (*TokenNumber)++;
    10971097    if ((*TokenNumber + 1 > mPeiNexTokenCount + 1) &&
    10981098        (*TokenNumber + 1 <= mPeiLocalTokenCount + 1)) {
    10991099      //
    1100       // The first Non-Ex type Token Number for DXE PCD 
     1100      // The first Non-Ex type Token Number for DXE PCD
    11011101      // database is mPeiLocalTokenCount + 1
    11021102      //
     
    12011201  *ExMapTableSize = TsIdx + 1;
    12021202  return DistinctTokenSpace;
    1203    
    1204 }
    1205  
     1203
     1204}
     1205
    12061206/**
    12071207  Retrieves the next valid PCD token namespace for a given namespace.
     
    12151215                            space of the current platform is returned. If the search cannot locate the next valid
    12161216                            token namespace, an error is returned and the value of *Guid is undefined.
    1217  
     1217
    12181218  @retval  EFI_SUCCESS      The PCD service retrieved the value requested.
    12191219  @retval  EFI_NOT_FOUND    The PCD service could not find the next valid token namespace.
     
    12381238
    12391239  ASSERT (Guid != NULL);
    1240  
     1240
    12411241  PeiExMapTableEmpty = mPeiExMapTableEmpty;
    12421242  DxeExMapTableEmpty = mDxeExMapTableEmpty;
     
    12451245    return EFI_NOT_FOUND;
    12461246  }
    1247  
     1247
    12481248  if (TmpTokenSpaceBuffer[0] == NULL) {
    12491249    PeiTokenSpaceTableSize = 0;
     
    12911291    return EFI_SUCCESS;
    12921292  }
    1293  
     1293
    12941294  for (Idx = 0; Idx < TmpTokenSpaceBufferCount; Idx++) {
    12951295    if (CompareGuid (*Guid, TmpTokenSpaceBuffer[Idx])) {
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

    r58459 r58466  
    22# PCD DXE driver manage database contains all dynamic PCD entries and produce the implementation of PCD protocol.
    33#
    4 # This version PCD DXE depends on the external PCD database binary file, not built in PCD data base. 
     4# This version PCD DXE depends on the external PCD database binary file, not built in PCD data base.
    55# There are two PCD Protocols as follows:
    6 #   1) PCD_PROTOCOL 
     6#   1) PCD_PROTOCOL
    77#      It is EDKII implementation which support Dynamic/DynamicEx type Pcds.
    88#   2) EFI_PCD_PROTOCOL
    9 #      It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 
     9#      It is defined by PI specification 1.2, Vol 3 which only support dynamicEx
    1010#      type Pcd.
    1111#
    12 # For dynamicEx type PCD, it is compatible between PCD_PROTOCOL and EFI_PCD_PROTOCOL. 
     12# For dynamicEx type PCD, it is compatible between PCD_PROTOCOL and EFI_PCD_PROTOCOL.
    1313# PCD DXE driver will produce above two protocols at same time.
    1414#
    15 # PCD database is generated as the separate binary image at build time. The binary image 
    16 # will be intergrated into Firmware volume together with PCD driver. 
     15# PCD database is generated as the separate binary image at build time. The binary image
     16# will be intergrated into Firmware volume together with PCD driver.
    1717#
    1818# ////////////////////////////////////////////////////////////////////////////////
     
    2323#
    2424# 1, Introduction
    25 #    PCD database hold all dynamic type PCD information. The structure of PEI PCD 
    26 #    database is generated by build tools according to dynamic PCD usage for 
     25#    PCD database hold all dynamic type PCD information. The structure of PEI PCD
     26#    database is generated by build tools according to dynamic PCD usage for
    2727#    specified platform.
    28 #   
     28#
    2929# 2, Dynamic Type PCD
    3030#    Dynamic type PCD is used for the configuration/setting which value is determined
    31 #    dynamic. In contrast, the value of static type PCD (FeatureFlag, FixedPcd, 
    32 #    PatchablePcd) is fixed in final generated FD image in build time. 
    33 #       
     31#    dynamic. In contrast, the value of static type PCD (FeatureFlag, FixedPcd,
     32#    PatchablePcd) is fixed in final generated FD image in build time.
     33#
    3434#    2.1 The "dynamic" determination means one of below cases:
    35 #      a) The PCD setting value is produced by someone driver and consumed by 
     35#      a) The PCD setting value is produced by someone driver and consumed by
    3636#         other driver in execution time.
    3737#      b) The PCD setting value is set/get by user from FrontPage.
    3838#      c) The PCD setting value is produced by platform OEM vendor in specified area.
    39 #   
     39#
    4040#    2.2 According to module distribution way, dynamic PCD could be classfied as:
    4141#      a) Dynamic:
    42 #         If module is released in source code and will be built with platform 
     42#         If module is released in source code and will be built with platform
    4343#         DSC, the dynamic PCD used by this module can be accessed as:
    44 #                 PcdGetxx(PcdSampleDynamicPcd); 
     44#                 PcdGetxx(PcdSampleDynamicPcd);
    4545#         In building platform, build tools will translate PcdSampleDynamicPcd to
    46 #         pair of {Token Space Guid: Token Number} for this PCD. 
     46#         pair of {Token Space Guid: Token Number} for this PCD.
    4747#      b) DynamicEx:
    4848#         If module is release as binary and will not pariticpate platform building,
     
    5151#         Developer need explicity gives {Token Space Guid:Token Number} as parameter
    5252#         in writting source code.
    53 #         
     53#
    5454#    2.3 According to PCD value's storage method, dynamic PCD could be classfied as:
    55 #      a) Default Storage: 
    56 #         - The PCD value is stored in PCD database maintained by PCD driver in boot 
     55#      a) Default Storage:
     56#         - The PCD value is stored in PCD database maintained by PCD driver in boot
    5757#           time memory.
    58 #         - This type is used for communication between PEIM/DXE driver, DXE/DXE 
    59 #           driver. But all set/get value will be losted after boot-time memory 
     58#         - This type is used for communication between PEIM/DXE driver, DXE/DXE
     59#           driver. But all set/get value will be losted after boot-time memory
    6060#           is turn off.
    61 #         - [PcdsDynamicDefault] is used as section name for this type PCD in 
     61#         - [PcdsDynamicDefault] is used as section name for this type PCD in
    6262#           platform DSC file. [PcdsDynamicExDefault] is used for dynamicEx type PCD.
    63 #         
    64 #      b) Variable Storage: 
    65 #         - The PCD value is stored in variable area. 
     63#
     64#      b) Variable Storage:
     65#         - The PCD value is stored in variable area.
    6666#         - As default storage type, this type PCD could be used for PEI/DXE driver
    67 #           communication. But beside it, this type PCD could also be used to store 
     67#           communication. But beside it, this type PCD could also be used to store
    6868#           the value associate with a HII setting via variable interface.
    69 #         - In PEI phase, the PCD value could only be got but can not be set due 
     69#         - In PEI phase, the PCD value could only be got but can not be set due
    7070#           to variable area is readonly.
    71 #         - [PcdsDynamicHii] is used as section name for this type PCD in platform 
     71#         - [PcdsDynamicHii] is used as section name for this type PCD in platform
    7272#           DSC file. [PcdsDynamicExHii] is for dynamicEx type PCD.
    73 #           
     73#
    7474#      c) OEM specificed storage area:
    75 #         - The PCD value is stored in OEM specified area which base address is 
     75#         - The PCD value is stored in OEM specified area which base address is
    7676#           specified by a FixedAtBuild PCD setting - PcdVpdBaseAddress.
    7777#         - The area is read only for PEI and DXE phase.
    78 #         - [PcdsDynamicVpd] is used as section name for this type PCD in platform 
     78#         - [PcdsDynamicVpd] is used as section name for this type PCD in platform
    7979#           DSC file. [PcdsDynamicExVpd] is for dynamicex type PCD.
    80 #     
     80#
    8181#    2.4 When and how to use dynamic PCD
    8282#      Module developer do not care the used PCD is dynamic or static when writting
    83 #      source code/INF. Dynamic PCD and dynamic type is pointed by platform integrator 
     83#      source code/INF. Dynamic PCD and dynamic type is pointed by platform integrator
    8484#      in platform DSC file. Please ref section 2.3 to get matching between dynamic
    8585#      PCD type and section name in DSC file.
    86 #   
     86#
    8787# 3, PCD database:
    88 #    Although dynamic PCD could be in different storage type as above description, 
     88#    Although dynamic PCD could be in different storage type as above description,
    8989#    but the basic information and default value for all dynamic PCD is hold
    9090#    by PCD database maintained by PEI/DXE driver.
    91 #   
     91#
    9292#    As the whole EFI BIOS boot path is divided into PEI/DXE phase, the PCD database
    9393#    also is divided into Pei/Dxe database maintaied by PcdPeim/PcdDxe driver separatly.
     
    9595#    PCD information used in PEI phase or use in both PEI/DXE phase. And DXE PCD
    9696#    database contains all PCDs used in PEI/DXE phase in memory.
    97 #   
    98 #    Build tool will generate PCD database into the separate binary file for 
    99 #    PEI/DXE PCD driver according to dynamic PCD section in platform DSC file. 
    100 #   
     97#
     98#    Build tool will generate PCD database into the separate binary file for
     99#    PEI/DXE PCD driver according to dynamic PCD section in platform DSC file.
     100#
    101101#    3.1 PcdPeim and PcdDxe
    102102#      PEI PCD database is maintained by PcdPeim driver run from flash. PcdPeim driver
    103 #      build guid hob in temporary memory and copy the binary data base from flash 
    104 #      to temporary memory for PEI PCD database. 
     103#      build guid hob in temporary memory and copy the binary data base from flash
     104#      to temporary memory for PEI PCD database.
    105105#      DXE PCD database is maintained by PcdDxe driver.At entry point of PcdDxe driver,
    106106#      a new PCD database is allocated in boot-time memory which including all
    107107#      PEI PCD and DXE PCD entry.
    108 #     
     108#
    109109#      Pcd driver should run as early as possible before any other driver access
    110110#      dynamic PCD's value. PEI/DXE "Apriori File" mechanism make it possible by
    111111#      making PcdPeim/PcdDxe as first dispatching driver in PEI/DXE phase.
    112 #     
     112#
    113113#    3.2 Token space Guid/Token number, Platform token, Local token number
    114114#           Dynamic PCD
     
    130130#                               |  Number   |
    131131#                               +-----------+
    132 #   
    133 #   
     132#
     133#
    134134#      3.2.1 Pair of Token space guid + Token number
    135135#        Any type PCD is identified by pair of "TokenSpaceGuid + TokeNumber". But it
    136 #        is not easy maintained by PCD driver, and hashed token number will make 
    137 #        searching slowly. 
     136#        is not easy maintained by PCD driver, and hashed token number will make
     137#        searching slowly.
    138138#
    139139#      3.2.2 Platform Token Number
    140 #        "Platform token number" concept is introduced for mapping to a pair of 
    141 #        "TokenSpaceGuid + TokenNumber". The platform token number is generated by 
    142 #        build tool in autogen.h and all of them are continual in a platform scope 
     140#        "Platform token number" concept is introduced for mapping to a pair of
     141#        "TokenSpaceGuid + TokenNumber". The platform token number is generated by
     142#        build tool in autogen.h and all of them are continual in a platform scope
    143143#        started from 1.(0 meaning invalid internal token number)
    144144#        With auto-generated "platform token number", PcdGet(PcdSampleDynamicPcd)
    145 #        in source code is translated to LibPcdGet(_PCD_TOKEN_PcdSampleDynamicPcd) 
     145#        in source code is translated to LibPcdGet(_PCD_TOKEN_PcdSampleDynamicPcd)
    146146#        in autogen.h.
    147147#        Notes: The mapping between pair of "tokenspace guid + token number" and
     
    150150#        To access a dynamicEx type PCD, pair of "token space guid/token number" all need
    151151#        to be specificed for PcdSet/PcdGet accessing macro.
    152 #     
    153 #        Platform Token Number is started from 1, and inceased continuous. From whole 
     152#
     153#        Platform Token Number is started from 1, and inceased continuous. From whole
    154154#        platform scope, there are two zones: PEI Zone and DXE Zone
    155155#                  |                      Platform Token Number
     
    157157#        PEI Zone: |            1                 ~  PEI_LOCAL_TOKEN_NUMBER
    158158#        DXE Zone: | (PEI_LOCAL_TOKEN_NUMBER + 1) ~ (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)
    159 #       
     159#
    160160#      3.2.3 Local Token Number
    161 #        To fast searching a PCD entry in PCD database, PCD driver translate 
     161#        To fast searching a PCD entry in PCD database, PCD driver translate
    162162#        platform token number to local token number via a mapping table.
    163163#        For binary DynamicEx type PCD, there is a another mapping table to translate
     
    165165#        Local token number is identifier for all internal interface in PCD PEI/DXE
    166166#        driver.
    167 #       
     167#
    168168#        A local token number is a 32-bit value in following meaning:
    169169#         32 ------------- 28 ---------- 24 -------- 0
     
    186186#       Based on local token number, PCD driver could fast determine PCD type, value
    187187#       type and get PCD entry from PCD database.
    188 #       
     188#
    189189#    3.3 PCD Database binary file
    190 #      PCD Database binary file will be created at build time as the standalone binary image. 
    191 #      To understand the binary image layout, PCD Database C structure is still generated 
     190#      PCD Database binary file will be created at build time as the standalone binary image.
     191#      To understand the binary image layout, PCD Database C structure is still generated
    192192#      as comments by build tools in PCD driver's autogen.h/
    193193#      autogen.c file. In generated C structure, following information is stored:
    194 #      - ExMapTable: This table is used translate a binary dynamicex type PCD's 
     194#      - ExMapTable: This table is used translate a binary dynamicex type PCD's
    195195#                    "tokenguid + token" to local token number.
    196196#      - LocalTokenNumberTable:
     
    202202#      - SkuIdTable: TBD
    203203#      - SystemSkuId: TBD
    204 #      - PCD value structure: 
     204#      - PCD value structure:
    205205#                    Every PCD has a value record in PCD database. For different
    206 #                    datum type PCD has different record structure which will be 
     206#                    datum type PCD has different record structure which will be
    207207#                    introduced in 3.3.1
    208 #     
    209 #      In a PCD database structure, there are two major area: Init and UnInit. 
    210 #      Init area is use stored above PCD internal structure such as ExMapTable, 
    211 #      LocalTokenNumberTable etc and the (default) value of PCD which has default 
     208#
     209#      In a PCD database structure, there are two major area: Init and UnInit.
     210#      Init area is use stored above PCD internal structure such as ExMapTable,
     211#      LocalTokenNumberTable etc and the (default) value of PCD which has default
    212212#      value specified in platform DSC file.
    213213#      Unint area is used stored the value of PCD which has no default value in
    214214#      platform DSC file, the value of NULL, 0 specified in platform DSC file can
    215215#      be seemed as "no default value".
    216 #     
     216#
    217217#      3.3.1 Simple Sample PCD Database C Structure
    218218#        A general sample of PCD database structue is as follows:
     
    226226#            UINT8             SkuIdTable[PEI_SKUID_TABLE_SIZE];
    227227#            SKU_ID            SystemSkuId;
    228 #           
     228#
    229229#            //===== Following is value structure for PCD with default value
    230230#            ....
     
    238238#          } UnInit;
    239239#        }
    240 #     
     240#
    241241#      3.3.2 PCD value structure in PCD database C structure
    242242#        The value's structure is generated by build tool in PCD database C structure.
    243243#        The PCDs in different datum type has different value structure.
    244 #       
     244#
    245245#        3.3.2.1 UINT8/UINT16/UINT32/UINT64 datum type PCD
    246246#          The C structure for these datum type PCD is just a UINT8/UINT16/UINT32/UINT64
     
    250250#          Member type is UINT16 according to PcdHardwareErrorRecordLevel declaration
    251251#          in DEC file.
    252 #         
     252#
    253253#        3.3.2.2 VOID* datum type PCD
    254254#          The value of VOID* datum type PCD is a UINT8/UINT16 array in PCD database.
    255 #         
     255#
    256256#          3.3.2.2.1 VOID* - string type
    257 #            If the default value for VOID* datum type PCD like L"xxx", the PCD is 
    258 #            used for unicode string, and C structure of this datum type PCD is 
     257#            If the default value for VOID* datum type PCD like L"xxx", the PCD is
     258#            used for unicode string, and C structure of this datum type PCD is
    259259#            UINT16 string array in PCD database, for example:
    260260#            UINT16 StringTable[29];
    261261#            The number of 29 in above sample is max size of a unicode string.
    262 #           
     262#
    263263#            If the default value for VOID* datum type PCD like "xxx", the PCD is
    264 #            used for ascii string, and C structure of this datum type PCD is 
     264#            used for ascii string, and C structure of this datum type PCD is
    265265#            UINT8 string array in PCD database, for example:
    266266#            UINT8 StringTable[20];
    267267#            The number of 20 in above sample is max size of a ascii string.
    268 #           
     268#
    269269#          3.3.2.2.2 VOID* - byte array
    270270#            If the default value of VOID* datum type PCD like {'0x29', '0x01', '0xf2'}
    271 #            the PCD is used for byte array. The generated structrue is same as 
     271#            the PCD is used for byte array. The generated structrue is same as
    272272#            above ascii string table,
    273273#            UINT8 StringTable[13];
    274274#            The number of 13 in above sample is max size of byte array.
    275 #       
     275#
    276276#      3.3.3 Some utility structures in PCD Database
    277277#        3.3.3.1 GuidTable
    278278#          GuidTable array is used to store all related GUID value in PCD database:
    279279#            - Variable GUID for HII type PCD
    280 #            - Token space GUID for dynamicex type PCD 
    281 #   
     280#            - Token space GUID for dynamicex type PCD
     281#
    282282#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    283283#
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Service.c

    r58459 r58466  
    1919PCD_DATABASE   mPcdDatabase;
    2020
    21 UINT32         mPcdTotalTokenCount; 
    22 UINT32         mPeiLocalTokenCount; 
    23 UINT32         mDxeLocalTokenCount; 
    24 UINT32         mPeiNexTokenCount;   
    25 UINT32         mDxeNexTokenCount; 
     21UINT32         mPcdTotalTokenCount;
     22UINT32         mPeiLocalTokenCount;
     23UINT32         mDxeLocalTokenCount;
     24UINT32         mPeiNexTokenCount;
     25UINT32         mDxeNexTokenCount;
    2626UINT32         mPeiExMapppingTableSize;
    2727UINT32         mDxeExMapppingTableSize;
     
    2929UINT32         mDxeGuidTableSize;
    3030
    31 BOOLEAN        mPeiExMapTableEmpty; 
    32 BOOLEAN        mDxeExMapTableEmpty; 
     31BOOLEAN        mPeiExMapTableEmpty;
     32BOOLEAN        mDxeExMapTableEmpty;
    3333BOOLEAN        mPeiDatabaseEmpty;
    3434
    3535LIST_ENTRY    *mCallbackFnTable;
    3636EFI_GUID     **TmpTokenSpaceBuffer;
    37 UINTN          TmpTokenSpaceBufferCount; 
     37UINTN          TmpTokenSpaceBufferCount;
    3838
    3939/**
     
    6767  //
    6868  // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
    69   // 
     69  //
    7070  TmpTokenNumber = TokenNumber;
    7171
    72   LocalTokenNumberTable  = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) : 
     72  LocalTokenNumberTable  = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
    7373                                     (UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
    7474  TokenNumber            = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
     
    183183    AsciiStrCat (Name, TokenSpaceName);
    184184    Name[AsciiStrSize (TokenSpaceName) - sizeof (CHAR8)] = '.';
    185     AsciiStrCat (Name, PcdName); 
     185    AsciiStrCat (Name, PcdName);
    186186  }
    187187
     
    200200  @param[in]    TokenNumber The PCD token number.
    201201  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
    202                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 
     202                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
    203203
    204204  @retval  EFI_SUCCESS      The PCD information was returned successfully
     
    249249        //
    250250        // Here use one representative in the token space to get the TokenSpaceCName.
    251         // 
     251        //
    252252        PcdInfo->PcdName = GetPcdName (TRUE, IsPeiDb, ExMapTable[Index].TokenNumber);
    253253        return EFI_SUCCESS;
     
    354354/**
    355355  Get the PCD entry pointer in PCD database.
    356  
     356
    357357  This routine will visit PCD database to find the PCD entry according to given
    358   token number. The given token number is autogened by build tools and it will be 
    359   translated to local token number. Local token number contains PCD's type and 
     358  token number. The given token number is autogened by build tools and it will be
     359  translated to local token number. Local token number contains PCD's type and
    360360  offset of PCD entry in PCD database.
    361361
     
    387387  UINT32              LocalTokenNumber;
    388388  UINT32              Offset;
    389   STRING_HEAD         StringTableIdx;     
     389  STRING_HEAD         StringTableIdx;
    390390  BOOLEAN             IsPeiDb;
    391391
     
    409409  //
    410410  // EBC compiler is very choosy. It may report warning about comparison
    411   // between UINTN and 0 . So we add 1 in each size of the 
     411  // between UINTN and 0 . So we add 1 in each size of the
    412412  // comparison.
    413413  //
     
    417417
    418418  // EBC compiler is very choosy. It may report warning about comparison
    419   // between UINTN and 0 . So we add 1 in each size of the 
     419  // between UINTN and 0 . So we add 1 in each size of the
    420420  // comparison.
    421421  IsPeiDb = (BOOLEAN) ((TokenNumber + 1 < mPeiLocalTokenCount + 1) ? TRUE : FALSE);
     
    424424
    425425  PcdDb = IsPeiDb ? ((UINT8 *) mPcdDatabase.PeiDb) : ((UINT8 *) mPcdDatabase.DxeDb);
    426                                    
     426
    427427  if (IsPeiDb) {
    428428    StringTable = (UINT8 *) ((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->StringTableOffset);
     
    455455      if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {
    456456        //
    457         // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of 
     457        // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of
    458458        // string array in string table.
    459459        //
    460         StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);   
    461         VaraiableDefaultBuffer = (UINT8 *) (StringTable + StringTableIdx);     
     460        StringTableIdx = *(STRING_HEAD*)((UINT8 *) PcdDb + VariableHead->DefaultValueOffset);
     461        VaraiableDefaultBuffer = (UINT8 *) (StringTable + StringTableIdx);
    462462      } else {
    463463        VaraiableDefaultBuffer = (UINT8 *) PcdDb + VariableHead->DefaultValueOffset;
     
    503503      ASSERT (FALSE);
    504504      break;
    505      
     505
    506506  }
    507507
     
    517517  This routine will register a callback function to a PCD entry by given token number
    518518  and token space guid.
    519  
     519
    520520  @param TokenNumber        PCD token's number, it is autogened by build tools.
    521   @param Guid               PCD token space's guid, 
     521  @param Guid               PCD token space's guid,
    522522                            if not NULL, this PCD is dynamicEx type PCD.
    523523  @param CallBackFunction   Callback function pointer
     
    567567  FnTableEntry->CallbackFn = CallBackFunction;
    568568  InsertTailList (ListHead, &FnTableEntry->Node);
    569  
     569
    570570  return EFI_SUCCESS;
    571571}
     
    619619      RemoveEntryList (ListNode);
    620620      FreePool (FnTableEntry);
    621      
     621
    622622      return EFI_SUCCESS;
    623623    }
     
    630630/**
    631631  Get next token number in given token space.
    632  
     632
    633633  This routine is used for dynamicEx type PCD. It will firstly scan token space
    634   table to get token space according to given token space guid. Then scan given 
    635   token number in found token space, if found, then return next token number in 
     634  table to get token space according to given token space guid. Then scan given
     635  token number in found token space, if found, then return next token number in
    636636  this token space.
    637637
    638   @param Guid            Token space guid. Next token number will be scaned in 
     638  @param Guid            Token space guid. Next token number will be scaned in
    639639                         this token space.
    640   @param TokenNumber     Token number. 
    641                          If PCD_INVALID_TOKEN_NUMBER, return first token number in 
     640  @param TokenNumber     Token number.
     641                         If PCD_INVALID_TOKEN_NUMBER, return first token number in
    642642                         token space table.
    643643                         If not PCD_INVALID_TOKEN_NUMBER, return next token number
     
    670670
    671671  //
    672   // Scan token space guid 
    673   // 
     672  // Scan token space guid
     673  //
    674674  MatchGuid = ScanGuid (GuidTable, SizeOfGuidTable, Guid);
    675675  if (MatchGuid == NULL) {
     
    736736LocateExPcdBinary (
    737737  VOID
    738 ) 
     738)
    739739{
    740740  DXE_PCD_DATABASE      *DxePcdDbBinary;
    741741  UINTN                 DxePcdDbSize;
    742742  EFI_STATUS            Status;
    743  
     743
    744744  DxePcdDbBinary = NULL;
    745745  //
    746   // Search the External Pcd database from one section of current FFS, 
     746  // Search the External Pcd database from one section of current FFS,
    747747  // and read it to memory
    748748  //
     
    768768/**
    769769  Initialize the PCD database in DXE phase.
    770  
     770
    771771  PCD database in DXE phase also contains PCD database in PEI phase which is copied
    772772  from GUID Hob.
     
    799799  if (GuidHob != NULL) {
    800800
    801     // 
     801    //
    802802    // If no PEIMs use dynamic Pcd Entry, the Pcd Service PEIM
    803803    // should not be included at all. So the GuidHob could
     
    805805    // Value to PCD Database.
    806806    //
    807    
     807
    808808    PeiDatabase = (PEI_PCD_DATABASE *) GET_GUID_HOB_DATA (GuidHob);
    809809    //
     
    833833  mPcdTotalTokenCount     = mPeiLocalTokenCount + mDxeLocalTokenCount;
    834834  mPeiNexTokenCount       = mPeiLocalTokenCount - mPcdDatabase.PeiDb->ExTokenCount;
    835   mDxeNexTokenCount       = mDxeLocalTokenCount - mPcdDatabase.DxeDb->ExTokenCount; 
     835  mDxeNexTokenCount       = mDxeLocalTokenCount - mPcdDatabase.DxeDb->ExTokenCount;
    836836
    837837  mPeiExMapTableEmpty     = (mPcdDatabase.PeiDb->ExTokenCount == 0) ? TRUE : FALSE;
     
    850850  //
    851851  // EBC compiler is very choosy. It may report warning about comparison
    852   // between UINTN and 0 . So we add 1 in each size of the 
     852  // between UINTN and 0 . So we add 1 in each size of the
    853853  // comparison.
    854854  //
     
    863863  @param VariableGuid    Variable's guid
    864864  @param VariableName    Variable's unicode name string
    865   @param VariableData    Variable's data pointer, 
     865  @param VariableData    Variable's data pointer,
    866866  @param VariableSize    Variable's size.
    867867
     
    882882  Size = 0;
    883883  Buffer = NULL;
    884  
     884
    885885  //
    886886  // Firstly get the real size of HII variable
     
    893893    Buffer
    894894    );
    895  
     895
    896896  //
    897897  // Allocate buffer to hold whole variable data according to variable size.
     
    915915  } else {
    916916    //
    917     // Use Default Data only when variable is not found. 
     917    // Use Default Data only when variable is not found.
    918918    // For other error status, correct data can't be got, and trig ASSERT().
    919919    //
     
    940940  UINTN     Size,
    941941  BOOLEAN   IsPeiDb
    942   ) 
     942  )
    943943{
    944944  SKU_HEAD              *SkuHead;
     
    954954
    955955  SkuHead     = (SKU_HEAD *) (PcdDb + (LocalTokenNumber & PCD_DATABASE_OFFSET_MASK));
    956   Value       = (UINT8 *) (PcdDb + SkuHead->SkuDataStartOffset); 
     956  Value       = (UINT8 *) (PcdDb + SkuHead->SkuDataStartOffset);
    957957
    958958  SkuIdTable =  (SKU_ID *)(PcdDb + SkuHead->SkuIdTableOffset);
     
    967967    }
    968968  }
    969  
     969
    970970  //
    971971  // Find the default SKU ID entry in SKU ID table.
    972972  //
    973  
     973
    974974  if(!FoundSku) {
    975975    for (Index = 0; Index < SkuIdTable[0]; Index++) {
     
    997997      Value = (UINT8 *) &(((STRING_HEAD *) Value)[Index]);
    998998      return (UINT32) ((Value - PcdDb) | PCD_TYPE_STRING);
    999      
     999
    10001000    case PCD_TYPE_DATA:
    10011001      Value += Size * Index;
     
    10091009
    10101010  return 0;
    1011  
    1012 }
    1013 
    1014 /**
    1015   Invoke the callback function when dynamic PCD entry was set, if this PCD entry 
     1011
     1012}
     1013
     1014/**
     1015  Invoke the callback function when dynamic PCD entry was set, if this PCD entry
    10161016  has registered callback function.
    10171017
     
    10491049    FnTableEntry = CR_FNENTRY_FROM_LISTNODE (ListNode, CALLBACK_FN_ENTRY, Node);
    10501050
    1051     FnTableEntry->CallbackFn(Guid, 
     1051    FnTableEntry->CallbackFn(Guid,
    10521052                    (Guid == NULL) ? TokenNumber : ExTokenNumber,
    10531053                    Data,
    10541054                    Size);
    1055    
     1055
    10561056    ListNode = GetNextNode (ListHead, ListNode);
    10571057  }
    1058  
     1058
    10591059  return;
    10601060}
     
    10931093  @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.
    10941094  @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.
    1095   @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database. 
     1095  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.
    10961096  @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in
    10971097                                 range of UINT8, UINT16, UINT32, UINT64
    1098   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                               
     1098  @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.
    10991099**/
    11001100EFI_STATUS
     
    11291129
    11301130  TmpTokenNumber = TokenNumber;
    1131  
     1131
    11321132  //
    11331133  // EBC compiler is very choosy. It may report warning about comparison
    1134   // between UINTN and 0 . So we add 1 in each size of the 
     1134  // between UINTN and 0 . So we add 1 in each size of the
    11351135  // comparison.
    11361136  //
     
    11541154  //
    11551155  // EBC compiler is very choosy. It may report warning about comparison
    1156   // between UINTN and 0 . So we add 1 in each size of the 
     1156  // between UINTN and 0 . So we add 1 in each size of the
    11571157  // comparison.
    11581158  //
     
    11691169  //
    11701170  // EBC compiler is very choosy. It may report warning about comparison
    1171   // between UINTN and 0 . So we add 1 in each size of the 
     1171  // between UINTN and 0 . So we add 1 in each size of the
    11721172  // comparison.
    11731173  //
     
    11861186  }
    11871187
    1188  
     1188
    11891189  InternalData = PcdDb + Offset;
    11901190
     
    11941194      Status = EFI_INVALID_PARAMETER;
    11951195      break;
    1196    
     1196
    11971197    case PCD_TYPE_STRING:
    11981198      if (SetPtrTypeSize (TmpTokenNumber, Size)) {
     
    12351235        } else {
    12361236          CopyMem (PcdDb + VariableHead->DefaultValueOffset, Data, *Size);
    1237         } 
     1237        }
    12381238        Status = EFI_SUCCESS;
    12391239      }
    12401240      break;
    1241      
     1241
    12421242    case PCD_TYPE_DATA:
    12431243      if (PtrType) {
     
    12831283
    12841284  EfiReleaseLock (&mPcdDatabaseLock);
    1285  
     1285
    12861286  return Status;
    12871287}
     
    13021302  IN UINTN                  ExTokenNumber,
    13031303  IN UINTN                  GetSize
    1304   ) 
     1304  )
    13051305{
    13061306  return GetWorker(GetExPcdTokenNumber (Guid, (UINT32) ExTokenNumber), GetSize);
     
    13311331/**
    13321332  Set value for a dynamic-ex PCD entry.
    1333  
    1334   This routine find the local token number according to dynamic-ex PCD's token 
     1333
     1334  This routine find the local token number according to dynamic-ex PCD's token
    13351335  space guid and token number firstly, and invoke callback function if this PCD
    13361336  entry registered callback function. Finally, invoken general SetWorker to set
    13371337  PCD value.
    1338  
     1338
    13391339  @param ExTokenNumber   Dynamic-ex PCD token number.
    13401340  @param Guid            Token space guid for dynamic-ex PCD.
     
    13571357{
    13581358  UINTN                   TokenNumber;
    1359  
     1359
    13601360  TokenNumber = GetExPcdTokenNumber (Guid, (UINT32) ExTokenNumber);
    13611361
     
    13691369  Set value for HII-type PCD.
    13701370
    1371   A HII-type PCD's value is stored in a variable. Setting/Getting the value of 
     1371  A HII-type PCD's value is stored in a variable. Setting/Getting the value of
    13721372  HII-type PCD is to visit this variable.
    1373  
     1373
    13741374  @param VariableGuid    Guid of variable which stored value of a HII-type PCD.
    13751375  @param VariableName    Unicode name of variable which stored value of a HII-type PCD.
     
    14091409    NULL
    14101410    );
    1411  
     1411
    14121412  if (Status == EFI_BUFFER_TOO_SMALL) {
    14131413    //
     
    14291429      Buffer
    14301430      );
    1431    
     1431
    14321432    ASSERT_EFI_ERROR (Status);
    14331433
     
    14481448    // If variable does not exist, a new variable need to be created.
    14491449    //
    1450    
     1450
    14511451    Size = Offset + DataSize;
    1452    
     1452
    14531453    Buffer = AllocateZeroPool (Size);
    14541454    ASSERT (Buffer != NULL);
    1455    
     1455
    14561456    CopyMem ((UINT8 *)Buffer + Offset, Data, DataSize);
    1457    
     1457
    14581458    Status = gRT->SetVariable (
    14591459              VariableName,
     
    14651465
    14661466    FreePool (Buffer);
    1467     return Status;   
    1468   }
    1469  
     1467    return Status;
     1468  }
     1469
    14701470  //
    14711471  // If we drop to here, the value is failed to be written in to variable area
     
    14811481  in DEC file. PCD database maintain a mapping table that translate pair of {token
    14821482  space guid: token number} to Token Number.
    1483  
     1483
    14841484  @param Guid            Token space guid for dynamic-ex PCD entry.
    14851485  @param ExTokenNumber   Dynamic-ex PCD token number.
     
    14881488
    14891489**/
    1490 UINTN           
     1490UINTN
    14911491GetExPcdTokenNumber (
    14921492  IN CONST EFI_GUID             *Guid,
     
    15751575
    15761576  return (SKU_ID *) (Database + SkuHead->SkuIdTableOffset);
    1577  
     1577
    15781578}
    15791579
    15801580/**
    15811581  Wrapper function of getting index of PCD entry in size table.
    1582  
     1582
    15831583  @param LocalTokenNumberTableIdx Index of this PCD in local token number table.
    15841584  @param IsPeiDb                  If TRUE, the pcd entry is initialized in PEI phase,
     
    15981598  UINTN  SizeTableIdx;
    15991599  SKU_ID *SkuIdTable;
    1600  
     1600
    16011601  if (IsPeiDb) {
    16021602    LocalTokenNumberTable = (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset);
     
    16121612    if ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER) {
    16131613      //
    1614       // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1614      // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    16151615      // PCD entry.
    16161616      //
     
    16451645  }
    16461646
    1647   return SizeTableIdx; 
     1647  return SizeTableIdx;
    16481648}
    16491649
     
    16721672
    16731673  // EBC compiler is very choosy. It may report warning about comparison
    1674   // between UINTN and 0 . So we add 1 in each size of the 
     1674  // between UINTN and 0 . So we add 1 in each size of the
    16751675  // comparison.
    16761676  IsPeiDb = (BOOLEAN) (LocalTokenNumberTableIdx + 1 < mPeiLocalTokenCount + 1);
     
    16891689
    16901690  ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
    1691  
     1691
    16921692  SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, IsPeiDb);
    16931693
    16941694  *MaxSize = SizeTable[SizeTableIdx];
    16951695  //
    1696   // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1696  // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    16971697  // PCD entry.
    16981698  //
     
    17571757  //
    17581758  // EBC compiler is very choosy. It may report warning about comparison
    1759   // between UINTN and 0 . So we add 1 in each size of the 
     1759  // between UINTN and 0 . So we add 1 in each size of the
    17601760  // comparison.
    17611761  //
     
    17741774
    17751775  ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
    1776  
     1776
    17771777  SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, IsPeiDb);
    17781778
    17791779  MaxSize = SizeTable[SizeTableIdx];
    17801780  //
    1781   // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1781  // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    17821782  // PCD entry.
    17831783  //
     
    17931793       *CurrentSize = MaxSize;
    17941794       return FALSE;
    1795     } 
    1796    
     1795    }
     1796
    17971797    if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
    17981798      //
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Service.h

    r58459 r58466  
    108108  Sets the SKU value for subsequent calls to set or get PCD token values.
    109109
    110   SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. 
     110  SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
    111111  SetSku() is normally called only once by the system.
    112112
    113   For each item (token), the database can hold a single value that applies to all SKUs, 
    114   or multiple values, where each value is associated with a specific SKU Id. Items with multiple, 
    115   SKU-specific values are called SKU enabled. 
    116  
    117   The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. 
    118   For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the 
    119   single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the 
    120   last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, 
    121   the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been 
     113  For each item (token), the database can hold a single value that applies to all SKUs,
     114  or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
     115  SKU-specific values are called SKU enabled.
     116
     117  The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
     118  For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
     119  single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
     120  last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
     121  the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
    122122  set for that Id, the results are unpredictable.
    123123
    124   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and 
     124  @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and
    125125              set values associated with a PCD token.
    126126
     
    135135  Retrieves an 8-bit value for a given PCD token.
    136136
    137   Retrieves the current byte-sized value for a PCD token number. 
     137  Retrieves the current byte-sized value for a PCD token number.
    138138  If the TokenNumber is invalid, the results are unpredictable.
    139  
    140   @param[in]  TokenNumber The PCD token number. 
     139
     140  @param[in]  TokenNumber The PCD token number.
    141141
    142142  @return The UINT8 value.
    143  
     143
    144144**/
    145145UINT8
     
    152152  Retrieves an 16-bit value for a given PCD token.
    153153
    154   Retrieves the current 16-bits value for a PCD token number. 
     154  Retrieves the current 16-bits value for a PCD token number.
    155155  If the TokenNumber is invalid, the results are unpredictable.
    156  
    157   @param[in]  TokenNumber The PCD token number. 
     156
     157  @param[in]  TokenNumber The PCD token number.
    158158
    159159  @return The UINT16 value.
    160  
     160
    161161**/
    162162UINT16
     
    169169  Retrieves an 32-bit value for a given PCD token.
    170170
    171   Retrieves the current 32-bits value for a PCD token number. 
     171  Retrieves the current 32-bits value for a PCD token number.
    172172  If the TokenNumber is invalid, the results are unpredictable.
    173  
    174   @param[in]  TokenNumber The PCD token number. 
     173
     174  @param[in]  TokenNumber The PCD token number.
    175175
    176176  @return The UINT32 value.
    177  
     177
    178178**/
    179179UINT32
     
    186186  Retrieves an 64-bit value for a given PCD token.
    187187
    188   Retrieves the current 64-bits value for a PCD token number. 
     188  Retrieves the current 64-bits value for a PCD token number.
    189189  If the TokenNumber is invalid, the results are unpredictable.
    190  
    191   @param[in]  TokenNumber The PCD token number. 
     190
     191  @param[in]  TokenNumber The PCD token number.
    192192
    193193  @return The UINT64 value.
    194  
     194
    195195**/
    196196UINT64
     
    203203  Retrieves a pointer to a value for a given PCD token.
    204204
    205   Retrieves the current pointer to the buffer for a PCD token number. 
    206   Do not make any assumptions about the alignment of the pointer that 
    207   is returned by this function call.  If the TokenNumber is invalid, 
     205  Retrieves the current pointer to the buffer for a PCD token number.
     206  Do not make any assumptions about the alignment of the pointer that
     207  is returned by this function call.  If the TokenNumber is invalid,
    208208  the results are unpredictable.
    209209
    210   @param[in]  TokenNumber The PCD token number. 
     210  @param[in]  TokenNumber The PCD token number.
    211211
    212212  @return The pointer to the buffer to be retrieved.
    213  
     213
    214214**/
    215215VOID *
     
    222222  Retrieves a Boolean value for a given PCD token.
    223223
    224   Retrieves the current boolean value for a PCD token number. 
    225   Do not make any assumptions about the alignment of the pointer that 
    226   is returned by this function call.  If the TokenNumber is invalid, 
     224  Retrieves the current boolean value for a PCD token number.
     225  Do not make any assumptions about the alignment of the pointer that
     226  is returned by this function call.  If the TokenNumber is invalid,
    227227  the results are unpredictable.
    228228
    229   @param[in]  TokenNumber The PCD token number. 
     229  @param[in]  TokenNumber The PCD token number.
    230230
    231231  @return The Boolean value.
    232  
     232
    233233**/
    234234BOOLEAN
     
    241241  Retrieves the size of the value for a given PCD token.
    242242
    243   Retrieves the current size of a particular PCD token. 
     243  Retrieves the current size of a particular PCD token.
    244244  If the TokenNumber is invalid, the results are unpredictable.
    245245
    246   @param[in]  TokenNumber The PCD token number. 
     246  @param[in]  TokenNumber The PCD token number.
    247247
    248248  @return The size of the value for the PCD token.
    249  
     249
    250250**/
    251251UINTN
     
    258258  Retrieves an 8-bit value for a given PCD token.
    259259
    260   Retrieves the 8-bit value of a particular PCD token. 
     260  Retrieves the 8-bit value of a particular PCD token.
    261261  If the TokenNumber is invalid or the token space
    262   specified by Guid does not exist, the results are 
     262  specified by Guid does not exist, the results are
    263263  unpredictable.
    264264
    265265  @param[in]  Guid The token space for the token number.
    266   @param[in]  TokenNumber The PCD token number. 
     266  @param[in]  TokenNumber The PCD token number.
    267267
    268268  @return The size 8-bit value for the PCD token.
    269  
     269
    270270**/
    271271UINT8
     
    279279  Retrieves an 16-bit value for a given PCD token.
    280280
    281   Retrieves the 16-bit value of a particular PCD token. 
     281  Retrieves the 16-bit value of a particular PCD token.
    282282  If the TokenNumber is invalid or the token space
    283   specified by Guid does not exist, the results are 
     283  specified by Guid does not exist, the results are
    284284  unpredictable.
    285285
    286286  @param[in]  Guid The token space for the token number.
    287   @param[in]  TokenNumber The PCD token number. 
     287  @param[in]  TokenNumber The PCD token number.
    288288
    289289  @return The size 16-bit value for the PCD token.
    290  
     290
    291291**/
    292292UINT16
     
    300300  Retrieves an 32-bit value for a given PCD token.
    301301
    302   Retrieves the 32-bit value of a particular PCD token. 
     302  Retrieves the 32-bit value of a particular PCD token.
    303303  If the TokenNumber is invalid or the token space
    304   specified by Guid does not exist, the results are 
     304  specified by Guid does not exist, the results are
    305305  unpredictable.
    306306
    307307  @param[in]  Guid The token space for the token number.
    308   @param[in]  TokenNumber The PCD token number. 
     308  @param[in]  TokenNumber The PCD token number.
    309309
    310310  @return The size 32-bit value for the PCD token.
    311  
     311
    312312**/
    313313UINT32
     
    321321  Retrieves an 64-bit value for a given PCD token.
    322322
    323   Retrieves the 64-bit value of a particular PCD token. 
     323  Retrieves the 64-bit value of a particular PCD token.
    324324  If the TokenNumber is invalid or the token space
    325   specified by Guid does not exist, the results are 
     325  specified by Guid does not exist, the results are
    326326  unpredictable.
    327327
    328328  @param[in]  Guid The token space for the token number.
    329   @param[in]  TokenNumber The PCD token number. 
     329  @param[in]  TokenNumber The PCD token number.
    330330
    331331  @return The size 64-bit value for the PCD token.
    332  
     332
    333333**/
    334334UINT64
     
    342342  Retrieves a pointer to a value for a given PCD token.
    343343
    344   Retrieves the current pointer to the buffer for a PCD token number. 
    345   Do not make any assumptions about the alignment of the pointer that 
    346   is returned by this function call.  If the TokenNumber is invalid, 
     344  Retrieves the current pointer to the buffer for a PCD token number.
     345  Do not make any assumptions about the alignment of the pointer that
     346  is returned by this function call.  If the TokenNumber is invalid,
    347347  the results are unpredictable.
    348348
    349349  @param[in]  Guid The token space for the token number.
    350   @param[in]  TokenNumber The PCD token number. 
     350  @param[in]  TokenNumber The PCD token number.
    351351
    352352  @return The pointer to the buffer to be retrieved.
    353  
     353
    354354**/
    355355VOID *
     
    363363  Retrieves an Boolean value for a given PCD token.
    364364
    365   Retrieves the Boolean value of a particular PCD token. 
     365  Retrieves the Boolean value of a particular PCD token.
    366366  If the TokenNumber is invalid or the token space
    367   specified by Guid does not exist, the results are 
     367  specified by Guid does not exist, the results are
    368368  unpredictable.
    369369
    370370  @param[in]  Guid The token space for the token number.
    371   @param[in]  TokenNumber The PCD token number. 
     371  @param[in]  TokenNumber The PCD token number.
    372372
    373373  @return The size Boolean value for the PCD token.
    374  
     374
    375375**/
    376376BOOLEAN
     
    384384  Retrieves the size of the value for a given PCD token.
    385385
    386   Retrieves the current size of a particular PCD token. 
     386  Retrieves the current size of a particular PCD token.
    387387  If the TokenNumber is invalid, the results are unpredictable.
    388388
    389389  @param[in]  Guid The token space for the token number.
    390   @param[in]  TokenNumber The PCD token number. 
     390  @param[in]  TokenNumber The PCD token number.
    391391
    392392  @return The size of the value for the PCD token.
    393  
     393
    394394**/
    395395UINTN
     
    403403  Sets an 8-bit value for a given PCD token.
    404404
    405   When the PCD service sets a value, it will check to ensure that the 
    406   size of the value being set is compatible with the Token's existing definition. 
     405  When the PCD service sets a value, it will check to ensure that the
     406  size of the value being set is compatible with the Token's existing definition.
    407407  If it is not, an error will be returned.
    408408
    409   @param[in]  TokenNumber The PCD token number. 
     409  @param[in]  TokenNumber The PCD token number.
    410410  @param[in]  Value The value to set for the PCD token.
    411411
    412412  @retval EFI_SUCCESS  Procedure returned successfully.
    413   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    414                                   being set was incompatible with a call to this function. 
     413  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     414                                  being set was incompatible with a call to this function.
    415415                                  Use GetSize() to retrieve the size of the target data.
    416416  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    417  
     417
    418418**/
    419419EFI_STATUS
     
    427427  Sets an 16-bit value for a given PCD token.
    428428
    429   When the PCD service sets a value, it will check to ensure that the 
    430   size of the value being set is compatible with the Token's existing definition. 
     429  When the PCD service sets a value, it will check to ensure that the
     430  size of the value being set is compatible with the Token's existing definition.
    431431  If it is not, an error will be returned.
    432432
    433   @param[in]  TokenNumber The PCD token number. 
     433  @param[in]  TokenNumber The PCD token number.
    434434  @param[in]  Value The value to set for the PCD token.
    435435
    436436  @retval EFI_SUCCESS  Procedure returned successfully.
    437   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    438                                   being set was incompatible with a call to this function. 
     437  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     438                                  being set was incompatible with a call to this function.
    439439                                  Use GetSize() to retrieve the size of the target data.
    440440  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    441  
     441
    442442**/
    443443EFI_STATUS
     
    451451  Sets an 32-bit value for a given PCD token.
    452452
    453   When the PCD service sets a value, it will check to ensure that the 
    454   size of the value being set is compatible with the Token's existing definition. 
     453  When the PCD service sets a value, it will check to ensure that the
     454  size of the value being set is compatible with the Token's existing definition.
    455455  If it is not, an error will be returned.
    456456
    457   @param[in]  TokenNumber The PCD token number. 
     457  @param[in]  TokenNumber The PCD token number.
    458458  @param[in]  Value The value to set for the PCD token.
    459459
    460460  @retval EFI_SUCCESS  Procedure returned successfully.
    461   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    462                                   being set was incompatible with a call to this function. 
     461  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     462                                  being set was incompatible with a call to this function.
    463463                                  Use GetSize() to retrieve the size of the target data.
    464464  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    465  
     465
    466466**/
    467467EFI_STATUS
     
    475475  Sets an 64-bit value for a given PCD token.
    476476
    477   When the PCD service sets a value, it will check to ensure that the 
    478   size of the value being set is compatible with the Token's existing definition. 
     477  When the PCD service sets a value, it will check to ensure that the
     478  size of the value being set is compatible with the Token's existing definition.
    479479  If it is not, an error will be returned.
    480480
    481   @param[in]  TokenNumber The PCD token number. 
     481  @param[in]  TokenNumber The PCD token number.
    482482  @param[in]  Value The value to set for the PCD token.
    483483
    484484  @retval EFI_SUCCESS  Procedure returned successfully.
    485   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    486                                   being set was incompatible with a call to this function. 
     485  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     486                                  being set was incompatible with a call to this function.
    487487                                  Use GetSize() to retrieve the size of the target data.
    488488  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    489  
     489
    490490**/
    491491EFI_STATUS
     
    500500  Sets a value of a specified size for a given PCD token.
    501501
    502   When the PCD service sets a value, it will check to ensure that the 
    503   size of the value being set is compatible with the Token's existing definition. 
     502  When the PCD service sets a value, it will check to ensure that the
     503  size of the value being set is compatible with the Token's existing definition.
    504504  If it is not, an error will be returned.
    505505
    506   @param[in]  TokenNumber The PCD token number. 
    507   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    508                               On input, if the SizeOfValue is greater than the maximum size supported 
    509                               for this TokenNumber then the output value of SizeOfValue will reflect 
     506  @param[in]  TokenNumber The PCD token number.
     507  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     508                              On input, if the SizeOfValue is greater than the maximum size supported
     509                              for this TokenNumber then the output value of SizeOfValue will reflect
    510510                              the maximum size supported for this TokenNumber.
    511511  @param[in]  Buffer The buffer to set for the PCD token.
    512512
    513513  @retval EFI_SUCCESS  Procedure returned successfully.
    514   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    515                                   being set was incompatible with a call to this function. 
     514  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     515                                  being set was incompatible with a call to this function.
    516516                                  Use GetSize() to retrieve the size of the target data.
    517517  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    518  
     518
    519519**/
    520520EFI_STATUS
     
    529529  Sets an Boolean value for a given PCD token.
    530530
    531   When the PCD service sets a value, it will check to ensure that the 
    532   size of the value being set is compatible with the Token's existing definition. 
     531  When the PCD service sets a value, it will check to ensure that the
     532  size of the value being set is compatible with the Token's existing definition.
    533533  If it is not, an error will be returned.
    534534
    535   @param[in]  TokenNumber The PCD token number. 
     535  @param[in]  TokenNumber The PCD token number.
    536536  @param[in]  Value The value to set for the PCD token.
    537537
    538538  @retval EFI_SUCCESS  Procedure returned successfully.
    539   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    540                                   being set was incompatible with a call to this function. 
     539  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     540                                  being set was incompatible with a call to this function.
    541541                                  Use GetSize() to retrieve the size of the target data.
    542542  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    543  
     543
    544544**/
    545545EFI_STATUS
     
    554554  Sets an 8-bit value for a given PCD token.
    555555
    556   When the PCD service sets a value, it will check to ensure that the 
    557   size of the value being set is compatible with the Token's existing definition. 
     556  When the PCD service sets a value, it will check to ensure that the
     557  size of the value being set is compatible with the Token's existing definition.
    558558  If it is not, an error will be returned.
    559559
    560560  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    561   @param[in]  TokenNumber The PCD token number. 
     561  @param[in]  TokenNumber The PCD token number.
    562562  @param[in]  Value The value to set for the PCD token.
    563563
    564564  @retval EFI_SUCCESS  Procedure returned successfully.
    565   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    566                                   being set was incompatible with a call to this function. 
     565  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     566                                  being set was incompatible with a call to this function.
    567567                                  Use GetSize() to retrieve the size of the target data.
    568568  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    569  
     569
    570570**/
    571571EFI_STATUS
     
    580580  Sets an 16-bit value for a given PCD token.
    581581
    582   When the PCD service sets a value, it will check to ensure that the 
    583   size of the value being set is compatible with the Token's existing definition. 
     582  When the PCD service sets a value, it will check to ensure that the
     583  size of the value being set is compatible with the Token's existing definition.
    584584  If it is not, an error will be returned.
    585585
    586586  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    587   @param[in]  TokenNumber The PCD token number. 
     587  @param[in]  TokenNumber The PCD token number.
    588588  @param[in]  Value The value to set for the PCD token.
    589589
    590590  @retval EFI_SUCCESS  Procedure returned successfully.
    591   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    592                                   being set was incompatible with a call to this function. 
     591  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     592                                  being set was incompatible with a call to this function.
    593593                                  Use GetSize() to retrieve the size of the target data.
    594594  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    595  
     595
    596596**/
    597597EFI_STATUS
     
    606606  Sets an 32-bit value for a given PCD token.
    607607
    608   When the PCD service sets a value, it will check to ensure that the 
    609   size of the value being set is compatible with the Token's existing definition. 
     608  When the PCD service sets a value, it will check to ensure that the
     609  size of the value being set is compatible with the Token's existing definition.
    610610  If it is not, an error will be returned.
    611611
    612612  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    613   @param[in]  TokenNumber The PCD token number. 
     613  @param[in]  TokenNumber The PCD token number.
    614614  @param[in]  Value The value to set for the PCD token.
    615615
    616616  @retval EFI_SUCCESS  Procedure returned successfully.
    617   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    618                                   being set was incompatible with a call to this function. 
     617  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     618                                  being set was incompatible with a call to this function.
    619619                                  Use GetSize() to retrieve the size of the target data.
    620620  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    621  
     621
    622622**/
    623623EFI_STATUS
     
    632632  Sets an 64-bit value for a given PCD token.
    633633
    634   When the PCD service sets a value, it will check to ensure that the 
    635   size of the value being set is compatible with the Token's existing definition. 
     634  When the PCD service sets a value, it will check to ensure that the
     635  size of the value being set is compatible with the Token's existing definition.
    636636  If it is not, an error will be returned.
    637637
    638638  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    639   @param[in]  TokenNumber The PCD token number. 
     639  @param[in]  TokenNumber The PCD token number.
    640640  @param[in]  Value The value to set for the PCD token.
    641641
    642642  @retval EFI_SUCCESS  Procedure returned successfully.
    643   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    644                                   being set was incompatible with a call to this function. 
     643  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     644                                  being set was incompatible with a call to this function.
    645645                                  Use GetSize() to retrieve the size of the target data.
    646646  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    647  
     647
    648648**/
    649649EFI_STATUS
     
    658658  Sets a value of a specified size for a given PCD token.
    659659
    660   When the PCD service sets a value, it will check to ensure that the 
    661   size of the value being set is compatible with the Token's existing definition. 
     660  When the PCD service sets a value, it will check to ensure that the
     661  size of the value being set is compatible with the Token's existing definition.
    662662  If it is not, an error will be returned.
    663663
    664664  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    665   @param[in]  TokenNumber The PCD token number. 
    666   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    667                               On input, if the SizeOfValue is greater than the maximum size supported 
    668                               for this TokenNumber then the output value of SizeOfValue will reflect 
     665  @param[in]  TokenNumber The PCD token number.
     666  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     667                              On input, if the SizeOfValue is greater than the maximum size supported
     668                              for this TokenNumber then the output value of SizeOfValue will reflect
    669669                              the maximum size supported for this TokenNumber.
    670670  @param[in]  Buffer The buffer to set for the PCD token.
    671671
    672672  @retval EFI_SUCCESS  Procedure returned successfully.
    673   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    674                                   being set was incompatible with a call to this function. 
     673  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     674                                  being set was incompatible with a call to this function.
    675675                                  Use GetSize() to retrieve the size of the target data.
    676676  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    677  
     677
    678678**/
    679679EFI_STATUS
     
    689689  Sets an Boolean value for a given PCD token.
    690690
    691   When the PCD service sets a value, it will check to ensure that the 
    692   size of the value being set is compatible with the Token's existing definition. 
     691  When the PCD service sets a value, it will check to ensure that the
     692  size of the value being set is compatible with the Token's existing definition.
    693693  If it is not, an error will be returned.
    694694
    695695  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    696   @param[in]  TokenNumber The PCD token number. 
     696  @param[in]  TokenNumber The PCD token number.
    697697  @param[in]  Value The value to set for the PCD token.
    698698
    699699  @retval EFI_SUCCESS  Procedure returned successfully.
    700   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    701                                   being set was incompatible with a call to this function. 
     700  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     701                                  being set was incompatible with a call to this function.
    702702                                  Use GetSize() to retrieve the size of the target data.
    703703  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    704  
     704
    705705**/
    706706EFI_STATUS
     
    716716
    717717  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    718   @param[in]  TokenNumber The PCD token number. 
    719   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    720 
    721   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     718  @param[in]  TokenNumber The PCD token number.
     719  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     720
     721  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    722722                        for the CallBackToken requested.
    723723  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    736736
    737737  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    738   @param[in]  TokenNumber The PCD token number. 
    739   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    740 
    741   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     738  @param[in]  TokenNumber The PCD token number.
     739  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     740
     741  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    742742                        for the CallBackToken requested.
    743743  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    753753
    754754/**
    755   Retrieves the next valid token number in a given namespace. 
    756  
    757   This is useful since the PCD infrastructure contains a sparse list of token numbers, 
    758   and one cannot a priori know what token numbers are valid in the database. 
    759  
    760   If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. 
    761   If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. 
    762   If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. 
    763   If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. 
    764   The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. 
    765   If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. 
    766   If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. 
     755  Retrieves the next valid token number in a given namespace.
     756
     757  This is useful since the PCD infrastructure contains a sparse list of token numbers,
     758  and one cannot a priori know what token numbers are valid in the database.
     759
     760  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
     761  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
     762  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
     763  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
     764  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
     765  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
     766  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    767767  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    768768
    769769
    770   @param[in]      Guid    The 128-bit unique value that designates the namespace from which to retrieve the next token. 
    771                           This is an optional parameter that may be NULL.  If this parameter is NULL, then a request is 
     770  @param[in]      Guid    The 128-bit unique value that designates the namespace from which to retrieve the next token.
     771                          This is an optional parameter that may be NULL.  If this parameter is NULL, then a request is
    772772                          being made to retrieve tokens from the default token space.
    773   @param[in, out] TokenNumber 
    774                           A pointer to the PCD token number to use to find the subsequent token number. 
    775 
    776   @retval EFI_SUCCESS   The PCD service retrieved the next valid token number. Or the input token number 
    777                         is already the last valid token number in the PCD database. 
     773  @param[in, out] TokenNumber
     774                          A pointer to the PCD token number to use to find the subsequent token number.
     775
     776  @retval EFI_SUCCESS   The PCD service retrieved the next valid token number. Or the input token number
     777                        is already the last valid token number in the PCD database.
    778778                        In the later case, *TokenNumber is updated with the value of 0.
    779779  @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
     
    789789/**
    790790  Get next token space in PCD database according to given token space guid.
    791  
    792   @param Guid            Given token space guid. If NULL, then Guid will be set to 
     791
     792  @param Guid            Given token space guid. If NULL, then Guid will be set to
    793793                         the first PCD token space in PCD database, If not NULL, then
    794794                         Guid will be set to next PCD token space.
     
    824824  @param[in]    TokenNumber The PCD token number.
    825825  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
    826                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 
     826                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
    827827
    828828  @retval  EFI_SUCCESS      The PCD information was returned successfully
     
    864864  @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.
    865865  @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.
    866   @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database. 
     866  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.
    867867  @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in
    868868                                 range of UINT8, UINT16, UINT32, UINT64
    869   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                               
     869  @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.
    870870**/
    871871EFI_STATUS
     
    898898/**
    899899  Set value for a dynamic PCD entry.
    900  
    901   This routine find the local token number according to dynamic-ex PCD's token 
     900
     901  This routine find the local token number according to dynamic-ex PCD's token
    902902  space guid and token number firstly, and invoke callback function if this PCD
    903903  entry registered callback function. Finally, invoken general SetWorker to set
    904904  PCD value.
    905  
     905
    906906  @param ExTokenNumber   Dynamic-ex PCD token number.
    907907  @param Guid            Token space guid for dynamic-ex PCD.
     
    925925/**
    926926  Get the PCD entry pointer in PCD database.
    927  
     927
    928928  This routine will visit PCD database to find the PCD entry according to given
    929   token number. The given token number is autogened by build tools and it will be 
    930   translated to local token number. Local token number contains PCD's type and 
     929  token number. The given token number is autogened by build tools and it will be
     930  translated to local token number. Local token number contains PCD's type and
    931931  offset of PCD entry in PCD database.
    932932
     
    983983  @param VariableGuid    Variable's guid
    984984  @param VariableName    Variable's unicode name string
    985   @param VariableData    Variable's data pointer, 
     985  @param VariableData    Variable's data pointer,
    986986  @param VariableSize    Variable's size.
    987987
     
    999999  Set value for HII-type PCD.
    10001000
    1001   A HII-type PCD's value is stored in a variable. Setting/Getting the value of 
     1001  A HII-type PCD's value is stored in a variable. Setting/Getting the value of
    10021002  HII-type PCD is to visit this variable.
    1003  
     1003
    10041004  @param VariableGuid    Guid of variable which stored value of a HII-type PCD.
    10051005  @param VariableName    Unicode name of variable which stored value of a HII-type PCD.
     
    10251025  This routine will register a callback function to a PCD entry by given token number
    10261026  and token space guid.
    1027  
     1027
    10281028  @param TokenNumber        PCD token's number, it is autogened by build tools.
    1029   @param Guid               PCD token space's guid, 
     1029  @param Guid               PCD token space's guid,
    10301030                            if not NULL, this PCD is dynamicEx type PCD.
    10311031  @param CallBackFunction   Callback function pointer
     
    10641064/**
    10651065  Initialize the PCD database in DXE phase.
    1066  
     1066
    10671067  PCD database in DXE phase also contains PCD database in PEI phase which is copied
    10681068  from GUID Hob.
     
    10801080  in DEC file. PCD database maintain a mapping table that translate pair of {token
    10811081  space guid: token number} to Token Number.
    1082  
     1082
    10831083  @param Guid            Token space guid for dynamic-ex PCD entry.
    10841084  @param ExTokenNumber   Dynamic-ex PCD token number.
     
    10951095/**
    10961096  Get next token number in given token space.
    1097  
     1097
    10981098  This routine is used for dynamicEx type PCD. It will firstly scan token space
    1099   table to get token space according to given token space guid. Then scan given 
    1100   token number in found token space, if found, then return next token number in 
     1099  table to get token space according to given token space guid. Then scan given
     1100  token number in found token space, if found, then return next token number in
    11011101  this token space.
    11021102
    1103   @param Guid            Token space guid. Next token number will be scaned in 
     1103  @param Guid            Token space guid. Next token number will be scaned in
    11041104                         this token space.
    1105   @param TokenNumber     Token number. 
    1106                          If PCD_INVALID_TOKEN_NUMBER, return first token number in 
     1105  @param TokenNumber     Token number.
     1106                         If PCD_INVALID_TOKEN_NUMBER, return first token number in
    11071107                         token space table.
    11081108                         If not PCD_INVALID_TOKEN_NUMBER, return next token number
     
    11611161extern  PCD_DATABASE   mPcdDatabase;
    11621162
    1163 extern  UINT32         mPcdTotalTokenCount; 
    1164 extern  UINT32         mPeiLocalTokenCount; 
    1165 extern  UINT32         mDxeLocalTokenCount; 
    1166 extern  UINT32         mPeiNexTokenCount;   
    1167 extern  UINT32         mDxeNexTokenCount; 
     1163extern  UINT32         mPcdTotalTokenCount;
     1164extern  UINT32         mPeiLocalTokenCount;
     1165extern  UINT32         mDxeLocalTokenCount;
     1166extern  UINT32         mPeiNexTokenCount;
     1167extern  UINT32         mDxeNexTokenCount;
    11681168extern  UINT32         mPeiExMapppingTableSize;
    11691169extern  UINT32         mDxeExMapppingTableSize;
     
    11711171extern  UINT32         mDxeGuidTableSize;
    11721172
    1173 extern  BOOLEAN        mPeiExMapTableEmpty; 
    1174 extern  BOOLEAN        mDxeExMapTableEmpty; 
     1173extern  BOOLEAN        mPeiExMapTableEmpty;
     1174extern  BOOLEAN        mDxeExMapTableEmpty;
    11751175extern  BOOLEAN        mPeiDatabaseEmpty;
    11761176
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Pcd.c

    r58459 r58466  
    1 /** @file 
     1/** @file
    22  All Pcd Ppi services are implemented here.
    3  
     3
    44Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
    5 This program and the accompanying materials                         
    6 are licensed and made available under the terms and conditions of the BSD License         
    7 which accompanies this distribution.  The full text of the license may be found at       
    8 http://opensource.org/licenses/bsd-license.php                                           
    9                                                                                          
    10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
    11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
     5This program and the accompanying materials
     6are licensed and made available under the terms and conditions of the BSD License
     7which accompanies this distribution.  The full text of the license may be found at
     8http://opensource.org/licenses/bsd-license.php
     9
     10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212
    1313**/
     
    2323
    2424  PeiPcdGet8,
    25   PeiPcdGet16,         
    26   PeiPcdGet32,         
    27   PeiPcdGet64,         
    28   PeiPcdGetPtr,         
    29   PeiPcdGetBool,     
     25  PeiPcdGet16,
     26  PeiPcdGet32,
     27  PeiPcdGet64,
     28  PeiPcdGetPtr,
     29  PeiPcdGetBool,
    3030  PeiPcdGetSize,
    3131
    3232  PeiPcdGet8Ex,
    33   PeiPcdGet16Ex,         
    34   PeiPcdGet32Ex,         
    35   PeiPcdGet64Ex,         
    36   PeiPcdGetPtrEx,         
    37   PeiPcdGetBoolEx,     
     33  PeiPcdGet16Ex,
     34  PeiPcdGet32Ex,
     35  PeiPcdGet64Ex,
     36  PeiPcdGetPtrEx,
     37  PeiPcdGetBoolEx,
    3838  PeiPcdGetSizeEx,
    39  
     39
    4040  PeiPcdSet8,
    41   PeiPcdSet16,         
    42   PeiPcdSet32,         
    43   PeiPcdSet64,         
    44   PeiPcdSetPtr,         
    45   PeiPcdSetBool,     
     41  PeiPcdSet16,
     42  PeiPcdSet32,
     43  PeiPcdSet64,
     44  PeiPcdSetPtr,
     45  PeiPcdSetBool,
    4646
    4747  PeiPcdSet8Ex,
    48   PeiPcdSet16Ex,         
    49   PeiPcdSet32Ex,         
    50   PeiPcdSet64Ex,         
    51   PeiPcdSetPtrEx,         
     48  PeiPcdSet16Ex,
     49  PeiPcdSet32Ex,
     50  PeiPcdSet64Ex,
     51  PeiPcdSetPtrEx,
    5252  PeiPcdSetBoolEx,
    5353
     
    6464EFI_PEI_PCD_PPI  mEfiPcdPpiInstance = {
    6565  PeiPcdSetSku,
    66  
     66
    6767  PeiPcdGet8Ex,
    6868  PeiPcdGet16Ex,
     
    131131/**
    132132  Main entry for PCD PEIM driver.
    133  
     133
    134134  This routine initialize the PCD database for PEI phase and install PCD_PPI/EFI_PEI_PCD_PPI.
    135135
     
    159159
    160160  //
    161   // Only install PcdInfo PPI when PCD info content is present. 
     161  // Only install PcdInfo PPI when PCD info content is present.
    162162  //
    163163  if (DataBase->PcdNameTableOffset != 0) {
     
    239239  Sets the SKU value for subsequent calls to set or get PCD token values.
    240240
    241   SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. 
     241  SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
    242242  SetSku() is normally called only once by the system.
    243243
    244   For each item (token), the database can hold a single value that applies to all SKUs, 
    245   or multiple values, where each value is associated with a specific SKU Id. Items with multiple, 
    246   SKU-specific values are called SKU enabled. 
    247  
    248   The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. 
    249   For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the 
    250   single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the 
    251   last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, 
    252   the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been 
     244  For each item (token), the database can hold a single value that applies to all SKUs,
     245  or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
     246  SKU-specific values are called SKU enabled.
     247
     248  The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
     249  For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
     250  single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
     251  last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
     252  the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
    253253  set for that Id, the results are unpredictable.
    254254
    255   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and 
     255  @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and
    256256              set values associated with a PCD token.
    257257
     
    272272  Retrieves an 8-bit value for a given PCD token.
    273273
    274   Retrieves the current byte-sized value for a PCD token number. 
     274  Retrieves the current byte-sized value for a PCD token number.
    275275  If the TokenNumber is invalid, the results are unpredictable.
    276  
    277   @param[in]  TokenNumber The PCD token number. 
     276
     277  @param[in]  TokenNumber The PCD token number.
    278278
    279279  @return The UINT8 value.
    280  
     280
    281281**/
    282282UINT8
     
    292292  Retrieves an 16-bit value for a given PCD token.
    293293
    294   Retrieves the current 16-bits value for a PCD token number. 
     294  Retrieves the current 16-bits value for a PCD token number.
    295295  If the TokenNumber is invalid, the results are unpredictable.
    296  
    297   @param[in]  TokenNumber The PCD token number. 
     296
     297  @param[in]  TokenNumber The PCD token number.
    298298
    299299  @return The UINT16 value.
    300  
     300
    301301**/
    302302UINT16
     
    312312  Retrieves an 32-bit value for a given PCD token.
    313313
    314   Retrieves the current 32-bits value for a PCD token number. 
     314  Retrieves the current 32-bits value for a PCD token number.
    315315  If the TokenNumber is invalid, the results are unpredictable.
    316  
    317   @param[in]  TokenNumber The PCD token number. 
     316
     317  @param[in]  TokenNumber The PCD token number.
    318318
    319319  @return The UINT32 value.
    320  
     320
    321321**/
    322322UINT32
     
    332332  Retrieves an 64-bit value for a given PCD token.
    333333
    334   Retrieves the current 64-bits value for a PCD token number. 
     334  Retrieves the current 64-bits value for a PCD token number.
    335335  If the TokenNumber is invalid, the results are unpredictable.
    336  
    337   @param[in]  TokenNumber The PCD token number. 
     336
     337  @param[in]  TokenNumber The PCD token number.
    338338
    339339  @return The UINT64 value.
    340  
     340
    341341**/
    342342UINT64
     
    352352  Retrieves a pointer to a value for a given PCD token.
    353353
    354   Retrieves the current pointer to the buffer for a PCD token number. 
    355   Do not make any assumptions about the alignment of the pointer that 
    356   is returned by this function call.  If the TokenNumber is invalid, 
     354  Retrieves the current pointer to the buffer for a PCD token number.
     355  Do not make any assumptions about the alignment of the pointer that
     356  is returned by this function call.  If the TokenNumber is invalid,
    357357  the results are unpredictable.
    358358
    359   @param[in]  TokenNumber The PCD token number. 
     359  @param[in]  TokenNumber The PCD token number.
    360360
    361361  @return The pointer to the buffer to be retrieved.
    362  
     362
    363363**/
    364364VOID *
     
    374374  Retrieves a Boolean value for a given PCD token.
    375375
    376   Retrieves the current boolean value for a PCD token number. 
    377   Do not make any assumptions about the alignment of the pointer that 
    378   is returned by this function call.  If the TokenNumber is invalid, 
     376  Retrieves the current boolean value for a PCD token number.
     377  Do not make any assumptions about the alignment of the pointer that
     378  is returned by this function call.  If the TokenNumber is invalid,
    379379  the results are unpredictable.
    380380
    381   @param[in]  TokenNumber The PCD token number. 
     381  @param[in]  TokenNumber The PCD token number.
    382382
    383383  @return The Boolean value.
    384  
     384
    385385**/
    386386BOOLEAN
     
    396396  Retrieves the size of the value for a given PCD token.
    397397
    398   Retrieves the current size of a particular PCD token. 
     398  Retrieves the current size of a particular PCD token.
    399399  If the TokenNumber is invalid, the results are unpredictable.
    400400
    401   @param[in]  TokenNumber The PCD token number. 
     401  @param[in]  TokenNumber The PCD token number.
    402402
    403403  @return The size of the value for the PCD token.
    404  
     404
    405405**/
    406406UINTN
     
    425425
    426426  // EBC compiler is very choosy. It may report warning about comparison
    427   // between UINTN and 0 . So we add 1 in each size of the 
     427  // between UINTN and 0 . So we add 1 in each size of the
    428428  // comparison.
    429429  ASSERT (TokenNumber + 1 < (LocalTokenCount + 1));
     
    445445  Retrieves an 8-bit value for a given PCD token.
    446446
    447   Retrieves the 8-bit value of a particular PCD token. 
     447  Retrieves the 8-bit value of a particular PCD token.
    448448  If the TokenNumber is invalid or the token space
    449   specified by Guid does not exist, the results are 
     449  specified by Guid does not exist, the results are
    450450  unpredictable.
    451451
    452452  @param[in]  Guid              The token space for the token number.
    453   @param[in]  ExTokenNumber     The PCD token number. 
     453  @param[in]  ExTokenNumber     The PCD token number.
    454454
    455455  @return The size 8-bit value for the PCD token.
    456  
     456
    457457**/
    458458UINT8
     
    469469  Retrieves an 16-bit value for a given PCD token.
    470470
    471   Retrieves the 16-bit value of a particular PCD token. 
     471  Retrieves the 16-bit value of a particular PCD token.
    472472  If the TokenNumber is invalid or the token space
    473   specified by Guid does not exist, the results are 
     473  specified by Guid does not exist, the results are
    474474  unpredictable.
    475475
    476476  @param[in]  Guid          The token space for the token number.
    477   @param[in]  ExTokenNumber The PCD token number. 
     477  @param[in]  ExTokenNumber The PCD token number.
    478478
    479479  @return The size 16-bit value for the PCD token.
    480  
     480
    481481**/
    482482UINT16
     
    493493  Retrieves an 32-bit value for a given PCD token.
    494494
    495   Retrieves the 32-bit value of a particular PCD token. 
     495  Retrieves the 32-bit value of a particular PCD token.
    496496  If the TokenNumber is invalid or the token space
    497   specified by Guid does not exist, the results are 
     497  specified by Guid does not exist, the results are
    498498  unpredictable.
    499499
    500500  @param[in]  Guid The token space for the token number.
    501   @param[in]  ExTokenNumber The PCD token number. 
     501  @param[in]  ExTokenNumber The PCD token number.
    502502
    503503  @return The size 32-bit value for the PCD token.
    504  
     504
    505505**/
    506506UINT32
     
    517517  Retrieves an 64-bit value for a given PCD token.
    518518
    519   Retrieves the 64-bit value of a particular PCD token. 
     519  Retrieves the 64-bit value of a particular PCD token.
    520520  If the TokenNumber is invalid or the token space
    521   specified by Guid does not exist, the results are 
     521  specified by Guid does not exist, the results are
    522522  unpredictable.
    523523
    524524  @param[in]  Guid The token space for the token number.
    525   @param[in]  ExTokenNumber The PCD token number. 
     525  @param[in]  ExTokenNumber The PCD token number.
    526526
    527527  @return The size 64-bit value for the PCD token.
    528  
     528
    529529**/
    530530UINT64
     
    541541  Retrieves a pointer to a value for a given PCD token.
    542542
    543   Retrieves the current pointer to the buffer for a PCD token number. 
    544   Do not make any assumptions about the alignment of the pointer that 
    545   is returned by this function call.  If the TokenNumber is invalid, 
     543  Retrieves the current pointer to the buffer for a PCD token number.
     544  Do not make any assumptions about the alignment of the pointer that
     545  is returned by this function call.  If the TokenNumber is invalid,
    546546  the results are unpredictable.
    547547
    548548  @param[in]  Guid          The token space for the token number.
    549   @param[in]  ExTokenNumber The PCD token number. 
     549  @param[in]  ExTokenNumber The PCD token number.
    550550
    551551  @return The pointer to the buffer to be retrieved.
    552  
     552
    553553**/
    554554VOID *
     
    565565  Retrieves an Boolean value for a given PCD token.
    566566
    567   Retrieves the Boolean value of a particular PCD token. 
     567  Retrieves the Boolean value of a particular PCD token.
    568568  If the TokenNumber is invalid or the token space
    569   specified by Guid does not exist, the results are 
     569  specified by Guid does not exist, the results are
    570570  unpredictable.
    571571
    572572  @param[in]  Guid          The token space for the token number.
    573   @param[in]  ExTokenNumber The PCD token number. 
     573  @param[in]  ExTokenNumber The PCD token number.
    574574
    575575  @return The size Boolean value for the PCD token.
    576  
     576
    577577**/
    578578BOOLEAN
     
    589589  Retrieves the size of the value for a given PCD token.
    590590
    591   Retrieves the current size of a particular PCD token. 
     591  Retrieves the current size of a particular PCD token.
    592592  If the TokenNumber is invalid, the results are unpredictable.
    593593
    594594  @param[in]  Guid          The token space for the token number.
    595   @param[in]  ExTokenNumber The PCD token number. 
     595  @param[in]  ExTokenNumber The PCD token number.
    596596
    597597  @return The size of the value for the PCD token.
    598  
     598
    599599**/
    600600UINTN
     
    611611  Sets an 8-bit value for a given PCD token.
    612612
    613   When the PCD service sets a value, it will check to ensure that the 
    614   size of the value being set is compatible with the Token's existing definition. 
     613  When the PCD service sets a value, it will check to ensure that the
     614  size of the value being set is compatible with the Token's existing definition.
    615615  If it is not, an error will be returned.
    616616
    617   @param[in]  TokenNumber The PCD token number. 
     617  @param[in]  TokenNumber The PCD token number.
    618618  @param[in]  Value The value to set for the PCD token.
    619619
    620620  @retval EFI_SUCCESS  Procedure returned successfully.
    621   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    622                                   being set was incompatible with a call to this function. 
     621  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     622                                  being set was incompatible with a call to this function.
    623623                                  Use GetSize() to retrieve the size of the target data.
    624624  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    625  
     625
    626626**/
    627627EFI_STATUS
     
    638638  Sets an 16-bit value for a given PCD token.
    639639
    640   When the PCD service sets a value, it will check to ensure that the 
    641   size of the value being set is compatible with the Token's existing definition. 
     640  When the PCD service sets a value, it will check to ensure that the
     641  size of the value being set is compatible with the Token's existing definition.
    642642  If it is not, an error will be returned.
    643643
    644   @param[in]  TokenNumber The PCD token number. 
     644  @param[in]  TokenNumber The PCD token number.
    645645  @param[in]  Value The value to set for the PCD token.
    646646
    647647  @retval EFI_SUCCESS  Procedure returned successfully.
    648   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    649                                   being set was incompatible with a call to this function. 
     648  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     649                                  being set was incompatible with a call to this function.
    650650                                  Use GetSize() to retrieve the size of the target data.
    651651  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    652  
     652
    653653**/
    654654EFI_STATUS
     
    665665  Sets an 32-bit value for a given PCD token.
    666666
    667   When the PCD service sets a value, it will check to ensure that the 
    668   size of the value being set is compatible with the Token's existing definition. 
     667  When the PCD service sets a value, it will check to ensure that the
     668  size of the value being set is compatible with the Token's existing definition.
    669669  If it is not, an error will be returned.
    670670
    671   @param[in]  TokenNumber The PCD token number. 
     671  @param[in]  TokenNumber The PCD token number.
    672672  @param[in]  Value The value to set for the PCD token.
    673673
    674674  @retval EFI_SUCCESS  Procedure returned successfully.
    675   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    676                                   being set was incompatible with a call to this function. 
     675  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     676                                  being set was incompatible with a call to this function.
    677677                                  Use GetSize() to retrieve the size of the target data.
    678678  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    679  
     679
    680680**/
    681681EFI_STATUS
     
    692692  Sets an 64-bit value for a given PCD token.
    693693
    694   When the PCD service sets a value, it will check to ensure that the 
    695   size of the value being set is compatible with the Token's existing definition. 
     694  When the PCD service sets a value, it will check to ensure that the
     695  size of the value being set is compatible with the Token's existing definition.
    696696  If it is not, an error will be returned.
    697697
    698   @param[in]  TokenNumber The PCD token number. 
     698  @param[in]  TokenNumber The PCD token number.
    699699  @param[in]  Value The value to set for the PCD token.
    700700
    701701  @retval EFI_SUCCESS  Procedure returned successfully.
    702   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    703                                   being set was incompatible with a call to this function. 
     702  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     703                                  being set was incompatible with a call to this function.
    704704                                  Use GetSize() to retrieve the size of the target data.
    705705  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    706  
     706
    707707**/
    708708EFI_STATUS
     
    719719  Sets a value of a specified size for a given PCD token.
    720720
    721   When the PCD service sets a value, it will check to ensure that the 
    722   size of the value being set is compatible with the Token's existing definition. 
     721  When the PCD service sets a value, it will check to ensure that the
     722  size of the value being set is compatible with the Token's existing definition.
    723723  If it is not, an error will be returned.
    724724
    725   @param[in]  TokenNumber The PCD token number. 
    726   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    727                               On input, if the SizeOfValue is greater than the maximum size supported 
    728                               for this TokenNumber then the output value of SizeOfValue will reflect 
     725  @param[in]  TokenNumber The PCD token number.
     726  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     727                              On input, if the SizeOfValue is greater than the maximum size supported
     728                              for this TokenNumber then the output value of SizeOfValue will reflect
    729729                              the maximum size supported for this TokenNumber.
    730730  @param[in]  Buffer The buffer to set for the PCD token.
    731731
    732732  @retval EFI_SUCCESS  Procedure returned successfully.
    733   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    734                                   being set was incompatible with a call to this function. 
     733  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     734                                  being set was incompatible with a call to this function.
    735735                                  Use GetSize() to retrieve the size of the target data.
    736736  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    737  
     737
    738738**/
    739739EFI_STATUS
     
    751751  Sets an Boolean value for a given PCD token.
    752752
    753   When the PCD service sets a value, it will check to ensure that the 
    754   size of the value being set is compatible with the Token's existing definition. 
     753  When the PCD service sets a value, it will check to ensure that the
     754  size of the value being set is compatible with the Token's existing definition.
    755755  If it is not, an error will be returned.
    756756
    757   @param[in]  TokenNumber The PCD token number. 
     757  @param[in]  TokenNumber The PCD token number.
    758758  @param[in]  Value The value to set for the PCD token.
    759759
    760760  @retval EFI_SUCCESS  Procedure returned successfully.
    761   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    762                                   being set was incompatible with a call to this function. 
     761  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     762                                  being set was incompatible with a call to this function.
    763763                                  Use GetSize() to retrieve the size of the target data.
    764764  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    765  
     765
    766766**/
    767767EFI_STATUS
     
    778778  Sets an 8-bit value for a given PCD token.
    779779
    780   When the PCD service sets a value, it will check to ensure that the 
    781   size of the value being set is compatible with the Token's existing definition. 
     780  When the PCD service sets a value, it will check to ensure that the
     781  size of the value being set is compatible with the Token's existing definition.
    782782  If it is not, an error will be returned.
    783783
    784784  @param[in]  Guid          The 128-bit unique value that designates the namespace from which to extract the value.
    785   @param[in]  ExTokenNumber The PCD token number. 
     785  @param[in]  ExTokenNumber The PCD token number.
    786786  @param[in]  Value         The value to set for the PCD token.
    787787
    788788  @retval EFI_SUCCESS  Procedure returned successfully.
    789   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    790                                   being set was incompatible with a call to this function. 
     789  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     790                                  being set was incompatible with a call to this function.
    791791                                  Use GetSize() to retrieve the size of the target data.
    792792  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    793  
     793
    794794**/
    795795EFI_STATUS
     
    807807  Sets an 16-bit value for a given PCD token.
    808808
    809   When the PCD service sets a value, it will check to ensure that the 
    810   size of the value being set is compatible with the Token's existing definition. 
     809  When the PCD service sets a value, it will check to ensure that the
     810  size of the value being set is compatible with the Token's existing definition.
    811811  If it is not, an error will be returned.
    812812
    813813  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    814   @param[in]  ExTokenNumber The PCD token number. 
     814  @param[in]  ExTokenNumber The PCD token number.
    815815  @param[in]  Value The value to set for the PCD token.
    816816
    817817  @retval EFI_SUCCESS  Procedure returned successfully.
    818   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    819                                   being set was incompatible with a call to this function. 
     818  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     819                                  being set was incompatible with a call to this function.
    820820                                  Use GetSize() to retrieve the size of the target data.
    821821  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    822  
     822
    823823**/
    824824EFI_STATUS
     
    836836  Sets an 32-bit value for a given PCD token.
    837837
    838   When the PCD service sets a value, it will check to ensure that the 
    839   size of the value being set is compatible with the Token's existing definition. 
     838  When the PCD service sets a value, it will check to ensure that the
     839  size of the value being set is compatible with the Token's existing definition.
    840840  If it is not, an error will be returned.
    841841
    842842  @param[in]  Guid          The 128-bit unique value that designates the namespace from which to extract the value.
    843   @param[in]  ExTokenNumber The PCD token number. 
     843  @param[in]  ExTokenNumber The PCD token number.
    844844  @param[in]  Value         The value to set for the PCD token.
    845845
    846846  @retval EFI_SUCCESS  Procedure returned successfully.
    847   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    848                                   being set was incompatible with a call to this function. 
     847  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     848                                  being set was incompatible with a call to this function.
    849849                                  Use GetSize() to retrieve the size of the target data.
    850850  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    851  
     851
    852852**/
    853853EFI_STATUS
     
    865865  Sets an 64-bit value for a given PCD token.
    866866
    867   When the PCD service sets a value, it will check to ensure that the 
    868   size of the value being set is compatible with the Token's existing definition. 
     867  When the PCD service sets a value, it will check to ensure that the
     868  size of the value being set is compatible with the Token's existing definition.
    869869  If it is not, an error will be returned.
    870870
    871871  @param[in]  Guid          The 128-bit unique value that designates the namespace from which to extract the value.
    872   @param[in]  ExTokenNumber The PCD token number. 
     872  @param[in]  ExTokenNumber The PCD token number.
    873873  @param[in]  Value         The value to set for the PCD token.
    874874
    875875  @retval EFI_SUCCESS  Procedure returned successfully.
    876   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    877                                   being set was incompatible with a call to this function. 
     876  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     877                                  being set was incompatible with a call to this function.
    878878                                  Use GetSize() to retrieve the size of the target data.
    879879  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    880  
     880
    881881**/
    882882EFI_STATUS
     
    894894  Sets a value of a specified size for a given PCD token.
    895895
    896   When the PCD service sets a value, it will check to ensure that the 
    897   size of the value being set is compatible with the Token's existing definition. 
     896  When the PCD service sets a value, it will check to ensure that the
     897  size of the value being set is compatible with the Token's existing definition.
    898898  If it is not, an error will be returned.
    899899
    900900  @param[in]        Guid            The 128-bit unique value that designates the namespace from which to extract the value.
    901   @param[in]        ExTokenNumber   The PCD token number. 
    902   @param[in, out]   SizeOfBuffer    A pointer to the length of the value being set for the PCD token. 
    903                                     On input, if the SizeOfValue is greater than the maximum size supported 
    904                                     for this TokenNumber then the output value of SizeOfValue will reflect 
     901  @param[in]        ExTokenNumber   The PCD token number.
     902  @param[in, out]   SizeOfBuffer    A pointer to the length of the value being set for the PCD token.
     903                                    On input, if the SizeOfValue is greater than the maximum size supported
     904                                    for this TokenNumber then the output value of SizeOfValue will reflect
    905905                                    the maximum size supported for this TokenNumber.
    906906  @param[in]        Value           The buffer to set for the PCD token.
    907907
    908908  @retval EFI_SUCCESS  Procedure returned successfully.
    909   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    910                                   being set was incompatible with a call to this function. 
     909  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     910                                  being set was incompatible with a call to this function.
    911911                                  Use GetSize() to retrieve the size of the target data.
    912912  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    913  
     913
    914914**/
    915915EFI_STATUS
     
    928928  Sets an Boolean value for a given PCD token.
    929929
    930   When the PCD service sets a value, it will check to ensure that the 
    931   size of the value being set is compatible with the Token's existing definition. 
     930  When the PCD service sets a value, it will check to ensure that the
     931  size of the value being set is compatible with the Token's existing definition.
    932932  If it is not, an error will be returned.
    933933
    934934  @param [in]  Guid          The 128-bit unique value that designates the namespace from which to extract the value.
    935   @param [in]  ExTokenNumber The PCD token number. 
     935  @param [in]  ExTokenNumber The PCD token number.
    936936  @param [in]  Value         The value to set for the PCD token.
    937937
    938938  @retval EFI_SUCCESS  Procedure returned successfully.
    939   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    940                                   being set was incompatible with a call to this function. 
     939  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     940                                  being set was incompatible with a call to this function.
    941941                                  Use GetSize() to retrieve the size of the target data.
    942942  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    943  
     943
    944944**/
    945945EFI_STATUS
     
    958958
    959959  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    960   @param[in]  ExTokenNumber The PCD token number. 
    961   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    962 
    963   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     960  @param[in]  ExTokenNumber The PCD token number.
     961  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     962
     963  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    964964                        for the CallBackToken requested.
    965965  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    989989
    990990  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    991   @param[in]  ExTokenNumber The PCD token number. 
    992   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    993 
    994   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     991  @param[in]  ExTokenNumber The PCD token number.
     992  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     993
     994  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    995995                        for the CallBackToken requested.
    996996  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    10171017
    10181018/**
    1019   Retrieves the next valid token number in a given namespace. 
    1020  
    1021   This is useful since the PCD infrastructure contains a sparse list of token numbers, 
    1022   and one cannot a priori know what token numbers are valid in the database. 
    1023  
    1024   If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. 
    1025   If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. 
    1026   If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. 
    1027   If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. 
    1028   The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. 
    1029   If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. 
    1030   If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. 
     1019  Retrieves the next valid token number in a given namespace.
     1020
     1021  This is useful since the PCD infrastructure contains a sparse list of token numbers,
     1022  and one cannot a priori know what token numbers are valid in the database.
     1023
     1024  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
     1025  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
     1026  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
     1027  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
     1028  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
     1029  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
     1030  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    10311031  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    10321032
    10331033
    1034   @param[in]       Guid        The 128-bit unique value that designates the namespace from which to extract the value. 
    1035                                This is an optional parameter that may be NULL.  If this parameter is NULL, then a request 
     1034  @param[in]       Guid        The 128-bit unique value that designates the namespace from which to extract the value.
     1035                               This is an optional parameter that may be NULL.  If this parameter is NULL, then a request
    10361036                               is being made to retrieve tokens from the default token space.
    10371037  @param[in, out]  TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
    1038                    
     1038
    10391039  @retval EFI_SUCCESS   The PCD service has retrieved the next valid token number.
    10401040  @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
     
    10561056  BOOLEAN             Found;
    10571057  BOOLEAN             PeiExMapTableEmpty;
    1058   UINTN               PeiNexTokenNumber; 
     1058  UINTN               PeiNexTokenNumber;
    10591059
    10601060  if (!FeaturePcdGet (PcdPeiFullPcdDatabaseEnable)) {
     
    11521152                            space of the current platform is returned. If the search cannot locate the next valid
    11531153                            token namespace, an error is returned and the value of *Guid is undefined.
    1154  
     1154
    11551155  @retval  EFI_SUCCESS      The PCD service retrieved the value requested.
    11561156  @retval  EFI_NOT_FOUND    The PCD service could not find the next valid token namespace.
     
    11861186    PeiExMapTableEmpty = FALSE;
    11871187  }
    1188  
     1188
    11891189  if (PeiExMapTableEmpty) {
    11901190    return EFI_NOT_FOUND;
     
    11931193  ExMapTable = (DYNAMICEX_MAPPING *)((UINT8 *)PeiPcdDb + PeiPcdDb->ExMapTableOffset);
    11941194  GuidTable  = (EFI_GUID *)((UINT8 *)PeiPcdDb + PeiPcdDb->GuidTableOffset);
    1195  
     1195
    11961196  if (*Guid == NULL) {
    11971197    //
     
    12071207    return EFI_NOT_FOUND;
    12081208  }
    1209  
     1209
    12101210  GuidTableIdx = MatchGuid - GuidTable;
    12111211
     
    12471247/**
    12481248  Get PCD value's size for POINTER type PCD.
    1249  
     1249
    12501250  The POINTER type PCD's value will be stored into a buffer in specified size.
    12511251  The max size of this PCD's value is described in PCD's definition in DEC file.
     
    12761276
    12771277  ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER);
    1278  
     1278
    12791279  SizeTable = (SIZE_INFO *)((UINT8 *)Database + Database->SizeTableOffset);
    12801280
    12811281  *MaxSize = SizeTable[SizeTableIdx];
    12821282  //
    1283   // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1283  // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    12841284  // PCD entry.
    12851285  //
     
    13191319/**
    13201320  Set PCD value's size for POINTER type PCD.
    1321  
     1321
    13221322  The POINTER type PCD's value will be stored into a buffer in specified size.
    13231323  The max size of this PCD's value is described in PCD's definition in DEC file.
     
    13441344  UINTN       Index;
    13451345  UINTN       MaxSize;
    1346  
     1346
    13471347  SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database);
    13481348
     
    13551355  MaxSize = SizeTable[SizeTableIdx];
    13561356  //
    1357   // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1357  // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    13581358  // PCD entry.
    13591359  //
     
    13701370       return FALSE;
    13711371    }
    1372    
     1372
    13731373    if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) {
    13741374      //
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Pcd.inf

    r58459 r58466  
    22# PCD PEIM produces PCD database to manage all dynamic PCD in PEI phase and install Pcd Ppi service.
    33#
    4 # This version PCD PEIM depends on the external PCD database binary file, not built in PCD data base. 
     4# This version PCD PEIM depends on the external PCD database binary file, not built in PCD data base.
    55# There are two PCD PPIs as follows:
    6 #   1) PCD_PPI 
     6#   1) PCD_PPI
    77#      It is EDKII implementation which support Dynamic/DynamicEx Pcds.
    88#   2) EFI_PEI_PCD_PPI
    9 #      It is defined by PI specification 1.2, Vol 3 which only support dynamicEx 
     9#      It is defined by PI specification 1.2, Vol 3 which only support dynamicEx
    1010#      type Pcd.
    1111# For dynamicEx type PCD, it is compatible between PCD_PPI and EFI_PEI_PCD_PPI.
    1212# PCD PEIM driver will produce above two PPIs at same time.
    1313#
    14 # PCD database is generated as the separate binary image at build time. The binary image 
    15 # will be intergrated into Firmware volume together with PCD driver. 
     14# PCD database is generated as the separate binary image at build time. The binary image
     15# will be intergrated into Firmware volume together with PCD driver.
    1616#
    1717# ////////////////////////////////////////////////////////////////////////////////
     
    2222#
    2323# 1, Introduction
    24 #    PCD database hold all dynamic type PCD information. The structure of PEI PCD 
    25 #    database is generated by build tools according to dynamic PCD usage for 
     24#    PCD database hold all dynamic type PCD information. The structure of PEI PCD
     25#    database is generated by build tools according to dynamic PCD usage for
    2626#    specified platform.
    27 #   
     27#
    2828# 2, Dynamic Type PCD
    2929#    Dynamic type PCD is used for the configuration/setting which value is determined
    30 #    dynamic. In contrast, the value of static type PCD (FeatureFlag, FixedPcd, 
    31 #    PatchablePcd) is fixed in final generated FD image in build time. 
    32 #       
     30#    dynamic. In contrast, the value of static type PCD (FeatureFlag, FixedPcd,
     31#    PatchablePcd) is fixed in final generated FD image in build time.
     32#
    3333#    2.1 The "dynamic" determination means one of below cases:
    34 #      a) The PCD setting value is produced by someone driver and consumed by 
     34#      a) The PCD setting value is produced by someone driver and consumed by
    3535#         other driver in execution time.
    3636#      b) The PCD setting value is set/get by user from FrontPage.
    3737#      c) The PCD setting value is produced by platform OEM vendor in specified area.
    38 #   
     38#
    3939#    2.2 According to module distribution way, dynamic PCD could be classfied as:
    4040#      a) Dynamic:
    41 #         If module is released in source code and will be built with platform 
     41#         If module is released in source code and will be built with platform
    4242#         DSC, the dynamic PCD used by this module can be accessed as:
    43 #                 PcdGetxx(PcdSampleDynamicPcd); 
     43#                 PcdGetxx(PcdSampleDynamicPcd);
    4444#         In building platform, build tools will translate PcdSampleDynamicPcd to
    45 #         pair of {Token Space Guid: Token Number} for this PCD. 
     45#         pair of {Token Space Guid: Token Number} for this PCD.
    4646#      b) DynamicEx:
    4747#         If module is release as binary and will not pariticpate platform building,
     
    5050#         Developer need explicity gives {Token Space Guid:Token Number} as parameter
    5151#         in writting source code.
    52 #         
     52#
    5353#    2.3 According to PCD value's storage method, dynamic PCD could be classfied as:
    54 #      a) Default Storage: 
    55 #         - The PCD value is stored in PCD database maintained by PCD driver in boot 
     54#      a) Default Storage:
     55#         - The PCD value is stored in PCD database maintained by PCD driver in boot
    5656#           time memory.
    57 #         - This type is used for communication between PEIM/DXE driver, DXE/DXE 
    58 #           driver. But all set/get value will be losted after boot-time memory 
     57#         - This type is used for communication between PEIM/DXE driver, DXE/DXE
     58#           driver. But all set/get value will be losted after boot-time memory
    5959#           is turn off.
    60 #         - [PcdsDynamicDefault] is used as section name for this type PCD in 
     60#         - [PcdsDynamicDefault] is used as section name for this type PCD in
    6161#           platform DSC file. [PcdsDynamicExDefault] is used for dynamicEx type PCD.
    62 #         
    63 #      b) Variable Storage: 
    64 #         - The PCD value is stored in variable area. 
     62#
     63#      b) Variable Storage:
     64#         - The PCD value is stored in variable area.
    6565#         - As default storage type, this type PCD could be used for PEI/DXE driver
    66 #           communication. But beside it, this type PCD could also be used to store 
     66#           communication. But beside it, this type PCD could also be used to store
    6767#           the value associate with a HII setting via variable interface.
    68 #         - In PEI phase, the PCD value could only be got but can not be set due 
     68#         - In PEI phase, the PCD value could only be got but can not be set due
    6969#           to variable area is readonly.
    70 #         - [PcdsDynamicHii] is used as section name for this type PCD in platform 
     70#         - [PcdsDynamicHii] is used as section name for this type PCD in platform
    7171#           DSC file. [PcdsDynamicExHii] is for dynamicEx type PCD.
    72 #           
     72#
    7373#      c) OEM specificed storage area:
    74 #         - The PCD value is stored in OEM specified area which base address is 
     74#         - The PCD value is stored in OEM specified area which base address is
    7575#           specified by a FixedAtBuild PCD setting - PcdVpdBaseAddress.
    7676#         - The area is read only for PEI and DXE phase.
    77 #         - [PcdsDynamicVpd] is used as section name for this type PCD in platform 
     77#         - [PcdsDynamicVpd] is used as section name for this type PCD in platform
    7878#           DSC file. [PcdsDynamicExVpd] is for dynamicex type PCD.
    79 #     
     79#
    8080#    2.4 When and how to use dynamic PCD
    8181#      Module developer do not care the used PCD is dynamic or static when writting
    82 #      source code/INF. Dynamic PCD and dynamic type is pointed by platform integrator 
     82#      source code/INF. Dynamic PCD and dynamic type is pointed by platform integrator
    8383#      in platform DSC file. Please ref section 2.3 to get matching between dynamic
    8484#      PCD type and section name in DSC file.
    85 #   
     85#
    8686# 3, PCD database:
    87 #    Although dynamic PCD could be in different storage type as above description, 
     87#    Although dynamic PCD could be in different storage type as above description,
    8888#    but the basic information and default value for all dynamic PCD is hold
    8989#    by PCD database maintained by PEI/DXE driver.
    90 #   
     90#
    9191#    As the whole EFI BIOS boot path is divided into PEI/DXE phase, the PCD database
    9292#    also is divided into Pei/Dxe database maintaied by PcdPeim/PcdDxe driver separatly.
     
    9494#    PCD information used in PEI phase or use in both PEI/DXE phase. And DXE PCD
    9595#    database contains all PCDs used in PEI/DXE phase in memory.
    96 #   
    97 #    Build tool will generate PCD database into the separate binary file for 
    98 #    PEI/DXE PCD driver according to dynamic PCD section in platform DSC file. 
    99 #   
     96#
     97#    Build tool will generate PCD database into the separate binary file for
     98#    PEI/DXE PCD driver according to dynamic PCD section in platform DSC file.
     99#
    100100#    3.1 PcdPeim and PcdDxe
    101101#      PEI PCD database is maintained by PcdPeim driver run from flash. PcdPeim driver
    102 #      build guid hob in temporary memory and copy the binary data base from flash 
    103 #      to temporary memory for PEI PCD database. 
     102#      build guid hob in temporary memory and copy the binary data base from flash
     103#      to temporary memory for PEI PCD database.
    104104#      DXE PCD database is maintained by PcdDxe driver.At entry point of PcdDxe driver,
    105105#      a new PCD database is allocated in boot-time memory which including all
    106106#      PEI PCD and DXE PCD entry.
    107 #     
     107#
    108108#      Pcd driver should run as early as possible before any other driver access
    109109#      dynamic PCD's value. PEI/DXE "Apriori File" mechanism make it possible by
    110110#      making PcdPeim/PcdDxe as first dispatching driver in PEI/DXE phase.
    111 #     
     111#
    112112#    3.2 Token space Guid/Token number, Platform token, Local token number
    113113#           Dynamic PCD
     
    129129#                               |  Number   |
    130130#                               +-----------+
    131 #   
    132 #   
     131#
     132#
    133133#      3.2.1 Pair of Token space guid + Token number
    134134#        Any type PCD is identified by pair of "TokenSpaceGuid + TokeNumber". But it
    135 #        is not easy maintained by PCD driver, and hashed token number will make 
    136 #        searching slowly. 
     135#        is not easy maintained by PCD driver, and hashed token number will make
     136#        searching slowly.
    137137#
    138138#      3.2.2 Platform Token Number
    139 #        "Platform token number" concept is introduced for mapping to a pair of 
    140 #        "TokenSpaceGuid + TokenNumber". The platform token number is generated by 
    141 #        build tool in autogen.h and all of them are continual in a platform scope 
     139#        "Platform token number" concept is introduced for mapping to a pair of
     140#        "TokenSpaceGuid + TokenNumber". The platform token number is generated by
     141#        build tool in autogen.h and all of them are continual in a platform scope
    142142#        started from 1.(0 meaning invalid internal token number)
    143143#        With auto-generated "platform token number", PcdGet(PcdSampleDynamicPcd)
    144 #        in source code is translated to LibPcdGet(_PCD_TOKEN_PcdSampleDynamicPcd) 
     144#        in source code is translated to LibPcdGet(_PCD_TOKEN_PcdSampleDynamicPcd)
    145145#        in autogen.h.
    146146#        Notes: The mapping between pair of "tokenspace guid + token number" and
     
    149149#        To access a dynamicEx type PCD, pair of "token space guid/token number" all need
    150150#        to be specificed for PcdSet/PcdGet accessing macro.
    151 #     
    152 #        Platform Token Number is started from 1, and inceased continuous. From whole 
     151#
     152#        Platform Token Number is started from 1, and inceased continuous. From whole
    153153#        platform scope, there are two zones: PEI Zone and DXE Zone
    154154#                  |                      Platform Token Number
     
    156156#        PEI Zone: |            1                 ~  PEI_LOCAL_TOKEN_NUMBER
    157157#        DXE Zone: | (PEI_LOCAL_TOKEN_NUMBER + 1) ~ (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)
    158 #       
     158#
    159159#      3.2.3 Local Token Number
    160 #        To fast searching a PCD entry in PCD database, PCD driver translate 
     160#        To fast searching a PCD entry in PCD database, PCD driver translate
    161161#        platform token number to local token number via a mapping table.
    162162#        For binary DynamicEx type PCD, there is a another mapping table to translate
     
    164164#        Local token number is identifier for all internal interface in PCD PEI/DXE
    165165#        driver.
    166 #       
     166#
    167167#        A local token number is a 32-bit value in following meaning:
    168168#         32 ------------- 28 ---------- 24 -------- 0
     
    185185#       Based on local token number, PCD driver could fast determine PCD type, value
    186186#       type and get PCD entry from PCD database.
    187 #       
     187#
    188188#    3.3 PCD Database binary file
    189 #      PCD Database binary file will be created at build time as the standalone binary image. 
    190 #      To understand the binary image layout, PCD Database C structure is still generated 
     189#      PCD Database binary file will be created at build time as the standalone binary image.
     190#      To understand the binary image layout, PCD Database C structure is still generated
    191191#      as comments by build tools in PCD driver's autogen.h/
    192192#      autogen.c file. In generated C structure, following information is stored:
    193 #      - ExMapTable: This table is used translate a binary dynamicex type PCD's 
     193#      - ExMapTable: This table is used translate a binary dynamicex type PCD's
    194194#                    "tokenguid + token" to local token number.
    195195#      - LocalTokenNumberTable:
     
    201201#      - SkuIdTable: TBD
    202202#      - SystemSkuId: TBD
    203 #      - PCD value structure: 
     203#      - PCD value structure:
    204204#                    Every PCD has a value record in PCD database. For different
    205 #                    datum type PCD has different record structure which will be 
     205#                    datum type PCD has different record structure which will be
    206206#                    introduced in 3.3.1
    207 #     
    208 #      In a PCD database structure, there are two major area: Init and UnInit. 
    209 #      Init area is use stored above PCD internal structure such as ExMapTable, 
    210 #      LocalTokenNumberTable etc and the (default) value of PCD which has default 
     207#
     208#      In a PCD database structure, there are two major area: Init and UnInit.
     209#      Init area is use stored above PCD internal structure such as ExMapTable,
     210#      LocalTokenNumberTable etc and the (default) value of PCD which has default
    211211#      value specified in platform DSC file.
    212212#      Unint area is used stored the value of PCD which has no default value in
    213213#      platform DSC file, the value of NULL, 0 specified in platform DSC file can
    214214#      be seemed as "no default value".
    215 #     
     215#
    216216#      3.3.1 Simple Sample PCD Database C Structure
    217217#        A general sample of PCD database structue is as follows:
     
    225225#            UINT8             SkuIdTable[PEI_SKUID_TABLE_SIZE];
    226226#            SKU_ID            SystemSkuId;
    227 #           
     227#
    228228#            //===== Following is value structure for PCD with default value
    229229#            ....
     
    237237#          } UnInit;
    238238#        }
    239 #     
     239#
    240240#      3.3.2 PCD value structure in PCD database C structure
    241241#        The value's structure is generated by build tool in PCD database C structure.
    242242#        The PCDs in different datum type has different value structure.
    243 #       
     243#
    244244#        3.3.2.1 UINT8/UINT16/UINT32/UINT64 datum type PCD
    245245#          The C structure for these datum type PCD is just a UINT8/UINT16/UINT32/UINT64
     
    249249#          Member type is UINT16 according to PcdHardwareErrorRecordLevel declaration
    250250#          in DEC file.
    251 #         
     251#
    252252#        3.3.2.2 VOID* datum type PCD
    253253#          The value of VOID* datum type PCD is a UINT8/UINT16 array in PCD database.
    254 #         
     254#
    255255#          3.3.2.2.1 VOID* - string type
    256 #            If the default value for VOID* datum type PCD like L"xxx", the PCD is 
    257 #            used for unicode string, and C structure of this datum type PCD is 
     256#            If the default value for VOID* datum type PCD like L"xxx", the PCD is
     257#            used for unicode string, and C structure of this datum type PCD is
    258258#            UINT16 string array in PCD database, for example:
    259259#            UINT16 StringTable[29];
    260260#            The number of 29 in above sample is max size of a unicode string.
    261 #           
     261#
    262262#            If the default value for VOID* datum type PCD like "xxx", the PCD is
    263 #            used for ascii string, and C structure of this datum type PCD is 
     263#            used for ascii string, and C structure of this datum type PCD is
    264264#            UINT8 string array in PCD database, for example:
    265265#            UINT8 StringTable[20];
    266266#            The number of 20 in above sample is max size of a ascii string.
    267 #           
     267#
    268268#          3.3.2.2.2 VOID* - byte array
    269269#            If the default value of VOID* datum type PCD like {'0x29', '0x01', '0xf2'}
    270 #            the PCD is used for byte array. The generated structrue is same as 
     270#            the PCD is used for byte array. The generated structrue is same as
    271271#            above ascii string table,
    272272#            UINT8 StringTable[13];
    273273#            The number of 13 in above sample is max size of byte array.
    274 #       
     274#
    275275#      3.3.3 Some utility structures in PCD Database
    276276#        3.3.3.1 GuidTable
    277277#          GuidTable array is used to store all related GUID value in PCD database:
    278278#            - Variable GUID for HII type PCD
    279 #            - Token space GUID for dynamicex type PCD 
    280 #   
     279#            - Token space GUID for dynamicex type PCD
     280#
    281281#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    282282#
     
    329329  ## PRODUCES            ## HOB
    330330  ## SOMETIMES_CONSUMES  ## HOB
    331   gPcdDataBaseHobGuid                           
     331  gPcdDataBaseHobGuid
    332332  gPcdDataBaseSignatureGuid                     ## CONSUMES  ## GUID  # PCD database signature GUID.
    333333
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Service.c

    r58459 r58466  
    145145    AsciiStrCat (Name, TokenSpaceName);
    146146    Name[AsciiStrSize (TokenSpaceName) - sizeof (CHAR8)] = '.';
    147     AsciiStrCat (Name, PcdName); 
     147    AsciiStrCat (Name, PcdName);
    148148  }
    149149
     
    161161  @param[in]    TokenNumber The PCD token number.
    162162  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
    163                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 
     163                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
    164164
    165165  @retval  EFI_SUCCESS      The PCD information was returned successfully
     
    207207        //
    208208        // Here use one representative in the token space to get the TokenSpaceCName.
    209         // 
     209        //
    210210        PcdInfo->PcdName = GetPcdName (TRUE, Database, ExMapTable[Index].TokenNumber);
    211211        return EFI_SUCCESS;
     
    350350    TokenNumber--;
    351351    // EBC compiler is very choosy. It may report warning about comparison
    352     // between UINTN and 0 . So we add 1 in each size of the 
     352    // between UINTN and 0 . So we add 1 in each size of the
    353353    // comparison.
    354354    ASSERT ((TokenNumber + 1) < (LocalTokenCount + 1));
     
    367367  GuidHob = GetFirstGuidHob (&gEfiCallerIdGuid);
    368368  ASSERT (GuidHob != NULL);
    369  
     369
    370370  CallbackTable = GET_GUID_HOB_DATA (GuidHob);
    371371  CallbackTable = CallbackTable + (TokenNumber * PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry));
     
    388388
    389389/**
    390   Find the Pcd database. 
     390  Find the Pcd database.
    391391
    392392  @param  FileHandle  Handle of the file the external PCD database binary located.
     
    457457
    458458  CallbackFnTable = BuildGuidHob (&gEfiCallerIdGuid, SizeOfCallbackFnTable);
    459  
     459
    460460  ZeroMem (CallbackFnTable, SizeOfCallbackFnTable);
    461461
     
    537537  UINT32 LocalTokenNumber,
    538538  UINTN  Size
    539   ) 
     539  )
    540540{
    541541  PEI_PCD_DATABASE      *PeiPcdDb;
     
    608608
    609609/**
    610   Invoke the callback function when dynamic PCD entry was set, if this PCD entry 
     610  Invoke the callback function when dynamic PCD entry was set, if this PCD entry
    611611  has registered callback function.
    612612
     
    647647  if (Guid == NULL) {
    648648    // EBC compiler is very choosy. It may report warning about comparison
    649     // between UINTN and 0 . So we add 1 in each size of the 
     649    // between UINTN and 0 . So we add 1 in each size of the
    650650    // comparison.
    651651    ASSERT (TokenNumber + 1 < (LocalTokenCount + 1));
     
    654654  GuidHob = GetFirstGuidHob (&gEfiCallerIdGuid);
    655655  ASSERT (GuidHob != NULL);
    656  
     656
    657657  CallbackTable = GET_GUID_HOB_DATA (GuidHob);
    658658
     
    704704  @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in
    705705                                 range of UINT8, UINT16, UINT32, UINT64
    706   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                               
     706  @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.
    707707**/
    708708EFI_STATUS
     
    726726    return EFI_UNSUPPORTED;
    727727  }
    728  
     728
    729729  //
    730730  // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
     
    737737
    738738  // EBC compiler is very choosy. It may report warning about comparison
    739   // between UINTN and 0 . So we add 1 in each size of the 
     739  // between UINTN and 0 . So we add 1 in each size of the
    740740  // comparison.
    741741  ASSERT (TokenNumber + 1 < (LocalTokenCount + 1));
     
    770770  Offset          = LocalTokenNumber & PCD_DATABASE_OFFSET_MASK;
    771771  InternalData    = (VOID *) ((UINT8 *) PeiPcdDb + Offset);
    772  
     772
    773773  switch (LocalTokenNumber & PCD_TYPE_ALL_SET) {
    774774    case PCD_TYPE_VPD:
     
    822822      }
    823823    }
    824      
     824
    825825  }
    826826
     
    854854/**
    855855  Set value for a dynamic-ex PCD entry.
    856  
    857   This routine find the local token number according to dynamic-ex PCD's token 
     856
     857  This routine find the local token number according to dynamic-ex PCD's token
    858858  space guid and token number firstly, and invoke callback function if this PCD
    859859  entry registered callback function. Finally, invoken general SetWorker to set
    860860  PCD value.
    861  
     861
    862862  @param ExTokenNumber   Dynamic-ex PCD token number.
    863863  @param Guid            Token space guid for dynamic-ex PCD.
     
    889889    return EFI_NOT_FOUND;
    890890  }
    891  
     891
    892892  InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size);
    893893
     
    912912  IN UINTN            GetSize
    913913  )
    914 { 
     914{
    915915  return GetWorker (GetExPcdTokenNumber (Guid, ExTokenNumber), GetSize);
    916916}
     
    918918/**
    919919  Get the PCD entry pointer in PCD database.
    920  
     920
    921921  This routine will visit PCD database to find the PCD entry according to given
    922   token number. The given token number is autogened by build tools and it will be 
    923   translated to local token number. Local token number contains PCD's type and 
     922  token number. The given token number is autogened by build tools and it will be
     923  translated to local token number. Local token number contains PCD's type and
    924924  offset of PCD entry in PCD database.
    925925
     
    961961
    962962  // EBC compiler is very choosy. It may report warning about comparison
    963   // between UINTN and 0 . So we add 1 in each size of the 
     963  // between UINTN and 0 . So we add 1 in each size of the
    964964  // comparison.
    965965  ASSERT (TokenNumber + 1 < (LocalTokenCount + 1));
     
    979979      return (VOID *) (UINTN) (PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset);
    980980    }
    981      
     981
    982982    case PCD_TYPE_HII|PCD_TYPE_STRING:
    983983    case PCD_TYPE_HII:
    984984    {
    985985      VariableHead = (VARIABLE_HEAD *) ((UINT8 *)PeiPcdDb + Offset);
    986      
     986
    987987      Guid = (EFI_GUID *) ((UINT8 *)PeiPcdDb + PeiPcdDb->GuidTableOffset) + VariableHead->GuidTableIndex;
    988988      Name = (UINT16*)&StringTable[VariableHead->StringIndex];
     
    990990      if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) {
    991991        //
    992         // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of 
     992        // If a HII type PCD's datum type is VOID*, the DefaultValueOffset is the index of
    993993        // string array in string table.
    994994        //
    995         VaraiableDefaultBuffer = (UINT8 *) &StringTable[*(STRING_HEAD*)((UINT8*) PeiPcdDb + VariableHead->DefaultValueOffset)];   
     995        VaraiableDefaultBuffer = (UINT8 *) &StringTable[*(STRING_HEAD*)((UINT8*) PeiPcdDb + VariableHead->DefaultValueOffset)];
    996996      } else {
    997997        VaraiableDefaultBuffer = (UINT8 *) PeiPcdDb + VariableHead->DefaultValueOffset;
     
    10311031      ASSERT (FALSE);
    10321032      break;
    1033      
     1033
    10341034  }
    10351035
    10361036  ASSERT (FALSE);
    1037      
     1037
    10381038  return NULL;
    1039  
     1039
    10401040}
    10411041
     
    10461046  in DEC file. PCD database maintain a mapping table that translate pair of {token
    10471047  space guid: token number} to Token Number.
    1048  
     1048
    10491049  @param Guid            Token space guid for dynamic-ex PCD entry.
    10501050  @param ExTokenNumber   Dynamic-ex PCD token number.
     
    10531053
    10541054**/
    1055 UINTN           
     1055UINTN
    10561056GetExPcdTokenNumber (
    10571057  IN CONST EFI_GUID             *Guid,
     
    10771077  //
    10781078  ASSERT (MatchGuid != NULL);
    1079  
     1079
    10801080  MatchGuidIdx = MatchGuid - GuidTable;
    1081  
     1081
    10821082  for (Index = 0; Index < PeiPcdDb->ExTokenCount; Index++) {
    1083     if ((ExTokenNumber == ExMap[Index].ExTokenNumber) && 
     1083    if ((ExTokenNumber == ExMap[Index].ExTokenNumber) &&
    10841084        (MatchGuidIdx == ExMap[Index].ExGuidIndex)) {
    10851085      return ExMap[Index].TokenNumber;
    10861086    }
    10871087  }
    1088  
     1088
    10891089  return PCD_INVALID_TOKEN_NUMBER;
    10901090}
     
    11051105  GuidHob = GetFirstGuidHob (&gPcdDataBaseHobGuid);
    11061106  ASSERT (GuidHob != NULL);
    1107  
     1107
    11081108  return (PEI_PCD_DATABASE *) GET_GUID_HOB_DATA (GuidHob);
    11091109}
     
    11341134
    11351135  return (SKU_ID *) ((UINT8 *)Database + SkuHead->SkuIdTableOffset);
    1136  
     1136
    11371137}
    11381138
     
    11561156  UINTN       LocalTokenNumber;
    11571157  SKU_ID      *SkuIdTable;
    1158  
     1158
    11591159  SizeTableIdx = 0;
    11601160
     
    11641164    if ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER) {
    11651165      //
    1166       // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 
     1166      // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type
    11671167      // PCD entry.
    11681168      //
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Service.h

    r58459 r58466  
    108108  Sets the SKU value for subsequent calls to set or get PCD token values.
    109109
    110   SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. 
     110  SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.
    111111  SetSku() is normally called only once by the system.
    112112
    113   For each item (token), the database can hold a single value that applies to all SKUs, 
    114   or multiple values, where each value is associated with a specific SKU Id. Items with multiple, 
    115   SKU-specific values are called SKU enabled. 
    116  
    117   The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. 
    118   For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the 
    119   single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the 
    120   last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, 
    121   the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been 
     113  For each item (token), the database can hold a single value that applies to all SKUs,
     114  or multiple values, where each value is associated with a specific SKU Id. Items with multiple,
     115  SKU-specific values are called SKU enabled.
     116
     117  The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.
     118  For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the
     119  single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the
     120  last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,
     121  the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been
    122122  set for that Id, the results are unpredictable.
    123123
    124   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and 
     124  @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and
    125125              set values associated with a PCD token.
    126126
     
    135135  Retrieves an 8-bit value for a given PCD token.
    136136
    137   Retrieves the current byte-sized value for a PCD token number. 
     137  Retrieves the current byte-sized value for a PCD token number.
    138138  If the TokenNumber is invalid, the results are unpredictable.
    139  
    140   @param[in]  TokenNumber The PCD token number. 
     139
     140  @param[in]  TokenNumber The PCD token number.
    141141
    142142  @return The UINT8 value.
    143  
     143
    144144**/
    145145UINT8
     
    152152  Retrieves an 16-bit value for a given PCD token.
    153153
    154   Retrieves the current 16-bits value for a PCD token number. 
     154  Retrieves the current 16-bits value for a PCD token number.
    155155  If the TokenNumber is invalid, the results are unpredictable.
    156  
    157   @param[in]  TokenNumber The PCD token number. 
     156
     157  @param[in]  TokenNumber The PCD token number.
    158158
    159159  @return The UINT16 value.
    160  
     160
    161161**/
    162162UINT16
     
    169169  Retrieves an 32-bit value for a given PCD token.
    170170
    171   Retrieves the current 32-bits value for a PCD token number. 
     171  Retrieves the current 32-bits value for a PCD token number.
    172172  If the TokenNumber is invalid, the results are unpredictable.
    173  
    174   @param[in]  TokenNumber The PCD token number. 
     173
     174  @param[in]  TokenNumber The PCD token number.
    175175
    176176  @return The UINT32 value.
    177  
     177
    178178**/
    179179UINT32
     
    186186  Retrieves an 64-bit value for a given PCD token.
    187187
    188   Retrieves the current 64-bits value for a PCD token number. 
     188  Retrieves the current 64-bits value for a PCD token number.
    189189  If the TokenNumber is invalid, the results are unpredictable.
    190  
    191   @param[in]  TokenNumber The PCD token number. 
     190
     191  @param[in]  TokenNumber The PCD token number.
    192192
    193193  @return The UINT64 value.
    194  
     194
    195195**/
    196196UINT64
     
    203203  Retrieves a pointer to a value for a given PCD token.
    204204
    205   Retrieves the current pointer to the buffer for a PCD token number. 
    206   Do not make any assumptions about the alignment of the pointer that 
    207   is returned by this function call.  If the TokenNumber is invalid, 
     205  Retrieves the current pointer to the buffer for a PCD token number.
     206  Do not make any assumptions about the alignment of the pointer that
     207  is returned by this function call.  If the TokenNumber is invalid,
    208208  the results are unpredictable.
    209209
    210   @param[in]  TokenNumber The PCD token number. 
     210  @param[in]  TokenNumber The PCD token number.
    211211
    212212  @return The pointer to the buffer to be retrived.
    213  
     213
    214214**/
    215215VOID *
     
    222222  Retrieves a Boolean value for a given PCD token.
    223223
    224   Retrieves the current boolean value for a PCD token number. 
    225   Do not make any assumptions about the alignment of the pointer that 
    226   is returned by this function call.  If the TokenNumber is invalid, 
     224  Retrieves the current boolean value for a PCD token number.
     225  Do not make any assumptions about the alignment of the pointer that
     226  is returned by this function call.  If the TokenNumber is invalid,
    227227  the results are unpredictable.
    228228
    229   @param[in]  TokenNumber The PCD token number. 
     229  @param[in]  TokenNumber The PCD token number.
    230230
    231231  @return The Boolean value.
    232  
     232
    233233**/
    234234BOOLEAN
     
    241241  Retrieves the size of the value for a given PCD token.
    242242
    243   Retrieves the current size of a particular PCD token. 
     243  Retrieves the current size of a particular PCD token.
    244244  If the TokenNumber is invalid, the results are unpredictable.
    245245
    246   @param[in]  TokenNumber The PCD token number. 
     246  @param[in]  TokenNumber The PCD token number.
    247247
    248248  @return The size of the value for the PCD token.
    249  
     249
    250250**/
    251251UINTN
     
    258258  Retrieves an 8-bit value for a given PCD token.
    259259
    260   Retrieves the 8-bit value of a particular PCD token. 
     260  Retrieves the 8-bit value of a particular PCD token.
    261261  If the TokenNumber is invalid or the token space
    262   specified by Guid does not exist, the results are 
     262  specified by Guid does not exist, the results are
    263263  unpredictable.
    264264
    265265  @param[in]  Guid The token space for the token number.
    266   @param[in]  TokenNumber The PCD token number. 
     266  @param[in]  TokenNumber The PCD token number.
    267267
    268268  @return The size 8-bit value for the PCD token.
    269  
     269
    270270**/
    271271UINT8
     
    279279  Retrieves an 16-bit value for a given PCD token.
    280280
    281   Retrieves the 16-bit value of a particular PCD token. 
     281  Retrieves the 16-bit value of a particular PCD token.
    282282  If the TokenNumber is invalid or the token space
    283   specified by Guid does not exist, the results are 
     283  specified by Guid does not exist, the results are
    284284  unpredictable.
    285285
    286286  @param[in]  Guid The token space for the token number.
    287   @param[in]  TokenNumber The PCD token number. 
     287  @param[in]  TokenNumber The PCD token number.
    288288
    289289  @return The size 16-bit value for the PCD token.
    290  
     290
    291291**/
    292292UINT16
     
    300300  Retrieves an 32-bit value for a given PCD token.
    301301
    302   Retrieves the 32-bit value of a particular PCD token. 
     302  Retrieves the 32-bit value of a particular PCD token.
    303303  If the TokenNumber is invalid or the token space
    304   specified by Guid does not exist, the results are 
     304  specified by Guid does not exist, the results are
    305305  unpredictable.
    306306
    307307  @param[in]  Guid The token space for the token number.
    308   @param[in]  TokenNumber The PCD token number. 
     308  @param[in]  TokenNumber The PCD token number.
    309309
    310310  @return The size 32-bit value for the PCD token.
    311  
     311
    312312**/
    313313UINT32
     
    321321  Retrieves an 64-bit value for a given PCD token.
    322322
    323   Retrieves the 64-bit value of a particular PCD token. 
     323  Retrieves the 64-bit value of a particular PCD token.
    324324  If the TokenNumber is invalid or the token space
    325   specified by Guid does not exist, the results are 
     325  specified by Guid does not exist, the results are
    326326  unpredictable.
    327327
    328328  @param[in]  Guid The token space for the token number.
    329   @param[in]  TokenNumber The PCD token number. 
     329  @param[in]  TokenNumber The PCD token number.
    330330
    331331  @return The size 64-bit value for the PCD token.
    332  
     332
    333333**/
    334334UINT64
     
    342342  Retrieves a pointer to a value for a given PCD token.
    343343
    344   Retrieves the current pointer to the buffer for a PCD token number. 
    345   Do not make any assumptions about the alignment of the pointer that 
    346   is returned by this function call.  If the TokenNumber is invalid, 
     344  Retrieves the current pointer to the buffer for a PCD token number.
     345  Do not make any assumptions about the alignment of the pointer that
     346  is returned by this function call.  If the TokenNumber is invalid,
    347347  the results are unpredictable.
    348348
    349349  @param[in]  Guid The token space for the token number.
    350   @param[in]  TokenNumber The PCD token number. 
     350  @param[in]  TokenNumber The PCD token number.
    351351
    352352  @return The pointer to the buffer to be retrived.
    353  
     353
    354354**/
    355355VOID *
     
    363363  Retrieves an Boolean value for a given PCD token.
    364364
    365   Retrieves the Boolean value of a particular PCD token. 
     365  Retrieves the Boolean value of a particular PCD token.
    366366  If the TokenNumber is invalid or the token space
    367   specified by Guid does not exist, the results are 
     367  specified by Guid does not exist, the results are
    368368  unpredictable.
    369369
    370370  @param[in]  Guid The token space for the token number.
    371   @param[in]  TokenNumber The PCD token number. 
     371  @param[in]  TokenNumber The PCD token number.
    372372
    373373  @return The size Boolean value for the PCD token.
    374  
     374
    375375**/
    376376BOOLEAN
     
    384384  Retrieves the size of the value for a given PCD token.
    385385
    386   Retrieves the current size of a particular PCD token. 
     386  Retrieves the current size of a particular PCD token.
    387387  If the TokenNumber is invalid, the results are unpredictable.
    388388
    389389  @param[in]  Guid The token space for the token number.
    390   @param[in]  TokenNumber The PCD token number. 
     390  @param[in]  TokenNumber The PCD token number.
    391391
    392392  @return The size of the value for the PCD token.
    393  
     393
    394394**/
    395395UINTN
     
    403403  Sets an 8-bit value for a given PCD token.
    404404
    405   When the PCD service sets a value, it will check to ensure that the 
    406   size of the value being set is compatible with the Token's existing definition. 
     405  When the PCD service sets a value, it will check to ensure that the
     406  size of the value being set is compatible with the Token's existing definition.
    407407  If it is not, an error will be returned.
    408408
    409   @param[in]  TokenNumber The PCD token number. 
     409  @param[in]  TokenNumber The PCD token number.
    410410  @param[in]  Value The value to set for the PCD token.
    411411
    412412  @retval EFI_SUCCESS  Procedure returned successfully.
    413   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    414                                   being set was incompatible with a call to this function. 
     413  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     414                                  being set was incompatible with a call to this function.
    415415                                  Use GetSize() to retrieve the size of the target data.
    416416  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    417  
     417
    418418**/
    419419EFI_STATUS
     
    427427  Sets an 16-bit value for a given PCD token.
    428428
    429   When the PCD service sets a value, it will check to ensure that the 
    430   size of the value being set is compatible with the Token's existing definition. 
     429  When the PCD service sets a value, it will check to ensure that the
     430  size of the value being set is compatible with the Token's existing definition.
    431431  If it is not, an error will be returned.
    432432
    433   @param[in]  TokenNumber The PCD token number. 
     433  @param[in]  TokenNumber The PCD token number.
    434434  @param[in]  Value The value to set for the PCD token.
    435435
    436436  @retval EFI_SUCCESS  Procedure returned successfully.
    437   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    438                                   being set was incompatible with a call to this function. 
     437  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     438                                  being set was incompatible with a call to this function.
    439439                                  Use GetSize() to retrieve the size of the target data.
    440440  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    441  
     441
    442442**/
    443443EFI_STATUS
     
    451451  Sets an 32-bit value for a given PCD token.
    452452
    453   When the PCD service sets a value, it will check to ensure that the 
    454   size of the value being set is compatible with the Token's existing definition. 
     453  When the PCD service sets a value, it will check to ensure that the
     454  size of the value being set is compatible with the Token's existing definition.
    455455  If it is not, an error will be returned.
    456456
    457   @param[in]  TokenNumber The PCD token number. 
     457  @param[in]  TokenNumber The PCD token number.
    458458  @param[in]  Value The value to set for the PCD token.
    459459
    460460  @retval EFI_SUCCESS  Procedure returned successfully.
    461   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    462                                   being set was incompatible with a call to this function. 
     461  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     462                                  being set was incompatible with a call to this function.
    463463                                  Use GetSize() to retrieve the size of the target data.
    464464  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    465  
     465
    466466**/
    467467EFI_STATUS
     
    475475  Sets an 64-bit value for a given PCD token.
    476476
    477   When the PCD service sets a value, it will check to ensure that the 
    478   size of the value being set is compatible with the Token's existing definition. 
     477  When the PCD service sets a value, it will check to ensure that the
     478  size of the value being set is compatible with the Token's existing definition.
    479479  If it is not, an error will be returned.
    480480
    481   @param[in]  TokenNumber The PCD token number. 
     481  @param[in]  TokenNumber The PCD token number.
    482482  @param[in]  Value The value to set for the PCD token.
    483483
    484484  @retval EFI_SUCCESS  Procedure returned successfully.
    485   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    486                                   being set was incompatible with a call to this function. 
     485  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     486                                  being set was incompatible with a call to this function.
    487487                                  Use GetSize() to retrieve the size of the target data.
    488488  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    489  
     489
    490490**/
    491491EFI_STATUS
     
    499499  Sets a value of a specified size for a given PCD token.
    500500
    501   When the PCD service sets a value, it will check to ensure that the 
    502   size of the value being set is compatible with the Token's existing definition. 
     501  When the PCD service sets a value, it will check to ensure that the
     502  size of the value being set is compatible with the Token's existing definition.
    503503  If it is not, an error will be returned.
    504504
    505   @param[in]  TokenNumber The PCD token number. 
    506   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    507                               On input, if the SizeOfValue is greater than the maximum size supported 
    508                               for this TokenNumber then the output value of SizeOfValue will reflect 
     505  @param[in]  TokenNumber The PCD token number.
     506  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     507                              On input, if the SizeOfValue is greater than the maximum size supported
     508                              for this TokenNumber then the output value of SizeOfValue will reflect
    509509                              the maximum size supported for this TokenNumber.
    510510  @param[in]  Buffer The buffer to set for the PCD token.
    511511
    512512  @retval EFI_SUCCESS  Procedure returned successfully.
    513   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    514                                   being set was incompatible with a call to this function. 
     513  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     514                                  being set was incompatible with a call to this function.
    515515                                  Use GetSize() to retrieve the size of the target data.
    516516  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    517  
     517
    518518**/
    519519EFI_STATUS
     
    528528  Sets an Boolean value for a given PCD token.
    529529
    530   When the PCD service sets a value, it will check to ensure that the 
    531   size of the value being set is compatible with the Token's existing definition. 
     530  When the PCD service sets a value, it will check to ensure that the
     531  size of the value being set is compatible with the Token's existing definition.
    532532  If it is not, an error will be returned.
    533533
    534   @param[in]  TokenNumber The PCD token number. 
     534  @param[in]  TokenNumber The PCD token number.
    535535  @param[in]  Value The value to set for the PCD token.
    536536
    537537  @retval EFI_SUCCESS  Procedure returned successfully.
    538   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    539                                   being set was incompatible with a call to this function. 
     538  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     539                                  being set was incompatible with a call to this function.
    540540                                  Use GetSize() to retrieve the size of the target data.
    541541  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    542  
     542
    543543**/
    544544EFI_STATUS
     
    552552  Sets an 8-bit value for a given PCD token.
    553553
    554   When the PCD service sets a value, it will check to ensure that the 
    555   size of the value being set is compatible with the Token's existing definition. 
     554  When the PCD service sets a value, it will check to ensure that the
     555  size of the value being set is compatible with the Token's existing definition.
    556556  If it is not, an error will be returned.
    557557
    558558  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    559   @param[in]  TokenNumber The PCD token number. 
     559  @param[in]  TokenNumber The PCD token number.
    560560  @param[in]  Value The value to set for the PCD token.
    561561
    562562  @retval EFI_SUCCESS  Procedure returned successfully.
    563   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    564                                   being set was incompatible with a call to this function. 
     563  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     564                                  being set was incompatible with a call to this function.
    565565                                  Use GetSize() to retrieve the size of the target data.
    566566  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    567  
     567
    568568**/
    569569EFI_STATUS
     
    578578  Sets an 16-bit value for a given PCD token.
    579579
    580   When the PCD service sets a value, it will check to ensure that the 
    581   size of the value being set is compatible with the Token's existing definition. 
     580  When the PCD service sets a value, it will check to ensure that the
     581  size of the value being set is compatible with the Token's existing definition.
    582582  If it is not, an error will be returned.
    583583
    584584  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    585   @param[in]  TokenNumber The PCD token number. 
     585  @param[in]  TokenNumber The PCD token number.
    586586  @param[in]  Value The value to set for the PCD token.
    587587
    588588  @retval EFI_SUCCESS  Procedure returned successfully.
    589   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    590                                   being set was incompatible with a call to this function. 
     589  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     590                                  being set was incompatible with a call to this function.
    591591                                  Use GetSize() to retrieve the size of the target data.
    592592  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    593  
     593
    594594**/
    595595EFI_STATUS
     
    604604  Sets an 32-bit value for a given PCD token.
    605605
    606   When the PCD service sets a value, it will check to ensure that the 
    607   size of the value being set is compatible with the Token's existing definition. 
     606  When the PCD service sets a value, it will check to ensure that the
     607  size of the value being set is compatible with the Token's existing definition.
    608608  If it is not, an error will be returned.
    609609
    610610  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    611   @param[in]  TokenNumber The PCD token number. 
     611  @param[in]  TokenNumber The PCD token number.
    612612  @param[in]  Value The value to set for the PCD token.
    613613
    614614  @retval EFI_SUCCESS  Procedure returned successfully.
    615   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    616                                   being set was incompatible with a call to this function. 
     615  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     616                                  being set was incompatible with a call to this function.
    617617                                  Use GetSize() to retrieve the size of the target data.
    618618  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    619  
     619
    620620**/
    621621EFI_STATUS
     
    630630  Sets an 64-bit value for a given PCD token.
    631631
    632   When the PCD service sets a value, it will check to ensure that the 
    633   size of the value being set is compatible with the Token's existing definition. 
     632  When the PCD service sets a value, it will check to ensure that the
     633  size of the value being set is compatible with the Token's existing definition.
    634634  If it is not, an error will be returned.
    635635
    636636  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    637   @param[in]  TokenNumber The PCD token number. 
     637  @param[in]  TokenNumber The PCD token number.
    638638  @param[in]  Value The value to set for the PCD token.
    639639
    640640  @retval EFI_SUCCESS  Procedure returned successfully.
    641   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    642                                   being set was incompatible with a call to this function. 
     641  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     642                                  being set was incompatible with a call to this function.
    643643                                  Use GetSize() to retrieve the size of the target data.
    644644  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    645  
     645
    646646**/
    647647EFI_STATUS
     
    656656  Sets a value of a specified size for a given PCD token.
    657657
    658   When the PCD service sets a value, it will check to ensure that the 
    659   size of the value being set is compatible with the Token's existing definition. 
     658  When the PCD service sets a value, it will check to ensure that the
     659  size of the value being set is compatible with the Token's existing definition.
    660660  If it is not, an error will be returned.
    661661
    662662  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    663   @param[in]  TokenNumber The PCD token number. 
    664   @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. 
    665                               On input, if the SizeOfValue is greater than the maximum size supported 
    666                               for this TokenNumber then the output value of SizeOfValue will reflect 
     663  @param[in]  TokenNumber The PCD token number.
     664  @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token.
     665                              On input, if the SizeOfValue is greater than the maximum size supported
     666                              for this TokenNumber then the output value of SizeOfValue will reflect
    667667                              the maximum size supported for this TokenNumber.
    668668  @param[in]  Buffer The buffer to set for the PCD token.
    669669
    670670  @retval EFI_SUCCESS  Procedure returned successfully.
    671   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    672                                   being set was incompatible with a call to this function. 
     671  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     672                                  being set was incompatible with a call to this function.
    673673                                  Use GetSize() to retrieve the size of the target data.
    674674  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    675  
     675
    676676**/
    677677EFI_STATUS
     
    687687  Sets an Boolean value for a given PCD token.
    688688
    689   When the PCD service sets a value, it will check to ensure that the 
    690   size of the value being set is compatible with the Token's existing definition. 
     689  When the PCD service sets a value, it will check to ensure that the
     690  size of the value being set is compatible with the Token's existing definition.
    691691  If it is not, an error will be returned.
    692692
    693693  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    694   @param[in]  TokenNumber The PCD token number. 
     694  @param[in]  TokenNumber The PCD token number.
    695695  @param[in]  Value The value to set for the PCD token.
    696696
    697697  @retval EFI_SUCCESS  Procedure returned successfully.
    698   @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data 
    699                                   being set was incompatible with a call to this function. 
     698  @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data
     699                                  being set was incompatible with a call to this function.
    700700                                  Use GetSize() to retrieve the size of the target data.
    701701  @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
    702  
     702
    703703**/
    704704EFI_STATUS
     
    714714
    715715  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    716   @param[in]  TokenNumber The PCD token number. 
    717   @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    718 
    719   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     716  @param[in]  TokenNumber The PCD token number.
     717  @param[in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     718
     719  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    720720                        for the CallBackToken requested.
    721721  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    734734
    735735  @param [in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.
    736   @param [in]  TokenNumber The PCD token number. 
    737   @param [in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set. 
    738 
    739   @retval EFI_SUCCESS  The PCD service has successfully established a call event 
     736  @param [in]  TokenNumber The PCD token number.
     737  @param [in]  CallBackFunction The function prototype called when the value associated with the CallBackToken is set.
     738
     739  @retval EFI_SUCCESS  The PCD service has successfully established a call event
    740740                        for the CallBackToken requested.
    741741  @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
     
    751751
    752752/**
    753   Retrieves the next valid token number in a given namespace. 
    754  
    755   This is useful since the PCD infrastructure contains a sparse list of token numbers, 
    756   and one cannot a priori know what token numbers are valid in the database. 
    757  
    758   If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. 
    759   If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. 
    760   If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. 
    761   If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. 
    762   The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. 
    763   If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. 
    764   If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. 
     753  Retrieves the next valid token number in a given namespace.
     754
     755  This is useful since the PCD infrastructure contains a sparse list of token numbers,
     756  and one cannot a priori know what token numbers are valid in the database.
     757
     758  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.
     759  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.
     760  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.
     761  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.
     762  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.
     763  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.
     764  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    765765  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.
    766766
    767767
    768   @param[in]       Guid        The 128-bit unique value that designates the namespace from which to extract the value. 
    769                                This is an optional parameter that may be NULL.  If this parameter is NULL, then a request 
     768  @param[in]       Guid        The 128-bit unique value that designates the namespace from which to extract the value.
     769                               This is an optional parameter that may be NULL.  If this parameter is NULL, then a request
    770770                               is being made to retrieve tokens from the default token space.
    771771  @param[in, out]  TokenNumber A pointer to the PCD token number to use to find the subsequent token number.
    772                    
    773   @retval EFI_SUCCESS   The PCD service has retrieved the next valid token number. 
    774                         Or the input token number is already the last valid token number in the PCD database. 
     772
     773  @retval EFI_SUCCESS   The PCD service has retrieved the next valid token number.
     774                        Or the input token number is already the last valid token number in the PCD database.
    775775                        In the later case, *TokenNumber is updated with the value of 0.
    776776  @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.
     
    787787  Retrieves the next valid PCD token namespace for a given namespace.
    788788
    789   @param[in, out]  Guid An indirect pointer to EFI_GUID.  On input it designates 
    790                     a known token namespace from which the search will start. On output, 
    791                     it designates the next valid token namespace on the platform. If the input 
    792                     token namespace does not exist on the platform, an error is returned and 
    793                     the value of *Guid is undefined. If *Guid is NULL, then the GUID of the 
    794                     first token space of the current platform is assigned to *Guid the function 
    795                     return EFI_SUCCESS. If  *Guid is NULL  and there is no namespace exist in 
    796                     the platform other than the default (NULL) tokennamespace, *Guid is unchanged 
    797                     and the function return EFI_SUCCESS. If this input token namespace is the last 
    798                     namespace on the platform, *Guid will be assigned to NULL and the function return 
    799                     EFI_SUCCESS. 
    800 
    801   @retval EFI_SUCCESS  The PCD service retrieved the next valid token space Guid. 
    802                         Or the input token space Guid is already the last valid token space Guid 
     789  @param[in, out]  Guid An indirect pointer to EFI_GUID.  On input it designates
     790                    a known token namespace from which the search will start. On output,
     791                    it designates the next valid token namespace on the platform. If the input
     792                    token namespace does not exist on the platform, an error is returned and
     793                    the value of *Guid is undefined. If *Guid is NULL, then the GUID of the
     794                    first token space of the current platform is assigned to *Guid the function
     795                    return EFI_SUCCESS. If  *Guid is NULL  and there is no namespace exist in
     796                    the platform other than the default (NULL) tokennamespace, *Guid is unchanged
     797                    and the function return EFI_SUCCESS. If this input token namespace is the last
     798                    namespace on the platform, *Guid will be assigned to NULL and the function return
     799                    EFI_SUCCESS.
     800
     801  @retval EFI_SUCCESS  The PCD service retrieved the next valid token space Guid.
     802                        Or the input token space Guid is already the last valid token space Guid
    803803                        in the PCD database. In the later case, *Guid is updated with the value of NULL.
    804804  @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.
     
    820820  @param[in]    TokenNumber The PCD token number.
    821821  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
    822                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 
     822                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
    823823
    824824  @retval  EFI_SUCCESS      The PCD information was returned successfully
     
    875875  @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in
    876876                                 range of UINT8, UINT16, UINT32, UINT64
    877   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                               
     877  @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.
    878878**/
    879879EFI_STATUS
     
    906906/**
    907907  Set value for a dynamic PCD entry.
    908  
    909   This routine find the local token number according to dynamic-ex PCD's token 
     908
     909  This routine find the local token number according to dynamic-ex PCD's token
    910910  space guid and token number firstly, and invoke callback function if this PCD
    911911  entry registered callback function. Finally, invoken general SetWorker to set
    912912  PCD value.
    913  
     913
    914914  @param ExTokenNumber   Dynamic-ex PCD token number.
    915915  @param Guid            Token space guid for dynamic-ex PCD.
     
    933933/**
    934934  Get the PCD entry pointer in PCD database.
    935  
     935
    936936  This routine will visit PCD database to find the PCD entry according to given
    937   token number. The given token number is autogened by build tools and it will be 
    938   translated to local token number. Local token number contains PCD's type and 
     937  token number. The given token number is autogened by build tools and it will be
     938  translated to local token number. Local token number contains PCD's type and
    939939  offset of PCD entry in PCD database.
    940940
     
    980980  in DEC file. PCD database maintain a mapping table that translate pair of {token
    981981  space guid: token number} to Token Number.
    982  
     982
    983983  @param Guid            Token space guid for dynamic-ex PCD entry.
    984984  @param ExTokenNumber   Token number for dynamic-ex PCD.
     
    10751075/**
    10761076  Get PCD value's size for POINTER type PCD.
    1077  
     1077
    10781078  The POINTER type PCD's value will be stored into a buffer in specificed size.
    10791079  The max size of this PCD's value is described in PCD's definition in DEC file.
     
    10951095/**
    10961096  Set PCD value's size for POINTER type PCD.
    1097  
     1097
    10981098  The POINTER type PCD's value will be stored into a buffer in specificed size.
    10991099  The max size of this PCD's value is described in PCD's definition in DEC file.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette