Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
r58459 r58466 23 23 24 24 /// 25 /// PCD_PROTOCOL the EDKII native implementation which support dynamic 25 /// PCD_PROTOCOL the EDKII native implementation which support dynamic 26 26 /// type and dynamicEx type PCDs. 27 27 /// … … 113 113 /** 114 114 Main entry for PCD DXE driver. 115 115 116 116 This routine initialize the PCD database and install PCD_PROTOCOL. 117 117 118 118 @param ImageHandle Image handle for PCD DXE driver. 119 119 @param SystemTable Pointer to SystemTable. … … 130 130 { 131 131 EFI_STATUS Status; 132 132 133 133 // 134 134 // Make sure the Pcd Protocol is not already installed in the system … … 152 152 153 153 // 154 // Only install PcdInfo PROTOCOL when PCD info content is present. 154 // Only install PcdInfo PROTOCOL when PCD info content is present. 155 155 // 156 156 if (mPcdDatabase.DxeDb->PcdNameTableOffset != 0) { … … 238 238 Sets the SKU value for subsequent calls to set or get PCD token values. 239 239 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. 241 241 SetSku() is normally called only once by the system. 242 242 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 252 252 set for that Id, the results are unpredictable. 253 253 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 255 255 set values associated with a PCD token. 256 256 … … 263 263 { 264 264 mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId; 265 265 266 266 return; 267 267 } … … 270 270 Retrieves an 8-bit value for a given PCD token. 271 271 272 Retrieves the current byte-sized value for a PCD token number. 272 Retrieves the current byte-sized value for a PCD token number. 273 273 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. 276 276 277 277 @return The UINT8 value. 278 278 279 279 **/ 280 280 UINT8 … … 290 290 Retrieves an 16-bit value for a given PCD token. 291 291 292 Retrieves the current 16-bits value for a PCD token number. 292 Retrieves the current 16-bits value for a PCD token number. 293 293 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. 296 296 297 297 @return The UINT16 value. 298 298 299 299 **/ 300 300 UINT16 … … 310 310 Retrieves an 32-bit value for a given PCD token. 311 311 312 Retrieves the current 32-bits value for a PCD token number. 312 Retrieves the current 32-bits value for a PCD token number. 313 313 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. 316 316 317 317 @return The UINT32 value. 318 318 319 319 **/ 320 320 UINT32 … … 330 330 Retrieves an 64-bit value for a given PCD token. 331 331 332 Retrieves the current 64-bits value for a PCD token number. 332 Retrieves the current 64-bits value for a PCD token number. 333 333 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. 336 336 337 337 @return The UINT64 value. 338 338 339 339 **/ 340 340 UINT64 … … 350 350 Retrieves a pointer to a value for a given PCD token. 351 351 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, 355 355 the results are unpredictable. 356 356 357 @param[in] TokenNumber The PCD token number. 357 @param[in] TokenNumber The PCD token number. 358 358 359 359 @return The pointer to the buffer to be retrived. 360 360 361 361 **/ 362 362 VOID * … … 372 372 Retrieves a Boolean value for a given PCD token. 373 373 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, 377 377 the results are unpredictable. 378 378 379 @param[in] TokenNumber The PCD token number. 379 @param[in] TokenNumber The PCD token number. 380 380 381 381 @return The Boolean value. 382 382 383 383 **/ 384 384 BOOLEAN … … 394 394 Retrieves the size of the value for a given PCD token. 395 395 396 Retrieves the current size of a particular PCD token. 396 Retrieves the current size of a particular PCD token. 397 397 If the TokenNumber is invalid, the results are unpredictable. 398 398 399 @param[in] TokenNumber The PCD token number. 399 @param[in] TokenNumber The PCD token number. 400 400 401 401 @return The size of the value for the PCD token. 402 402 403 403 **/ 404 404 UINTN … … 422 422 // 423 423 // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber 424 // 424 // 425 425 TmpTokenNumber = TokenNumber; 426 426 427 427 // 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 429 429 // comparison. 430 430 ASSERT (TokenNumber + 1 < mPcdTotalTokenCount + 1); 431 431 432 432 // 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 434 434 // comparison. 435 435 IsPeiDb = (BOOLEAN) (TokenNumber + 1 < mPeiLocalTokenCount + 1); 436 437 TokenNumber = IsPeiDb ? TokenNumber : 436 437 TokenNumber = IsPeiDb ? TokenNumber : 438 438 (TokenNumber - mPeiLocalTokenCount); 439 439 440 LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) 440 LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) 441 441 : (UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset); 442 442 … … 457 457 Retrieves an 8-bit value for a given PCD token. 458 458 459 Retrieves the 8-bit value of a particular PCD token. 459 Retrieves the 8-bit value of a particular PCD token. 460 460 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 462 462 unpredictable. 463 463 464 464 @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. 466 466 467 467 @return The size 8-bit value for the PCD token. 468 468 469 469 **/ 470 470 UINT8 … … 481 481 Retrieves an 16-bit value for a given PCD token. 482 482 483 Retrieves the 16-bit value of a particular PCD token. 483 Retrieves the 16-bit value of a particular PCD token. 484 484 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 486 486 unpredictable. 487 487 488 488 @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. 490 490 491 491 @return The size 16-bit value for the PCD token. 492 492 493 493 **/ 494 494 UINT16 … … 505 505 Retrieves an 32-bit value for a given PCD token. 506 506 507 Retrieves the 32-bit value of a particular PCD token. 507 Retrieves the 32-bit value of a particular PCD token. 508 508 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 510 510 unpredictable. 511 511 512 512 @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. 514 514 515 515 @return The size 32-bit value for the PCD token. 516 516 517 517 **/ 518 518 UINT32 … … 529 529 Retrieves an 64-bit value for a given PCD token. 530 530 531 Retrieves the 64-bit value of a particular PCD token. 531 Retrieves the 64-bit value of a particular PCD token. 532 532 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 534 534 unpredictable. 535 535 536 536 @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. 538 538 539 539 @return The size 64-bit value for the PCD token. 540 540 541 541 **/ 542 542 UINT64 … … 553 553 Retrieves a pointer to a value for a given PCD token. 554 554 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, 558 558 the results are unpredictable. 559 559 560 560 @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. 562 562 563 563 @return The pointer to the buffer to be retrived. 564 564 565 565 **/ 566 566 VOID * … … 577 577 Retrieves an Boolean value for a given PCD token. 578 578 579 Retrieves the Boolean value of a particular PCD token. 579 Retrieves the Boolean value of a particular PCD token. 580 580 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 582 582 unpredictable. 583 583 584 584 @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. 586 586 587 587 @return The size Boolean value for the PCD token. 588 588 589 589 **/ 590 590 BOOLEAN … … 601 601 Retrieves the size of the value for a given PCD token. 602 602 603 Retrieves the current size of a particular PCD token. 603 Retrieves the current size of a particular PCD token. 604 604 If the TokenNumber is invalid, the results are unpredictable. 605 605 606 606 @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. 608 608 609 609 @return The size of the value for the PCD token. 610 610 611 611 **/ 612 612 UINTN … … 623 623 Sets an 8-bit value for a given PCD token. 624 624 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. 627 627 If it is not, an error will be returned. 628 628 629 @param[in] TokenNumber The PCD token number. 629 @param[in] TokenNumber The PCD token number. 630 630 @param[in] Value The value to set for the PCD token. 631 631 632 632 @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. 635 635 Use GetSize() to retrieve the size of the target data. 636 636 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 637 637 638 638 **/ 639 639 EFI_STATUS … … 650 650 Sets an 16-bit value for a given PCD token. 651 651 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. 654 654 If it is not, an error will be returned. 655 655 656 @param[in] TokenNumber The PCD token number. 656 @param[in] TokenNumber The PCD token number. 657 657 @param[in] Value The value to set for the PCD token. 658 658 659 659 @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. 662 662 Use GetSize() to retrieve the size of the target data. 663 663 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 664 664 665 665 **/ 666 666 EFI_STATUS … … 677 677 Sets an 32-bit value for a given PCD token. 678 678 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. 681 681 If it is not, an error will be returned. 682 682 683 @param[in] TokenNumber The PCD token number. 683 @param[in] TokenNumber The PCD token number. 684 684 @param[in] Value The value to set for the PCD token. 685 685 686 686 @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. 689 689 Use GetSize() to retrieve the size of the target data. 690 690 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 691 691 692 692 **/ 693 693 EFI_STATUS … … 704 704 Sets an 64-bit value for a given PCD token. 705 705 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. 708 708 If it is not, an error will be returned. 709 709 710 @param[in] TokenNumber The PCD token number. 710 @param[in] TokenNumber The PCD token number. 711 711 @param[in] Value The value to set for the PCD token. 712 712 713 713 @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. 716 716 Use GetSize() to retrieve the size of the target data. 717 717 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 718 718 719 719 **/ 720 720 EFI_STATUS … … 731 731 Sets a value of a specified size for a given PCD token. 732 732 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. 735 735 If it is not, an error will be returned. 736 736 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 741 741 the maximum size supported for this TokenNumber. 742 742 @param[in] Buffer The buffer to set for the PCD token. 743 743 744 744 @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. 747 747 Use GetSize() to retrieve the size of the target data. 748 748 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 749 749 750 750 **/ 751 751 EFI_STATUS … … 763 763 Sets an Boolean value for a given PCD token. 764 764 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. 767 767 If it is not, an error will be returned. 768 768 769 @param[in] TokenNumber The PCD token number. 769 @param[in] TokenNumber The PCD token number. 770 770 @param[in] Value The value to set for the PCD token. 771 771 772 772 @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. 775 775 Use GetSize() to retrieve the size of the target data. 776 776 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 777 777 778 778 **/ 779 779 EFI_STATUS … … 790 790 Sets an 8-bit value for a given PCD token. 791 791 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. 794 794 If it is not, an error will be returned. 795 795 796 796 @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. 798 798 @param[in] Value The value to set for the PCD token. 799 799 800 800 @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. 803 803 Use GetSize() to retrieve the size of the target data. 804 804 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 805 805 806 806 **/ 807 807 EFI_STATUS … … 819 819 Sets an 16-bit value for a given PCD token. 820 820 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. 823 823 If it is not, an error will be returned. 824 824 825 825 @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. 827 827 @param[in] Value The value to set for the PCD token. 828 828 829 829 @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. 832 832 Use GetSize() to retrieve the size of the target data. 833 833 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 834 834 835 835 **/ 836 836 EFI_STATUS … … 848 848 Sets an 32-bit value for a given PCD token. 849 849 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. 852 852 If it is not, an error will be returned. 853 853 854 854 @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. 856 856 @param[in] Value The value to set for the PCD token. 857 857 858 858 @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. 861 861 Use GetSize() to retrieve the size of the target data. 862 862 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 863 863 864 864 **/ 865 865 EFI_STATUS … … 877 877 Sets an 64-bit value for a given PCD token. 878 878 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. 881 881 If it is not, an error will be returned. 882 882 883 883 @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. 885 885 @param[in] Value The value to set for the PCD token. 886 886 887 887 @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. 890 890 Use GetSize() to retrieve the size of the target data. 891 891 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 892 892 893 893 **/ 894 894 EFI_STATUS … … 906 906 Sets a value of a specified size for a given PCD token. 907 907 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. 910 910 If it is not, an error will be returned. 911 911 912 912 @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 917 917 the maximum size supported for this TokenNumber. 918 918 @param[in] Buffer The buffer to set for the PCD token. 919 919 920 920 @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. 923 923 Use GetSize() to retrieve the size of the target data. 924 924 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 925 925 926 926 **/ 927 927 EFI_STATUS … … 940 940 Sets an Boolean value for a given PCD token. 941 941 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. 944 944 If it is not, an error will be returned. 945 945 946 946 @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. 948 948 @param[in] Value The value to set for the PCD token. 949 949 950 950 @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. 953 953 Use GetSize() to retrieve the size of the target data. 954 954 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 955 955 956 956 **/ 957 957 EFI_STATUS … … 970 970 971 971 @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 976 976 for the CallBackToken requested. 977 977 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 987 987 { 988 988 EFI_STATUS Status; 989 989 990 990 if (CallBackFunction == NULL) { 991 991 return EFI_INVALID_PARAMETER; … … 999 999 1000 1000 EfiReleaseLock (&mPcdDatabaseLock); 1001 1001 1002 1002 return Status; 1003 1003 } … … 1007 1007 1008 1008 @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 1013 1013 for the CallBackToken requested. 1014 1014 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 1024 1024 { 1025 1025 EFI_STATUS Status; 1026 1026 1027 1027 if (CallBackFunction == NULL) { 1028 1028 return EFI_INVALID_PARAMETER; … … 1033 1033 // 1034 1034 EfiAcquireLock (&mPcdDatabaseLock); 1035 1035 1036 1036 Status = DxeUnRegisterCallBackWorker (TokenNumber, Guid, CallBackFunction); 1037 1037 1038 1038 EfiReleaseLock (&mPcdDatabaseLock); 1039 1039 1040 1040 return Status; 1041 1041 } 1042 1042 1043 1043 /** 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. 1056 1056 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned. 1057 1057 1058 1058 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 1061 1061 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. 1064 1064 1065 1065 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number. … … 1087 1087 if (Guid == NULL) { 1088 1088 // 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 1090 1090 // comparison. 1091 1091 if (((*TokenNumber + 1 > mPeiNexTokenCount + 1) && (*TokenNumber + 1 <= mPeiLocalTokenCount + 1)) || … … 1093 1093 return EFI_NOT_FOUND; 1094 1094 } 1095 1095 1096 1096 (*TokenNumber)++; 1097 1097 if ((*TokenNumber + 1 > mPeiNexTokenCount + 1) && 1098 1098 (*TokenNumber + 1 <= mPeiLocalTokenCount + 1)) { 1099 1099 // 1100 // The first Non-Ex type Token Number for DXE PCD 1100 // The first Non-Ex type Token Number for DXE PCD 1101 1101 // database is mPeiLocalTokenCount + 1 1102 1102 // … … 1201 1201 *ExMapTableSize = TsIdx + 1; 1202 1202 return DistinctTokenSpace; 1203 1204 } 1205 1203 1204 } 1205 1206 1206 /** 1207 1207 Retrieves the next valid PCD token namespace for a given namespace. … … 1215 1215 space of the current platform is returned. If the search cannot locate the next valid 1216 1216 token namespace, an error is returned and the value of *Guid is undefined. 1217 1217 1218 1218 @retval EFI_SUCCESS The PCD service retrieved the value requested. 1219 1219 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace. … … 1238 1238 1239 1239 ASSERT (Guid != NULL); 1240 1240 1241 1241 PeiExMapTableEmpty = mPeiExMapTableEmpty; 1242 1242 DxeExMapTableEmpty = mDxeExMapTableEmpty; … … 1245 1245 return EFI_NOT_FOUND; 1246 1246 } 1247 1247 1248 1248 if (TmpTokenSpaceBuffer[0] == NULL) { 1249 1249 PeiTokenSpaceTableSize = 0; … … 1291 1291 return EFI_SUCCESS; 1292 1292 } 1293 1293 1294 1294 for (Idx = 0; Idx < TmpTokenSpaceBufferCount; Idx++) { 1295 1295 if (CompareGuid (*Guid, TmpTokenSpaceBuffer[Idx])) { -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
r58459 r58466 2 2 # PCD DXE driver manage database contains all dynamic PCD entries and produce the implementation of PCD protocol. 3 3 # 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. 5 5 # There are two PCD Protocols as follows: 6 # 1) PCD_PROTOCOL 6 # 1) PCD_PROTOCOL 7 7 # It is EDKII implementation which support Dynamic/DynamicEx type Pcds. 8 8 # 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 10 10 # type Pcd. 11 11 # 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. 13 13 # PCD DXE driver will produce above two protocols at same time. 14 14 # 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. 17 17 # 18 18 # //////////////////////////////////////////////////////////////////////////////// … … 23 23 # 24 24 # 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 27 27 # specified platform. 28 # 28 # 29 29 # 2, Dynamic Type PCD 30 30 # 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 # 34 34 # 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 36 36 # other driver in execution time. 37 37 # b) The PCD setting value is set/get by user from FrontPage. 38 38 # c) The PCD setting value is produced by platform OEM vendor in specified area. 39 # 39 # 40 40 # 2.2 According to module distribution way, dynamic PCD could be classfied as: 41 41 # 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 43 43 # DSC, the dynamic PCD used by this module can be accessed as: 44 # PcdGetxx(PcdSampleDynamicPcd); 44 # PcdGetxx(PcdSampleDynamicPcd); 45 45 # 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. 47 47 # b) DynamicEx: 48 48 # If module is release as binary and will not pariticpate platform building, … … 51 51 # Developer need explicity gives {Token Space Guid:Token Number} as parameter 52 52 # in writting source code. 53 # 53 # 54 54 # 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 57 57 # 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 60 60 # 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 62 62 # 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. 66 66 # - 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 68 68 # 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 70 70 # 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 72 72 # DSC file. [PcdsDynamicExHii] is for dynamicEx type PCD. 73 # 73 # 74 74 # 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 76 76 # specified by a FixedAtBuild PCD setting - PcdVpdBaseAddress. 77 77 # - 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 79 79 # DSC file. [PcdsDynamicExVpd] is for dynamicex type PCD. 80 # 80 # 81 81 # 2.4 When and how to use dynamic PCD 82 82 # 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 84 84 # in platform DSC file. Please ref section 2.3 to get matching between dynamic 85 85 # PCD type and section name in DSC file. 86 # 86 # 87 87 # 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, 89 89 # but the basic information and default value for all dynamic PCD is hold 90 90 # by PCD database maintained by PEI/DXE driver. 91 # 91 # 92 92 # As the whole EFI BIOS boot path is divided into PEI/DXE phase, the PCD database 93 93 # also is divided into Pei/Dxe database maintaied by PcdPeim/PcdDxe driver separatly. … … 95 95 # PCD information used in PEI phase or use in both PEI/DXE phase. And DXE PCD 96 96 # 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 # 101 101 # 3.1 PcdPeim and PcdDxe 102 102 # 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. 105 105 # DXE PCD database is maintained by PcdDxe driver.At entry point of PcdDxe driver, 106 106 # a new PCD database is allocated in boot-time memory which including all 107 107 # PEI PCD and DXE PCD entry. 108 # 108 # 109 109 # Pcd driver should run as early as possible before any other driver access 110 110 # dynamic PCD's value. PEI/DXE "Apriori File" mechanism make it possible by 111 111 # making PcdPeim/PcdDxe as first dispatching driver in PEI/DXE phase. 112 # 112 # 113 113 # 3.2 Token space Guid/Token number, Platform token, Local token number 114 114 # Dynamic PCD … … 130 130 # | Number | 131 131 # +-----------+ 132 # 133 # 132 # 133 # 134 134 # 3.2.1 Pair of Token space guid + Token number 135 135 # 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. 138 138 # 139 139 # 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 143 143 # started from 1.(0 meaning invalid internal token number) 144 144 # 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) 146 146 # in autogen.h. 147 147 # Notes: The mapping between pair of "tokenspace guid + token number" and … … 150 150 # To access a dynamicEx type PCD, pair of "token space guid/token number" all need 151 151 # 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 154 154 # platform scope, there are two zones: PEI Zone and DXE Zone 155 155 # | Platform Token Number … … 157 157 # PEI Zone: | 1 ~ PEI_LOCAL_TOKEN_NUMBER 158 158 # DXE Zone: | (PEI_LOCAL_TOKEN_NUMBER + 1) ~ (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER) 159 # 159 # 160 160 # 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 162 162 # platform token number to local token number via a mapping table. 163 163 # For binary DynamicEx type PCD, there is a another mapping table to translate … … 165 165 # Local token number is identifier for all internal interface in PCD PEI/DXE 166 166 # driver. 167 # 167 # 168 168 # A local token number is a 32-bit value in following meaning: 169 169 # 32 ------------- 28 ---------- 24 -------- 0 … … 186 186 # Based on local token number, PCD driver could fast determine PCD type, value 187 187 # type and get PCD entry from PCD database. 188 # 188 # 189 189 # 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 192 192 # as comments by build tools in PCD driver's autogen.h/ 193 193 # 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 195 195 # "tokenguid + token" to local token number. 196 196 # - LocalTokenNumberTable: … … 202 202 # - SkuIdTable: TBD 203 203 # - SystemSkuId: TBD 204 # - PCD value structure: 204 # - PCD value structure: 205 205 # 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 207 207 # 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 212 212 # value specified in platform DSC file. 213 213 # Unint area is used stored the value of PCD which has no default value in 214 214 # platform DSC file, the value of NULL, 0 specified in platform DSC file can 215 215 # be seemed as "no default value". 216 # 216 # 217 217 # 3.3.1 Simple Sample PCD Database C Structure 218 218 # A general sample of PCD database structue is as follows: … … 226 226 # UINT8 SkuIdTable[PEI_SKUID_TABLE_SIZE]; 227 227 # SKU_ID SystemSkuId; 228 # 228 # 229 229 # //===== Following is value structure for PCD with default value 230 230 # .... … … 238 238 # } UnInit; 239 239 # } 240 # 240 # 241 241 # 3.3.2 PCD value structure in PCD database C structure 242 242 # The value's structure is generated by build tool in PCD database C structure. 243 243 # The PCDs in different datum type has different value structure. 244 # 244 # 245 245 # 3.3.2.1 UINT8/UINT16/UINT32/UINT64 datum type PCD 246 246 # The C structure for these datum type PCD is just a UINT8/UINT16/UINT32/UINT64 … … 250 250 # Member type is UINT16 according to PcdHardwareErrorRecordLevel declaration 251 251 # in DEC file. 252 # 252 # 253 253 # 3.3.2.2 VOID* datum type PCD 254 254 # The value of VOID* datum type PCD is a UINT8/UINT16 array in PCD database. 255 # 255 # 256 256 # 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 259 259 # UINT16 string array in PCD database, for example: 260 260 # UINT16 StringTable[29]; 261 261 # The number of 29 in above sample is max size of a unicode string. 262 # 262 # 263 263 # 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 265 265 # UINT8 string array in PCD database, for example: 266 266 # UINT8 StringTable[20]; 267 267 # The number of 20 in above sample is max size of a ascii string. 268 # 268 # 269 269 # 3.3.2.2.2 VOID* - byte array 270 270 # 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 272 272 # above ascii string table, 273 273 # UINT8 StringTable[13]; 274 274 # The number of 13 in above sample is max size of byte array. 275 # 275 # 276 276 # 3.3.3 Some utility structures in PCD Database 277 277 # 3.3.3.1 GuidTable 278 278 # GuidTable array is used to store all related GUID value in PCD database: 279 279 # - Variable GUID for HII type PCD 280 # - Token space GUID for dynamicex type PCD 281 # 280 # - Token space GUID for dynamicex type PCD 281 # 282 282 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 283 283 # -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Service.c
r58459 r58466 19 19 PCD_DATABASE mPcdDatabase; 20 20 21 UINT32 mPcdTotalTokenCount; 22 UINT32 mPeiLocalTokenCount; 23 UINT32 mDxeLocalTokenCount; 24 UINT32 mPeiNexTokenCount; 25 UINT32 mDxeNexTokenCount; 21 UINT32 mPcdTotalTokenCount; 22 UINT32 mPeiLocalTokenCount; 23 UINT32 mDxeLocalTokenCount; 24 UINT32 mPeiNexTokenCount; 25 UINT32 mDxeNexTokenCount; 26 26 UINT32 mPeiExMapppingTableSize; 27 27 UINT32 mDxeExMapppingTableSize; … … 29 29 UINT32 mDxeGuidTableSize; 30 30 31 BOOLEAN mPeiExMapTableEmpty; 32 BOOLEAN mDxeExMapTableEmpty; 31 BOOLEAN mPeiExMapTableEmpty; 32 BOOLEAN mDxeExMapTableEmpty; 33 33 BOOLEAN mPeiDatabaseEmpty; 34 34 35 35 LIST_ENTRY *mCallbackFnTable; 36 36 EFI_GUID **TmpTokenSpaceBuffer; 37 UINTN TmpTokenSpaceBufferCount; 37 UINTN TmpTokenSpaceBufferCount; 38 38 39 39 /** … … 67 67 // 68 68 // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber 69 // 69 // 70 70 TmpTokenNumber = TokenNumber; 71 71 72 LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) : 72 LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) : 73 73 (UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset); 74 74 TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount; … … 183 183 AsciiStrCat (Name, TokenSpaceName); 184 184 Name[AsciiStrSize (TokenSpaceName) - sizeof (CHAR8)] = '.'; 185 AsciiStrCat (Name, PcdName); 185 AsciiStrCat (Name, PcdName); 186 186 } 187 187 … … 200 200 @param[in] TokenNumber The PCD token number. 201 201 @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. 203 203 204 204 @retval EFI_SUCCESS The PCD information was returned successfully … … 249 249 // 250 250 // Here use one representative in the token space to get the TokenSpaceCName. 251 // 251 // 252 252 PcdInfo->PcdName = GetPcdName (TRUE, IsPeiDb, ExMapTable[Index].TokenNumber); 253 253 return EFI_SUCCESS; … … 354 354 /** 355 355 Get the PCD entry pointer in PCD database. 356 356 357 357 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 360 360 offset of PCD entry in PCD database. 361 361 … … 387 387 UINT32 LocalTokenNumber; 388 388 UINT32 Offset; 389 STRING_HEAD StringTableIdx; 389 STRING_HEAD StringTableIdx; 390 390 BOOLEAN IsPeiDb; 391 391 … … 409 409 // 410 410 // 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 412 412 // comparison. 413 413 // … … 417 417 418 418 // 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 420 420 // comparison. 421 421 IsPeiDb = (BOOLEAN) ((TokenNumber + 1 < mPeiLocalTokenCount + 1) ? TRUE : FALSE); … … 424 424 425 425 PcdDb = IsPeiDb ? ((UINT8 *) mPcdDatabase.PeiDb) : ((UINT8 *) mPcdDatabase.DxeDb); 426 426 427 427 if (IsPeiDb) { 428 428 StringTable = (UINT8 *) ((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->StringTableOffset); … … 455 455 if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) { 456 456 // 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 458 458 // string array in string table. 459 459 // 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); 462 462 } else { 463 463 VaraiableDefaultBuffer = (UINT8 *) PcdDb + VariableHead->DefaultValueOffset; … … 503 503 ASSERT (FALSE); 504 504 break; 505 505 506 506 } 507 507 … … 517 517 This routine will register a callback function to a PCD entry by given token number 518 518 and token space guid. 519 519 520 520 @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, 522 522 if not NULL, this PCD is dynamicEx type PCD. 523 523 @param CallBackFunction Callback function pointer … … 567 567 FnTableEntry->CallbackFn = CallBackFunction; 568 568 InsertTailList (ListHead, &FnTableEntry->Node); 569 569 570 570 return EFI_SUCCESS; 571 571 } … … 619 619 RemoveEntryList (ListNode); 620 620 FreePool (FnTableEntry); 621 621 622 622 return EFI_SUCCESS; 623 623 } … … 630 630 /** 631 631 Get next token number in given token space. 632 632 633 633 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 636 636 this token space. 637 637 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 639 639 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 642 642 token space table. 643 643 If not PCD_INVALID_TOKEN_NUMBER, return next token number … … 670 670 671 671 // 672 // Scan token space guid 673 // 672 // Scan token space guid 673 // 674 674 MatchGuid = ScanGuid (GuidTable, SizeOfGuidTable, Guid); 675 675 if (MatchGuid == NULL) { … … 736 736 LocateExPcdBinary ( 737 737 VOID 738 ) 738 ) 739 739 { 740 740 DXE_PCD_DATABASE *DxePcdDbBinary; 741 741 UINTN DxePcdDbSize; 742 742 EFI_STATUS Status; 743 743 744 744 DxePcdDbBinary = NULL; 745 745 // 746 // Search the External Pcd database from one section of current FFS, 746 // Search the External Pcd database from one section of current FFS, 747 747 // and read it to memory 748 748 // … … 768 768 /** 769 769 Initialize the PCD database in DXE phase. 770 770 771 771 PCD database in DXE phase also contains PCD database in PEI phase which is copied 772 772 from GUID Hob. … … 799 799 if (GuidHob != NULL) { 800 800 801 // 801 // 802 802 // If no PEIMs use dynamic Pcd Entry, the Pcd Service PEIM 803 803 // should not be included at all. So the GuidHob could … … 805 805 // Value to PCD Database. 806 806 // 807 807 808 808 PeiDatabase = (PEI_PCD_DATABASE *) GET_GUID_HOB_DATA (GuidHob); 809 809 // … … 833 833 mPcdTotalTokenCount = mPeiLocalTokenCount + mDxeLocalTokenCount; 834 834 mPeiNexTokenCount = mPeiLocalTokenCount - mPcdDatabase.PeiDb->ExTokenCount; 835 mDxeNexTokenCount = mDxeLocalTokenCount - mPcdDatabase.DxeDb->ExTokenCount; 835 mDxeNexTokenCount = mDxeLocalTokenCount - mPcdDatabase.DxeDb->ExTokenCount; 836 836 837 837 mPeiExMapTableEmpty = (mPcdDatabase.PeiDb->ExTokenCount == 0) ? TRUE : FALSE; … … 850 850 // 851 851 // 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 853 853 // comparison. 854 854 // … … 863 863 @param VariableGuid Variable's guid 864 864 @param VariableName Variable's unicode name string 865 @param VariableData Variable's data pointer, 865 @param VariableData Variable's data pointer, 866 866 @param VariableSize Variable's size. 867 867 … … 882 882 Size = 0; 883 883 Buffer = NULL; 884 884 885 885 // 886 886 // Firstly get the real size of HII variable … … 893 893 Buffer 894 894 ); 895 895 896 896 // 897 897 // Allocate buffer to hold whole variable data according to variable size. … … 915 915 } else { 916 916 // 917 // Use Default Data only when variable is not found. 917 // Use Default Data only when variable is not found. 918 918 // For other error status, correct data can't be got, and trig ASSERT(). 919 919 // … … 940 940 UINTN Size, 941 941 BOOLEAN IsPeiDb 942 ) 942 ) 943 943 { 944 944 SKU_HEAD *SkuHead; … … 954 954 955 955 SkuHead = (SKU_HEAD *) (PcdDb + (LocalTokenNumber & PCD_DATABASE_OFFSET_MASK)); 956 Value = (UINT8 *) (PcdDb + SkuHead->SkuDataStartOffset); 956 Value = (UINT8 *) (PcdDb + SkuHead->SkuDataStartOffset); 957 957 958 958 SkuIdTable = (SKU_ID *)(PcdDb + SkuHead->SkuIdTableOffset); … … 967 967 } 968 968 } 969 969 970 970 // 971 971 // Find the default SKU ID entry in SKU ID table. 972 972 // 973 973 974 974 if(!FoundSku) { 975 975 for (Index = 0; Index < SkuIdTable[0]; Index++) { … … 997 997 Value = (UINT8 *) &(((STRING_HEAD *) Value)[Index]); 998 998 return (UINT32) ((Value - PcdDb) | PCD_TYPE_STRING); 999 999 1000 1000 case PCD_TYPE_DATA: 1001 1001 Value += Size * Index; … … 1009 1009 1010 1010 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 1016 1016 has registered callback function. 1017 1017 … … 1049 1049 FnTableEntry = CR_FNENTRY_FROM_LISTNODE (ListNode, CALLBACK_FN_ENTRY, Node); 1050 1050 1051 FnTableEntry->CallbackFn(Guid, 1051 FnTableEntry->CallbackFn(Guid, 1052 1052 (Guid == NULL) ? TokenNumber : ExTokenNumber, 1053 1053 Data, 1054 1054 Size); 1055 1055 1056 1056 ListNode = GetNextNode (ListHead, ListNode); 1057 1057 } 1058 1058 1059 1059 return; 1060 1060 } … … 1093 1093 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set. 1094 1094 @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. 1096 1096 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in 1097 1097 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. 1099 1099 **/ 1100 1100 EFI_STATUS … … 1129 1129 1130 1130 TmpTokenNumber = TokenNumber; 1131 1131 1132 1132 // 1133 1133 // 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 1135 1135 // comparison. 1136 1136 // … … 1154 1154 // 1155 1155 // 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 1157 1157 // comparison. 1158 1158 // … … 1169 1169 // 1170 1170 // 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 1172 1172 // comparison. 1173 1173 // … … 1186 1186 } 1187 1187 1188 1188 1189 1189 InternalData = PcdDb + Offset; 1190 1190 … … 1194 1194 Status = EFI_INVALID_PARAMETER; 1195 1195 break; 1196 1196 1197 1197 case PCD_TYPE_STRING: 1198 1198 if (SetPtrTypeSize (TmpTokenNumber, Size)) { … … 1235 1235 } else { 1236 1236 CopyMem (PcdDb + VariableHead->DefaultValueOffset, Data, *Size); 1237 } 1237 } 1238 1238 Status = EFI_SUCCESS; 1239 1239 } 1240 1240 break; 1241 1241 1242 1242 case PCD_TYPE_DATA: 1243 1243 if (PtrType) { … … 1283 1283 1284 1284 EfiReleaseLock (&mPcdDatabaseLock); 1285 1285 1286 1286 return Status; 1287 1287 } … … 1302 1302 IN UINTN ExTokenNumber, 1303 1303 IN UINTN GetSize 1304 ) 1304 ) 1305 1305 { 1306 1306 return GetWorker(GetExPcdTokenNumber (Guid, (UINT32) ExTokenNumber), GetSize); … … 1331 1331 /** 1332 1332 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 1335 1335 space guid and token number firstly, and invoke callback function if this PCD 1336 1336 entry registered callback function. Finally, invoken general SetWorker to set 1337 1337 PCD value. 1338 1338 1339 1339 @param ExTokenNumber Dynamic-ex PCD token number. 1340 1340 @param Guid Token space guid for dynamic-ex PCD. … … 1357 1357 { 1358 1358 UINTN TokenNumber; 1359 1359 1360 1360 TokenNumber = GetExPcdTokenNumber (Guid, (UINT32) ExTokenNumber); 1361 1361 … … 1369 1369 Set value for HII-type PCD. 1370 1370 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 1372 1372 HII-type PCD is to visit this variable. 1373 1373 1374 1374 @param VariableGuid Guid of variable which stored value of a HII-type PCD. 1375 1375 @param VariableName Unicode name of variable which stored value of a HII-type PCD. … … 1409 1409 NULL 1410 1410 ); 1411 1411 1412 1412 if (Status == EFI_BUFFER_TOO_SMALL) { 1413 1413 // … … 1429 1429 Buffer 1430 1430 ); 1431 1431 1432 1432 ASSERT_EFI_ERROR (Status); 1433 1433 … … 1448 1448 // If variable does not exist, a new variable need to be created. 1449 1449 // 1450 1450 1451 1451 Size = Offset + DataSize; 1452 1452 1453 1453 Buffer = AllocateZeroPool (Size); 1454 1454 ASSERT (Buffer != NULL); 1455 1455 1456 1456 CopyMem ((UINT8 *)Buffer + Offset, Data, DataSize); 1457 1457 1458 1458 Status = gRT->SetVariable ( 1459 1459 VariableName, … … 1465 1465 1466 1466 FreePool (Buffer); 1467 return Status; 1468 } 1469 1467 return Status; 1468 } 1469 1470 1470 // 1471 1471 // If we drop to here, the value is failed to be written in to variable area … … 1481 1481 in DEC file. PCD database maintain a mapping table that translate pair of {token 1482 1482 space guid: token number} to Token Number. 1483 1483 1484 1484 @param Guid Token space guid for dynamic-ex PCD entry. 1485 1485 @param ExTokenNumber Dynamic-ex PCD token number. … … 1488 1488 1489 1489 **/ 1490 UINTN 1490 UINTN 1491 1491 GetExPcdTokenNumber ( 1492 1492 IN CONST EFI_GUID *Guid, … … 1575 1575 1576 1576 return (SKU_ID *) (Database + SkuHead->SkuIdTableOffset); 1577 1577 1578 1578 } 1579 1579 1580 1580 /** 1581 1581 Wrapper function of getting index of PCD entry in size table. 1582 1582 1583 1583 @param LocalTokenNumberTableIdx Index of this PCD in local token number table. 1584 1584 @param IsPeiDb If TRUE, the pcd entry is initialized in PEI phase, … … 1598 1598 UINTN SizeTableIdx; 1599 1599 SKU_ID *SkuIdTable; 1600 1600 1601 1601 if (IsPeiDb) { 1602 1602 LocalTokenNumberTable = (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset); … … 1612 1612 if ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER) { 1613 1613 // 1614 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1614 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1615 1615 // PCD entry. 1616 1616 // … … 1645 1645 } 1646 1646 1647 return SizeTableIdx; 1647 return SizeTableIdx; 1648 1648 } 1649 1649 … … 1672 1672 1673 1673 // 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 1675 1675 // comparison. 1676 1676 IsPeiDb = (BOOLEAN) (LocalTokenNumberTableIdx + 1 < mPeiLocalTokenCount + 1); … … 1689 1689 1690 1690 ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER); 1691 1691 1692 1692 SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, IsPeiDb); 1693 1693 1694 1694 *MaxSize = SizeTable[SizeTableIdx]; 1695 1695 // 1696 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1696 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1697 1697 // PCD entry. 1698 1698 // … … 1757 1757 // 1758 1758 // 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 1760 1760 // comparison. 1761 1761 // … … 1774 1774 1775 1775 ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER); 1776 1776 1777 1777 SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, IsPeiDb); 1778 1778 1779 1779 MaxSize = SizeTable[SizeTableIdx]; 1780 1780 // 1781 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1781 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1782 1782 // PCD entry. 1783 1783 // … … 1793 1793 *CurrentSize = MaxSize; 1794 1794 return FALSE; 1795 } 1796 1795 } 1796 1797 1797 if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) { 1798 1798 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Dxe/Service.h
r58459 r58466 108 108 Sets the SKU value for subsequent calls to set or get PCD token values. 109 109 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. 111 111 SetSku() is normally called only once by the system. 112 112 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 122 122 set for that Id, the results are unpredictable. 123 123 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 125 125 set values associated with a PCD token. 126 126 … … 135 135 Retrieves an 8-bit value for a given PCD token. 136 136 137 Retrieves the current byte-sized value for a PCD token number. 137 Retrieves the current byte-sized value for a PCD token number. 138 138 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. 141 141 142 142 @return The UINT8 value. 143 143 144 144 **/ 145 145 UINT8 … … 152 152 Retrieves an 16-bit value for a given PCD token. 153 153 154 Retrieves the current 16-bits value for a PCD token number. 154 Retrieves the current 16-bits value for a PCD token number. 155 155 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. 158 158 159 159 @return The UINT16 value. 160 160 161 161 **/ 162 162 UINT16 … … 169 169 Retrieves an 32-bit value for a given PCD token. 170 170 171 Retrieves the current 32-bits value for a PCD token number. 171 Retrieves the current 32-bits value for a PCD token number. 172 172 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. 175 175 176 176 @return The UINT32 value. 177 177 178 178 **/ 179 179 UINT32 … … 186 186 Retrieves an 64-bit value for a given PCD token. 187 187 188 Retrieves the current 64-bits value for a PCD token number. 188 Retrieves the current 64-bits value for a PCD token number. 189 189 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. 192 192 193 193 @return The UINT64 value. 194 194 195 195 **/ 196 196 UINT64 … … 203 203 Retrieves a pointer to a value for a given PCD token. 204 204 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, 208 208 the results are unpredictable. 209 209 210 @param[in] TokenNumber The PCD token number. 210 @param[in] TokenNumber The PCD token number. 211 211 212 212 @return The pointer to the buffer to be retrieved. 213 213 214 214 **/ 215 215 VOID * … … 222 222 Retrieves a Boolean value for a given PCD token. 223 223 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, 227 227 the results are unpredictable. 228 228 229 @param[in] TokenNumber The PCD token number. 229 @param[in] TokenNumber The PCD token number. 230 230 231 231 @return The Boolean value. 232 232 233 233 **/ 234 234 BOOLEAN … … 241 241 Retrieves the size of the value for a given PCD token. 242 242 243 Retrieves the current size of a particular PCD token. 243 Retrieves the current size of a particular PCD token. 244 244 If the TokenNumber is invalid, the results are unpredictable. 245 245 246 @param[in] TokenNumber The PCD token number. 246 @param[in] TokenNumber The PCD token number. 247 247 248 248 @return The size of the value for the PCD token. 249 249 250 250 **/ 251 251 UINTN … … 258 258 Retrieves an 8-bit value for a given PCD token. 259 259 260 Retrieves the 8-bit value of a particular PCD token. 260 Retrieves the 8-bit value of a particular PCD token. 261 261 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 263 263 unpredictable. 264 264 265 265 @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. 267 267 268 268 @return The size 8-bit value for the PCD token. 269 269 270 270 **/ 271 271 UINT8 … … 279 279 Retrieves an 16-bit value for a given PCD token. 280 280 281 Retrieves the 16-bit value of a particular PCD token. 281 Retrieves the 16-bit value of a particular PCD token. 282 282 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 284 284 unpredictable. 285 285 286 286 @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. 288 288 289 289 @return The size 16-bit value for the PCD token. 290 290 291 291 **/ 292 292 UINT16 … … 300 300 Retrieves an 32-bit value for a given PCD token. 301 301 302 Retrieves the 32-bit value of a particular PCD token. 302 Retrieves the 32-bit value of a particular PCD token. 303 303 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 305 305 unpredictable. 306 306 307 307 @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. 309 309 310 310 @return The size 32-bit value for the PCD token. 311 311 312 312 **/ 313 313 UINT32 … … 321 321 Retrieves an 64-bit value for a given PCD token. 322 322 323 Retrieves the 64-bit value of a particular PCD token. 323 Retrieves the 64-bit value of a particular PCD token. 324 324 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 326 326 unpredictable. 327 327 328 328 @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. 330 330 331 331 @return The size 64-bit value for the PCD token. 332 332 333 333 **/ 334 334 UINT64 … … 342 342 Retrieves a pointer to a value for a given PCD token. 343 343 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, 347 347 the results are unpredictable. 348 348 349 349 @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. 351 351 352 352 @return The pointer to the buffer to be retrieved. 353 353 354 354 **/ 355 355 VOID * … … 363 363 Retrieves an Boolean value for a given PCD token. 364 364 365 Retrieves the Boolean value of a particular PCD token. 365 Retrieves the Boolean value of a particular PCD token. 366 366 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 368 368 unpredictable. 369 369 370 370 @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. 372 372 373 373 @return The size Boolean value for the PCD token. 374 374 375 375 **/ 376 376 BOOLEAN … … 384 384 Retrieves the size of the value for a given PCD token. 385 385 386 Retrieves the current size of a particular PCD token. 386 Retrieves the current size of a particular PCD token. 387 387 If the TokenNumber is invalid, the results are unpredictable. 388 388 389 389 @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. 391 391 392 392 @return The size of the value for the PCD token. 393 393 394 394 **/ 395 395 UINTN … … 403 403 Sets an 8-bit value for a given PCD token. 404 404 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. 407 407 If it is not, an error will be returned. 408 408 409 @param[in] TokenNumber The PCD token number. 409 @param[in] TokenNumber The PCD token number. 410 410 @param[in] Value The value to set for the PCD token. 411 411 412 412 @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. 415 415 Use GetSize() to retrieve the size of the target data. 416 416 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 417 417 418 418 **/ 419 419 EFI_STATUS … … 427 427 Sets an 16-bit value for a given PCD token. 428 428 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. 431 431 If it is not, an error will be returned. 432 432 433 @param[in] TokenNumber The PCD token number. 433 @param[in] TokenNumber The PCD token number. 434 434 @param[in] Value The value to set for the PCD token. 435 435 436 436 @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. 439 439 Use GetSize() to retrieve the size of the target data. 440 440 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 441 441 442 442 **/ 443 443 EFI_STATUS … … 451 451 Sets an 32-bit value for a given PCD token. 452 452 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. 455 455 If it is not, an error will be returned. 456 456 457 @param[in] TokenNumber The PCD token number. 457 @param[in] TokenNumber The PCD token number. 458 458 @param[in] Value The value to set for the PCD token. 459 459 460 460 @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. 463 463 Use GetSize() to retrieve the size of the target data. 464 464 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 465 465 466 466 **/ 467 467 EFI_STATUS … … 475 475 Sets an 64-bit value for a given PCD token. 476 476 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. 479 479 If it is not, an error will be returned. 480 480 481 @param[in] TokenNumber The PCD token number. 481 @param[in] TokenNumber The PCD token number. 482 482 @param[in] Value The value to set for the PCD token. 483 483 484 484 @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. 487 487 Use GetSize() to retrieve the size of the target data. 488 488 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 489 489 490 490 **/ 491 491 EFI_STATUS … … 500 500 Sets a value of a specified size for a given PCD token. 501 501 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. 504 504 If it is not, an error will be returned. 505 505 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 510 510 the maximum size supported for this TokenNumber. 511 511 @param[in] Buffer The buffer to set for the PCD token. 512 512 513 513 @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. 516 516 Use GetSize() to retrieve the size of the target data. 517 517 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 518 518 519 519 **/ 520 520 EFI_STATUS … … 529 529 Sets an Boolean value for a given PCD token. 530 530 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. 533 533 If it is not, an error will be returned. 534 534 535 @param[in] TokenNumber The PCD token number. 535 @param[in] TokenNumber The PCD token number. 536 536 @param[in] Value The value to set for the PCD token. 537 537 538 538 @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. 541 541 Use GetSize() to retrieve the size of the target data. 542 542 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 543 543 544 544 **/ 545 545 EFI_STATUS … … 554 554 Sets an 8-bit value for a given PCD token. 555 555 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. 558 558 If it is not, an error will be returned. 559 559 560 560 @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. 562 562 @param[in] Value The value to set for the PCD token. 563 563 564 564 @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. 567 567 Use GetSize() to retrieve the size of the target data. 568 568 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 569 569 570 570 **/ 571 571 EFI_STATUS … … 580 580 Sets an 16-bit value for a given PCD token. 581 581 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. 584 584 If it is not, an error will be returned. 585 585 586 586 @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. 588 588 @param[in] Value The value to set for the PCD token. 589 589 590 590 @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. 593 593 Use GetSize() to retrieve the size of the target data. 594 594 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 595 595 596 596 **/ 597 597 EFI_STATUS … … 606 606 Sets an 32-bit value for a given PCD token. 607 607 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. 610 610 If it is not, an error will be returned. 611 611 612 612 @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. 614 614 @param[in] Value The value to set for the PCD token. 615 615 616 616 @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. 619 619 Use GetSize() to retrieve the size of the target data. 620 620 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 621 621 622 622 **/ 623 623 EFI_STATUS … … 632 632 Sets an 64-bit value for a given PCD token. 633 633 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. 636 636 If it is not, an error will be returned. 637 637 638 638 @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. 640 640 @param[in] Value The value to set for the PCD token. 641 641 642 642 @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. 645 645 Use GetSize() to retrieve the size of the target data. 646 646 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 647 647 648 648 **/ 649 649 EFI_STATUS … … 658 658 Sets a value of a specified size for a given PCD token. 659 659 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. 662 662 If it is not, an error will be returned. 663 663 664 664 @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 669 669 the maximum size supported for this TokenNumber. 670 670 @param[in] Buffer The buffer to set for the PCD token. 671 671 672 672 @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. 675 675 Use GetSize() to retrieve the size of the target data. 676 676 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 677 677 678 678 **/ 679 679 EFI_STATUS … … 689 689 Sets an Boolean value for a given PCD token. 690 690 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. 693 693 If it is not, an error will be returned. 694 694 695 695 @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. 697 697 @param[in] Value The value to set for the PCD token. 698 698 699 699 @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. 702 702 Use GetSize() to retrieve the size of the target data. 703 703 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 704 704 705 705 **/ 706 706 EFI_STATUS … … 716 716 717 717 @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 722 722 for the CallBackToken requested. 723 723 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 736 736 737 737 @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 742 742 for the CallBackToken requested. 743 743 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 753 753 754 754 /** 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. 767 767 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned. 768 768 769 769 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 772 772 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. 778 778 In the later case, *TokenNumber is updated with the value of 0. 779 779 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform. … … 789 789 /** 790 790 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 793 793 the first PCD token space in PCD database, If not NULL, then 794 794 Guid will be set to next PCD token space. … … 824 824 @param[in] TokenNumber The PCD token number. 825 825 @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. 827 827 828 828 @retval EFI_SUCCESS The PCD information was returned successfully … … 864 864 @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set. 865 865 @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. 867 867 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in 868 868 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. 870 870 **/ 871 871 EFI_STATUS … … 898 898 /** 899 899 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 902 902 space guid and token number firstly, and invoke callback function if this PCD 903 903 entry registered callback function. Finally, invoken general SetWorker to set 904 904 PCD value. 905 905 906 906 @param ExTokenNumber Dynamic-ex PCD token number. 907 907 @param Guid Token space guid for dynamic-ex PCD. … … 925 925 /** 926 926 Get the PCD entry pointer in PCD database. 927 927 928 928 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 931 931 offset of PCD entry in PCD database. 932 932 … … 983 983 @param VariableGuid Variable's guid 984 984 @param VariableName Variable's unicode name string 985 @param VariableData Variable's data pointer, 985 @param VariableData Variable's data pointer, 986 986 @param VariableSize Variable's size. 987 987 … … 999 999 Set value for HII-type PCD. 1000 1000 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 1002 1002 HII-type PCD is to visit this variable. 1003 1003 1004 1004 @param VariableGuid Guid of variable which stored value of a HII-type PCD. 1005 1005 @param VariableName Unicode name of variable which stored value of a HII-type PCD. … … 1025 1025 This routine will register a callback function to a PCD entry by given token number 1026 1026 and token space guid. 1027 1027 1028 1028 @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, 1030 1030 if not NULL, this PCD is dynamicEx type PCD. 1031 1031 @param CallBackFunction Callback function pointer … … 1064 1064 /** 1065 1065 Initialize the PCD database in DXE phase. 1066 1066 1067 1067 PCD database in DXE phase also contains PCD database in PEI phase which is copied 1068 1068 from GUID Hob. … … 1080 1080 in DEC file. PCD database maintain a mapping table that translate pair of {token 1081 1081 space guid: token number} to Token Number. 1082 1082 1083 1083 @param Guid Token space guid for dynamic-ex PCD entry. 1084 1084 @param ExTokenNumber Dynamic-ex PCD token number. … … 1095 1095 /** 1096 1096 Get next token number in given token space. 1097 1097 1098 1098 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 1101 1101 this token space. 1102 1102 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 1104 1104 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 1107 1107 token space table. 1108 1108 If not PCD_INVALID_TOKEN_NUMBER, return next token number … … 1161 1161 extern PCD_DATABASE mPcdDatabase; 1162 1162 1163 extern UINT32 mPcdTotalTokenCount; 1164 extern UINT32 mPeiLocalTokenCount; 1165 extern UINT32 mDxeLocalTokenCount; 1166 extern UINT32 mPeiNexTokenCount; 1167 extern UINT32 mDxeNexTokenCount; 1163 extern UINT32 mPcdTotalTokenCount; 1164 extern UINT32 mPeiLocalTokenCount; 1165 extern UINT32 mDxeLocalTokenCount; 1166 extern UINT32 mPeiNexTokenCount; 1167 extern UINT32 mDxeNexTokenCount; 1168 1168 extern UINT32 mPeiExMapppingTableSize; 1169 1169 extern UINT32 mDxeExMapppingTableSize; … … 1171 1171 extern UINT32 mDxeGuidTableSize; 1172 1172 1173 extern BOOLEAN mPeiExMapTableEmpty; 1174 extern BOOLEAN mDxeExMapTableEmpty; 1173 extern BOOLEAN mPeiExMapTableEmpty; 1174 extern BOOLEAN mDxeExMapTableEmpty; 1175 1175 extern BOOLEAN mPeiDatabaseEmpty; 1176 1176 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Pcd.c
r58459 r58466 1 /** @file 1 /** @file 2 2 All Pcd Ppi services are implemented here. 3 3 4 4 Copyright (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. 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. 12 12 13 13 **/ … … 23 23 24 24 PeiPcdGet8, 25 PeiPcdGet16, 26 PeiPcdGet32, 27 PeiPcdGet64, 28 PeiPcdGetPtr, 29 PeiPcdGetBool, 25 PeiPcdGet16, 26 PeiPcdGet32, 27 PeiPcdGet64, 28 PeiPcdGetPtr, 29 PeiPcdGetBool, 30 30 PeiPcdGetSize, 31 31 32 32 PeiPcdGet8Ex, 33 PeiPcdGet16Ex, 34 PeiPcdGet32Ex, 35 PeiPcdGet64Ex, 36 PeiPcdGetPtrEx, 37 PeiPcdGetBoolEx, 33 PeiPcdGet16Ex, 34 PeiPcdGet32Ex, 35 PeiPcdGet64Ex, 36 PeiPcdGetPtrEx, 37 PeiPcdGetBoolEx, 38 38 PeiPcdGetSizeEx, 39 39 40 40 PeiPcdSet8, 41 PeiPcdSet16, 42 PeiPcdSet32, 43 PeiPcdSet64, 44 PeiPcdSetPtr, 45 PeiPcdSetBool, 41 PeiPcdSet16, 42 PeiPcdSet32, 43 PeiPcdSet64, 44 PeiPcdSetPtr, 45 PeiPcdSetBool, 46 46 47 47 PeiPcdSet8Ex, 48 PeiPcdSet16Ex, 49 PeiPcdSet32Ex, 50 PeiPcdSet64Ex, 51 PeiPcdSetPtrEx, 48 PeiPcdSet16Ex, 49 PeiPcdSet32Ex, 50 PeiPcdSet64Ex, 51 PeiPcdSetPtrEx, 52 52 PeiPcdSetBoolEx, 53 53 … … 64 64 EFI_PEI_PCD_PPI mEfiPcdPpiInstance = { 65 65 PeiPcdSetSku, 66 66 67 67 PeiPcdGet8Ex, 68 68 PeiPcdGet16Ex, … … 131 131 /** 132 132 Main entry for PCD PEIM driver. 133 133 134 134 This routine initialize the PCD database for PEI phase and install PCD_PPI/EFI_PEI_PCD_PPI. 135 135 … … 159 159 160 160 // 161 // Only install PcdInfo PPI when PCD info content is present. 161 // Only install PcdInfo PPI when PCD info content is present. 162 162 // 163 163 if (DataBase->PcdNameTableOffset != 0) { … … 239 239 Sets the SKU value for subsequent calls to set or get PCD token values. 240 240 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. 242 242 SetSku() is normally called only once by the system. 243 243 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 253 253 set for that Id, the results are unpredictable. 254 254 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 256 256 set values associated with a PCD token. 257 257 … … 272 272 Retrieves an 8-bit value for a given PCD token. 273 273 274 Retrieves the current byte-sized value for a PCD token number. 274 Retrieves the current byte-sized value for a PCD token number. 275 275 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. 278 278 279 279 @return The UINT8 value. 280 280 281 281 **/ 282 282 UINT8 … … 292 292 Retrieves an 16-bit value for a given PCD token. 293 293 294 Retrieves the current 16-bits value for a PCD token number. 294 Retrieves the current 16-bits value for a PCD token number. 295 295 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. 298 298 299 299 @return The UINT16 value. 300 300 301 301 **/ 302 302 UINT16 … … 312 312 Retrieves an 32-bit value for a given PCD token. 313 313 314 Retrieves the current 32-bits value for a PCD token number. 314 Retrieves the current 32-bits value for a PCD token number. 315 315 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. 318 318 319 319 @return The UINT32 value. 320 320 321 321 **/ 322 322 UINT32 … … 332 332 Retrieves an 64-bit value for a given PCD token. 333 333 334 Retrieves the current 64-bits value for a PCD token number. 334 Retrieves the current 64-bits value for a PCD token number. 335 335 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. 338 338 339 339 @return The UINT64 value. 340 340 341 341 **/ 342 342 UINT64 … … 352 352 Retrieves a pointer to a value for a given PCD token. 353 353 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, 357 357 the results are unpredictable. 358 358 359 @param[in] TokenNumber The PCD token number. 359 @param[in] TokenNumber The PCD token number. 360 360 361 361 @return The pointer to the buffer to be retrieved. 362 362 363 363 **/ 364 364 VOID * … … 374 374 Retrieves a Boolean value for a given PCD token. 375 375 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, 379 379 the results are unpredictable. 380 380 381 @param[in] TokenNumber The PCD token number. 381 @param[in] TokenNumber The PCD token number. 382 382 383 383 @return The Boolean value. 384 384 385 385 **/ 386 386 BOOLEAN … … 396 396 Retrieves the size of the value for a given PCD token. 397 397 398 Retrieves the current size of a particular PCD token. 398 Retrieves the current size of a particular PCD token. 399 399 If the TokenNumber is invalid, the results are unpredictable. 400 400 401 @param[in] TokenNumber The PCD token number. 401 @param[in] TokenNumber The PCD token number. 402 402 403 403 @return The size of the value for the PCD token. 404 404 405 405 **/ 406 406 UINTN … … 425 425 426 426 // 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 428 428 // comparison. 429 429 ASSERT (TokenNumber + 1 < (LocalTokenCount + 1)); … … 445 445 Retrieves an 8-bit value for a given PCD token. 446 446 447 Retrieves the 8-bit value of a particular PCD token. 447 Retrieves the 8-bit value of a particular PCD token. 448 448 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 450 450 unpredictable. 451 451 452 452 @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. 454 454 455 455 @return The size 8-bit value for the PCD token. 456 456 457 457 **/ 458 458 UINT8 … … 469 469 Retrieves an 16-bit value for a given PCD token. 470 470 471 Retrieves the 16-bit value of a particular PCD token. 471 Retrieves the 16-bit value of a particular PCD token. 472 472 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 474 474 unpredictable. 475 475 476 476 @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. 478 478 479 479 @return The size 16-bit value for the PCD token. 480 480 481 481 **/ 482 482 UINT16 … … 493 493 Retrieves an 32-bit value for a given PCD token. 494 494 495 Retrieves the 32-bit value of a particular PCD token. 495 Retrieves the 32-bit value of a particular PCD token. 496 496 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 498 498 unpredictable. 499 499 500 500 @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. 502 502 503 503 @return The size 32-bit value for the PCD token. 504 504 505 505 **/ 506 506 UINT32 … … 517 517 Retrieves an 64-bit value for a given PCD token. 518 518 519 Retrieves the 64-bit value of a particular PCD token. 519 Retrieves the 64-bit value of a particular PCD token. 520 520 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 522 522 unpredictable. 523 523 524 524 @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. 526 526 527 527 @return The size 64-bit value for the PCD token. 528 528 529 529 **/ 530 530 UINT64 … … 541 541 Retrieves a pointer to a value for a given PCD token. 542 542 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, 546 546 the results are unpredictable. 547 547 548 548 @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. 550 550 551 551 @return The pointer to the buffer to be retrieved. 552 552 553 553 **/ 554 554 VOID * … … 565 565 Retrieves an Boolean value for a given PCD token. 566 566 567 Retrieves the Boolean value of a particular PCD token. 567 Retrieves the Boolean value of a particular PCD token. 568 568 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 570 570 unpredictable. 571 571 572 572 @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. 574 574 575 575 @return The size Boolean value for the PCD token. 576 576 577 577 **/ 578 578 BOOLEAN … … 589 589 Retrieves the size of the value for a given PCD token. 590 590 591 Retrieves the current size of a particular PCD token. 591 Retrieves the current size of a particular PCD token. 592 592 If the TokenNumber is invalid, the results are unpredictable. 593 593 594 594 @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. 596 596 597 597 @return The size of the value for the PCD token. 598 598 599 599 **/ 600 600 UINTN … … 611 611 Sets an 8-bit value for a given PCD token. 612 612 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. 615 615 If it is not, an error will be returned. 616 616 617 @param[in] TokenNumber The PCD token number. 617 @param[in] TokenNumber The PCD token number. 618 618 @param[in] Value The value to set for the PCD token. 619 619 620 620 @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. 623 623 Use GetSize() to retrieve the size of the target data. 624 624 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 625 625 626 626 **/ 627 627 EFI_STATUS … … 638 638 Sets an 16-bit value for a given PCD token. 639 639 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. 642 642 If it is not, an error will be returned. 643 643 644 @param[in] TokenNumber The PCD token number. 644 @param[in] TokenNumber The PCD token number. 645 645 @param[in] Value The value to set for the PCD token. 646 646 647 647 @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. 650 650 Use GetSize() to retrieve the size of the target data. 651 651 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 652 652 653 653 **/ 654 654 EFI_STATUS … … 665 665 Sets an 32-bit value for a given PCD token. 666 666 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. 669 669 If it is not, an error will be returned. 670 670 671 @param[in] TokenNumber The PCD token number. 671 @param[in] TokenNumber The PCD token number. 672 672 @param[in] Value The value to set for the PCD token. 673 673 674 674 @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. 677 677 Use GetSize() to retrieve the size of the target data. 678 678 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 679 679 680 680 **/ 681 681 EFI_STATUS … … 692 692 Sets an 64-bit value for a given PCD token. 693 693 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. 696 696 If it is not, an error will be returned. 697 697 698 @param[in] TokenNumber The PCD token number. 698 @param[in] TokenNumber The PCD token number. 699 699 @param[in] Value The value to set for the PCD token. 700 700 701 701 @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. 704 704 Use GetSize() to retrieve the size of the target data. 705 705 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 706 706 707 707 **/ 708 708 EFI_STATUS … … 719 719 Sets a value of a specified size for a given PCD token. 720 720 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. 723 723 If it is not, an error will be returned. 724 724 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 729 729 the maximum size supported for this TokenNumber. 730 730 @param[in] Buffer The buffer to set for the PCD token. 731 731 732 732 @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. 735 735 Use GetSize() to retrieve the size of the target data. 736 736 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 737 737 738 738 **/ 739 739 EFI_STATUS … … 751 751 Sets an Boolean value for a given PCD token. 752 752 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. 755 755 If it is not, an error will be returned. 756 756 757 @param[in] TokenNumber The PCD token number. 757 @param[in] TokenNumber The PCD token number. 758 758 @param[in] Value The value to set for the PCD token. 759 759 760 760 @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. 763 763 Use GetSize() to retrieve the size of the target data. 764 764 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 765 765 766 766 **/ 767 767 EFI_STATUS … … 778 778 Sets an 8-bit value for a given PCD token. 779 779 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. 782 782 If it is not, an error will be returned. 783 783 784 784 @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. 786 786 @param[in] Value The value to set for the PCD token. 787 787 788 788 @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. 791 791 Use GetSize() to retrieve the size of the target data. 792 792 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 793 793 794 794 **/ 795 795 EFI_STATUS … … 807 807 Sets an 16-bit value for a given PCD token. 808 808 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. 811 811 If it is not, an error will be returned. 812 812 813 813 @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. 815 815 @param[in] Value The value to set for the PCD token. 816 816 817 817 @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. 820 820 Use GetSize() to retrieve the size of the target data. 821 821 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 822 822 823 823 **/ 824 824 EFI_STATUS … … 836 836 Sets an 32-bit value for a given PCD token. 837 837 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. 840 840 If it is not, an error will be returned. 841 841 842 842 @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. 844 844 @param[in] Value The value to set for the PCD token. 845 845 846 846 @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. 849 849 Use GetSize() to retrieve the size of the target data. 850 850 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 851 851 852 852 **/ 853 853 EFI_STATUS … … 865 865 Sets an 64-bit value for a given PCD token. 866 866 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. 869 869 If it is not, an error will be returned. 870 870 871 871 @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. 873 873 @param[in] Value The value to set for the PCD token. 874 874 875 875 @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. 878 878 Use GetSize() to retrieve the size of the target data. 879 879 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 880 880 881 881 **/ 882 882 EFI_STATUS … … 894 894 Sets a value of a specified size for a given PCD token. 895 895 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. 898 898 If it is not, an error will be returned. 899 899 900 900 @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 905 905 the maximum size supported for this TokenNumber. 906 906 @param[in] Value The buffer to set for the PCD token. 907 907 908 908 @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. 911 911 Use GetSize() to retrieve the size of the target data. 912 912 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 913 913 914 914 **/ 915 915 EFI_STATUS … … 928 928 Sets an Boolean value for a given PCD token. 929 929 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. 932 932 If it is not, an error will be returned. 933 933 934 934 @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. 936 936 @param [in] Value The value to set for the PCD token. 937 937 938 938 @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. 941 941 Use GetSize() to retrieve the size of the target data. 942 942 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 943 943 944 944 **/ 945 945 EFI_STATUS … … 958 958 959 959 @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 964 964 for the CallBackToken requested. 965 965 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 989 989 990 990 @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 995 995 for the CallBackToken requested. 996 996 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 1017 1017 1018 1018 /** 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. 1031 1031 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned. 1032 1032 1033 1033 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 1036 1036 is being made to retrieve tokens from the default token space. 1037 1037 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. 1038 1038 1039 1039 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number. 1040 1040 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number. … … 1056 1056 BOOLEAN Found; 1057 1057 BOOLEAN PeiExMapTableEmpty; 1058 UINTN PeiNexTokenNumber; 1058 UINTN PeiNexTokenNumber; 1059 1059 1060 1060 if (!FeaturePcdGet (PcdPeiFullPcdDatabaseEnable)) { … … 1152 1152 space of the current platform is returned. If the search cannot locate the next valid 1153 1153 token namespace, an error is returned and the value of *Guid is undefined. 1154 1154 1155 1155 @retval EFI_SUCCESS The PCD service retrieved the value requested. 1156 1156 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace. … … 1186 1186 PeiExMapTableEmpty = FALSE; 1187 1187 } 1188 1188 1189 1189 if (PeiExMapTableEmpty) { 1190 1190 return EFI_NOT_FOUND; … … 1193 1193 ExMapTable = (DYNAMICEX_MAPPING *)((UINT8 *)PeiPcdDb + PeiPcdDb->ExMapTableOffset); 1194 1194 GuidTable = (EFI_GUID *)((UINT8 *)PeiPcdDb + PeiPcdDb->GuidTableOffset); 1195 1195 1196 1196 if (*Guid == NULL) { 1197 1197 // … … 1207 1207 return EFI_NOT_FOUND; 1208 1208 } 1209 1209 1210 1210 GuidTableIdx = MatchGuid - GuidTable; 1211 1211 … … 1247 1247 /** 1248 1248 Get PCD value's size for POINTER type PCD. 1249 1249 1250 1250 The POINTER type PCD's value will be stored into a buffer in specified size. 1251 1251 The max size of this PCD's value is described in PCD's definition in DEC file. … … 1276 1276 1277 1277 ASSERT ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER); 1278 1278 1279 1279 SizeTable = (SIZE_INFO *)((UINT8 *)Database + Database->SizeTableOffset); 1280 1280 1281 1281 *MaxSize = SizeTable[SizeTableIdx]; 1282 1282 // 1283 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1283 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1284 1284 // PCD entry. 1285 1285 // … … 1319 1319 /** 1320 1320 Set PCD value's size for POINTER type PCD. 1321 1321 1322 1322 The POINTER type PCD's value will be stored into a buffer in specified size. 1323 1323 The max size of this PCD's value is described in PCD's definition in DEC file. … … 1344 1344 UINTN Index; 1345 1345 UINTN MaxSize; 1346 1346 1347 1347 SizeTableIdx = GetSizeTableIndex (LocalTokenNumberTableIdx, Database); 1348 1348 … … 1355 1355 MaxSize = SizeTable[SizeTableIdx]; 1356 1356 // 1357 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1357 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1358 1358 // PCD entry. 1359 1359 // … … 1370 1370 return FALSE; 1371 1371 } 1372 1372 1373 1373 if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == 0) { 1374 1374 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Pcd.inf
r58459 r58466 2 2 # PCD PEIM produces PCD database to manage all dynamic PCD in PEI phase and install Pcd Ppi service. 3 3 # 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. 5 5 # There are two PCD PPIs as follows: 6 # 1) PCD_PPI 6 # 1) PCD_PPI 7 7 # It is EDKII implementation which support Dynamic/DynamicEx Pcds. 8 8 # 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 10 10 # type Pcd. 11 11 # For dynamicEx type PCD, it is compatible between PCD_PPI and EFI_PEI_PCD_PPI. 12 12 # PCD PEIM driver will produce above two PPIs at same time. 13 13 # 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. 16 16 # 17 17 # //////////////////////////////////////////////////////////////////////////////// … … 22 22 # 23 23 # 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 26 26 # specified platform. 27 # 27 # 28 28 # 2, Dynamic Type PCD 29 29 # 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 # 33 33 # 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 35 35 # other driver in execution time. 36 36 # b) The PCD setting value is set/get by user from FrontPage. 37 37 # c) The PCD setting value is produced by platform OEM vendor in specified area. 38 # 38 # 39 39 # 2.2 According to module distribution way, dynamic PCD could be classfied as: 40 40 # 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 42 42 # DSC, the dynamic PCD used by this module can be accessed as: 43 # PcdGetxx(PcdSampleDynamicPcd); 43 # PcdGetxx(PcdSampleDynamicPcd); 44 44 # 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. 46 46 # b) DynamicEx: 47 47 # If module is release as binary and will not pariticpate platform building, … … 50 50 # Developer need explicity gives {Token Space Guid:Token Number} as parameter 51 51 # in writting source code. 52 # 52 # 53 53 # 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 56 56 # 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 59 59 # 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 61 61 # 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. 65 65 # - 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 67 67 # 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 69 69 # 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 71 71 # DSC file. [PcdsDynamicExHii] is for dynamicEx type PCD. 72 # 72 # 73 73 # 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 75 75 # specified by a FixedAtBuild PCD setting - PcdVpdBaseAddress. 76 76 # - 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 78 78 # DSC file. [PcdsDynamicExVpd] is for dynamicex type PCD. 79 # 79 # 80 80 # 2.4 When and how to use dynamic PCD 81 81 # 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 83 83 # in platform DSC file. Please ref section 2.3 to get matching between dynamic 84 84 # PCD type and section name in DSC file. 85 # 85 # 86 86 # 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, 88 88 # but the basic information and default value for all dynamic PCD is hold 89 89 # by PCD database maintained by PEI/DXE driver. 90 # 90 # 91 91 # As the whole EFI BIOS boot path is divided into PEI/DXE phase, the PCD database 92 92 # also is divided into Pei/Dxe database maintaied by PcdPeim/PcdDxe driver separatly. … … 94 94 # PCD information used in PEI phase or use in both PEI/DXE phase. And DXE PCD 95 95 # 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 # 100 100 # 3.1 PcdPeim and PcdDxe 101 101 # 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. 104 104 # DXE PCD database is maintained by PcdDxe driver.At entry point of PcdDxe driver, 105 105 # a new PCD database is allocated in boot-time memory which including all 106 106 # PEI PCD and DXE PCD entry. 107 # 107 # 108 108 # Pcd driver should run as early as possible before any other driver access 109 109 # dynamic PCD's value. PEI/DXE "Apriori File" mechanism make it possible by 110 110 # making PcdPeim/PcdDxe as first dispatching driver in PEI/DXE phase. 111 # 111 # 112 112 # 3.2 Token space Guid/Token number, Platform token, Local token number 113 113 # Dynamic PCD … … 129 129 # | Number | 130 130 # +-----------+ 131 # 132 # 131 # 132 # 133 133 # 3.2.1 Pair of Token space guid + Token number 134 134 # 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. 137 137 # 138 138 # 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 142 142 # started from 1.(0 meaning invalid internal token number) 143 143 # 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) 145 145 # in autogen.h. 146 146 # Notes: The mapping between pair of "tokenspace guid + token number" and … … 149 149 # To access a dynamicEx type PCD, pair of "token space guid/token number" all need 150 150 # 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 153 153 # platform scope, there are two zones: PEI Zone and DXE Zone 154 154 # | Platform Token Number … … 156 156 # PEI Zone: | 1 ~ PEI_LOCAL_TOKEN_NUMBER 157 157 # DXE Zone: | (PEI_LOCAL_TOKEN_NUMBER + 1) ~ (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER) 158 # 158 # 159 159 # 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 161 161 # platform token number to local token number via a mapping table. 162 162 # For binary DynamicEx type PCD, there is a another mapping table to translate … … 164 164 # Local token number is identifier for all internal interface in PCD PEI/DXE 165 165 # driver. 166 # 166 # 167 167 # A local token number is a 32-bit value in following meaning: 168 168 # 32 ------------- 28 ---------- 24 -------- 0 … … 185 185 # Based on local token number, PCD driver could fast determine PCD type, value 186 186 # type and get PCD entry from PCD database. 187 # 187 # 188 188 # 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 191 191 # as comments by build tools in PCD driver's autogen.h/ 192 192 # 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 194 194 # "tokenguid + token" to local token number. 195 195 # - LocalTokenNumberTable: … … 201 201 # - SkuIdTable: TBD 202 202 # - SystemSkuId: TBD 203 # - PCD value structure: 203 # - PCD value structure: 204 204 # 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 206 206 # 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 211 211 # value specified in platform DSC file. 212 212 # Unint area is used stored the value of PCD which has no default value in 213 213 # platform DSC file, the value of NULL, 0 specified in platform DSC file can 214 214 # be seemed as "no default value". 215 # 215 # 216 216 # 3.3.1 Simple Sample PCD Database C Structure 217 217 # A general sample of PCD database structue is as follows: … … 225 225 # UINT8 SkuIdTable[PEI_SKUID_TABLE_SIZE]; 226 226 # SKU_ID SystemSkuId; 227 # 227 # 228 228 # //===== Following is value structure for PCD with default value 229 229 # .... … … 237 237 # } UnInit; 238 238 # } 239 # 239 # 240 240 # 3.3.2 PCD value structure in PCD database C structure 241 241 # The value's structure is generated by build tool in PCD database C structure. 242 242 # The PCDs in different datum type has different value structure. 243 # 243 # 244 244 # 3.3.2.1 UINT8/UINT16/UINT32/UINT64 datum type PCD 245 245 # The C structure for these datum type PCD is just a UINT8/UINT16/UINT32/UINT64 … … 249 249 # Member type is UINT16 according to PcdHardwareErrorRecordLevel declaration 250 250 # in DEC file. 251 # 251 # 252 252 # 3.3.2.2 VOID* datum type PCD 253 253 # The value of VOID* datum type PCD is a UINT8/UINT16 array in PCD database. 254 # 254 # 255 255 # 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 258 258 # UINT16 string array in PCD database, for example: 259 259 # UINT16 StringTable[29]; 260 260 # The number of 29 in above sample is max size of a unicode string. 261 # 261 # 262 262 # 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 264 264 # UINT8 string array in PCD database, for example: 265 265 # UINT8 StringTable[20]; 266 266 # The number of 20 in above sample is max size of a ascii string. 267 # 267 # 268 268 # 3.3.2.2.2 VOID* - byte array 269 269 # 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 271 271 # above ascii string table, 272 272 # UINT8 StringTable[13]; 273 273 # The number of 13 in above sample is max size of byte array. 274 # 274 # 275 275 # 3.3.3 Some utility structures in PCD Database 276 276 # 3.3.3.1 GuidTable 277 277 # GuidTable array is used to store all related GUID value in PCD database: 278 278 # - Variable GUID for HII type PCD 279 # - Token space GUID for dynamicex type PCD 280 # 279 # - Token space GUID for dynamicex type PCD 280 # 281 281 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 282 282 # … … 329 329 ## PRODUCES ## HOB 330 330 ## SOMETIMES_CONSUMES ## HOB 331 gPcdDataBaseHobGuid 331 gPcdDataBaseHobGuid 332 332 gPcdDataBaseSignatureGuid ## CONSUMES ## GUID # PCD database signature GUID. 333 333 -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Service.c
r58459 r58466 145 145 AsciiStrCat (Name, TokenSpaceName); 146 146 Name[AsciiStrSize (TokenSpaceName) - sizeof (CHAR8)] = '.'; 147 AsciiStrCat (Name, PcdName); 147 AsciiStrCat (Name, PcdName); 148 148 } 149 149 … … 161 161 @param[in] TokenNumber The PCD token number. 162 162 @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. 164 164 165 165 @retval EFI_SUCCESS The PCD information was returned successfully … … 207 207 // 208 208 // Here use one representative in the token space to get the TokenSpaceCName. 209 // 209 // 210 210 PcdInfo->PcdName = GetPcdName (TRUE, Database, ExMapTable[Index].TokenNumber); 211 211 return EFI_SUCCESS; … … 350 350 TokenNumber--; 351 351 // 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 353 353 // comparison. 354 354 ASSERT ((TokenNumber + 1) < (LocalTokenCount + 1)); … … 367 367 GuidHob = GetFirstGuidHob (&gEfiCallerIdGuid); 368 368 ASSERT (GuidHob != NULL); 369 369 370 370 CallbackTable = GET_GUID_HOB_DATA (GuidHob); 371 371 CallbackTable = CallbackTable + (TokenNumber * PcdGet32 (PcdMaxPeiPcdCallBackNumberPerPcdEntry)); … … 388 388 389 389 /** 390 Find the Pcd database. 390 Find the Pcd database. 391 391 392 392 @param FileHandle Handle of the file the external PCD database binary located. … … 457 457 458 458 CallbackFnTable = BuildGuidHob (&gEfiCallerIdGuid, SizeOfCallbackFnTable); 459 459 460 460 ZeroMem (CallbackFnTable, SizeOfCallbackFnTable); 461 461 … … 537 537 UINT32 LocalTokenNumber, 538 538 UINTN Size 539 ) 539 ) 540 540 { 541 541 PEI_PCD_DATABASE *PeiPcdDb; … … 608 608 609 609 /** 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 611 611 has registered callback function. 612 612 … … 647 647 if (Guid == NULL) { 648 648 // 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 650 650 // comparison. 651 651 ASSERT (TokenNumber + 1 < (LocalTokenCount + 1)); … … 654 654 GuidHob = GetFirstGuidHob (&gEfiCallerIdGuid); 655 655 ASSERT (GuidHob != NULL); 656 656 657 657 CallbackTable = GET_GUID_HOB_DATA (GuidHob); 658 658 … … 704 704 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in 705 705 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. 707 707 **/ 708 708 EFI_STATUS … … 726 726 return EFI_UNSUPPORTED; 727 727 } 728 728 729 729 // 730 730 // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER. … … 737 737 738 738 // 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 740 740 // comparison. 741 741 ASSERT (TokenNumber + 1 < (LocalTokenCount + 1)); … … 770 770 Offset = LocalTokenNumber & PCD_DATABASE_OFFSET_MASK; 771 771 InternalData = (VOID *) ((UINT8 *) PeiPcdDb + Offset); 772 772 773 773 switch (LocalTokenNumber & PCD_TYPE_ALL_SET) { 774 774 case PCD_TYPE_VPD: … … 822 822 } 823 823 } 824 824 825 825 } 826 826 … … 854 854 /** 855 855 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 858 858 space guid and token number firstly, and invoke callback function if this PCD 859 859 entry registered callback function. Finally, invoken general SetWorker to set 860 860 PCD value. 861 861 862 862 @param ExTokenNumber Dynamic-ex PCD token number. 863 863 @param Guid Token space guid for dynamic-ex PCD. … … 889 889 return EFI_NOT_FOUND; 890 890 } 891 891 892 892 InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size); 893 893 … … 912 912 IN UINTN GetSize 913 913 ) 914 { 914 { 915 915 return GetWorker (GetExPcdTokenNumber (Guid, ExTokenNumber), GetSize); 916 916 } … … 918 918 /** 919 919 Get the PCD entry pointer in PCD database. 920 920 921 921 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 924 924 offset of PCD entry in PCD database. 925 925 … … 961 961 962 962 // 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 964 964 // comparison. 965 965 ASSERT (TokenNumber + 1 < (LocalTokenCount + 1)); … … 979 979 return (VOID *) (UINTN) (PcdGet32 (PcdVpdBaseAddress) + VpdHead->Offset); 980 980 } 981 981 982 982 case PCD_TYPE_HII|PCD_TYPE_STRING: 983 983 case PCD_TYPE_HII: 984 984 { 985 985 VariableHead = (VARIABLE_HEAD *) ((UINT8 *)PeiPcdDb + Offset); 986 986 987 987 Guid = (EFI_GUID *) ((UINT8 *)PeiPcdDb + PeiPcdDb->GuidTableOffset) + VariableHead->GuidTableIndex; 988 988 Name = (UINT16*)&StringTable[VariableHead->StringIndex]; … … 990 990 if ((LocalTokenNumber & PCD_TYPE_ALL_SET) == (PCD_TYPE_HII|PCD_TYPE_STRING)) { 991 991 // 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 993 993 // string array in string table. 994 994 // 995 VaraiableDefaultBuffer = (UINT8 *) &StringTable[*(STRING_HEAD*)((UINT8*) PeiPcdDb + VariableHead->DefaultValueOffset)]; 995 VaraiableDefaultBuffer = (UINT8 *) &StringTable[*(STRING_HEAD*)((UINT8*) PeiPcdDb + VariableHead->DefaultValueOffset)]; 996 996 } else { 997 997 VaraiableDefaultBuffer = (UINT8 *) PeiPcdDb + VariableHead->DefaultValueOffset; … … 1031 1031 ASSERT (FALSE); 1032 1032 break; 1033 1033 1034 1034 } 1035 1035 1036 1036 ASSERT (FALSE); 1037 1037 1038 1038 return NULL; 1039 1039 1040 1040 } 1041 1041 … … 1046 1046 in DEC file. PCD database maintain a mapping table that translate pair of {token 1047 1047 space guid: token number} to Token Number. 1048 1048 1049 1049 @param Guid Token space guid for dynamic-ex PCD entry. 1050 1050 @param ExTokenNumber Dynamic-ex PCD token number. … … 1053 1053 1054 1054 **/ 1055 UINTN 1055 UINTN 1056 1056 GetExPcdTokenNumber ( 1057 1057 IN CONST EFI_GUID *Guid, … … 1077 1077 // 1078 1078 ASSERT (MatchGuid != NULL); 1079 1079 1080 1080 MatchGuidIdx = MatchGuid - GuidTable; 1081 1081 1082 1082 for (Index = 0; Index < PeiPcdDb->ExTokenCount; Index++) { 1083 if ((ExTokenNumber == ExMap[Index].ExTokenNumber) && 1083 if ((ExTokenNumber == ExMap[Index].ExTokenNumber) && 1084 1084 (MatchGuidIdx == ExMap[Index].ExGuidIndex)) { 1085 1085 return ExMap[Index].TokenNumber; 1086 1086 } 1087 1087 } 1088 1088 1089 1089 return PCD_INVALID_TOKEN_NUMBER; 1090 1090 } … … 1105 1105 GuidHob = GetFirstGuidHob (&gPcdDataBaseHobGuid); 1106 1106 ASSERT (GuidHob != NULL); 1107 1107 1108 1108 return (PEI_PCD_DATABASE *) GET_GUID_HOB_DATA (GuidHob); 1109 1109 } … … 1134 1134 1135 1135 return (SKU_ID *) ((UINT8 *)Database + SkuHead->SkuIdTableOffset); 1136 1136 1137 1137 } 1138 1138 … … 1156 1156 UINTN LocalTokenNumber; 1157 1157 SKU_ID *SkuIdTable; 1158 1158 1159 1159 SizeTableIdx = 0; 1160 1160 … … 1164 1164 if ((LocalTokenNumber & PCD_DATUM_TYPE_ALL_SET) == PCD_DATUM_TYPE_POINTER) { 1165 1165 // 1166 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1166 // SizeTable only contain record for PCD_DATUM_TYPE_POINTER type 1167 1167 // PCD entry. 1168 1168 // -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/PCD/Pei/Service.h
r58459 r58466 108 108 Sets the SKU value for subsequent calls to set or get PCD token values. 109 109 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. 111 111 SetSku() is normally called only once by the system. 112 112 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 122 122 set for that Id, the results are unpredictable. 123 123 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 125 125 set values associated with a PCD token. 126 126 … … 135 135 Retrieves an 8-bit value for a given PCD token. 136 136 137 Retrieves the current byte-sized value for a PCD token number. 137 Retrieves the current byte-sized value for a PCD token number. 138 138 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. 141 141 142 142 @return The UINT8 value. 143 143 144 144 **/ 145 145 UINT8 … … 152 152 Retrieves an 16-bit value for a given PCD token. 153 153 154 Retrieves the current 16-bits value for a PCD token number. 154 Retrieves the current 16-bits value for a PCD token number. 155 155 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. 158 158 159 159 @return The UINT16 value. 160 160 161 161 **/ 162 162 UINT16 … … 169 169 Retrieves an 32-bit value for a given PCD token. 170 170 171 Retrieves the current 32-bits value for a PCD token number. 171 Retrieves the current 32-bits value for a PCD token number. 172 172 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. 175 175 176 176 @return The UINT32 value. 177 177 178 178 **/ 179 179 UINT32 … … 186 186 Retrieves an 64-bit value for a given PCD token. 187 187 188 Retrieves the current 64-bits value for a PCD token number. 188 Retrieves the current 64-bits value for a PCD token number. 189 189 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. 192 192 193 193 @return The UINT64 value. 194 194 195 195 **/ 196 196 UINT64 … … 203 203 Retrieves a pointer to a value for a given PCD token. 204 204 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, 208 208 the results are unpredictable. 209 209 210 @param[in] TokenNumber The PCD token number. 210 @param[in] TokenNumber The PCD token number. 211 211 212 212 @return The pointer to the buffer to be retrived. 213 213 214 214 **/ 215 215 VOID * … … 222 222 Retrieves a Boolean value for a given PCD token. 223 223 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, 227 227 the results are unpredictable. 228 228 229 @param[in] TokenNumber The PCD token number. 229 @param[in] TokenNumber The PCD token number. 230 230 231 231 @return The Boolean value. 232 232 233 233 **/ 234 234 BOOLEAN … … 241 241 Retrieves the size of the value for a given PCD token. 242 242 243 Retrieves the current size of a particular PCD token. 243 Retrieves the current size of a particular PCD token. 244 244 If the TokenNumber is invalid, the results are unpredictable. 245 245 246 @param[in] TokenNumber The PCD token number. 246 @param[in] TokenNumber The PCD token number. 247 247 248 248 @return The size of the value for the PCD token. 249 249 250 250 **/ 251 251 UINTN … … 258 258 Retrieves an 8-bit value for a given PCD token. 259 259 260 Retrieves the 8-bit value of a particular PCD token. 260 Retrieves the 8-bit value of a particular PCD token. 261 261 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 263 263 unpredictable. 264 264 265 265 @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. 267 267 268 268 @return The size 8-bit value for the PCD token. 269 269 270 270 **/ 271 271 UINT8 … … 279 279 Retrieves an 16-bit value for a given PCD token. 280 280 281 Retrieves the 16-bit value of a particular PCD token. 281 Retrieves the 16-bit value of a particular PCD token. 282 282 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 284 284 unpredictable. 285 285 286 286 @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. 288 288 289 289 @return The size 16-bit value for the PCD token. 290 290 291 291 **/ 292 292 UINT16 … … 300 300 Retrieves an 32-bit value for a given PCD token. 301 301 302 Retrieves the 32-bit value of a particular PCD token. 302 Retrieves the 32-bit value of a particular PCD token. 303 303 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 305 305 unpredictable. 306 306 307 307 @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. 309 309 310 310 @return The size 32-bit value for the PCD token. 311 311 312 312 **/ 313 313 UINT32 … … 321 321 Retrieves an 64-bit value for a given PCD token. 322 322 323 Retrieves the 64-bit value of a particular PCD token. 323 Retrieves the 64-bit value of a particular PCD token. 324 324 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 326 326 unpredictable. 327 327 328 328 @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. 330 330 331 331 @return The size 64-bit value for the PCD token. 332 332 333 333 **/ 334 334 UINT64 … … 342 342 Retrieves a pointer to a value for a given PCD token. 343 343 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, 347 347 the results are unpredictable. 348 348 349 349 @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. 351 351 352 352 @return The pointer to the buffer to be retrived. 353 353 354 354 **/ 355 355 VOID * … … 363 363 Retrieves an Boolean value for a given PCD token. 364 364 365 Retrieves the Boolean value of a particular PCD token. 365 Retrieves the Boolean value of a particular PCD token. 366 366 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 368 368 unpredictable. 369 369 370 370 @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. 372 372 373 373 @return The size Boolean value for the PCD token. 374 374 375 375 **/ 376 376 BOOLEAN … … 384 384 Retrieves the size of the value for a given PCD token. 385 385 386 Retrieves the current size of a particular PCD token. 386 Retrieves the current size of a particular PCD token. 387 387 If the TokenNumber is invalid, the results are unpredictable. 388 388 389 389 @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. 391 391 392 392 @return The size of the value for the PCD token. 393 393 394 394 **/ 395 395 UINTN … … 403 403 Sets an 8-bit value for a given PCD token. 404 404 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. 407 407 If it is not, an error will be returned. 408 408 409 @param[in] TokenNumber The PCD token number. 409 @param[in] TokenNumber The PCD token number. 410 410 @param[in] Value The value to set for the PCD token. 411 411 412 412 @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. 415 415 Use GetSize() to retrieve the size of the target data. 416 416 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 417 417 418 418 **/ 419 419 EFI_STATUS … … 427 427 Sets an 16-bit value for a given PCD token. 428 428 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. 431 431 If it is not, an error will be returned. 432 432 433 @param[in] TokenNumber The PCD token number. 433 @param[in] TokenNumber The PCD token number. 434 434 @param[in] Value The value to set for the PCD token. 435 435 436 436 @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. 439 439 Use GetSize() to retrieve the size of the target data. 440 440 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 441 441 442 442 **/ 443 443 EFI_STATUS … … 451 451 Sets an 32-bit value for a given PCD token. 452 452 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. 455 455 If it is not, an error will be returned. 456 456 457 @param[in] TokenNumber The PCD token number. 457 @param[in] TokenNumber The PCD token number. 458 458 @param[in] Value The value to set for the PCD token. 459 459 460 460 @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. 463 463 Use GetSize() to retrieve the size of the target data. 464 464 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 465 465 466 466 **/ 467 467 EFI_STATUS … … 475 475 Sets an 64-bit value for a given PCD token. 476 476 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. 479 479 If it is not, an error will be returned. 480 480 481 @param[in] TokenNumber The PCD token number. 481 @param[in] TokenNumber The PCD token number. 482 482 @param[in] Value The value to set for the PCD token. 483 483 484 484 @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. 487 487 Use GetSize() to retrieve the size of the target data. 488 488 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 489 489 490 490 **/ 491 491 EFI_STATUS … … 499 499 Sets a value of a specified size for a given PCD token. 500 500 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. 503 503 If it is not, an error will be returned. 504 504 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 509 509 the maximum size supported for this TokenNumber. 510 510 @param[in] Buffer The buffer to set for the PCD token. 511 511 512 512 @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. 515 515 Use GetSize() to retrieve the size of the target data. 516 516 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 517 517 518 518 **/ 519 519 EFI_STATUS … … 528 528 Sets an Boolean value for a given PCD token. 529 529 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. 532 532 If it is not, an error will be returned. 533 533 534 @param[in] TokenNumber The PCD token number. 534 @param[in] TokenNumber The PCD token number. 535 535 @param[in] Value The value to set for the PCD token. 536 536 537 537 @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. 540 540 Use GetSize() to retrieve the size of the target data. 541 541 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 542 542 543 543 **/ 544 544 EFI_STATUS … … 552 552 Sets an 8-bit value for a given PCD token. 553 553 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. 556 556 If it is not, an error will be returned. 557 557 558 558 @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. 560 560 @param[in] Value The value to set for the PCD token. 561 561 562 562 @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. 565 565 Use GetSize() to retrieve the size of the target data. 566 566 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 567 567 568 568 **/ 569 569 EFI_STATUS … … 578 578 Sets an 16-bit value for a given PCD token. 579 579 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. 582 582 If it is not, an error will be returned. 583 583 584 584 @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. 586 586 @param[in] Value The value to set for the PCD token. 587 587 588 588 @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. 591 591 Use GetSize() to retrieve the size of the target data. 592 592 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 593 593 594 594 **/ 595 595 EFI_STATUS … … 604 604 Sets an 32-bit value for a given PCD token. 605 605 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. 608 608 If it is not, an error will be returned. 609 609 610 610 @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. 612 612 @param[in] Value The value to set for the PCD token. 613 613 614 614 @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. 617 617 Use GetSize() to retrieve the size of the target data. 618 618 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 619 619 620 620 **/ 621 621 EFI_STATUS … … 630 630 Sets an 64-bit value for a given PCD token. 631 631 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. 634 634 If it is not, an error will be returned. 635 635 636 636 @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. 638 638 @param[in] Value The value to set for the PCD token. 639 639 640 640 @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. 643 643 Use GetSize() to retrieve the size of the target data. 644 644 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 645 645 646 646 **/ 647 647 EFI_STATUS … … 656 656 Sets a value of a specified size for a given PCD token. 657 657 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. 660 660 If it is not, an error will be returned. 661 661 662 662 @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 667 667 the maximum size supported for this TokenNumber. 668 668 @param[in] Buffer The buffer to set for the PCD token. 669 669 670 670 @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. 673 673 Use GetSize() to retrieve the size of the target data. 674 674 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 675 675 676 676 **/ 677 677 EFI_STATUS … … 687 687 Sets an Boolean value for a given PCD token. 688 688 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. 691 691 If it is not, an error will be returned. 692 692 693 693 @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. 695 695 @param[in] Value The value to set for the PCD token. 696 696 697 697 @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. 700 700 Use GetSize() to retrieve the size of the target data. 701 701 @retval EFI_NOT_FOUND The PCD service could not find the requested token number. 702 702 703 703 **/ 704 704 EFI_STATUS … … 714 714 715 715 @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 720 720 for the CallBackToken requested. 721 721 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 734 734 735 735 @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 740 740 for the CallBackToken requested. 741 741 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number. … … 751 751 752 752 /** 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. 765 765 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned. 766 766 767 767 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 770 770 is being made to retrieve tokens from the default token space. 771 771 @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. 775 775 In the later case, *TokenNumber is updated with the value of 0. 776 776 @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform. … … 787 787 Retrieves the next valid PCD token namespace for a given namespace. 788 788 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 803 803 in the PCD database. In the later case, *Guid is updated with the value of NULL. 804 804 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform. … … 820 820 @param[in] TokenNumber The PCD token number. 821 821 @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. 823 823 824 824 @retval EFI_SUCCESS The PCD information was returned successfully … … 875 875 @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in 876 876 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. 878 878 **/ 879 879 EFI_STATUS … … 906 906 /** 907 907 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 910 910 space guid and token number firstly, and invoke callback function if this PCD 911 911 entry registered callback function. Finally, invoken general SetWorker to set 912 912 PCD value. 913 913 914 914 @param ExTokenNumber Dynamic-ex PCD token number. 915 915 @param Guid Token space guid for dynamic-ex PCD. … … 933 933 /** 934 934 Get the PCD entry pointer in PCD database. 935 935 936 936 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 939 939 offset of PCD entry in PCD database. 940 940 … … 980 980 in DEC file. PCD database maintain a mapping table that translate pair of {token 981 981 space guid: token number} to Token Number. 982 982 983 983 @param Guid Token space guid for dynamic-ex PCD entry. 984 984 @param ExTokenNumber Token number for dynamic-ex PCD. … … 1075 1075 /** 1076 1076 Get PCD value's size for POINTER type PCD. 1077 1077 1078 1078 The POINTER type PCD's value will be stored into a buffer in specificed size. 1079 1079 The max size of this PCD's value is described in PCD's definition in DEC file. … … 1095 1095 /** 1096 1096 Set PCD value's size for POINTER type PCD. 1097 1097 1098 1098 The POINTER type PCD's value will be stored into a buffer in specificed size. 1099 1099 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.