Path: blob/main/sys/contrib/edk2/Include/Library/PcdLib.h
48383 views
/** @file1Provides library services to get and set Platform Configuration Database entries.23PCD Library Class provides a PCD usage macro interface for all PCD types.4It should be included in any module that uses PCD. If a module uses dynamic/dynamicex5PCD, module should be linked to a PEIM/DXE library instance to access that PCD.6If a module uses PatchableInModule type PCD, it also needs the library instance to produce7LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is8translated to a variable or macro that is auto-generated by build tool in9module's autogen.h/autogen.c.10The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are11only available prior to ExitBootServices(). If access to PCD values are required12at runtime, then their values must be collected prior to ExitBootServices().13There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),14PatchPcdGetXX(), and PatchPcdSetXX().1516Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>17SPDX-License-Identifier: BSD-2-Clause-Patent1819**/2021#ifndef __PCD_LIB_H__22#define __PCD_LIB_H__2324/**25Retrieves a token number based on a token name.2627Returns the token number associated with the PCD token specified by TokenName.28If TokenName is not a valid token in the token space, then the module will not build.2930@param TokenName The name of the PCD token to retrieve the token number for.3132@return The token number associated with the PCD.3334**/35#define PcdToken(TokenName) _PCD_TOKEN_##TokenName3637/**38Retrieves a Boolean PCD feature flag based on a token name.3940Returns the Boolean value for the PCD feature flag specified by TokenName.41If TokenName is not a valid token in the token space, then the module will not build.42If TokenName is not a feature flag PCD, then the module will not build.4344@param TokenName The name of the PCD token to retrieve a current value for.4546@return Boolean value for the PCD feature flag.4748**/49#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName5051/**52Retrieves an 8-bit fixed PCD token value based on a token name.5354Returns the 8-bit value for the token specified by TokenName.55If TokenName is not a valid token in the token space, then the module will not build.56If TokenName is not a fixed at build PCD, then the module will not build.5758@param TokenName The name of the PCD token to retrieve a current value for.5960@return 8-bit value for the token specified by TokenName.6162**/63#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName6465/**66Retrieves a 16-bit fixed PCD token value based on a token name.6768Returns the 16-bit value for the token specified by TokenName.69If TokenName is not a valid token in the token space, then the module will not build.70If TokenName is not a fixed at build PCD, then the module will not build.7172@param TokenName The name of the PCD token to retrieve a current value for.7374@return 16-bit value for the token specified by TokenName.7576**/77#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName7879/**80Retrieves a 32-bit fixed PCD token value based on a token name.8182Returns the 32-bit value for the token specified by TokenName.83If TokenName is not a valid token in the token space, then the module will not build.84If TokenName is not a fixed at build PCD, then the module will not build.8586@param TokenName The name of the PCD token to retrieve a current value for.8788@return 32-bit value for the token specified by TokenName.8990**/91#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName9293/**94Retrieves a 64-bit fixed PCD token value based on a token name.9596Returns the 64-bit value for the token specified by TokenName.97If TokenName is not a valid token in the token space, then the module will not build.98If TokenName is not a fixed at build PCD, then the module will not build.99100@param TokenName The name of the PCD token to retrieve a current value for.101102@return 64-bit value for the token specified by TokenName.103104**/105#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName106107/**108Retrieves a Boolean fixed PCD token value based on a token name.109110Returns the Boolean value for the token specified by TokenName.111If TokenName is not a valid token in the token space, then the module will not build.112If TokenName is not a fixed at build PCD, then the module will not build.113114@param TokenName The name of the PCD token to retrieve a current value for.115116@return The Boolean value for the token.117118**/119#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName120121/**122Retrieves a pointer to a fixed PCD token buffer based on a token name.123124Returns a pointer to the buffer for the token specified by TokenName.125If TokenName is not a valid token in the token space, then the module will not build.126If TokenName is not a fixed at build PCD, then the module will not build.127128@param TokenName The name of the PCD token to retrieve a current value for.129130@return A pointer to the buffer.131132**/133#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)134135/**136Retrieves an 8-bit binary patchable PCD token value based on a token name.137138Returns the 8-bit value for the token specified by TokenName.139If TokenName is not a valid token in the token space, then the module will not build.140If TokenName is not a patchable in module PCD, then the module will not build.141142@param TokenName The name of the PCD token to retrieve a current value for.143144@return An 8-bit binary patchable PCD token value.145146**/147#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName148149/**150Retrieves a 16-bit binary patchable PCD token value based on a token name.151152Returns the 16-bit value for the token specified by TokenName.153If TokenName is not a valid token in the token space, then the module will not build.154If TokenName is not a patchable in module PCD, then the module will not build.155156@param TokenName The name of the PCD token to retrieve a current value for.157158@return A 16-bit binary patchable PCD token value.159160**/161#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName162163/**164Retrieves a 32-bit binary patchable PCD token value based on a token name.165166Returns the 32-bit value for the token specified by TokenName.167If TokenName is not a valid token in the token space, then the module will not build.168If TokenName is not a patchable in module PCD, then the module will not build.169170@param TokenName The name of the PCD token to retrieve a current value for.171172@return A 32-bit binary patchable PCD token value.173174**/175#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName176177/**178Retrieves a 64-bit binary patchable PCD token value based on a token name.179180Returns the 64-bit value for the token specified by TokenName.181If TokenName is not a valid token in the token space, then the module will not build.182If TokenName is not a patchable in module PCD, then the module will not build.183184@param TokenName The name of the PCD token to retrieve a current value for.185186@return A 64-bit binary patchable PCD token value.187188**/189#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName190191/**192Retrieves a Boolean binary patchable PCD token value based on a token name.193194Returns the Boolean value for the token specified by TokenName.195If TokenName is not a valid token in the token space, then the module will not build.196If TokenName is not a patchable in module PCD, then the module will not build.197198@param TokenName The name of the PCD token to retrieve a current value for.199200@return The Boolean value for the token.201202**/203#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName204205/**206Retrieves a pointer to a binary patchable PCD token buffer based on a token name.207208Returns a pointer to the buffer for the token specified by TokenName.209If TokenName is not a valid token in the token space, then the module will not build.210If TokenName is not a patchable in module PCD, then the module will not build.211212@param TokenName The name of the PCD token to retrieve a current value for.213214@return A pointer to the buffer for the token.215216**/217#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)218219/**220Sets an 8-bit binary patchable PCD token value based on a token name.221222Sets the 8-bit value for the token specified by TokenName. Value is returned.223If TokenName is not a valid token in the token space, then the module will not build.224If TokenName is not a patchable in module PCD, then the module will not build.225226@param TokenName The name of the binary patchable PCD token to set the current value for.227@param Value The 8-bit value to set.228229@return Return the Value that was set.230231**/232#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))233234/**235Sets a 16-bit binary patchable PCD token value based on a token name.236237Sets the 16-bit value for the token specified by TokenName. Value is returned.238If TokenName is not a valid token in the token space, then the module will not build.239If TokenName is not a patchable in module PCD, then the module will not build.240241@param TokenName The name of the binary patchable PCD token to set the current value for.242@param Value The 16-bit value to set.243244@return Return the Value that was set.245246**/247#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))248249/**250Sets a 32-bit binary patchable PCD token value based on a token name.251252Sets the 32-bit value for the token specified by TokenName. Value is returned.253If TokenName is not a valid token in the token space, then the module will not build.254If TokenName is not a patchable in module PCD, then the module will not build.255256@param TokenName The name of the binary patchable PCD token to set the current value for.257@param Value The 32-bit value to set.258259@return Return the Value that was set.260261**/262#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))263264/**265Sets a 64-bit binary patchable PCD token value based on a token name.266267Sets the 64-bit value for the token specified by TokenName. Value is returned.268If TokenName is not a valid token in the token space, then the module will not build.269If TokenName is not a patchable in module PCD, then the module will not build.270271@param TokenName The name of the binary patchable PCD token to set the current value for.272@param Value The 64-bit value to set.273274@return Return the Value that was set.275276**/277#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))278279/**280Sets a Boolean binary patchable PCD token value based on a token name.281282Sets the Boolean value for the token specified by TokenName. Value is returned.283If TokenName is not a valid token in the token space, then the module will not build.284If TokenName is not a patchable in module PCD, then the module will not build.285286@param TokenName The name of the binary patchable PCD token to set the current value for.287@param Value The boolean value to set.288289@return Return the Value that was set.290291**/292#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))293294/**295Sets a pointer to a binary patchable PCD token buffer based on a token name.296297Sets the buffer for the token specified by TokenName. Buffer is returned.298If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer299to the maximum size supported by TokenName and return NULL to indicate that the set operation300was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be301set to the maximum size supported by TokenName and NULL must be returned.302If TokenName is not a valid token in the token space, then the module will not build.303If TokenName is not a patchable in module PCD, then the module will not build.304305If SizeOfBuffer is NULL, then ASSERT().306If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().307308@param TokenName The name of the binary patchable PCD token to set the current value for.309@param SizeOfBuffer A pointer to the size, in bytes, of Buffer.310@param Buffer Pointer to the value to set.311312@return Return the pointer to the Buffer that was set.313314**/315#define PatchPcdSetPtr(TokenName, Size, Buffer) \316LibPatchPcdSetPtrAndSize ( \317(VOID *)_gPcd_BinaryPatch_##TokenName, \318&_gPcd_BinaryPatch_Size_##TokenName, \319(UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \320(Size), \321(Buffer) \322)323324/**325Retrieves an 8-bit PCD token value based on a token name.326327Returns the 8-bit value for the token specified by TokenName.328If TokenName is not a valid token in the token space, then the module will not build.329330@param TokenName The name of the PCD token to retrieve a current value for.331332@return 8-bit value for the token specified by TokenName.333334**/335#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName336337/**338Retrieves a 16-bit PCD token value based on a token name.339340Returns the 16-bit value for the token specified by TokenName.341If TokenName is not a valid token in the token space, then the module will not build.342343@param TokenName The name of the PCD token to retrieve a current value for.344345@return 16-bit value for the token specified by TokenName.346347**/348#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName349350/**351Retrieves a 32-bit PCD token value based on a token name.352353Returns the 32-bit value for the token specified by TokenName.354If TokenName is not a valid token in the token space, then the module will not build.355356@param TokenName The name of the PCD token to retrieve a current value for.357358@return 32-bit value for the token specified by TokenName.359360**/361#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName362363/**364Retrieves a 64-bit PCD token value based on a token name.365366Returns the 64-bit value for the token specified by TokenName.367If TokenName is not a valid token in the token space, then the module will not build.368369@param TokenName The name of the PCD token to retrieve a current value for.370371@return 64-bit value for the token specified by TokenName.372373**/374#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName375376/**377Retrieves a pointer to a PCD token buffer based on a token name.378379Returns a pointer to the buffer for the token specified by TokenName.380If TokenName is not a valid token in the token space, then the module will not build.381382@param TokenName The name of the PCD token to retrieve a current value for.383384@return A pointer to the buffer.385386**/387#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName388389/**390Retrieves a Boolean PCD token value based on a token name.391392Returns the Boolean value for the token specified by TokenName.393If TokenName is not a valid token in the token space, then the module will not build.394395@param TokenName The name of the PCD token to retrieve a current value for.396397@return A Boolean PCD token value.398399**/400#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName401402/**403Retrieves the size of a fixed PCD token based on a token name.404405Returns the size of the token specified by TokenName.406If TokenName is not a valid token in the token space, then the module will not build.407408@param[in] TokenName The name of the PCD token to retrieve a current value size for.409410@return Return the size411412**/413#define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName414415/**416Retrieves the size of a binary patchable PCD token based on a token name.417418Returns the size of the token specified by TokenName.419If TokenName is not a valid token in the token space, then the module will not build.420421@param[in] TokenName The name of the PCD token to retrieve a current value size for.422423@return Return the size424425**/426#define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName427428/**429Retrieves the size of the PCD token based on a token name.430431Returns the size of the token specified by TokenName.432If TokenName is not a valid token in the token space, then the module will not build.433434@param[in] TokenName The name of the PCD token to retrieve a current value size for.435436@return Return the size437438**/439#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName440441/**442Retrieve the size of a given PCD token.443444Returns the size of the token specified by TokenNumber and Guid.445If Guid is NULL, then ASSERT().446447@param[in] Guid Pointer to a 128-bit unique value that designates448which namespace to retrieve a value from.449@param[in] TokenNumber The PCD token number to retrieve a current value size for.450451@return Return the size.452453**/454#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))455456/**457Sets a 8-bit PCD token value based on a token name.458459Sets the 8-bit value for the token specified by TokenName.460If TokenName is not a valid token in the token space, then the module will not build.461462@param TokenName The name of the PCD token to retrieve a current value for.463@param Value The 8-bit value to set.464465@return The status of the set operation.466467**/468#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))469470/**471Sets a 16-bit PCD token value based on a token name.472473Sets the 16-bit value for the token specified by TokenName.474If TokenName is not a valid token in the token space, then the module will not build.475476@param TokenName The name of the PCD token to retrieve a current value for.477@param Value The 16-bit value to set.478479@return The status of the set operation.480481**/482#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))483484/**485Sets a 32-bit PCD token value based on a token name.486487Sets the 32-bit value for the token specified by TokenName.488If TokenName is not a valid token in the token space, then the module will not build.489490@param TokenName The name of the PCD token to retrieve a current value for.491@param Value The 32-bit value to set.492493@return The status of the set operation.494495**/496#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))497498/**499Sets a 64-bit PCD token value based on a token name.500501Sets the 64-bit value for the token specified by TokenName.502If TokenName is not a valid token in the token space, then the module will not build.503504@param TokenName The name of the PCD token to retrieve a current value for.505@param Value The 64-bit value to set.506507@return The status of the set operation.508509**/510#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))511512/**513Sets a pointer to a PCD token buffer based on a token name.514515Sets the buffer for the token specified by TokenName.516If SizeOfBuffer is greater than the maximum size supported by TokenName,517then set SizeOfBuffer to the maximum size supported by TokenName and return518RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.519If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size520supported by TokenName and RETURN_INVALID_PARAMETER must be returned.521If TokenName is not a valid token in the token space, then the module will not build.522523If SizeOfBuffer is NULL, then ASSERT().524If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().525526@param TokenName The name of the PCD token to set the current value for.527@param SizeOfBuffer A pointer to the size, in bytes, of Buffer.528@param Buffer A pointer to the buffer to set.529530@return The status of the set operation.531532**/533#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \534_PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer))535536/**537Sets a boolean PCD token value based on a token name.538539Sets the boolean value for the token specified by TokenName.540If TokenName is not a valid token in the token space, then the module will not build.541542@param TokenName The name of the PCD token to retrieve a current value for.543@param Value The boolean value to set.544545@return The status of the set operation.546547**/548#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))549550/**551Retrieves a token number based on a GUID and a token name.552553Returns the token number for the token specified by Guid and TokenName.554If TokenName is not a valid token in the token space, then the module will not build.555556@param Guid Pointer to a 128-bit unique value that designates557which namespace to retrieve a value from.558@param TokenName The name of the PCD token to retrieve a current value for.559560@return Return the token number.561562**/563#define PcdTokenEx(Guid, TokenName) _PCD_TOKEN_EX_##TokenName(Guid)564565/**566Retrieves an 8-bit PCD token value based on a GUID and a token name.567568Returns the 8-bit value for the token specified by Guid and TokenName.569If TokenName is not a valid token in the token space specified by Guid,570then the module will not build.571572If Guid is NULL, then ASSERT().573574@param Guid Pointer to a 128-bit unique value that designates575which namespace to retrieve a value from.576@param TokenName The name of the PCD token to retrieve a current value for.577578@return An 8-bit PCD token value.579580**/581#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))582583/**584Retrieves a 16-bit PCD token value based on a GUID and a token name.585586Returns the 16-bit value for the token specified by Guid and TokenName.587If TokenName is not a valid token in the token space specified by Guid,588then the module will not build.589590If Guid is NULL, then ASSERT().591592@param Guid Pointer to a 128-bit unique value that designates593which namespace to retrieve a value from.594@param TokenName The name of the PCD token to retrieve a current value for.595596@return A 16-bit PCD token value.597598**/599#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))600601/**602Retrieves a 32-bit PCD token value based on a GUID and a token name.603604Returns the 32-bit value for the token specified by Guid and TokenName.605If TokenName is not a valid token in the token space specified by Guid,606then the module will not build.607608If Guid is NULL, then ASSERT().609610@param Guid Pointer to a 128-bit unique value that designates611which namespace to retrieve a value from.612@param TokenName The name of the PCD token to retrieve a current value for.613614@return A 32-bit PCD token value.615616**/617#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))618619/**620Retrieves a 64-bit PCD token value based on a GUID and a token name.621622Returns the 64-bit value for the token specified by Guid and TokenName.623If TokenName is not a valid token in the token space specified by Guid,624then the module will not build.625626If Guid is NULL, then ASSERT().627628@param Guid Pointer to a 128-bit unique value that designates629which namespace to retrieve a value from.630@param TokenName The name of the PCD token to retrieve a current value for.631632@return A 64-bit PCD token value.633634**/635#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))636637/**638Retrieves a pointer to a PCD token buffer based on a GUID and a token name.639640Returns a pointer to the buffer for the token specified by Guid and TokenName.641If TokenName is not a valid token in the token space specified by Guid,642then the module will not build.643644If Guid is NULL, then ASSERT().645646@param Guid Pointer to a 128-bit unique value that designates647which namespace to retrieve a value from.648@param TokenName The name of the PCD token to retrieve a current value for.649650@return A pointer to a PCD token buffer.651652**/653#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))654655/**656Retrieves a Boolean PCD token value based on a GUID and a token name.657658Returns the Boolean value for the token specified by Guid and TokenName.659If TokenName is not a valid token in the token space specified by Guid,660then the module will not build.661662If Guid is NULL, then ASSERT().663664@param Guid Pointer to a 128-bit unique value that designates665which namespace to retrieve a value from.666@param TokenName The name of the PCD token to retrieve a current value for.667668@return A Boolean PCD token value.669670**/671#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))672673/**674Sets an 8-bit PCD token value based on a GUID and a token name.675676Sets the 8-bit value for the token specified by Guid and TokenName.677If TokenName is not a valid token in the token space specified by Guid,678then the module will not build.679680If Guid is NULL, then ASSERT().681682@param Guid Pointer to a 128-bit unique value that designates683which namespace to retrieve a value from.684@param TokenName The name of the PCD token to set the current value for.685@param Value The 8-bit value to set.686687@return The status of the set operation.688689**/690#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))691692/**693Sets an 16-bit PCD token value based on a GUID and a token name.694695Sets the 16-bit value for the token specified by Guid and TokenName.696If TokenName is not a valid token in the token space specified by Guid,697then the module will not build.698699If Guid is NULL, then ASSERT().700701@param Guid Pointer to a 128-bit unique value that designates702which namespace to retrieve a value from.703@param TokenName The name of the PCD token to set the current value for.704@param Value The 16-bit value to set.705706@return The status of the set operation.707708**/709#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))710711/**712Sets an 32-bit PCD token value based on a GUID and a token name.713714Sets the 32-bit value for the token specified by Guid and TokenName.715If TokenName is not a valid token in the token space specified by Guid,716then the module will not build.717718If Guid is NULL, then ASSERT().719720@param Guid Pointer to a 128-bit unique value that designates721which namespace to retrieve a value from.722@param TokenName The name of the PCD token to set the current value for.723@param Value The 32-bit value to set.724725@return The status of the set operation.726727**/728#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))729730/**731Sets an 64-bit PCD token value based on a GUID and a token name.732733Sets the 64-bit value for the token specified by Guid and TokenName.734If TokenName is not a valid token in the token space specified by Guid,735then the module will not build.736737If Guid is NULL, then ASSERT().738739@param Guid Pointer to a 128-bit unique value that designates740which namespace to retrieve a value from.741@param TokenName The name of the PCD token to set the current value for.742@param Value The 64-bit value to set.743744@return The status of the set operation.745746**/747#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))748749/**750Sets a pointer to a PCD token buffer based on a GUID and a token name.751752Sets the buffer for the token specified by Guid and TokenName.753If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,754then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return755RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.756If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size757supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned.758If TokenName is not a valid token in the token space specified by Guid,759then the module will not build.760761If Guid is NULL, then ASSERT().762If SizeOfBuffer is NULL, then ASSERT().763If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().764765@param Guid Pointer to a 128-bit unique value that designates766which namespace to retrieve a value from.767@param TokenName The name of the PCD token to set the current value for.768@param SizeOfBuffer A pointer to the size, in bytes, of Buffer.769@param Buffer Pointer to the buffer to set.770771@return The status of the set operation.772773**/774#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \775LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))776777/**778Sets an boolean PCD token value based on a GUID and a token name.779780Sets the boolean value for the token specified by Guid and TokenName.781If TokenName is not a valid token in the token space specified by Guid,782then the module will not build.783784If Guid is NULL, then ASSERT().785786@param Guid Pointer to a 128-bit unique value that designates787which namespace to retrieve a value from.788@param TokenName The name of the PCD token to set the current value for.789@param Value The boolean value to set.790791@return The status of the set operation.792793**/794#define PcdSetExBoolS(Guid, TokenName, Value) \795LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))796797/**798This function provides a means by which SKU support can be established in the PCD infrastructure.799800Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.801802@param SkuId The SKU value that will be used when the PCD service retrieves and sets values803associated with a PCD token.804805@return Return the SKU ID that was set.806807**/808UINTN809EFIAPI810LibPcdSetSku (811IN UINTN SkuId812);813814/**815This function provides a means by which to retrieve a value for a given PCD token.816817Returns the 8-bit value for the token specified by TokenNumber.818819@param[in] TokenNumber The PCD token number to retrieve a current value for.820821@return Returns the 8-bit value for the token specified by TokenNumber.822823**/824UINT8825EFIAPI826LibPcdGet8 (827IN UINTN TokenNumber828);829830/**831This function provides a means by which to retrieve a value for a given PCD token.832833Returns the 16-bit value for the token specified by TokenNumber.834835@param[in] TokenNumber The PCD token number to retrieve a current value for.836837@return Returns the 16-bit value for the token specified by TokenNumber.838839**/840UINT16841EFIAPI842LibPcdGet16 (843IN UINTN TokenNumber844);845846/**847This function provides a means by which to retrieve a value for a given PCD token.848849Returns the 32-bit value for the token specified by TokenNumber.850851@param[in] TokenNumber The PCD token number to retrieve a current value for.852853@return Returns the 32-bit value for the token specified by TokenNumber.854855**/856UINT32857EFIAPI858LibPcdGet32 (859IN UINTN TokenNumber860);861862/**863This function provides a means by which to retrieve a value for a given PCD token.864865Returns the 64-bit value for the token specified by TokenNumber.866867@param[in] TokenNumber The PCD token number to retrieve a current value for.868869@return Returns the 64-bit value for the token specified by TokenNumber.870871**/872UINT64873EFIAPI874LibPcdGet64 (875IN UINTN TokenNumber876);877878/**879This function provides a means by which to retrieve a value for a given PCD token.880881Returns the pointer to the buffer of the token specified by TokenNumber.882883@param[in] TokenNumber The PCD token number to retrieve a current value for.884885@return Returns the pointer to the token specified by TokenNumber.886887**/888VOID *889EFIAPI890LibPcdGetPtr (891IN UINTN TokenNumber892);893894/**895This function provides a means by which to retrieve a value for a given PCD token.896897Returns the Boolean value of the token specified by TokenNumber.898899@param[in] TokenNumber The PCD token number to retrieve a current value for.900901@return Returns the Boolean value of the token specified by TokenNumber.902903**/904BOOLEAN905EFIAPI906LibPcdGetBool (907IN UINTN TokenNumber908);909910/**911This function provides a means by which to retrieve the size of a given PCD token.912913@param[in] TokenNumber The PCD token number to retrieve a current value for.914915@return Returns the size of the token specified by TokenNumber.916917**/918UINTN919EFIAPI920LibPcdGetSize (921IN UINTN TokenNumber922);923924/**925This function provides a means by which to retrieve a value for a given PCD token.926927Returns the 8-bit value for the token specified by TokenNumber and Guid.928929If Guid is NULL, then ASSERT().930931@param[in] Guid Pointer to a 128-bit unique value that designates932which namespace to retrieve a value from.933@param[in] TokenNumber The PCD token number to retrieve a current value for.934935@return Return the UINT8.936937**/938UINT8939EFIAPI940LibPcdGetEx8 (941IN CONST GUID *Guid,942IN UINTN TokenNumber943);944945/**946This function provides a means by which to retrieve a value for a given PCD token.947948Returns the 16-bit value for the token specified by TokenNumber and Guid.949950If Guid is NULL, then ASSERT().951952@param[in] Guid Pointer to a 128-bit unique value that designates953which namespace to retrieve a value from.954@param[in] TokenNumber The PCD token number to retrieve a current value for.955956@return Return the UINT16.957958**/959UINT16960EFIAPI961LibPcdGetEx16 (962IN CONST GUID *Guid,963IN UINTN TokenNumber964);965966/**967Returns the 32-bit value for the token specified by TokenNumber and Guid.968If Guid is NULL, then ASSERT().969970@param[in] Guid Pointer to a 128-bit unique value that designates971which namespace to retrieve a value from.972@param[in] TokenNumber The PCD token number to retrieve a current value for.973974@return Return the UINT32.975976**/977UINT32978EFIAPI979LibPcdGetEx32 (980IN CONST GUID *Guid,981IN UINTN TokenNumber982);983984/**985This function provides a means by which to retrieve a value for a given PCD token.986987Returns the 64-bit value for the token specified by TokenNumber and Guid.988989If Guid is NULL, then ASSERT().990991@param[in] Guid Pointer to a 128-bit unique value that designates992which namespace to retrieve a value from.993@param[in] TokenNumber The PCD token number to retrieve a current value for.994995@return Return the UINT64.996997**/998UINT64999EFIAPI1000LibPcdGetEx64 (1001IN CONST GUID *Guid,1002IN UINTN TokenNumber1003);10041005/**1006This function provides a means by which to retrieve a value for a given PCD token.10071008Returns the pointer to the buffer of token specified by TokenNumber and Guid.10091010If Guid is NULL, then ASSERT().10111012@param[in] Guid Pointer to a 128-bit unique value that designates1013which namespace to retrieve a value from.1014@param[in] TokenNumber The PCD token number to retrieve a current value for.10151016@return Return the VOID* pointer.10171018**/1019VOID *1020EFIAPI1021LibPcdGetExPtr (1022IN CONST GUID *Guid,1023IN UINTN TokenNumber1024);10251026/**1027This function provides a means by which to retrieve a value for a given PCD token.10281029Returns the Boolean value of the token specified by TokenNumber and Guid.10301031If Guid is NULL, then ASSERT().10321033@param[in] Guid Pointer to a 128-bit unique value that designates1034which namespace to retrieve a value from.1035@param[in] TokenNumber The PCD token number to retrieve a current value for.10361037@return Return the BOOLEAN.10381039**/1040BOOLEAN1041EFIAPI1042LibPcdGetExBool (1043IN CONST GUID *Guid,1044IN UINTN TokenNumber1045);10461047/**1048This function provides a means by which to retrieve the size of a given PCD token.10491050Returns the size of the token specified by TokenNumber and Guid.10511052If Guid is NULL, then ASSERT().10531054@param[in] Guid Pointer to a 128-bit unique value that designates1055which namespace to retrieve a value from.1056@param[in] TokenNumber The PCD token number to retrieve a current value for.10571058@return Return the size.10591060**/1061UINTN1062EFIAPI1063LibPcdGetExSize (1064IN CONST GUID *Guid,1065IN UINTN TokenNumber1066);10671068/**1069This function provides a means by which to set a value for a given PCD token.10701071Sets the 8-bit value for the token specified by TokenNumber1072to the value specified by Value.10731074@param[in] TokenNumber The PCD token number to set a current value for.1075@param[in] Value The 8-bit value to set.10761077@return The status of the set operation.10781079**/1080RETURN_STATUS1081EFIAPI1082LibPcdSet8S (1083IN UINTN TokenNumber,1084IN UINT8 Value1085);10861087/**1088This function provides a means by which to set a value for a given PCD token.10891090Sets the 16-bit value for the token specified by TokenNumber1091to the value specified by Value.10921093@param[in] TokenNumber The PCD token number to set a current value for.1094@param[in] Value The 16-bit value to set.10951096@return The status of the set operation.10971098**/1099RETURN_STATUS1100EFIAPI1101LibPcdSet16S (1102IN UINTN TokenNumber,1103IN UINT16 Value1104);11051106/**1107This function provides a means by which to set a value for a given PCD token.11081109Sets the 32-bit value for the token specified by TokenNumber1110to the value specified by Value.11111112@param[in] TokenNumber The PCD token number to set a current value for.1113@param[in] Value The 32-bit value to set.11141115@return The status of the set operation.11161117**/1118RETURN_STATUS1119EFIAPI1120LibPcdSet32S (1121IN UINTN TokenNumber,1122IN UINT32 Value1123);11241125/**1126This function provides a means by which to set a value for a given PCD token.11271128Sets the 64-bit value for the token specified by TokenNumber1129to the value specified by Value.11301131@param[in] TokenNumber The PCD token number to set a current value for.1132@param[in] Value The 64-bit value to set.11331134@return The status of the set operation.11351136**/1137RETURN_STATUS1138EFIAPI1139LibPcdSet64S (1140IN UINTN TokenNumber,1141IN UINT64 Value1142);11431144/**1145This function provides a means by which to set a value for a given PCD token.11461147Sets a buffer for the token specified by TokenNumber to the value specified1148by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size1149support by TokenNumber, then set SizeOfBuffer to the maximum size supported by1150TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation1151was not actually performed.11521153If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the1154maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned.11551156If SizeOfBuffer is NULL, then ASSERT().1157If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().11581159@param[in] TokenNumber The PCD token number to set a current value for.1160@param[in, out] SizeOfBuffer The size, in bytes, of Buffer.1161@param[in] Buffer A pointer to the buffer to set.11621163@return The status of the set operation.11641165**/1166RETURN_STATUS1167EFIAPI1168LibPcdSetPtrS (1169IN UINTN TokenNumber,1170IN OUT UINTN *SizeOfBuffer,1171IN CONST VOID *Buffer1172);11731174/**1175This function provides a means by which to set a value for a given PCD token.11761177Sets the boolean value for the token specified by TokenNumber1178to the value specified by Value.11791180@param[in] TokenNumber The PCD token number to set a current value for.1181@param[in] Value The boolean value to set.11821183@return The status of the set operation.11841185**/1186RETURN_STATUS1187EFIAPI1188LibPcdSetBoolS (1189IN UINTN TokenNumber,1190IN BOOLEAN Value1191);11921193/**1194This function provides a means by which to set a value for a given PCD token.11951196Sets the 8-bit value for the token specified by TokenNumber1197to the value specified by Value.11981199If Guid is NULL, then ASSERT().12001201@param[in] Guid The pointer to a 128-bit unique value that1202designates which namespace to set a value from.1203@param[in] TokenNumber The PCD token number to set a current value for.1204@param[in] Value The 8-bit value to set.12051206@return The status of the set operation.12071208**/1209RETURN_STATUS1210EFIAPI1211LibPcdSetEx8S (1212IN CONST GUID *Guid,1213IN UINTN TokenNumber,1214IN UINT8 Value1215);12161217/**1218This function provides a means by which to set a value for a given PCD token.12191220Sets the 16-bit value for the token specified by TokenNumber1221to the value specified by Value.12221223If Guid is NULL, then ASSERT().12241225@param[in] Guid The pointer to a 128-bit unique value that1226designates which namespace to set a value from.1227@param[in] TokenNumber The PCD token number to set a current value for.1228@param[in] Value The 16-bit value to set.12291230@return The status of the set operation.12311232**/1233RETURN_STATUS1234EFIAPI1235LibPcdSetEx16S (1236IN CONST GUID *Guid,1237IN UINTN TokenNumber,1238IN UINT16 Value1239);12401241/**1242This function provides a means by which to set a value for a given PCD token.12431244Sets the 32-bit value for the token specified by TokenNumber1245to the value specified by Value.12461247If Guid is NULL, then ASSERT().12481249@param[in] Guid The pointer to a 128-bit unique value that1250designates which namespace to set a value from.1251@param[in] TokenNumber The PCD token number to set a current value for.1252@param[in] Value The 32-bit value to set.12531254@return The status of the set operation.12551256**/1257RETURN_STATUS1258EFIAPI1259LibPcdSetEx32S (1260IN CONST GUID *Guid,1261IN UINTN TokenNumber,1262IN UINT32 Value1263);12641265/**1266This function provides a means by which to set a value for a given PCD token.12671268Sets the 64-bit value for the token specified by TokenNumber1269to the value specified by Value.12701271If Guid is NULL, then ASSERT().12721273@param[in] Guid The pointer to a 128-bit unique value that1274designates which namespace to set a value from.1275@param[in] TokenNumber The PCD token number to set a current value for.1276@param[in] Value The 64-bit value to set.12771278@return The status of the set operation.12791280**/1281RETURN_STATUS1282EFIAPI1283LibPcdSetEx64S (1284IN CONST GUID *Guid,1285IN UINTN TokenNumber,1286IN UINT64 Value1287);12881289/**1290This function provides a means by which to set a value for a given PCD token.12911292Sets a buffer for the token specified by TokenNumber to the value specified by1293Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size1294support by TokenNumber, then set SizeOfBuffer to the maximum size supported by1295TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation1296was not actually performed.12971298If Guid is NULL, then ASSERT().1299If SizeOfBuffer is NULL, then ASSERT().1300If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().13011302@param[in] Guid Pointer to a 128-bit unique value that1303designates which namespace to set a value from.1304@param[in] TokenNumber The PCD token number to set a current value for.1305@param[in, out] SizeOfBuffer The size, in bytes, of Buffer.1306@param[in] Buffer A pointer to the buffer to set.13071308@return The status of the set operation.13091310**/1311RETURN_STATUS1312EFIAPI1313LibPcdSetExPtrS (1314IN CONST GUID *Guid,1315IN UINTN TokenNumber,1316IN OUT UINTN *SizeOfBuffer,1317IN VOID *Buffer1318);13191320/**1321This function provides a means by which to set a value for a given PCD token.13221323Sets the boolean value for the token specified by TokenNumber1324to the value specified by Value.13251326If Guid is NULL, then ASSERT().13271328@param[in] Guid The pointer to a 128-bit unique value that1329designates which namespace to set a value from.1330@param[in] TokenNumber The PCD token number to set a current value for.1331@param[in] Value The boolean value to set.13321333@return The status of the set operation.13341335**/1336RETURN_STATUS1337EFIAPI1338LibPcdSetExBoolS (1339IN CONST GUID *Guid,1340IN UINTN TokenNumber,1341IN BOOLEAN Value1342);13431344/**1345This notification function serves two purposes.13461347Firstly, it notifies the module that did the registration that the value of this1348PCD token has been set.1349Secondly, it provides a mechanism for the module that did the registration to intercept1350the set operation and override the value been set if necessary. After the invocation of1351the callback function, TokenData will be used by PCD service PEIM or driver to modify th1352internal data in PCD database.13531354@param[in] CallBackGuid The PCD token GUID being set.1355@param[in] CallBackToken The PCD token number being set.1356@param[in, out] TokenData A pointer to the token data being set.1357@param[in] TokenDataSize The size, in bytes, of the data being set.13581359**/1360typedef1361VOID1362(EFIAPI *PCD_CALLBACK)(1363IN CONST GUID *CallBackGuid OPTIONAL,1364IN UINTN CallBackToken,1365IN OUT VOID *TokenData,1366IN UINTN TokenDataSize1367);13681369/**1370Set up a notification function that is called when a specified token is set.13711372When the token specified by TokenNumber and Guid is set,1373then notification function specified by NotificationFunction is called.1374If Guid is NULL, then the default token space is used.1375If NotificationFunction is NULL, then ASSERT().13761377@param[in] Guid Pointer to a 128-bit unique value that designates which1378namespace to set a value from. If NULL, then the default1379token space is used.1380@param[in] TokenNumber The PCD token number to monitor.1381@param[in] NotificationFunction The function to call when the token1382specified by Guid and TokenNumber is set.13831384**/1385VOID1386EFIAPI1387LibPcdCallbackOnSet (1388IN CONST GUID *Guid OPTIONAL,1389IN UINTN TokenNumber,1390IN PCD_CALLBACK NotificationFunction1391);13921393/**1394Disable a notification function that was established with LibPcdCallbackonSet().13951396Disable a notification function that was previously established with LibPcdCallbackOnSet().1397If NotificationFunction is NULL, then ASSERT().1398If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,1399and NotificationFunction, then ASSERT().14001401@param[in] Guid Specify the GUID token space.1402@param[in] TokenNumber Specify the token number.1403@param[in] NotificationFunction The callback function to be unregistered.14041405**/1406VOID1407EFIAPI1408LibPcdCancelCallback (1409IN CONST GUID *Guid OPTIONAL,1410IN UINTN TokenNumber,1411IN PCD_CALLBACK NotificationFunction1412);14131414/**1415Retrieves the next token in a token space.14161417Retrieves the next PCD token number from the token space specified by Guid.1418If Guid is NULL, then the default token space is used. If TokenNumber is 0,1419then the first token number is returned. Otherwise, the token number that1420follows TokenNumber in the token space is returned. If TokenNumber is the last1421token number in the token space, then 0 is returned.14221423If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().14241425@param[in] Guid Pointer to a 128-bit unique value that designates which namespace1426to set a value from. If NULL, then the default token space is used.1427@param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD1428token number.14291430@return The next valid token number.14311432**/1433UINTN1434EFIAPI1435LibPcdGetNextToken (1436IN CONST GUID *Guid OPTIONAL,1437IN UINTN TokenNumber1438);14391440/**1441Used to retrieve the list of available PCD token space GUIDs.14421443Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces1444in the platform.1445If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.1446If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.14471448@param TokenSpaceGuid Pointer to the a PCD token space GUID14491450@return The next valid token namespace.14511452**/1453GUID *1454EFIAPI1455LibPcdGetNextTokenSpace (1456IN CONST GUID *TokenSpaceGuid1457);14581459/**1460Sets a value of a patchable PCD entry that is type pointer.14611462Sets the PCD entry specified by PatchVariable to the value specified by Buffer1463and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than1464MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return1465NULL to indicate that the set operation was not actually performed.1466If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to1467MaximumDatumSize and NULL must be returned.14681469If PatchVariable is NULL, then ASSERT().1470If SizeOfBuffer is NULL, then ASSERT().1471If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().14721473@param[out] PatchVariable A pointer to the global variable in a module that is1474the target of the set operation.1475@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.1476@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.1477@param[in] Buffer A pointer to the buffer to used to set the target variable.14781479@return Return the pointer to the Buffer that was set.14801481**/1482VOID *1483EFIAPI1484LibPatchPcdSetPtr (1485OUT VOID *PatchVariable,1486IN UINTN MaximumDatumSize,1487IN OUT UINTN *SizeOfBuffer,1488IN CONST VOID *Buffer1489);14901491/**1492Sets a value of a patchable PCD entry that is type pointer.14931494Sets the PCD entry specified by PatchVariable to the value specified1495by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,1496then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER1497to indicate that the set operation was not actually performed.1498If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to1499MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.15001501If PatchVariable is NULL, then ASSERT().1502If SizeOfBuffer is NULL, then ASSERT().1503If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().15041505@param[out] PatchVariable A pointer to the global variable in a module that is1506the target of the set operation.1507@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.1508@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.1509@param[in] Buffer A pointer to the buffer to used to set the target variable.15101511@return The status of the set operation.15121513**/1514RETURN_STATUS1515EFIAPI1516LibPatchPcdSetPtrS (1517OUT VOID *PatchVariable,1518IN UINTN MaximumDatumSize,1519IN OUT UINTN *SizeOfBuffer,1520IN CONST VOID *Buffer1521);15221523/**1524Sets a value and size of a patchable PCD entry that is type pointer.15251526Sets the PCD entry specified by PatchVariable to the value specified by Buffer1527and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than1528MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return1529NULL to indicate that the set operation was not actually performed.1530If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to1531MaximumDatumSize and NULL must be returned.15321533If PatchVariable is NULL, then ASSERT().1534If SizeOfPatchVariable is NULL, then ASSERT().1535If SizeOfBuffer is NULL, then ASSERT().1536If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().15371538@param[out] PatchVariable A pointer to the global variable in a module that is1539the target of the set operation.1540@param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.1541@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.1542@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.1543@param[in] Buffer A pointer to the buffer to used to set the target variable.15441545@return Return the pointer to the Buffer that was set.15461547**/1548VOID *1549EFIAPI1550LibPatchPcdSetPtrAndSize (1551OUT VOID *PatchVariable,1552OUT UINTN *SizeOfPatchVariable,1553IN UINTN MaximumDatumSize,1554IN OUT UINTN *SizeOfBuffer,1555IN CONST VOID *Buffer1556);15571558/**1559Sets a value and size of a patchable PCD entry that is type pointer.15601561Sets the PCD entry specified by PatchVariable to the value specified1562by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,1563then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER1564to indicate that the set operation was not actually performed.1565If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to1566MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.15671568If PatchVariable is NULL, then ASSERT().1569If SizeOfPatchVariable is NULL, then ASSERT().1570If SizeOfBuffer is NULL, then ASSERT().1571If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().15721573@param[out] PatchVariable A pointer to the global variable in a module that is1574the target of the set operation.1575@param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.1576@param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable.1577@param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer.1578@param[in] Buffer A pointer to the buffer to used to set the target variable.15791580@return The status of the set operation.15811582**/1583RETURN_STATUS1584EFIAPI1585LibPatchPcdSetPtrAndSizeS (1586OUT VOID *PatchVariable,1587OUT UINTN *SizeOfPatchVariable,1588IN UINTN MaximumDatumSize,1589IN OUT UINTN *SizeOfBuffer,1590IN CONST VOID *Buffer1591);15921593typedef enum {1594PCD_TYPE_8,1595PCD_TYPE_16,1596PCD_TYPE_32,1597PCD_TYPE_64,1598PCD_TYPE_BOOL,1599PCD_TYPE_PTR1600} PCD_TYPE;16011602typedef struct {1603///1604/// The returned information associated with the requested TokenNumber. If1605/// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.1606///1607PCD_TYPE PcdType;1608///1609/// The size of the data in bytes associated with the TokenNumber specified. If1610/// TokenNumber is 0, then PcdSize is set 0.1611///1612UINTN PcdSize;1613///1614/// The null-terminated ASCII string associated with a given token. If the1615/// TokenNumber specified was 0, then this field corresponds to the null-terminated1616/// ASCII string associated with the token's namespace Guid. If NULL, there is no1617/// name associated with this request.1618///1619CHAR8 *PcdName;1620} PCD_INFO;16211622/**1623Retrieve additional information associated with a PCD token.16241625This includes information such as the type of value the TokenNumber is associated with as well as possible1626human readable name that is associated with the token.16271628If TokenNumber is not in the default token space specified, then ASSERT().16291630@param[in] TokenNumber The PCD token number.1631@param[out] PcdInfo The returned information associated with the requested TokenNumber.1632The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.1633**/1634VOID1635EFIAPI1636LibPcdGetInfo (1637IN UINTN TokenNumber,1638OUT PCD_INFO *PcdInfo1639);16401641/**1642Retrieve additional information associated with a PCD token.16431644This includes information such as the type of value the TokenNumber is associated with as well as possible1645human readable name that is associated with the token.16461647If TokenNumber is not in the token space specified by Guid, then ASSERT().16481649@param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.1650@param[in] TokenNumber The PCD token number.1651@param[out] PcdInfo The returned information associated with the requested TokenNumber.1652The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.1653**/1654VOID1655EFIAPI1656LibPcdGetInfoEx (1657IN CONST GUID *Guid,1658IN UINTN TokenNumber,1659OUT PCD_INFO *PcdInfo1660);16611662/**1663Retrieve the currently set SKU Id.16641665@return The currently set SKU Id. If the platform has not set at a SKU Id, then the1666default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU1667Id is returned.1668**/1669UINTN1670EFIAPI1671LibPcdGetSku (1672VOID1673);16741675#endif167616771678