1*22ce4affSfengbojiang /** @file 2*22ce4affSfengbojiang Provides library services to get and set Platform Configuration Database entries. 3*22ce4affSfengbojiang 4*22ce4affSfengbojiang PCD Library Class provides a PCD usage macro interface for all PCD types. 5*22ce4affSfengbojiang It should be included in any module that uses PCD. If a module uses dynamic/dynamicex 6*22ce4affSfengbojiang PCD, module should be linked to a PEIM/DXE library instance to access that PCD. 7*22ce4affSfengbojiang If a module uses PatchableInModule type PCD, it also needs the library instance to produce 8*22ce4affSfengbojiang LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is 9*22ce4affSfengbojiang translated to a variable or macro that is auto-generated by build tool in 10*22ce4affSfengbojiang module's autogen.h/autogen.c. 11*22ce4affSfengbojiang The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are 12*22ce4affSfengbojiang only available prior to ExitBootServices(). If access to PCD values are required 13*22ce4affSfengbojiang at runtime, then their values must be collected prior to ExitBootServices(). 14*22ce4affSfengbojiang There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(), 15*22ce4affSfengbojiang PatchPcdGetXX(), and PatchPcdSetXX(). 16*22ce4affSfengbojiang 17*22ce4affSfengbojiang Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 18*22ce4affSfengbojiang SPDX-License-Identifier: BSD-2-Clause-Patent 19*22ce4affSfengbojiang 20*22ce4affSfengbojiang **/ 21*22ce4affSfengbojiang 22*22ce4affSfengbojiang #ifndef __PCD_LIB_H__ 23*22ce4affSfengbojiang #define __PCD_LIB_H__ 24*22ce4affSfengbojiang 25*22ce4affSfengbojiang 26*22ce4affSfengbojiang /** 27*22ce4affSfengbojiang Retrieves a token number based on a token name. 28*22ce4affSfengbojiang 29*22ce4affSfengbojiang Returns the token number associated with the PCD token specified by TokenName. 30*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 31*22ce4affSfengbojiang 32*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve the token number for. 33*22ce4affSfengbojiang 34*22ce4affSfengbojiang @return The token number associated with the PCD. 35*22ce4affSfengbojiang 36*22ce4affSfengbojiang **/ 37*22ce4affSfengbojiang #define PcdToken(TokenName) _PCD_TOKEN_##TokenName 38*22ce4affSfengbojiang 39*22ce4affSfengbojiang 40*22ce4affSfengbojiang /** 41*22ce4affSfengbojiang Retrieves a Boolean PCD feature flag based on a token name. 42*22ce4affSfengbojiang 43*22ce4affSfengbojiang Returns the Boolean value for the PCD feature flag specified by TokenName. 44*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 45*22ce4affSfengbojiang If TokenName is not a feature flag PCD, then the module will not build. 46*22ce4affSfengbojiang 47*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 48*22ce4affSfengbojiang 49*22ce4affSfengbojiang @return Boolean value for the PCD feature flag. 50*22ce4affSfengbojiang 51*22ce4affSfengbojiang **/ 52*22ce4affSfengbojiang #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName 53*22ce4affSfengbojiang 54*22ce4affSfengbojiang 55*22ce4affSfengbojiang /** 56*22ce4affSfengbojiang Retrieves an 8-bit fixed PCD token value based on a token name. 57*22ce4affSfengbojiang 58*22ce4affSfengbojiang Returns the 8-bit value for the token specified by TokenName. 59*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 60*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 61*22ce4affSfengbojiang 62*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 63*22ce4affSfengbojiang 64*22ce4affSfengbojiang @return 8-bit value for the token specified by TokenName. 65*22ce4affSfengbojiang 66*22ce4affSfengbojiang **/ 67*22ce4affSfengbojiang #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName 68*22ce4affSfengbojiang 69*22ce4affSfengbojiang 70*22ce4affSfengbojiang /** 71*22ce4affSfengbojiang Retrieves a 16-bit fixed PCD token value based on a token name. 72*22ce4affSfengbojiang 73*22ce4affSfengbojiang Returns the 16-bit value for the token specified by TokenName. 74*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 75*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 76*22ce4affSfengbojiang 77*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 78*22ce4affSfengbojiang 79*22ce4affSfengbojiang @return 16-bit value for the token specified by TokenName. 80*22ce4affSfengbojiang 81*22ce4affSfengbojiang **/ 82*22ce4affSfengbojiang #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName 83*22ce4affSfengbojiang 84*22ce4affSfengbojiang 85*22ce4affSfengbojiang /** 86*22ce4affSfengbojiang Retrieves a 32-bit fixed PCD token value based on a token name. 87*22ce4affSfengbojiang 88*22ce4affSfengbojiang Returns the 32-bit value for the token specified by TokenName. 89*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 90*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 91*22ce4affSfengbojiang 92*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 93*22ce4affSfengbojiang 94*22ce4affSfengbojiang @return 32-bit value for the token specified by TokenName. 95*22ce4affSfengbojiang 96*22ce4affSfengbojiang **/ 97*22ce4affSfengbojiang #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName 98*22ce4affSfengbojiang 99*22ce4affSfengbojiang 100*22ce4affSfengbojiang /** 101*22ce4affSfengbojiang Retrieves a 64-bit fixed PCD token value based on a token name. 102*22ce4affSfengbojiang 103*22ce4affSfengbojiang Returns the 64-bit value for the token specified by TokenName. 104*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 105*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 106*22ce4affSfengbojiang 107*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 108*22ce4affSfengbojiang 109*22ce4affSfengbojiang @return 64-bit value for the token specified by TokenName. 110*22ce4affSfengbojiang 111*22ce4affSfengbojiang **/ 112*22ce4affSfengbojiang #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName 113*22ce4affSfengbojiang 114*22ce4affSfengbojiang 115*22ce4affSfengbojiang /** 116*22ce4affSfengbojiang Retrieves a Boolean fixed PCD token value based on a token name. 117*22ce4affSfengbojiang 118*22ce4affSfengbojiang Returns the Boolean value for the token specified by TokenName. 119*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 120*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 121*22ce4affSfengbojiang 122*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 123*22ce4affSfengbojiang 124*22ce4affSfengbojiang @return The Boolean value for the token. 125*22ce4affSfengbojiang 126*22ce4affSfengbojiang **/ 127*22ce4affSfengbojiang #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName 128*22ce4affSfengbojiang 129*22ce4affSfengbojiang 130*22ce4affSfengbojiang /** 131*22ce4affSfengbojiang Retrieves a pointer to a fixed PCD token buffer based on a token name. 132*22ce4affSfengbojiang 133*22ce4affSfengbojiang Returns a pointer to the buffer for the token specified by TokenName. 134*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 135*22ce4affSfengbojiang If TokenName is not a fixed at build PCD, then the module will not build. 136*22ce4affSfengbojiang 137*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 138*22ce4affSfengbojiang 139*22ce4affSfengbojiang @return A pointer to the buffer. 140*22ce4affSfengbojiang 141*22ce4affSfengbojiang **/ 142*22ce4affSfengbojiang #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName) 143*22ce4affSfengbojiang 144*22ce4affSfengbojiang 145*22ce4affSfengbojiang /** 146*22ce4affSfengbojiang Retrieves an 8-bit binary patchable PCD token value based on a token name. 147*22ce4affSfengbojiang 148*22ce4affSfengbojiang Returns the 8-bit value for the token specified by TokenName. 149*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 150*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 151*22ce4affSfengbojiang 152*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 153*22ce4affSfengbojiang 154*22ce4affSfengbojiang @return An 8-bit binary patchable PCD token value. 155*22ce4affSfengbojiang 156*22ce4affSfengbojiang **/ 157*22ce4affSfengbojiang #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName 158*22ce4affSfengbojiang 159*22ce4affSfengbojiang /** 160*22ce4affSfengbojiang Retrieves a 16-bit binary patchable PCD token value based on a token name. 161*22ce4affSfengbojiang 162*22ce4affSfengbojiang Returns the 16-bit value for the token specified by TokenName. 163*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 164*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 165*22ce4affSfengbojiang 166*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 167*22ce4affSfengbojiang 168*22ce4affSfengbojiang @return A 16-bit binary patchable PCD token value. 169*22ce4affSfengbojiang 170*22ce4affSfengbojiang **/ 171*22ce4affSfengbojiang #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName 172*22ce4affSfengbojiang 173*22ce4affSfengbojiang 174*22ce4affSfengbojiang /** 175*22ce4affSfengbojiang Retrieves a 32-bit binary patchable PCD token value based on a token name. 176*22ce4affSfengbojiang 177*22ce4affSfengbojiang Returns the 32-bit value for the token specified by TokenName. 178*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 179*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 180*22ce4affSfengbojiang 181*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 182*22ce4affSfengbojiang 183*22ce4affSfengbojiang @return A 32-bit binary patchable PCD token value. 184*22ce4affSfengbojiang 185*22ce4affSfengbojiang **/ 186*22ce4affSfengbojiang #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName 187*22ce4affSfengbojiang 188*22ce4affSfengbojiang 189*22ce4affSfengbojiang /** 190*22ce4affSfengbojiang Retrieves a 64-bit binary patchable PCD token value based on a token name. 191*22ce4affSfengbojiang 192*22ce4affSfengbojiang Returns the 64-bit value for the token specified by TokenName. 193*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 194*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 195*22ce4affSfengbojiang 196*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 197*22ce4affSfengbojiang 198*22ce4affSfengbojiang @return A 64-bit binary patchable PCD token value. 199*22ce4affSfengbojiang 200*22ce4affSfengbojiang **/ 201*22ce4affSfengbojiang #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName 202*22ce4affSfengbojiang 203*22ce4affSfengbojiang 204*22ce4affSfengbojiang /** 205*22ce4affSfengbojiang Retrieves a Boolean binary patchable PCD token value based on a token name. 206*22ce4affSfengbojiang 207*22ce4affSfengbojiang Returns the Boolean value for the token specified by TokenName. 208*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 209*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 210*22ce4affSfengbojiang 211*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 212*22ce4affSfengbojiang 213*22ce4affSfengbojiang @return The Boolean value for the token. 214*22ce4affSfengbojiang 215*22ce4affSfengbojiang **/ 216*22ce4affSfengbojiang #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName 217*22ce4affSfengbojiang 218*22ce4affSfengbojiang 219*22ce4affSfengbojiang /** 220*22ce4affSfengbojiang Retrieves a pointer to a binary patchable PCD token buffer based on a token name. 221*22ce4affSfengbojiang 222*22ce4affSfengbojiang Returns a pointer to the buffer for the token specified by TokenName. 223*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 224*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 225*22ce4affSfengbojiang 226*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 227*22ce4affSfengbojiang 228*22ce4affSfengbojiang @return A pointer to the buffer for the token. 229*22ce4affSfengbojiang 230*22ce4affSfengbojiang **/ 231*22ce4affSfengbojiang #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName) 232*22ce4affSfengbojiang 233*22ce4affSfengbojiang 234*22ce4affSfengbojiang /** 235*22ce4affSfengbojiang Sets an 8-bit binary patchable PCD token value based on a token name. 236*22ce4affSfengbojiang 237*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenName. Value is returned. 238*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 239*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 240*22ce4affSfengbojiang 241*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 242*22ce4affSfengbojiang @param Value The 8-bit value to set. 243*22ce4affSfengbojiang 244*22ce4affSfengbojiang @return Return the Value that was set. 245*22ce4affSfengbojiang 246*22ce4affSfengbojiang **/ 247*22ce4affSfengbojiang #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 248*22ce4affSfengbojiang 249*22ce4affSfengbojiang 250*22ce4affSfengbojiang /** 251*22ce4affSfengbojiang Sets a 16-bit binary patchable PCD token value based on a token name. 252*22ce4affSfengbojiang 253*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenName. Value is returned. 254*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 255*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 256*22ce4affSfengbojiang 257*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 258*22ce4affSfengbojiang @param Value The 16-bit value to set. 259*22ce4affSfengbojiang 260*22ce4affSfengbojiang @return Return the Value that was set. 261*22ce4affSfengbojiang 262*22ce4affSfengbojiang **/ 263*22ce4affSfengbojiang #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 264*22ce4affSfengbojiang 265*22ce4affSfengbojiang 266*22ce4affSfengbojiang /** 267*22ce4affSfengbojiang Sets a 32-bit binary patchable PCD token value based on a token name. 268*22ce4affSfengbojiang 269*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenName. Value is returned. 270*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 271*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 272*22ce4affSfengbojiang 273*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 274*22ce4affSfengbojiang @param Value The 32-bit value to set. 275*22ce4affSfengbojiang 276*22ce4affSfengbojiang @return Return the Value that was set. 277*22ce4affSfengbojiang 278*22ce4affSfengbojiang **/ 279*22ce4affSfengbojiang #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 280*22ce4affSfengbojiang 281*22ce4affSfengbojiang 282*22ce4affSfengbojiang /** 283*22ce4affSfengbojiang Sets a 64-bit binary patchable PCD token value based on a token name. 284*22ce4affSfengbojiang 285*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenName. Value is returned. 286*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 287*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 288*22ce4affSfengbojiang 289*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 290*22ce4affSfengbojiang @param Value The 64-bit value to set. 291*22ce4affSfengbojiang 292*22ce4affSfengbojiang @return Return the Value that was set. 293*22ce4affSfengbojiang 294*22ce4affSfengbojiang **/ 295*22ce4affSfengbojiang #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 296*22ce4affSfengbojiang 297*22ce4affSfengbojiang 298*22ce4affSfengbojiang /** 299*22ce4affSfengbojiang Sets a Boolean binary patchable PCD token value based on a token name. 300*22ce4affSfengbojiang 301*22ce4affSfengbojiang Sets the Boolean value for the token specified by TokenName. Value is returned. 302*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 303*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 304*22ce4affSfengbojiang 305*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 306*22ce4affSfengbojiang @param Value The boolean value to set. 307*22ce4affSfengbojiang 308*22ce4affSfengbojiang @return Return the Value that was set. 309*22ce4affSfengbojiang 310*22ce4affSfengbojiang **/ 311*22ce4affSfengbojiang #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 312*22ce4affSfengbojiang 313*22ce4affSfengbojiang 314*22ce4affSfengbojiang /** 315*22ce4affSfengbojiang Sets a pointer to a binary patchable PCD token buffer based on a token name. 316*22ce4affSfengbojiang 317*22ce4affSfengbojiang Sets the buffer for the token specified by TokenName. Buffer is returned. 318*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer 319*22ce4affSfengbojiang to the maximum size supported by TokenName and return NULL to indicate that the set operation 320*22ce4affSfengbojiang was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be 321*22ce4affSfengbojiang set to the maximum size supported by TokenName and NULL must be returned. 322*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 323*22ce4affSfengbojiang If TokenName is not a patchable in module PCD, then the module will not build. 324*22ce4affSfengbojiang 325*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 326*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 327*22ce4affSfengbojiang 328*22ce4affSfengbojiang @param TokenName The name of the binary patchable PCD token to set the current value for. 329*22ce4affSfengbojiang @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 330*22ce4affSfengbojiang @param Buffer Pointer to the value to set. 331*22ce4affSfengbojiang 332*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 333*22ce4affSfengbojiang 334*22ce4affSfengbojiang **/ 335*22ce4affSfengbojiang #define PatchPcdSetPtr(TokenName, Size, Buffer) \ 336*22ce4affSfengbojiang LibPatchPcdSetPtrAndSize ( \ 337*22ce4affSfengbojiang (VOID *)_gPcd_BinaryPatch_##TokenName, \ 338*22ce4affSfengbojiang &_gPcd_BinaryPatch_Size_##TokenName, \ 339*22ce4affSfengbojiang (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \ 340*22ce4affSfengbojiang (Size), \ 341*22ce4affSfengbojiang (Buffer) \ 342*22ce4affSfengbojiang ) 343*22ce4affSfengbojiang /** 344*22ce4affSfengbojiang Retrieves an 8-bit PCD token value based on a token name. 345*22ce4affSfengbojiang 346*22ce4affSfengbojiang Returns the 8-bit value for the token specified by TokenName. 347*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 348*22ce4affSfengbojiang 349*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 350*22ce4affSfengbojiang 351*22ce4affSfengbojiang @return 8-bit value for the token specified by TokenName. 352*22ce4affSfengbojiang 353*22ce4affSfengbojiang **/ 354*22ce4affSfengbojiang #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName 355*22ce4affSfengbojiang 356*22ce4affSfengbojiang 357*22ce4affSfengbojiang /** 358*22ce4affSfengbojiang Retrieves a 16-bit PCD token value based on a token name. 359*22ce4affSfengbojiang 360*22ce4affSfengbojiang Returns the 16-bit value for the token specified by TokenName. 361*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 362*22ce4affSfengbojiang 363*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 364*22ce4affSfengbojiang 365*22ce4affSfengbojiang @return 16-bit value for the token specified by TokenName. 366*22ce4affSfengbojiang 367*22ce4affSfengbojiang **/ 368*22ce4affSfengbojiang #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName 369*22ce4affSfengbojiang 370*22ce4affSfengbojiang 371*22ce4affSfengbojiang /** 372*22ce4affSfengbojiang Retrieves a 32-bit PCD token value based on a token name. 373*22ce4affSfengbojiang 374*22ce4affSfengbojiang Returns the 32-bit value for the token specified by TokenName. 375*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 376*22ce4affSfengbojiang 377*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 378*22ce4affSfengbojiang 379*22ce4affSfengbojiang @return 32-bit value for the token specified by TokenName. 380*22ce4affSfengbojiang 381*22ce4affSfengbojiang **/ 382*22ce4affSfengbojiang #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName 383*22ce4affSfengbojiang 384*22ce4affSfengbojiang 385*22ce4affSfengbojiang /** 386*22ce4affSfengbojiang Retrieves a 64-bit PCD token value based on a token name. 387*22ce4affSfengbojiang 388*22ce4affSfengbojiang Returns the 64-bit value for the token specified by TokenName. 389*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 390*22ce4affSfengbojiang 391*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 392*22ce4affSfengbojiang 393*22ce4affSfengbojiang @return 64-bit value for the token specified by TokenName. 394*22ce4affSfengbojiang 395*22ce4affSfengbojiang **/ 396*22ce4affSfengbojiang #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName 397*22ce4affSfengbojiang 398*22ce4affSfengbojiang 399*22ce4affSfengbojiang /** 400*22ce4affSfengbojiang Retrieves a pointer to a PCD token buffer based on a token name. 401*22ce4affSfengbojiang 402*22ce4affSfengbojiang Returns a pointer to the buffer for the token specified by TokenName. 403*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 404*22ce4affSfengbojiang 405*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 406*22ce4affSfengbojiang 407*22ce4affSfengbojiang @return A pointer to the buffer. 408*22ce4affSfengbojiang 409*22ce4affSfengbojiang **/ 410*22ce4affSfengbojiang #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName 411*22ce4affSfengbojiang 412*22ce4affSfengbojiang 413*22ce4affSfengbojiang /** 414*22ce4affSfengbojiang Retrieves a Boolean PCD token value based on a token name. 415*22ce4affSfengbojiang 416*22ce4affSfengbojiang Returns the Boolean value for the token specified by TokenName. 417*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 418*22ce4affSfengbojiang 419*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 420*22ce4affSfengbojiang 421*22ce4affSfengbojiang @return A Boolean PCD token value. 422*22ce4affSfengbojiang 423*22ce4affSfengbojiang **/ 424*22ce4affSfengbojiang #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName 425*22ce4affSfengbojiang 426*22ce4affSfengbojiang 427*22ce4affSfengbojiang /** 428*22ce4affSfengbojiang Retrieves the size of a fixed PCD token based on a token name. 429*22ce4affSfengbojiang 430*22ce4affSfengbojiang Returns the size of the token specified by TokenName. 431*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 432*22ce4affSfengbojiang 433*22ce4affSfengbojiang @param[in] TokenName The name of the PCD token to retrieve a current value size for. 434*22ce4affSfengbojiang 435*22ce4affSfengbojiang @return Return the size 436*22ce4affSfengbojiang 437*22ce4affSfengbojiang **/ 438*22ce4affSfengbojiang #define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName 439*22ce4affSfengbojiang 440*22ce4affSfengbojiang 441*22ce4affSfengbojiang /** 442*22ce4affSfengbojiang Retrieves the size of a binary patchable PCD token based on a token name. 443*22ce4affSfengbojiang 444*22ce4affSfengbojiang Returns the size of the token specified by TokenName. 445*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 446*22ce4affSfengbojiang 447*22ce4affSfengbojiang @param[in] TokenName The name of the PCD token to retrieve a current value size for. 448*22ce4affSfengbojiang 449*22ce4affSfengbojiang @return Return the size 450*22ce4affSfengbojiang 451*22ce4affSfengbojiang **/ 452*22ce4affSfengbojiang #define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName 453*22ce4affSfengbojiang 454*22ce4affSfengbojiang 455*22ce4affSfengbojiang /** 456*22ce4affSfengbojiang Retrieves the size of the PCD token based on a token name. 457*22ce4affSfengbojiang 458*22ce4affSfengbojiang Returns the size of the token specified by TokenName. 459*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 460*22ce4affSfengbojiang 461*22ce4affSfengbojiang @param[in] TokenName The name of the PCD token to retrieve a current value size for. 462*22ce4affSfengbojiang 463*22ce4affSfengbojiang @return Return the size 464*22ce4affSfengbojiang 465*22ce4affSfengbojiang **/ 466*22ce4affSfengbojiang #define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName 467*22ce4affSfengbojiang 468*22ce4affSfengbojiang 469*22ce4affSfengbojiang /** 470*22ce4affSfengbojiang Retrieve the size of a given PCD token. 471*22ce4affSfengbojiang 472*22ce4affSfengbojiang Returns the size of the token specified by TokenNumber and Guid. 473*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 474*22ce4affSfengbojiang 475*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 476*22ce4affSfengbojiang which namespace to retrieve a value from. 477*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value size for. 478*22ce4affSfengbojiang 479*22ce4affSfengbojiang @return Return the size. 480*22ce4affSfengbojiang 481*22ce4affSfengbojiang **/ 482*22ce4affSfengbojiang #define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName)) 483*22ce4affSfengbojiang 484*22ce4affSfengbojiang #ifndef DISABLE_NEW_DEPRECATED_INTERFACES 485*22ce4affSfengbojiang /** 486*22ce4affSfengbojiang Sets an 8-bit PCD token value based on a token name. 487*22ce4affSfengbojiang 488*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenName. Value is returned. 489*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 490*22ce4affSfengbojiang 491*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 492*22ce4affSfengbojiang @param Value The 8-bit value to set. 493*22ce4affSfengbojiang 494*22ce4affSfengbojiang @return Return the Value that was set. 495*22ce4affSfengbojiang 496*22ce4affSfengbojiang **/ 497*22ce4affSfengbojiang #define PcdSet8(TokenName, Value) _PCD_SET_MODE_8_##TokenName ((Value)) 498*22ce4affSfengbojiang 499*22ce4affSfengbojiang 500*22ce4affSfengbojiang /** 501*22ce4affSfengbojiang Sets a 16-bit PCD token value based on a token name. 502*22ce4affSfengbojiang 503*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenName. Value is returned. 504*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 505*22ce4affSfengbojiang 506*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 507*22ce4affSfengbojiang @param Value The 16-bit value to set. 508*22ce4affSfengbojiang 509*22ce4affSfengbojiang @return Return the Value that was set. 510*22ce4affSfengbojiang 511*22ce4affSfengbojiang **/ 512*22ce4affSfengbojiang #define PcdSet16(TokenName, Value) _PCD_SET_MODE_16_##TokenName ((Value)) 513*22ce4affSfengbojiang 514*22ce4affSfengbojiang 515*22ce4affSfengbojiang /** 516*22ce4affSfengbojiang Sets a 32-bit PCD token value based on a token name. 517*22ce4affSfengbojiang 518*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenName. Value is returned. 519*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 520*22ce4affSfengbojiang 521*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 522*22ce4affSfengbojiang @param Value The 32-bit value to set. 523*22ce4affSfengbojiang 524*22ce4affSfengbojiang @return Return the Value that was set. 525*22ce4affSfengbojiang 526*22ce4affSfengbojiang **/ 527*22ce4affSfengbojiang #define PcdSet32(TokenName, Value) _PCD_SET_MODE_32_##TokenName ((Value)) 528*22ce4affSfengbojiang 529*22ce4affSfengbojiang 530*22ce4affSfengbojiang /** 531*22ce4affSfengbojiang Sets a 64-bit PCD token value based on a token name. 532*22ce4affSfengbojiang 533*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenName. Value is returned. 534*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 535*22ce4affSfengbojiang 536*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 537*22ce4affSfengbojiang @param Value The 64-bit value to set. 538*22ce4affSfengbojiang 539*22ce4affSfengbojiang @return Return the Value that was set. 540*22ce4affSfengbojiang 541*22ce4affSfengbojiang **/ 542*22ce4affSfengbojiang #define PcdSet64(TokenName, Value) _PCD_SET_MODE_64_##TokenName ((Value)) 543*22ce4affSfengbojiang 544*22ce4affSfengbojiang 545*22ce4affSfengbojiang /** 546*22ce4affSfengbojiang Sets a pointer to a PCD token buffer based on a token name. 547*22ce4affSfengbojiang 548*22ce4affSfengbojiang Sets the buffer for the token specified by TokenName. Buffer is returned. 549*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size supported by TokenName, 550*22ce4affSfengbojiang then set SizeOfBuffer to the maximum size supported by TokenName and return NULL 551*22ce4affSfengbojiang to indicate that the set operation was not actually performed. If SizeOfBuffer 552*22ce4affSfengbojiang is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported 553*22ce4affSfengbojiang by TokenName and NULL must be returned. 554*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 555*22ce4affSfengbojiang 556*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 557*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 558*22ce4affSfengbojiang 559*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 560*22ce4affSfengbojiang @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 561*22ce4affSfengbojiang @param Buffer A pointer to the buffer to set. 562*22ce4affSfengbojiang 563*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 564*22ce4affSfengbojiang 565*22ce4affSfengbojiang **/ 566*22ce4affSfengbojiang #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \ 567*22ce4affSfengbojiang _PCD_SET_MODE_PTR_##TokenName ((SizeOfBuffer), (Buffer)) 568*22ce4affSfengbojiang 569*22ce4affSfengbojiang /** 570*22ce4affSfengbojiang Sets a Boolean PCD token value based on a token name. 571*22ce4affSfengbojiang 572*22ce4affSfengbojiang Sets the Boolean value for the token specified by TokenName. Value is returned. 573*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 574*22ce4affSfengbojiang 575*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 576*22ce4affSfengbojiang @param Buffer The Boolean value to set. 577*22ce4affSfengbojiang 578*22ce4affSfengbojiang @return Return the Value that was set. 579*22ce4affSfengbojiang 580*22ce4affSfengbojiang **/ 581*22ce4affSfengbojiang #define PcdSetBool(TokenName, Value) _PCD_SET_MODE_BOOL_##TokenName ((Value)) 582*22ce4affSfengbojiang #endif 583*22ce4affSfengbojiang 584*22ce4affSfengbojiang /** 585*22ce4affSfengbojiang Sets a 8-bit PCD token value based on a token name. 586*22ce4affSfengbojiang 587*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenName. 588*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 589*22ce4affSfengbojiang 590*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 591*22ce4affSfengbojiang @param Value The 8-bit value to set. 592*22ce4affSfengbojiang 593*22ce4affSfengbojiang @return The status of the set operation. 594*22ce4affSfengbojiang 595*22ce4affSfengbojiang **/ 596*22ce4affSfengbojiang #define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value)) 597*22ce4affSfengbojiang 598*22ce4affSfengbojiang /** 599*22ce4affSfengbojiang Sets a 16-bit PCD token value based on a token name. 600*22ce4affSfengbojiang 601*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenName. 602*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 603*22ce4affSfengbojiang 604*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 605*22ce4affSfengbojiang @param Value The 16-bit value to set. 606*22ce4affSfengbojiang 607*22ce4affSfengbojiang @return The status of the set operation. 608*22ce4affSfengbojiang 609*22ce4affSfengbojiang **/ 610*22ce4affSfengbojiang #define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value)) 611*22ce4affSfengbojiang 612*22ce4affSfengbojiang /** 613*22ce4affSfengbojiang Sets a 32-bit PCD token value based on a token name. 614*22ce4affSfengbojiang 615*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenName. 616*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 617*22ce4affSfengbojiang 618*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 619*22ce4affSfengbojiang @param Value The 32-bit value to set. 620*22ce4affSfengbojiang 621*22ce4affSfengbojiang @return The status of the set operation. 622*22ce4affSfengbojiang 623*22ce4affSfengbojiang **/ 624*22ce4affSfengbojiang #define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value)) 625*22ce4affSfengbojiang 626*22ce4affSfengbojiang /** 627*22ce4affSfengbojiang Sets a 64-bit PCD token value based on a token name. 628*22ce4affSfengbojiang 629*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenName. 630*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 631*22ce4affSfengbojiang 632*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 633*22ce4affSfengbojiang @param Value The 64-bit value to set. 634*22ce4affSfengbojiang 635*22ce4affSfengbojiang @return The status of the set operation. 636*22ce4affSfengbojiang 637*22ce4affSfengbojiang **/ 638*22ce4affSfengbojiang #define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value)) 639*22ce4affSfengbojiang 640*22ce4affSfengbojiang /** 641*22ce4affSfengbojiang Sets a pointer to a PCD token buffer based on a token name. 642*22ce4affSfengbojiang 643*22ce4affSfengbojiang Sets the buffer for the token specified by TokenName. 644*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size supported by TokenName, 645*22ce4affSfengbojiang then set SizeOfBuffer to the maximum size supported by TokenName and return 646*22ce4affSfengbojiang RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed. 647*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size 648*22ce4affSfengbojiang supported by TokenName and RETURN_INVALID_PARAMETER must be returned. 649*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 650*22ce4affSfengbojiang 651*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 652*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 653*22ce4affSfengbojiang 654*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 655*22ce4affSfengbojiang @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 656*22ce4affSfengbojiang @param Buffer A pointer to the buffer to set. 657*22ce4affSfengbojiang 658*22ce4affSfengbojiang @return The status of the set operation. 659*22ce4affSfengbojiang 660*22ce4affSfengbojiang **/ 661*22ce4affSfengbojiang #define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \ 662*22ce4affSfengbojiang _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer)) 663*22ce4affSfengbojiang 664*22ce4affSfengbojiang 665*22ce4affSfengbojiang 666*22ce4affSfengbojiang /** 667*22ce4affSfengbojiang Sets a boolean PCD token value based on a token name. 668*22ce4affSfengbojiang 669*22ce4affSfengbojiang Sets the boolean value for the token specified by TokenName. 670*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 671*22ce4affSfengbojiang 672*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 673*22ce4affSfengbojiang @param Value The boolean value to set. 674*22ce4affSfengbojiang 675*22ce4affSfengbojiang @return The status of the set operation. 676*22ce4affSfengbojiang 677*22ce4affSfengbojiang **/ 678*22ce4affSfengbojiang #define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value)) 679*22ce4affSfengbojiang 680*22ce4affSfengbojiang /** 681*22ce4affSfengbojiang Retrieves a token number based on a GUID and a token name. 682*22ce4affSfengbojiang 683*22ce4affSfengbojiang Returns the token number for the token specified by Guid and TokenName. 684*22ce4affSfengbojiang If TokenName is not a valid token in the token space, then the module will not build. 685*22ce4affSfengbojiang 686*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 687*22ce4affSfengbojiang which namespace to retrieve a value from. 688*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 689*22ce4affSfengbojiang 690*22ce4affSfengbojiang @return Return the token number. 691*22ce4affSfengbojiang 692*22ce4affSfengbojiang **/ 693*22ce4affSfengbojiang #define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid) 694*22ce4affSfengbojiang 695*22ce4affSfengbojiang /** 696*22ce4affSfengbojiang Retrieves an 8-bit PCD token value based on a GUID and a token name. 697*22ce4affSfengbojiang 698*22ce4affSfengbojiang Returns the 8-bit value for the token specified by Guid and TokenName. 699*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 700*22ce4affSfengbojiang then the module will not build. 701*22ce4affSfengbojiang 702*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 703*22ce4affSfengbojiang 704*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 705*22ce4affSfengbojiang which namespace to retrieve a value from. 706*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 707*22ce4affSfengbojiang 708*22ce4affSfengbojiang @return An 8-bit PCD token value. 709*22ce4affSfengbojiang 710*22ce4affSfengbojiang **/ 711*22ce4affSfengbojiang #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName)) 712*22ce4affSfengbojiang 713*22ce4affSfengbojiang /** 714*22ce4affSfengbojiang Retrieves a 16-bit PCD token value based on a GUID and a token name. 715*22ce4affSfengbojiang 716*22ce4affSfengbojiang Returns the 16-bit value for the token specified by Guid and TokenName. 717*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 718*22ce4affSfengbojiang then the module will not build. 719*22ce4affSfengbojiang 720*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 721*22ce4affSfengbojiang 722*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 723*22ce4affSfengbojiang which namespace to retrieve a value from. 724*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 725*22ce4affSfengbojiang 726*22ce4affSfengbojiang @return A 16-bit PCD token value. 727*22ce4affSfengbojiang 728*22ce4affSfengbojiang **/ 729*22ce4affSfengbojiang #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName)) 730*22ce4affSfengbojiang 731*22ce4affSfengbojiang 732*22ce4affSfengbojiang /** 733*22ce4affSfengbojiang Retrieves a 32-bit PCD token value based on a GUID and a token name. 734*22ce4affSfengbojiang 735*22ce4affSfengbojiang Returns the 32-bit value for the token specified by Guid and TokenName. 736*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 737*22ce4affSfengbojiang then the module will not build. 738*22ce4affSfengbojiang 739*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 740*22ce4affSfengbojiang 741*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 742*22ce4affSfengbojiang which namespace to retrieve a value from. 743*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 744*22ce4affSfengbojiang 745*22ce4affSfengbojiang @return A 32-bit PCD token value. 746*22ce4affSfengbojiang 747*22ce4affSfengbojiang **/ 748*22ce4affSfengbojiang #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName)) 749*22ce4affSfengbojiang 750*22ce4affSfengbojiang 751*22ce4affSfengbojiang /** 752*22ce4affSfengbojiang Retrieves a 64-bit PCD token value based on a GUID and a token name. 753*22ce4affSfengbojiang 754*22ce4affSfengbojiang Returns the 64-bit value for the token specified by Guid and TokenName. 755*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 756*22ce4affSfengbojiang then the module will not build. 757*22ce4affSfengbojiang 758*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 759*22ce4affSfengbojiang 760*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 761*22ce4affSfengbojiang which namespace to retrieve a value from. 762*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 763*22ce4affSfengbojiang 764*22ce4affSfengbojiang @return A 64-bit PCD token value. 765*22ce4affSfengbojiang 766*22ce4affSfengbojiang **/ 767*22ce4affSfengbojiang #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName)) 768*22ce4affSfengbojiang 769*22ce4affSfengbojiang 770*22ce4affSfengbojiang /** 771*22ce4affSfengbojiang Retrieves a pointer to a PCD token buffer based on a GUID and a token name. 772*22ce4affSfengbojiang 773*22ce4affSfengbojiang Returns a pointer to the buffer for the token specified by Guid and TokenName. 774*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 775*22ce4affSfengbojiang then the module will not build. 776*22ce4affSfengbojiang 777*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 778*22ce4affSfengbojiang 779*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 780*22ce4affSfengbojiang which namespace to retrieve a value from. 781*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 782*22ce4affSfengbojiang 783*22ce4affSfengbojiang @return A pointer to a PCD token buffer. 784*22ce4affSfengbojiang 785*22ce4affSfengbojiang **/ 786*22ce4affSfengbojiang #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName)) 787*22ce4affSfengbojiang 788*22ce4affSfengbojiang 789*22ce4affSfengbojiang /** 790*22ce4affSfengbojiang Retrieves a Boolean PCD token value based on a GUID and a token name. 791*22ce4affSfengbojiang 792*22ce4affSfengbojiang Returns the Boolean value for the token specified by Guid and TokenName. 793*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 794*22ce4affSfengbojiang then the module will not build. 795*22ce4affSfengbojiang 796*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 797*22ce4affSfengbojiang 798*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 799*22ce4affSfengbojiang which namespace to retrieve a value from. 800*22ce4affSfengbojiang @param TokenName The name of the PCD token to retrieve a current value for. 801*22ce4affSfengbojiang 802*22ce4affSfengbojiang @return A Boolean PCD token value. 803*22ce4affSfengbojiang 804*22ce4affSfengbojiang **/ 805*22ce4affSfengbojiang #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName)) 806*22ce4affSfengbojiang 807*22ce4affSfengbojiang 808*22ce4affSfengbojiang 809*22ce4affSfengbojiang #ifndef DISABLE_NEW_DEPRECATED_INTERFACES 810*22ce4affSfengbojiang /** 811*22ce4affSfengbojiang Sets an 8-bit PCD token value based on a GUID and a token name. 812*22ce4affSfengbojiang 813*22ce4affSfengbojiang Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned. 814*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 815*22ce4affSfengbojiang then the module will not build. 816*22ce4affSfengbojiang 817*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 818*22ce4affSfengbojiang 819*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 820*22ce4affSfengbojiang which namespace to retrieve a value from. 821*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 822*22ce4affSfengbojiang @param Value The 8-bit value to set. 823*22ce4affSfengbojiang 824*22ce4affSfengbojiang @return Return the Value that was set. 825*22ce4affSfengbojiang 826*22ce4affSfengbojiang **/ 827*22ce4affSfengbojiang #define PcdSetEx8(Guid, TokenName, Value) LibPcdSetEx8 ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 828*22ce4affSfengbojiang 829*22ce4affSfengbojiang 830*22ce4affSfengbojiang /** 831*22ce4affSfengbojiang Sets a 16-bit PCD token value based on a GUID and a token name. 832*22ce4affSfengbojiang 833*22ce4affSfengbojiang Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned. 834*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 835*22ce4affSfengbojiang then the module will not build. 836*22ce4affSfengbojiang 837*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 838*22ce4affSfengbojiang 839*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 840*22ce4affSfengbojiang which namespace to retrieve a value from. 841*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 842*22ce4affSfengbojiang @param Value The 16-bit value to set. 843*22ce4affSfengbojiang 844*22ce4affSfengbojiang @return Return the Value that was set. 845*22ce4affSfengbojiang 846*22ce4affSfengbojiang **/ 847*22ce4affSfengbojiang #define PcdSetEx16(Guid, TokenName, Value) LibPcdSetEx16 ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 848*22ce4affSfengbojiang 849*22ce4affSfengbojiang 850*22ce4affSfengbojiang /** 851*22ce4affSfengbojiang Sets a 32-bit PCD token value based on a GUID and a token name. 852*22ce4affSfengbojiang 853*22ce4affSfengbojiang Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned. 854*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 855*22ce4affSfengbojiang then the module will not build. 856*22ce4affSfengbojiang 857*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 858*22ce4affSfengbojiang 859*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 860*22ce4affSfengbojiang which namespace to retrieve a value from. 861*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 862*22ce4affSfengbojiang @param Value The 32-bit value to set. 863*22ce4affSfengbojiang 864*22ce4affSfengbojiang @return Return the Value that was set. 865*22ce4affSfengbojiang 866*22ce4affSfengbojiang **/ 867*22ce4affSfengbojiang #define PcdSetEx32(Guid, TokenName, Value) LibPcdSetEx32 ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 868*22ce4affSfengbojiang 869*22ce4affSfengbojiang 870*22ce4affSfengbojiang /** 871*22ce4affSfengbojiang Sets a 64-bit PCD token value based on a GUID and a token name. 872*22ce4affSfengbojiang 873*22ce4affSfengbojiang Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned. 874*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 875*22ce4affSfengbojiang then the module will not build. 876*22ce4affSfengbojiang 877*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 878*22ce4affSfengbojiang 879*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 880*22ce4affSfengbojiang which namespace to retrieve a value from. 881*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 882*22ce4affSfengbojiang @param Value The 64-bit value to set. 883*22ce4affSfengbojiang 884*22ce4affSfengbojiang @return Return the Value that was set. 885*22ce4affSfengbojiang 886*22ce4affSfengbojiang **/ 887*22ce4affSfengbojiang #define PcdSetEx64(Guid, TokenName, Value) LibPcdSetEx64 ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 888*22ce4affSfengbojiang 889*22ce4affSfengbojiang 890*22ce4affSfengbojiang /** 891*22ce4affSfengbojiang Sets a pointer to a PCD token buffer based on a GUID and a token name. 892*22ce4affSfengbojiang 893*22ce4affSfengbojiang Sets the buffer for the token specified by Guid and TokenName. Buffer is returned. 894*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName, 895*22ce4affSfengbojiang then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return 896*22ce4affSfengbojiang NULL to indicate that the set operation was not actually performed. If SizeOfBuffer 897*22ce4affSfengbojiang is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by 898*22ce4affSfengbojiang Guid and TokenName and NULL must be returned. 899*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 900*22ce4affSfengbojiang then the module will not build. 901*22ce4affSfengbojiang 902*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 903*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 904*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 905*22ce4affSfengbojiang 906*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 907*22ce4affSfengbojiang which namespace to retrieve a value from. 908*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 909*22ce4affSfengbojiang @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 910*22ce4affSfengbojiang @param Buffer Pointer to the buffer to set. 911*22ce4affSfengbojiang 912*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 913*22ce4affSfengbojiang 914*22ce4affSfengbojiang **/ 915*22ce4affSfengbojiang #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \ 916*22ce4affSfengbojiang LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer)) 917*22ce4affSfengbojiang 918*22ce4affSfengbojiang 919*22ce4affSfengbojiang /** 920*22ce4affSfengbojiang Sets a Boolean PCD token value based on a GUID and a token name. 921*22ce4affSfengbojiang 922*22ce4affSfengbojiang Sets the Boolean value for the token specified by Guid and TokenName. Value is returned. 923*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 924*22ce4affSfengbojiang then the module will not build. 925*22ce4affSfengbojiang 926*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 927*22ce4affSfengbojiang 928*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 929*22ce4affSfengbojiang which namespace to retrieve a value from. 930*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 931*22ce4affSfengbojiang @param Value The Boolean value to set. 932*22ce4affSfengbojiang 933*22ce4affSfengbojiang @return Return the Value that was set. 934*22ce4affSfengbojiang 935*22ce4affSfengbojiang **/ 936*22ce4affSfengbojiang #define PcdSetExBool(Guid, TokenName, Value) \ 937*22ce4affSfengbojiang LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value)) 938*22ce4affSfengbojiang #endif 939*22ce4affSfengbojiang 940*22ce4affSfengbojiang /** 941*22ce4affSfengbojiang Sets an 8-bit PCD token value based on a GUID and a token name. 942*22ce4affSfengbojiang 943*22ce4affSfengbojiang Sets the 8-bit value for the token specified by Guid and TokenName. 944*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 945*22ce4affSfengbojiang then the module will not build. 946*22ce4affSfengbojiang 947*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 948*22ce4affSfengbojiang 949*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 950*22ce4affSfengbojiang which namespace to retrieve a value from. 951*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 952*22ce4affSfengbojiang @param Value The 8-bit value to set. 953*22ce4affSfengbojiang 954*22ce4affSfengbojiang @return The status of the set operation. 955*22ce4affSfengbojiang 956*22ce4affSfengbojiang **/ 957*22ce4affSfengbojiang #define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 958*22ce4affSfengbojiang 959*22ce4affSfengbojiang /** 960*22ce4affSfengbojiang Sets an 16-bit PCD token value based on a GUID and a token name. 961*22ce4affSfengbojiang 962*22ce4affSfengbojiang Sets the 16-bit value for the token specified by Guid and TokenName. 963*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 964*22ce4affSfengbojiang then the module will not build. 965*22ce4affSfengbojiang 966*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 967*22ce4affSfengbojiang 968*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 969*22ce4affSfengbojiang which namespace to retrieve a value from. 970*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 971*22ce4affSfengbojiang @param Value The 16-bit value to set. 972*22ce4affSfengbojiang 973*22ce4affSfengbojiang @return The status of the set operation. 974*22ce4affSfengbojiang 975*22ce4affSfengbojiang **/ 976*22ce4affSfengbojiang #define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 977*22ce4affSfengbojiang 978*22ce4affSfengbojiang /** 979*22ce4affSfengbojiang Sets an 32-bit PCD token value based on a GUID and a token name. 980*22ce4affSfengbojiang 981*22ce4affSfengbojiang Sets the 32-bit value for the token specified by Guid and TokenName. 982*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 983*22ce4affSfengbojiang then the module will not build. 984*22ce4affSfengbojiang 985*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 986*22ce4affSfengbojiang 987*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 988*22ce4affSfengbojiang which namespace to retrieve a value from. 989*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 990*22ce4affSfengbojiang @param Value The 32-bit value to set. 991*22ce4affSfengbojiang 992*22ce4affSfengbojiang @return The status of the set operation. 993*22ce4affSfengbojiang 994*22ce4affSfengbojiang **/ 995*22ce4affSfengbojiang #define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 996*22ce4affSfengbojiang 997*22ce4affSfengbojiang /** 998*22ce4affSfengbojiang Sets an 64-bit PCD token value based on a GUID and a token name. 999*22ce4affSfengbojiang 1000*22ce4affSfengbojiang Sets the 64-bit value for the token specified by Guid and TokenName. 1001*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 1002*22ce4affSfengbojiang then the module will not build. 1003*22ce4affSfengbojiang 1004*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1005*22ce4affSfengbojiang 1006*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 1007*22ce4affSfengbojiang which namespace to retrieve a value from. 1008*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 1009*22ce4affSfengbojiang @param Value The 64-bit value to set. 1010*22ce4affSfengbojiang 1011*22ce4affSfengbojiang @return The status of the set operation. 1012*22ce4affSfengbojiang 1013*22ce4affSfengbojiang **/ 1014*22ce4affSfengbojiang #define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 1015*22ce4affSfengbojiang 1016*22ce4affSfengbojiang /** 1017*22ce4affSfengbojiang Sets a pointer to a PCD token buffer based on a GUID and a token name. 1018*22ce4affSfengbojiang 1019*22ce4affSfengbojiang Sets the buffer for the token specified by Guid and TokenName. 1020*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName, 1021*22ce4affSfengbojiang then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return 1022*22ce4affSfengbojiang RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed. 1023*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size 1024*22ce4affSfengbojiang supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned. 1025*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 1026*22ce4affSfengbojiang then the module will not build. 1027*22ce4affSfengbojiang 1028*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1029*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 1030*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1031*22ce4affSfengbojiang 1032*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 1033*22ce4affSfengbojiang which namespace to retrieve a value from. 1034*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 1035*22ce4affSfengbojiang @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1036*22ce4affSfengbojiang @param Buffer Pointer to the buffer to set. 1037*22ce4affSfengbojiang 1038*22ce4affSfengbojiang @return The status of the set operation. 1039*22ce4affSfengbojiang 1040*22ce4affSfengbojiang **/ 1041*22ce4affSfengbojiang #define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \ 1042*22ce4affSfengbojiang LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer)) 1043*22ce4affSfengbojiang 1044*22ce4affSfengbojiang 1045*22ce4affSfengbojiang /** 1046*22ce4affSfengbojiang Sets an boolean PCD token value based on a GUID and a token name. 1047*22ce4affSfengbojiang 1048*22ce4affSfengbojiang Sets the boolean value for the token specified by Guid and TokenName. 1049*22ce4affSfengbojiang If TokenName is not a valid token in the token space specified by Guid, 1050*22ce4affSfengbojiang then the module will not build. 1051*22ce4affSfengbojiang 1052*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1053*22ce4affSfengbojiang 1054*22ce4affSfengbojiang @param Guid Pointer to a 128-bit unique value that designates 1055*22ce4affSfengbojiang which namespace to retrieve a value from. 1056*22ce4affSfengbojiang @param TokenName The name of the PCD token to set the current value for. 1057*22ce4affSfengbojiang @param Value The boolean value to set. 1058*22ce4affSfengbojiang 1059*22ce4affSfengbojiang @return The status of the set operation. 1060*22ce4affSfengbojiang 1061*22ce4affSfengbojiang **/ 1062*22ce4affSfengbojiang #define PcdSetExBoolS(Guid, TokenName, Value) \ 1063*22ce4affSfengbojiang LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 1064*22ce4affSfengbojiang 1065*22ce4affSfengbojiang /** 1066*22ce4affSfengbojiang This function provides a means by which SKU support can be established in the PCD infrastructure. 1067*22ce4affSfengbojiang 1068*22ce4affSfengbojiang Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. 1069*22ce4affSfengbojiang 1070*22ce4affSfengbojiang @param SkuId The SKU value that will be used when the PCD service retrieves and sets values 1071*22ce4affSfengbojiang associated with a PCD token. 1072*22ce4affSfengbojiang 1073*22ce4affSfengbojiang @return Return the SKU ID that was set. 1074*22ce4affSfengbojiang 1075*22ce4affSfengbojiang **/ 1076*22ce4affSfengbojiang UINTN 1077*22ce4affSfengbojiang EFIAPI 1078*22ce4affSfengbojiang LibPcdSetSku ( 1079*22ce4affSfengbojiang IN UINTN SkuId 1080*22ce4affSfengbojiang ); 1081*22ce4affSfengbojiang 1082*22ce4affSfengbojiang 1083*22ce4affSfengbojiang /** 1084*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1085*22ce4affSfengbojiang 1086*22ce4affSfengbojiang Returns the 8-bit value for the token specified by TokenNumber. 1087*22ce4affSfengbojiang 1088*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1089*22ce4affSfengbojiang 1090*22ce4affSfengbojiang @return Returns the 8-bit value for the token specified by TokenNumber. 1091*22ce4affSfengbojiang 1092*22ce4affSfengbojiang **/ 1093*22ce4affSfengbojiang UINT8 1094*22ce4affSfengbojiang EFIAPI 1095*22ce4affSfengbojiang LibPcdGet8 ( 1096*22ce4affSfengbojiang IN UINTN TokenNumber 1097*22ce4affSfengbojiang ); 1098*22ce4affSfengbojiang 1099*22ce4affSfengbojiang 1100*22ce4affSfengbojiang /** 1101*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1102*22ce4affSfengbojiang 1103*22ce4affSfengbojiang Returns the 16-bit value for the token specified by TokenNumber. 1104*22ce4affSfengbojiang 1105*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1106*22ce4affSfengbojiang 1107*22ce4affSfengbojiang @return Returns the 16-bit value for the token specified by TokenNumber. 1108*22ce4affSfengbojiang 1109*22ce4affSfengbojiang **/ 1110*22ce4affSfengbojiang UINT16 1111*22ce4affSfengbojiang EFIAPI 1112*22ce4affSfengbojiang LibPcdGet16 ( 1113*22ce4affSfengbojiang IN UINTN TokenNumber 1114*22ce4affSfengbojiang ); 1115*22ce4affSfengbojiang 1116*22ce4affSfengbojiang 1117*22ce4affSfengbojiang /** 1118*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1119*22ce4affSfengbojiang 1120*22ce4affSfengbojiang Returns the 32-bit value for the token specified by TokenNumber. 1121*22ce4affSfengbojiang 1122*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1123*22ce4affSfengbojiang 1124*22ce4affSfengbojiang @return Returns the 32-bit value for the token specified by TokenNumber. 1125*22ce4affSfengbojiang 1126*22ce4affSfengbojiang **/ 1127*22ce4affSfengbojiang UINT32 1128*22ce4affSfengbojiang EFIAPI 1129*22ce4affSfengbojiang LibPcdGet32 ( 1130*22ce4affSfengbojiang IN UINTN TokenNumber 1131*22ce4affSfengbojiang ); 1132*22ce4affSfengbojiang 1133*22ce4affSfengbojiang 1134*22ce4affSfengbojiang /** 1135*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1136*22ce4affSfengbojiang 1137*22ce4affSfengbojiang Returns the 64-bit value for the token specified by TokenNumber. 1138*22ce4affSfengbojiang 1139*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1140*22ce4affSfengbojiang 1141*22ce4affSfengbojiang @return Returns the 64-bit value for the token specified by TokenNumber. 1142*22ce4affSfengbojiang 1143*22ce4affSfengbojiang **/ 1144*22ce4affSfengbojiang UINT64 1145*22ce4affSfengbojiang EFIAPI 1146*22ce4affSfengbojiang LibPcdGet64 ( 1147*22ce4affSfengbojiang IN UINTN TokenNumber 1148*22ce4affSfengbojiang ); 1149*22ce4affSfengbojiang 1150*22ce4affSfengbojiang 1151*22ce4affSfengbojiang /** 1152*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1153*22ce4affSfengbojiang 1154*22ce4affSfengbojiang Returns the pointer to the buffer of the token specified by TokenNumber. 1155*22ce4affSfengbojiang 1156*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1157*22ce4affSfengbojiang 1158*22ce4affSfengbojiang @return Returns the pointer to the token specified by TokenNumber. 1159*22ce4affSfengbojiang 1160*22ce4affSfengbojiang **/ 1161*22ce4affSfengbojiang VOID * 1162*22ce4affSfengbojiang EFIAPI 1163*22ce4affSfengbojiang LibPcdGetPtr ( 1164*22ce4affSfengbojiang IN UINTN TokenNumber 1165*22ce4affSfengbojiang ); 1166*22ce4affSfengbojiang 1167*22ce4affSfengbojiang 1168*22ce4affSfengbojiang /** 1169*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1170*22ce4affSfengbojiang 1171*22ce4affSfengbojiang Returns the Boolean value of the token specified by TokenNumber. 1172*22ce4affSfengbojiang 1173*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1174*22ce4affSfengbojiang 1175*22ce4affSfengbojiang @return Returns the Boolean value of the token specified by TokenNumber. 1176*22ce4affSfengbojiang 1177*22ce4affSfengbojiang **/ 1178*22ce4affSfengbojiang BOOLEAN 1179*22ce4affSfengbojiang EFIAPI 1180*22ce4affSfengbojiang LibPcdGetBool ( 1181*22ce4affSfengbojiang IN UINTN TokenNumber 1182*22ce4affSfengbojiang ); 1183*22ce4affSfengbojiang 1184*22ce4affSfengbojiang 1185*22ce4affSfengbojiang /** 1186*22ce4affSfengbojiang This function provides a means by which to retrieve the size of a given PCD token. 1187*22ce4affSfengbojiang 1188*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1189*22ce4affSfengbojiang 1190*22ce4affSfengbojiang @return Returns the size of the token specified by TokenNumber. 1191*22ce4affSfengbojiang 1192*22ce4affSfengbojiang **/ 1193*22ce4affSfengbojiang UINTN 1194*22ce4affSfengbojiang EFIAPI 1195*22ce4affSfengbojiang LibPcdGetSize ( 1196*22ce4affSfengbojiang IN UINTN TokenNumber 1197*22ce4affSfengbojiang ); 1198*22ce4affSfengbojiang 1199*22ce4affSfengbojiang 1200*22ce4affSfengbojiang /** 1201*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1202*22ce4affSfengbojiang 1203*22ce4affSfengbojiang Returns the 8-bit value for the token specified by TokenNumber and Guid. 1204*22ce4affSfengbojiang 1205*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1206*22ce4affSfengbojiang 1207*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1208*22ce4affSfengbojiang which namespace to retrieve a value from. 1209*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1210*22ce4affSfengbojiang 1211*22ce4affSfengbojiang @return Return the UINT8. 1212*22ce4affSfengbojiang 1213*22ce4affSfengbojiang **/ 1214*22ce4affSfengbojiang UINT8 1215*22ce4affSfengbojiang EFIAPI 1216*22ce4affSfengbojiang LibPcdGetEx8 ( 1217*22ce4affSfengbojiang IN CONST GUID *Guid, 1218*22ce4affSfengbojiang IN UINTN TokenNumber 1219*22ce4affSfengbojiang ); 1220*22ce4affSfengbojiang 1221*22ce4affSfengbojiang 1222*22ce4affSfengbojiang /** 1223*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1224*22ce4affSfengbojiang 1225*22ce4affSfengbojiang Returns the 16-bit value for the token specified by TokenNumber and Guid. 1226*22ce4affSfengbojiang 1227*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1228*22ce4affSfengbojiang 1229*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1230*22ce4affSfengbojiang which namespace to retrieve a value from. 1231*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1232*22ce4affSfengbojiang 1233*22ce4affSfengbojiang @return Return the UINT16. 1234*22ce4affSfengbojiang 1235*22ce4affSfengbojiang **/ 1236*22ce4affSfengbojiang UINT16 1237*22ce4affSfengbojiang EFIAPI 1238*22ce4affSfengbojiang LibPcdGetEx16 ( 1239*22ce4affSfengbojiang IN CONST GUID *Guid, 1240*22ce4affSfengbojiang IN UINTN TokenNumber 1241*22ce4affSfengbojiang ); 1242*22ce4affSfengbojiang 1243*22ce4affSfengbojiang 1244*22ce4affSfengbojiang /** 1245*22ce4affSfengbojiang Returns the 32-bit value for the token specified by TokenNumber and Guid. 1246*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1247*22ce4affSfengbojiang 1248*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1249*22ce4affSfengbojiang which namespace to retrieve a value from. 1250*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1251*22ce4affSfengbojiang 1252*22ce4affSfengbojiang @return Return the UINT32. 1253*22ce4affSfengbojiang 1254*22ce4affSfengbojiang **/ 1255*22ce4affSfengbojiang UINT32 1256*22ce4affSfengbojiang EFIAPI 1257*22ce4affSfengbojiang LibPcdGetEx32 ( 1258*22ce4affSfengbojiang IN CONST GUID *Guid, 1259*22ce4affSfengbojiang IN UINTN TokenNumber 1260*22ce4affSfengbojiang ); 1261*22ce4affSfengbojiang 1262*22ce4affSfengbojiang 1263*22ce4affSfengbojiang /** 1264*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1265*22ce4affSfengbojiang 1266*22ce4affSfengbojiang Returns the 64-bit value for the token specified by TokenNumber and Guid. 1267*22ce4affSfengbojiang 1268*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1269*22ce4affSfengbojiang 1270*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1271*22ce4affSfengbojiang which namespace to retrieve a value from. 1272*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1273*22ce4affSfengbojiang 1274*22ce4affSfengbojiang @return Return the UINT64. 1275*22ce4affSfengbojiang 1276*22ce4affSfengbojiang **/ 1277*22ce4affSfengbojiang UINT64 1278*22ce4affSfengbojiang EFIAPI 1279*22ce4affSfengbojiang LibPcdGetEx64 ( 1280*22ce4affSfengbojiang IN CONST GUID *Guid, 1281*22ce4affSfengbojiang IN UINTN TokenNumber 1282*22ce4affSfengbojiang ); 1283*22ce4affSfengbojiang 1284*22ce4affSfengbojiang 1285*22ce4affSfengbojiang /** 1286*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1287*22ce4affSfengbojiang 1288*22ce4affSfengbojiang Returns the pointer to the buffer of token specified by TokenNumber and Guid. 1289*22ce4affSfengbojiang 1290*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1291*22ce4affSfengbojiang 1292*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1293*22ce4affSfengbojiang which namespace to retrieve a value from. 1294*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1295*22ce4affSfengbojiang 1296*22ce4affSfengbojiang @return Return the VOID* pointer. 1297*22ce4affSfengbojiang 1298*22ce4affSfengbojiang **/ 1299*22ce4affSfengbojiang VOID * 1300*22ce4affSfengbojiang EFIAPI 1301*22ce4affSfengbojiang LibPcdGetExPtr ( 1302*22ce4affSfengbojiang IN CONST GUID *Guid, 1303*22ce4affSfengbojiang IN UINTN TokenNumber 1304*22ce4affSfengbojiang ); 1305*22ce4affSfengbojiang 1306*22ce4affSfengbojiang 1307*22ce4affSfengbojiang /** 1308*22ce4affSfengbojiang This function provides a means by which to retrieve a value for a given PCD token. 1309*22ce4affSfengbojiang 1310*22ce4affSfengbojiang Returns the Boolean value of the token specified by TokenNumber and Guid. 1311*22ce4affSfengbojiang 1312*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1313*22ce4affSfengbojiang 1314*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1315*22ce4affSfengbojiang which namespace to retrieve a value from. 1316*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1317*22ce4affSfengbojiang 1318*22ce4affSfengbojiang @return Return the BOOLEAN. 1319*22ce4affSfengbojiang 1320*22ce4affSfengbojiang **/ 1321*22ce4affSfengbojiang BOOLEAN 1322*22ce4affSfengbojiang EFIAPI 1323*22ce4affSfengbojiang LibPcdGetExBool ( 1324*22ce4affSfengbojiang IN CONST GUID *Guid, 1325*22ce4affSfengbojiang IN UINTN TokenNumber 1326*22ce4affSfengbojiang ); 1327*22ce4affSfengbojiang 1328*22ce4affSfengbojiang 1329*22ce4affSfengbojiang /** 1330*22ce4affSfengbojiang This function provides a means by which to retrieve the size of a given PCD token. 1331*22ce4affSfengbojiang 1332*22ce4affSfengbojiang Returns the size of the token specified by TokenNumber and Guid. 1333*22ce4affSfengbojiang 1334*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1335*22ce4affSfengbojiang 1336*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates 1337*22ce4affSfengbojiang which namespace to retrieve a value from. 1338*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to retrieve a current value for. 1339*22ce4affSfengbojiang 1340*22ce4affSfengbojiang @return Return the size. 1341*22ce4affSfengbojiang 1342*22ce4affSfengbojiang **/ 1343*22ce4affSfengbojiang UINTN 1344*22ce4affSfengbojiang EFIAPI 1345*22ce4affSfengbojiang LibPcdGetExSize ( 1346*22ce4affSfengbojiang IN CONST GUID *Guid, 1347*22ce4affSfengbojiang IN UINTN TokenNumber 1348*22ce4affSfengbojiang ); 1349*22ce4affSfengbojiang 1350*22ce4affSfengbojiang 1351*22ce4affSfengbojiang #ifndef DISABLE_NEW_DEPRECATED_INTERFACES 1352*22ce4affSfengbojiang /** 1353*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1354*22ce4affSfengbojiang 1355*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenNumber 1356*22ce4affSfengbojiang to the value specified by Value. Value is returned. 1357*22ce4affSfengbojiang 1358*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1359*22ce4affSfengbojiang @param[in] Value The 8-bit value to set. 1360*22ce4affSfengbojiang 1361*22ce4affSfengbojiang @return Return the Value that was set. 1362*22ce4affSfengbojiang 1363*22ce4affSfengbojiang **/ 1364*22ce4affSfengbojiang UINT8 1365*22ce4affSfengbojiang EFIAPI 1366*22ce4affSfengbojiang LibPcdSet8 ( 1367*22ce4affSfengbojiang IN UINTN TokenNumber, 1368*22ce4affSfengbojiang IN UINT8 Value 1369*22ce4affSfengbojiang ); 1370*22ce4affSfengbojiang 1371*22ce4affSfengbojiang 1372*22ce4affSfengbojiang /** 1373*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1374*22ce4affSfengbojiang 1375*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenNumber 1376*22ce4affSfengbojiang to the value specified by Value. Value is returned. 1377*22ce4affSfengbojiang 1378*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1379*22ce4affSfengbojiang @param[in] Value The 16-bit value to set. 1380*22ce4affSfengbojiang 1381*22ce4affSfengbojiang @return Return the Value that was set. 1382*22ce4affSfengbojiang 1383*22ce4affSfengbojiang **/ 1384*22ce4affSfengbojiang UINT16 1385*22ce4affSfengbojiang EFIAPI 1386*22ce4affSfengbojiang LibPcdSet16 ( 1387*22ce4affSfengbojiang IN UINTN TokenNumber, 1388*22ce4affSfengbojiang IN UINT16 Value 1389*22ce4affSfengbojiang ); 1390*22ce4affSfengbojiang 1391*22ce4affSfengbojiang 1392*22ce4affSfengbojiang /** 1393*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1394*22ce4affSfengbojiang 1395*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenNumber 1396*22ce4affSfengbojiang to the value specified by Value. Value is returned. 1397*22ce4affSfengbojiang 1398*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1399*22ce4affSfengbojiang @param[in] Value The 32-bit value to set. 1400*22ce4affSfengbojiang 1401*22ce4affSfengbojiang @return Return the Value that was set. 1402*22ce4affSfengbojiang 1403*22ce4affSfengbojiang **/ 1404*22ce4affSfengbojiang UINT32 1405*22ce4affSfengbojiang EFIAPI 1406*22ce4affSfengbojiang LibPcdSet32 ( 1407*22ce4affSfengbojiang IN UINTN TokenNumber, 1408*22ce4affSfengbojiang IN UINT32 Value 1409*22ce4affSfengbojiang ); 1410*22ce4affSfengbojiang 1411*22ce4affSfengbojiang 1412*22ce4affSfengbojiang /** 1413*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1414*22ce4affSfengbojiang 1415*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenNumber 1416*22ce4affSfengbojiang to the value specified by Value. Value is returned. 1417*22ce4affSfengbojiang 1418*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1419*22ce4affSfengbojiang @param[in] Value The 64-bit value to set. 1420*22ce4affSfengbojiang 1421*22ce4affSfengbojiang @return Return the Value that was set. 1422*22ce4affSfengbojiang 1423*22ce4affSfengbojiang **/ 1424*22ce4affSfengbojiang UINT64 1425*22ce4affSfengbojiang EFIAPI 1426*22ce4affSfengbojiang LibPcdSet64 ( 1427*22ce4affSfengbojiang IN UINTN TokenNumber, 1428*22ce4affSfengbojiang IN UINT64 Value 1429*22ce4affSfengbojiang ); 1430*22ce4affSfengbojiang 1431*22ce4affSfengbojiang 1432*22ce4affSfengbojiang /** 1433*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1434*22ce4affSfengbojiang 1435*22ce4affSfengbojiang Sets a buffer for the token specified by TokenNumber to the value 1436*22ce4affSfengbojiang specified by Buffer and SizeOfBuffer. Buffer is returned. 1437*22ce4affSfengbojiang If SizeOfBuffer is greater than the maximum size support by TokenNumber, 1438*22ce4affSfengbojiang then set SizeOfBuffer to the maximum size supported by TokenNumber and 1439*22ce4affSfengbojiang return NULL to indicate that the set operation was not actually performed. 1440*22ce4affSfengbojiang 1441*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 1442*22ce4affSfengbojiang maximum size supported by TokenName and NULL must be returned. 1443*22ce4affSfengbojiang 1444*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 1445*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1446*22ce4affSfengbojiang 1447*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1448*22ce4affSfengbojiang @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1449*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to set. 1450*22ce4affSfengbojiang 1451*22ce4affSfengbojiang @return Return the pointer for the Buffer that was set. 1452*22ce4affSfengbojiang 1453*22ce4affSfengbojiang **/ 1454*22ce4affSfengbojiang VOID * 1455*22ce4affSfengbojiang EFIAPI 1456*22ce4affSfengbojiang LibPcdSetPtr ( 1457*22ce4affSfengbojiang IN UINTN TokenNumber, 1458*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 1459*22ce4affSfengbojiang IN CONST VOID *Buffer 1460*22ce4affSfengbojiang ); 1461*22ce4affSfengbojiang 1462*22ce4affSfengbojiang 1463*22ce4affSfengbojiang /** 1464*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1465*22ce4affSfengbojiang 1466*22ce4affSfengbojiang Sets the Boolean value for the token specified by TokenNumber 1467*22ce4affSfengbojiang to the value specified by Value. Value is returned. 1468*22ce4affSfengbojiang 1469*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1470*22ce4affSfengbojiang @param[in] Value The boolean value to set. 1471*22ce4affSfengbojiang 1472*22ce4affSfengbojiang @return Return the Value that was set. 1473*22ce4affSfengbojiang 1474*22ce4affSfengbojiang **/ 1475*22ce4affSfengbojiang BOOLEAN 1476*22ce4affSfengbojiang EFIAPI 1477*22ce4affSfengbojiang LibPcdSetBool ( 1478*22ce4affSfengbojiang IN UINTN TokenNumber, 1479*22ce4affSfengbojiang IN BOOLEAN Value 1480*22ce4affSfengbojiang ); 1481*22ce4affSfengbojiang 1482*22ce4affSfengbojiang 1483*22ce4affSfengbojiang /** 1484*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1485*22ce4affSfengbojiang 1486*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenNumber and 1487*22ce4affSfengbojiang Guid to the value specified by Value. Value is returned. 1488*22ce4affSfengbojiang 1489*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1490*22ce4affSfengbojiang 1491*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1492*22ce4affSfengbojiang designates which namespace to set a value from. 1493*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1494*22ce4affSfengbojiang @param[in] Value The 8-bit value to set. 1495*22ce4affSfengbojiang 1496*22ce4affSfengbojiang @return Return the Value that was set. 1497*22ce4affSfengbojiang 1498*22ce4affSfengbojiang **/ 1499*22ce4affSfengbojiang UINT8 1500*22ce4affSfengbojiang EFIAPI 1501*22ce4affSfengbojiang LibPcdSetEx8 ( 1502*22ce4affSfengbojiang IN CONST GUID *Guid, 1503*22ce4affSfengbojiang IN UINTN TokenNumber, 1504*22ce4affSfengbojiang IN UINT8 Value 1505*22ce4affSfengbojiang ); 1506*22ce4affSfengbojiang 1507*22ce4affSfengbojiang 1508*22ce4affSfengbojiang /** 1509*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1510*22ce4affSfengbojiang 1511*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenNumber and 1512*22ce4affSfengbojiang Guid to the value specified by Value. Value is returned. 1513*22ce4affSfengbojiang 1514*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1515*22ce4affSfengbojiang 1516*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1517*22ce4affSfengbojiang designates which namespace to set a value from. 1518*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1519*22ce4affSfengbojiang @param[in] Value The 16-bit value to set. 1520*22ce4affSfengbojiang 1521*22ce4affSfengbojiang @return Return the Value that was set. 1522*22ce4affSfengbojiang 1523*22ce4affSfengbojiang **/ 1524*22ce4affSfengbojiang UINT16 1525*22ce4affSfengbojiang EFIAPI 1526*22ce4affSfengbojiang LibPcdSetEx16 ( 1527*22ce4affSfengbojiang IN CONST GUID *Guid, 1528*22ce4affSfengbojiang IN UINTN TokenNumber, 1529*22ce4affSfengbojiang IN UINT16 Value 1530*22ce4affSfengbojiang ); 1531*22ce4affSfengbojiang 1532*22ce4affSfengbojiang 1533*22ce4affSfengbojiang /** 1534*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1535*22ce4affSfengbojiang 1536*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenNumber and 1537*22ce4affSfengbojiang Guid to the value specified by Value. Value is returned. 1538*22ce4affSfengbojiang 1539*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1540*22ce4affSfengbojiang 1541*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1542*22ce4affSfengbojiang designates which namespace to set a value from. 1543*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1544*22ce4affSfengbojiang @param[in] Value The 32-bit value to set. 1545*22ce4affSfengbojiang 1546*22ce4affSfengbojiang @return Return the Value that was set. 1547*22ce4affSfengbojiang 1548*22ce4affSfengbojiang **/ 1549*22ce4affSfengbojiang UINT32 1550*22ce4affSfengbojiang EFIAPI 1551*22ce4affSfengbojiang LibPcdSetEx32 ( 1552*22ce4affSfengbojiang IN CONST GUID *Guid, 1553*22ce4affSfengbojiang IN UINTN TokenNumber, 1554*22ce4affSfengbojiang IN UINT32 Value 1555*22ce4affSfengbojiang ); 1556*22ce4affSfengbojiang 1557*22ce4affSfengbojiang 1558*22ce4affSfengbojiang /** 1559*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1560*22ce4affSfengbojiang 1561*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenNumber and 1562*22ce4affSfengbojiang Guid to the value specified by Value. Value is returned. 1563*22ce4affSfengbojiang 1564*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1565*22ce4affSfengbojiang 1566*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1567*22ce4affSfengbojiang designates which namespace to set a value from. 1568*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1569*22ce4affSfengbojiang @param[in] Value The 64-bit value to set. 1570*22ce4affSfengbojiang 1571*22ce4affSfengbojiang @return Return the Value that was set. 1572*22ce4affSfengbojiang 1573*22ce4affSfengbojiang **/ 1574*22ce4affSfengbojiang UINT64 1575*22ce4affSfengbojiang EFIAPI 1576*22ce4affSfengbojiang LibPcdSetEx64 ( 1577*22ce4affSfengbojiang IN CONST GUID *Guid, 1578*22ce4affSfengbojiang IN UINTN TokenNumber, 1579*22ce4affSfengbojiang IN UINT64 Value 1580*22ce4affSfengbojiang ); 1581*22ce4affSfengbojiang 1582*22ce4affSfengbojiang 1583*22ce4affSfengbojiang /** 1584*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1585*22ce4affSfengbojiang 1586*22ce4affSfengbojiang Sets a buffer for the token specified by TokenNumber to the value specified by 1587*22ce4affSfengbojiang Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1588*22ce4affSfengbojiang the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size 1589*22ce4affSfengbojiang supported by TokenNumber and return NULL to indicate that the set operation 1590*22ce4affSfengbojiang was not actually performed. 1591*22ce4affSfengbojiang 1592*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1593*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 1594*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1595*22ce4affSfengbojiang 1596*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1597*22ce4affSfengbojiang designates which namespace to set a value from. 1598*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1599*22ce4affSfengbojiang @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1600*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to set. 1601*22ce4affSfengbojiang 1602*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 1603*22ce4affSfengbojiang 1604*22ce4affSfengbojiang **/ 1605*22ce4affSfengbojiang VOID * 1606*22ce4affSfengbojiang EFIAPI 1607*22ce4affSfengbojiang LibPcdSetExPtr ( 1608*22ce4affSfengbojiang IN CONST GUID *Guid, 1609*22ce4affSfengbojiang IN UINTN TokenNumber, 1610*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 1611*22ce4affSfengbojiang IN VOID *Buffer 1612*22ce4affSfengbojiang ); 1613*22ce4affSfengbojiang 1614*22ce4affSfengbojiang 1615*22ce4affSfengbojiang /** 1616*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1617*22ce4affSfengbojiang 1618*22ce4affSfengbojiang Sets the Boolean value for the token specified by TokenNumber and 1619*22ce4affSfengbojiang Guid to the value specified by Value. Value is returned. 1620*22ce4affSfengbojiang 1621*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1622*22ce4affSfengbojiang 1623*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1624*22ce4affSfengbojiang designates which namespace to set a value from. 1625*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1626*22ce4affSfengbojiang @param[in] Value The Boolean value to set. 1627*22ce4affSfengbojiang 1628*22ce4affSfengbojiang @return Return the Value that was set. 1629*22ce4affSfengbojiang 1630*22ce4affSfengbojiang **/ 1631*22ce4affSfengbojiang BOOLEAN 1632*22ce4affSfengbojiang EFIAPI 1633*22ce4affSfengbojiang LibPcdSetExBool ( 1634*22ce4affSfengbojiang IN CONST GUID *Guid, 1635*22ce4affSfengbojiang IN UINTN TokenNumber, 1636*22ce4affSfengbojiang IN BOOLEAN Value 1637*22ce4affSfengbojiang ); 1638*22ce4affSfengbojiang #endif 1639*22ce4affSfengbojiang 1640*22ce4affSfengbojiang /** 1641*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1642*22ce4affSfengbojiang 1643*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenNumber 1644*22ce4affSfengbojiang to the value specified by Value. 1645*22ce4affSfengbojiang 1646*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1647*22ce4affSfengbojiang @param[in] Value The 8-bit value to set. 1648*22ce4affSfengbojiang 1649*22ce4affSfengbojiang @return The status of the set operation. 1650*22ce4affSfengbojiang 1651*22ce4affSfengbojiang **/ 1652*22ce4affSfengbojiang RETURN_STATUS 1653*22ce4affSfengbojiang EFIAPI 1654*22ce4affSfengbojiang LibPcdSet8S ( 1655*22ce4affSfengbojiang IN UINTN TokenNumber, 1656*22ce4affSfengbojiang IN UINT8 Value 1657*22ce4affSfengbojiang ); 1658*22ce4affSfengbojiang 1659*22ce4affSfengbojiang /** 1660*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1661*22ce4affSfengbojiang 1662*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenNumber 1663*22ce4affSfengbojiang to the value specified by Value. 1664*22ce4affSfengbojiang 1665*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1666*22ce4affSfengbojiang @param[in] Value The 16-bit value to set. 1667*22ce4affSfengbojiang 1668*22ce4affSfengbojiang @return The status of the set operation. 1669*22ce4affSfengbojiang 1670*22ce4affSfengbojiang **/ 1671*22ce4affSfengbojiang RETURN_STATUS 1672*22ce4affSfengbojiang EFIAPI 1673*22ce4affSfengbojiang LibPcdSet16S ( 1674*22ce4affSfengbojiang IN UINTN TokenNumber, 1675*22ce4affSfengbojiang IN UINT16 Value 1676*22ce4affSfengbojiang ); 1677*22ce4affSfengbojiang 1678*22ce4affSfengbojiang /** 1679*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1680*22ce4affSfengbojiang 1681*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenNumber 1682*22ce4affSfengbojiang to the value specified by Value. 1683*22ce4affSfengbojiang 1684*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1685*22ce4affSfengbojiang @param[in] Value The 32-bit value to set. 1686*22ce4affSfengbojiang 1687*22ce4affSfengbojiang @return The status of the set operation. 1688*22ce4affSfengbojiang 1689*22ce4affSfengbojiang **/ 1690*22ce4affSfengbojiang RETURN_STATUS 1691*22ce4affSfengbojiang EFIAPI 1692*22ce4affSfengbojiang LibPcdSet32S ( 1693*22ce4affSfengbojiang IN UINTN TokenNumber, 1694*22ce4affSfengbojiang IN UINT32 Value 1695*22ce4affSfengbojiang ); 1696*22ce4affSfengbojiang 1697*22ce4affSfengbojiang /** 1698*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1699*22ce4affSfengbojiang 1700*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenNumber 1701*22ce4affSfengbojiang to the value specified by Value. 1702*22ce4affSfengbojiang 1703*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1704*22ce4affSfengbojiang @param[in] Value The 64-bit value to set. 1705*22ce4affSfengbojiang 1706*22ce4affSfengbojiang @return The status of the set operation. 1707*22ce4affSfengbojiang 1708*22ce4affSfengbojiang **/ 1709*22ce4affSfengbojiang RETURN_STATUS 1710*22ce4affSfengbojiang EFIAPI 1711*22ce4affSfengbojiang LibPcdSet64S ( 1712*22ce4affSfengbojiang IN UINTN TokenNumber, 1713*22ce4affSfengbojiang IN UINT64 Value 1714*22ce4affSfengbojiang ); 1715*22ce4affSfengbojiang 1716*22ce4affSfengbojiang /** 1717*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1718*22ce4affSfengbojiang 1719*22ce4affSfengbojiang Sets a buffer for the token specified by TokenNumber to the value specified 1720*22ce4affSfengbojiang by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size 1721*22ce4affSfengbojiang support by TokenNumber, then set SizeOfBuffer to the maximum size supported by 1722*22ce4affSfengbojiang TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation 1723*22ce4affSfengbojiang was not actually performed. 1724*22ce4affSfengbojiang 1725*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 1726*22ce4affSfengbojiang maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned. 1727*22ce4affSfengbojiang 1728*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 1729*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1730*22ce4affSfengbojiang 1731*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1732*22ce4affSfengbojiang @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1733*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to set. 1734*22ce4affSfengbojiang 1735*22ce4affSfengbojiang @return The status of the set operation. 1736*22ce4affSfengbojiang 1737*22ce4affSfengbojiang **/ 1738*22ce4affSfengbojiang RETURN_STATUS 1739*22ce4affSfengbojiang EFIAPI 1740*22ce4affSfengbojiang LibPcdSetPtrS ( 1741*22ce4affSfengbojiang IN UINTN TokenNumber, 1742*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 1743*22ce4affSfengbojiang IN CONST VOID *Buffer 1744*22ce4affSfengbojiang ); 1745*22ce4affSfengbojiang 1746*22ce4affSfengbojiang /** 1747*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1748*22ce4affSfengbojiang 1749*22ce4affSfengbojiang Sets the boolean value for the token specified by TokenNumber 1750*22ce4affSfengbojiang to the value specified by Value. 1751*22ce4affSfengbojiang 1752*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1753*22ce4affSfengbojiang @param[in] Value The boolean value to set. 1754*22ce4affSfengbojiang 1755*22ce4affSfengbojiang @return The status of the set operation. 1756*22ce4affSfengbojiang 1757*22ce4affSfengbojiang **/ 1758*22ce4affSfengbojiang RETURN_STATUS 1759*22ce4affSfengbojiang EFIAPI 1760*22ce4affSfengbojiang LibPcdSetBoolS ( 1761*22ce4affSfengbojiang IN UINTN TokenNumber, 1762*22ce4affSfengbojiang IN BOOLEAN Value 1763*22ce4affSfengbojiang ); 1764*22ce4affSfengbojiang 1765*22ce4affSfengbojiang /** 1766*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1767*22ce4affSfengbojiang 1768*22ce4affSfengbojiang Sets the 8-bit value for the token specified by TokenNumber 1769*22ce4affSfengbojiang to the value specified by Value. 1770*22ce4affSfengbojiang 1771*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1772*22ce4affSfengbojiang 1773*22ce4affSfengbojiang @param[in] Guid The pointer to a 128-bit unique value that 1774*22ce4affSfengbojiang designates which namespace to set a value from. 1775*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1776*22ce4affSfengbojiang @param[in] Value The 8-bit value to set. 1777*22ce4affSfengbojiang 1778*22ce4affSfengbojiang @return The status of the set operation. 1779*22ce4affSfengbojiang 1780*22ce4affSfengbojiang **/ 1781*22ce4affSfengbojiang RETURN_STATUS 1782*22ce4affSfengbojiang EFIAPI 1783*22ce4affSfengbojiang LibPcdSetEx8S ( 1784*22ce4affSfengbojiang IN CONST GUID *Guid, 1785*22ce4affSfengbojiang IN UINTN TokenNumber, 1786*22ce4affSfengbojiang IN UINT8 Value 1787*22ce4affSfengbojiang ); 1788*22ce4affSfengbojiang 1789*22ce4affSfengbojiang /** 1790*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1791*22ce4affSfengbojiang 1792*22ce4affSfengbojiang Sets the 16-bit value for the token specified by TokenNumber 1793*22ce4affSfengbojiang to the value specified by Value. 1794*22ce4affSfengbojiang 1795*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1796*22ce4affSfengbojiang 1797*22ce4affSfengbojiang @param[in] Guid The pointer to a 128-bit unique value that 1798*22ce4affSfengbojiang designates which namespace to set a value from. 1799*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1800*22ce4affSfengbojiang @param[in] Value The 16-bit value to set. 1801*22ce4affSfengbojiang 1802*22ce4affSfengbojiang @return The status of the set operation. 1803*22ce4affSfengbojiang 1804*22ce4affSfengbojiang **/ 1805*22ce4affSfengbojiang RETURN_STATUS 1806*22ce4affSfengbojiang EFIAPI 1807*22ce4affSfengbojiang LibPcdSetEx16S ( 1808*22ce4affSfengbojiang IN CONST GUID *Guid, 1809*22ce4affSfengbojiang IN UINTN TokenNumber, 1810*22ce4affSfengbojiang IN UINT16 Value 1811*22ce4affSfengbojiang ); 1812*22ce4affSfengbojiang 1813*22ce4affSfengbojiang /** 1814*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1815*22ce4affSfengbojiang 1816*22ce4affSfengbojiang Sets the 32-bit value for the token specified by TokenNumber 1817*22ce4affSfengbojiang to the value specified by Value. 1818*22ce4affSfengbojiang 1819*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1820*22ce4affSfengbojiang 1821*22ce4affSfengbojiang @param[in] Guid The pointer to a 128-bit unique value that 1822*22ce4affSfengbojiang designates which namespace to set a value from. 1823*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1824*22ce4affSfengbojiang @param[in] Value The 32-bit value to set. 1825*22ce4affSfengbojiang 1826*22ce4affSfengbojiang @return The status of the set operation. 1827*22ce4affSfengbojiang 1828*22ce4affSfengbojiang **/ 1829*22ce4affSfengbojiang RETURN_STATUS 1830*22ce4affSfengbojiang EFIAPI 1831*22ce4affSfengbojiang LibPcdSetEx32S ( 1832*22ce4affSfengbojiang IN CONST GUID *Guid, 1833*22ce4affSfengbojiang IN UINTN TokenNumber, 1834*22ce4affSfengbojiang IN UINT32 Value 1835*22ce4affSfengbojiang ); 1836*22ce4affSfengbojiang 1837*22ce4affSfengbojiang /** 1838*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1839*22ce4affSfengbojiang 1840*22ce4affSfengbojiang Sets the 64-bit value for the token specified by TokenNumber 1841*22ce4affSfengbojiang to the value specified by Value. 1842*22ce4affSfengbojiang 1843*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1844*22ce4affSfengbojiang 1845*22ce4affSfengbojiang @param[in] Guid The pointer to a 128-bit unique value that 1846*22ce4affSfengbojiang designates which namespace to set a value from. 1847*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1848*22ce4affSfengbojiang @param[in] Value The 64-bit value to set. 1849*22ce4affSfengbojiang 1850*22ce4affSfengbojiang @return The status of the set operation. 1851*22ce4affSfengbojiang 1852*22ce4affSfengbojiang **/ 1853*22ce4affSfengbojiang RETURN_STATUS 1854*22ce4affSfengbojiang EFIAPI 1855*22ce4affSfengbojiang LibPcdSetEx64S ( 1856*22ce4affSfengbojiang IN CONST GUID *Guid, 1857*22ce4affSfengbojiang IN UINTN TokenNumber, 1858*22ce4affSfengbojiang IN UINT64 Value 1859*22ce4affSfengbojiang ); 1860*22ce4affSfengbojiang 1861*22ce4affSfengbojiang /** 1862*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1863*22ce4affSfengbojiang 1864*22ce4affSfengbojiang Sets a buffer for the token specified by TokenNumber to the value specified by 1865*22ce4affSfengbojiang Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size 1866*22ce4affSfengbojiang support by TokenNumber, then set SizeOfBuffer to the maximum size supported by 1867*22ce4affSfengbojiang TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation 1868*22ce4affSfengbojiang was not actually performed. 1869*22ce4affSfengbojiang 1870*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1871*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 1872*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1873*22ce4affSfengbojiang 1874*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that 1875*22ce4affSfengbojiang designates which namespace to set a value from. 1876*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1877*22ce4affSfengbojiang @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1878*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to set. 1879*22ce4affSfengbojiang 1880*22ce4affSfengbojiang @return The status of the set operation. 1881*22ce4affSfengbojiang 1882*22ce4affSfengbojiang **/ 1883*22ce4affSfengbojiang RETURN_STATUS 1884*22ce4affSfengbojiang EFIAPI 1885*22ce4affSfengbojiang LibPcdSetExPtrS ( 1886*22ce4affSfengbojiang IN CONST GUID *Guid, 1887*22ce4affSfengbojiang IN UINTN TokenNumber, 1888*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 1889*22ce4affSfengbojiang IN VOID *Buffer 1890*22ce4affSfengbojiang ); 1891*22ce4affSfengbojiang 1892*22ce4affSfengbojiang /** 1893*22ce4affSfengbojiang This function provides a means by which to set a value for a given PCD token. 1894*22ce4affSfengbojiang 1895*22ce4affSfengbojiang Sets the boolean value for the token specified by TokenNumber 1896*22ce4affSfengbojiang to the value specified by Value. 1897*22ce4affSfengbojiang 1898*22ce4affSfengbojiang If Guid is NULL, then ASSERT(). 1899*22ce4affSfengbojiang 1900*22ce4affSfengbojiang @param[in] Guid The pointer to a 128-bit unique value that 1901*22ce4affSfengbojiang designates which namespace to set a value from. 1902*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to set a current value for. 1903*22ce4affSfengbojiang @param[in] Value The boolean value to set. 1904*22ce4affSfengbojiang 1905*22ce4affSfengbojiang @return The status of the set operation. 1906*22ce4affSfengbojiang 1907*22ce4affSfengbojiang **/ 1908*22ce4affSfengbojiang RETURN_STATUS 1909*22ce4affSfengbojiang EFIAPI 1910*22ce4affSfengbojiang LibPcdSetExBoolS ( 1911*22ce4affSfengbojiang IN CONST GUID *Guid, 1912*22ce4affSfengbojiang IN UINTN TokenNumber, 1913*22ce4affSfengbojiang IN BOOLEAN Value 1914*22ce4affSfengbojiang ); 1915*22ce4affSfengbojiang 1916*22ce4affSfengbojiang /** 1917*22ce4affSfengbojiang This notification function serves two purposes. 1918*22ce4affSfengbojiang 1919*22ce4affSfengbojiang Firstly, it notifies the module that did the registration that the value of this 1920*22ce4affSfengbojiang PCD token has been set. 1921*22ce4affSfengbojiang Secondly, it provides a mechanism for the module that did the registration to intercept 1922*22ce4affSfengbojiang the set operation and override the value been set if necessary. After the invocation of 1923*22ce4affSfengbojiang the callback function, TokenData will be used by PCD service PEIM or driver to modify th 1924*22ce4affSfengbojiang internal data in PCD database. 1925*22ce4affSfengbojiang 1926*22ce4affSfengbojiang @param[in] CallBackGuid The PCD token GUID being set. 1927*22ce4affSfengbojiang @param[in] CallBackToken The PCD token number being set. 1928*22ce4affSfengbojiang @param[in, out] TokenData A pointer to the token data being set. 1929*22ce4affSfengbojiang @param[in] TokenDataSize The size, in bytes, of the data being set. 1930*22ce4affSfengbojiang 1931*22ce4affSfengbojiang **/ 1932*22ce4affSfengbojiang typedef 1933*22ce4affSfengbojiang VOID 1934*22ce4affSfengbojiang (EFIAPI *PCD_CALLBACK)( 1935*22ce4affSfengbojiang IN CONST GUID *CallBackGuid, OPTIONAL 1936*22ce4affSfengbojiang IN UINTN CallBackToken, 1937*22ce4affSfengbojiang IN OUT VOID *TokenData, 1938*22ce4affSfengbojiang IN UINTN TokenDataSize 1939*22ce4affSfengbojiang ); 1940*22ce4affSfengbojiang 1941*22ce4affSfengbojiang 1942*22ce4affSfengbojiang /** 1943*22ce4affSfengbojiang Set up a notification function that is called when a specified token is set. 1944*22ce4affSfengbojiang 1945*22ce4affSfengbojiang When the token specified by TokenNumber and Guid is set, 1946*22ce4affSfengbojiang then notification function specified by NotificationFunction is called. 1947*22ce4affSfengbojiang If Guid is NULL, then the default token space is used. 1948*22ce4affSfengbojiang If NotificationFunction is NULL, then ASSERT(). 1949*22ce4affSfengbojiang 1950*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates which 1951*22ce4affSfengbojiang namespace to set a value from. If NULL, then the default 1952*22ce4affSfengbojiang token space is used. 1953*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number to monitor. 1954*22ce4affSfengbojiang @param[in] NotificationFunction The function to call when the token 1955*22ce4affSfengbojiang specified by Guid and TokenNumber is set. 1956*22ce4affSfengbojiang 1957*22ce4affSfengbojiang **/ 1958*22ce4affSfengbojiang VOID 1959*22ce4affSfengbojiang EFIAPI 1960*22ce4affSfengbojiang LibPcdCallbackOnSet ( 1961*22ce4affSfengbojiang IN CONST GUID *Guid, OPTIONAL 1962*22ce4affSfengbojiang IN UINTN TokenNumber, 1963*22ce4affSfengbojiang IN PCD_CALLBACK NotificationFunction 1964*22ce4affSfengbojiang ); 1965*22ce4affSfengbojiang 1966*22ce4affSfengbojiang 1967*22ce4affSfengbojiang /** 1968*22ce4affSfengbojiang Disable a notification function that was established with LibPcdCallbackonSet(). 1969*22ce4affSfengbojiang 1970*22ce4affSfengbojiang Disable a notification function that was previously established with LibPcdCallbackOnSet(). 1971*22ce4affSfengbojiang If NotificationFunction is NULL, then ASSERT(). 1972*22ce4affSfengbojiang If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 1973*22ce4affSfengbojiang and NotificationFunction, then ASSERT(). 1974*22ce4affSfengbojiang 1975*22ce4affSfengbojiang @param[in] Guid Specify the GUID token space. 1976*22ce4affSfengbojiang @param[in] TokenNumber Specify the token number. 1977*22ce4affSfengbojiang @param[in] NotificationFunction The callback function to be unregistered. 1978*22ce4affSfengbojiang 1979*22ce4affSfengbojiang **/ 1980*22ce4affSfengbojiang VOID 1981*22ce4affSfengbojiang EFIAPI 1982*22ce4affSfengbojiang LibPcdCancelCallback ( 1983*22ce4affSfengbojiang IN CONST GUID *Guid, OPTIONAL 1984*22ce4affSfengbojiang IN UINTN TokenNumber, 1985*22ce4affSfengbojiang IN PCD_CALLBACK NotificationFunction 1986*22ce4affSfengbojiang ); 1987*22ce4affSfengbojiang 1988*22ce4affSfengbojiang 1989*22ce4affSfengbojiang /** 1990*22ce4affSfengbojiang Retrieves the next token in a token space. 1991*22ce4affSfengbojiang 1992*22ce4affSfengbojiang Retrieves the next PCD token number from the token space specified by Guid. 1993*22ce4affSfengbojiang If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1994*22ce4affSfengbojiang then the first token number is returned. Otherwise, the token number that 1995*22ce4affSfengbojiang follows TokenNumber in the token space is returned. If TokenNumber is the last 1996*22ce4affSfengbojiang token number in the token space, then 0 is returned. 1997*22ce4affSfengbojiang 1998*22ce4affSfengbojiang If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). 1999*22ce4affSfengbojiang 2000*22ce4affSfengbojiang @param[in] Guid Pointer to a 128-bit unique value that designates which namespace 2001*22ce4affSfengbojiang to set a value from. If NULL, then the default token space is used. 2002*22ce4affSfengbojiang @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 2003*22ce4affSfengbojiang token number. 2004*22ce4affSfengbojiang 2005*22ce4affSfengbojiang @return The next valid token number. 2006*22ce4affSfengbojiang 2007*22ce4affSfengbojiang **/ 2008*22ce4affSfengbojiang UINTN 2009*22ce4affSfengbojiang EFIAPI 2010*22ce4affSfengbojiang LibPcdGetNextToken ( 2011*22ce4affSfengbojiang IN CONST GUID *Guid, OPTIONAL 2012*22ce4affSfengbojiang IN UINTN TokenNumber 2013*22ce4affSfengbojiang ); 2014*22ce4affSfengbojiang 2015*22ce4affSfengbojiang 2016*22ce4affSfengbojiang 2017*22ce4affSfengbojiang /** 2018*22ce4affSfengbojiang Used to retrieve the list of available PCD token space GUIDs. 2019*22ce4affSfengbojiang 2020*22ce4affSfengbojiang Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces 2021*22ce4affSfengbojiang in the platform. 2022*22ce4affSfengbojiang If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. 2023*22ce4affSfengbojiang If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. 2024*22ce4affSfengbojiang 2025*22ce4affSfengbojiang @param TokenSpaceGuid Pointer to the a PCD token space GUID 2026*22ce4affSfengbojiang 2027*22ce4affSfengbojiang @return The next valid token namespace. 2028*22ce4affSfengbojiang 2029*22ce4affSfengbojiang **/ 2030*22ce4affSfengbojiang GUID * 2031*22ce4affSfengbojiang EFIAPI 2032*22ce4affSfengbojiang LibPcdGetNextTokenSpace ( 2033*22ce4affSfengbojiang IN CONST GUID *TokenSpaceGuid 2034*22ce4affSfengbojiang ); 2035*22ce4affSfengbojiang 2036*22ce4affSfengbojiang 2037*22ce4affSfengbojiang /** 2038*22ce4affSfengbojiang Sets a value of a patchable PCD entry that is type pointer. 2039*22ce4affSfengbojiang 2040*22ce4affSfengbojiang Sets the PCD entry specified by PatchVariable to the value specified by Buffer 2041*22ce4affSfengbojiang and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 2042*22ce4affSfengbojiang MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 2043*22ce4affSfengbojiang NULL to indicate that the set operation was not actually performed. 2044*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 2045*22ce4affSfengbojiang MaximumDatumSize and NULL must be returned. 2046*22ce4affSfengbojiang 2047*22ce4affSfengbojiang If PatchVariable is NULL, then ASSERT(). 2048*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 2049*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 2050*22ce4affSfengbojiang 2051*22ce4affSfengbojiang @param[out] PatchVariable A pointer to the global variable in a module that is 2052*22ce4affSfengbojiang the target of the set operation. 2053*22ce4affSfengbojiang @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 2054*22ce4affSfengbojiang @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 2055*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to used to set the target variable. 2056*22ce4affSfengbojiang 2057*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 2058*22ce4affSfengbojiang 2059*22ce4affSfengbojiang **/ 2060*22ce4affSfengbojiang VOID * 2061*22ce4affSfengbojiang EFIAPI 2062*22ce4affSfengbojiang LibPatchPcdSetPtr ( 2063*22ce4affSfengbojiang OUT VOID *PatchVariable, 2064*22ce4affSfengbojiang IN UINTN MaximumDatumSize, 2065*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 2066*22ce4affSfengbojiang IN CONST VOID *Buffer 2067*22ce4affSfengbojiang ); 2068*22ce4affSfengbojiang 2069*22ce4affSfengbojiang /** 2070*22ce4affSfengbojiang Sets a value of a patchable PCD entry that is type pointer. 2071*22ce4affSfengbojiang 2072*22ce4affSfengbojiang Sets the PCD entry specified by PatchVariable to the value specified 2073*22ce4affSfengbojiang by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, 2074*22ce4affSfengbojiang then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER 2075*22ce4affSfengbojiang to indicate that the set operation was not actually performed. 2076*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 2077*22ce4affSfengbojiang MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. 2078*22ce4affSfengbojiang 2079*22ce4affSfengbojiang If PatchVariable is NULL, then ASSERT(). 2080*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 2081*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 2082*22ce4affSfengbojiang 2083*22ce4affSfengbojiang @param[out] PatchVariable A pointer to the global variable in a module that is 2084*22ce4affSfengbojiang the target of the set operation. 2085*22ce4affSfengbojiang @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 2086*22ce4affSfengbojiang @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 2087*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to used to set the target variable. 2088*22ce4affSfengbojiang 2089*22ce4affSfengbojiang @return The status of the set operation. 2090*22ce4affSfengbojiang 2091*22ce4affSfengbojiang **/ 2092*22ce4affSfengbojiang RETURN_STATUS 2093*22ce4affSfengbojiang EFIAPI 2094*22ce4affSfengbojiang LibPatchPcdSetPtrS ( 2095*22ce4affSfengbojiang OUT VOID *PatchVariable, 2096*22ce4affSfengbojiang IN UINTN MaximumDatumSize, 2097*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 2098*22ce4affSfengbojiang IN CONST VOID *Buffer 2099*22ce4affSfengbojiang ); 2100*22ce4affSfengbojiang 2101*22ce4affSfengbojiang /** 2102*22ce4affSfengbojiang Sets a value and size of a patchable PCD entry that is type pointer. 2103*22ce4affSfengbojiang 2104*22ce4affSfengbojiang Sets the PCD entry specified by PatchVariable to the value specified by Buffer 2105*22ce4affSfengbojiang and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 2106*22ce4affSfengbojiang MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 2107*22ce4affSfengbojiang NULL to indicate that the set operation was not actually performed. 2108*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 2109*22ce4affSfengbojiang MaximumDatumSize and NULL must be returned. 2110*22ce4affSfengbojiang 2111*22ce4affSfengbojiang If PatchVariable is NULL, then ASSERT(). 2112*22ce4affSfengbojiang If SizeOfPatchVariable is NULL, then ASSERT(). 2113*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 2114*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 2115*22ce4affSfengbojiang 2116*22ce4affSfengbojiang @param[out] PatchVariable A pointer to the global variable in a module that is 2117*22ce4affSfengbojiang the target of the set operation. 2118*22ce4affSfengbojiang @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. 2119*22ce4affSfengbojiang @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 2120*22ce4affSfengbojiang @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 2121*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to used to set the target variable. 2122*22ce4affSfengbojiang 2123*22ce4affSfengbojiang @return Return the pointer to the Buffer that was set. 2124*22ce4affSfengbojiang 2125*22ce4affSfengbojiang **/ 2126*22ce4affSfengbojiang VOID * 2127*22ce4affSfengbojiang EFIAPI 2128*22ce4affSfengbojiang LibPatchPcdSetPtrAndSize ( 2129*22ce4affSfengbojiang OUT VOID *PatchVariable, 2130*22ce4affSfengbojiang OUT UINTN *SizeOfPatchVariable, 2131*22ce4affSfengbojiang IN UINTN MaximumDatumSize, 2132*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 2133*22ce4affSfengbojiang IN CONST VOID *Buffer 2134*22ce4affSfengbojiang ); 2135*22ce4affSfengbojiang 2136*22ce4affSfengbojiang /** 2137*22ce4affSfengbojiang Sets a value and size of a patchable PCD entry that is type pointer. 2138*22ce4affSfengbojiang 2139*22ce4affSfengbojiang Sets the PCD entry specified by PatchVariable to the value specified 2140*22ce4affSfengbojiang by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, 2141*22ce4affSfengbojiang then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER 2142*22ce4affSfengbojiang to indicate that the set operation was not actually performed. 2143*22ce4affSfengbojiang If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 2144*22ce4affSfengbojiang MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. 2145*22ce4affSfengbojiang 2146*22ce4affSfengbojiang If PatchVariable is NULL, then ASSERT(). 2147*22ce4affSfengbojiang If SizeOfPatchVariable is NULL, then ASSERT(). 2148*22ce4affSfengbojiang If SizeOfBuffer is NULL, then ASSERT(). 2149*22ce4affSfengbojiang If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 2150*22ce4affSfengbojiang 2151*22ce4affSfengbojiang @param[out] PatchVariable A pointer to the global variable in a module that is 2152*22ce4affSfengbojiang the target of the set operation. 2153*22ce4affSfengbojiang @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. 2154*22ce4affSfengbojiang @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 2155*22ce4affSfengbojiang @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 2156*22ce4affSfengbojiang @param[in] Buffer A pointer to the buffer to used to set the target variable. 2157*22ce4affSfengbojiang 2158*22ce4affSfengbojiang @return The status of the set operation. 2159*22ce4affSfengbojiang 2160*22ce4affSfengbojiang **/ 2161*22ce4affSfengbojiang RETURN_STATUS 2162*22ce4affSfengbojiang EFIAPI 2163*22ce4affSfengbojiang LibPatchPcdSetPtrAndSizeS ( 2164*22ce4affSfengbojiang OUT VOID *PatchVariable, 2165*22ce4affSfengbojiang OUT UINTN *SizeOfPatchVariable, 2166*22ce4affSfengbojiang IN UINTN MaximumDatumSize, 2167*22ce4affSfengbojiang IN OUT UINTN *SizeOfBuffer, 2168*22ce4affSfengbojiang IN CONST VOID *Buffer 2169*22ce4affSfengbojiang ); 2170*22ce4affSfengbojiang 2171*22ce4affSfengbojiang typedef enum { 2172*22ce4affSfengbojiang PCD_TYPE_8, 2173*22ce4affSfengbojiang PCD_TYPE_16, 2174*22ce4affSfengbojiang PCD_TYPE_32, 2175*22ce4affSfengbojiang PCD_TYPE_64, 2176*22ce4affSfengbojiang PCD_TYPE_BOOL, 2177*22ce4affSfengbojiang PCD_TYPE_PTR 2178*22ce4affSfengbojiang } PCD_TYPE; 2179*22ce4affSfengbojiang 2180*22ce4affSfengbojiang typedef struct { 2181*22ce4affSfengbojiang /// 2182*22ce4affSfengbojiang /// The returned information associated with the requested TokenNumber. If 2183*22ce4affSfengbojiang /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8. 2184*22ce4affSfengbojiang /// 2185*22ce4affSfengbojiang PCD_TYPE PcdType; 2186*22ce4affSfengbojiang /// 2187*22ce4affSfengbojiang /// The size of the data in bytes associated with the TokenNumber specified. If 2188*22ce4affSfengbojiang /// TokenNumber is 0, then PcdSize is set 0. 2189*22ce4affSfengbojiang /// 2190*22ce4affSfengbojiang UINTN PcdSize; 2191*22ce4affSfengbojiang /// 2192*22ce4affSfengbojiang /// The null-terminated ASCII string associated with a given token. If the 2193*22ce4affSfengbojiang /// TokenNumber specified was 0, then this field corresponds to the null-terminated 2194*22ce4affSfengbojiang /// ASCII string associated with the token's namespace Guid. If NULL, there is no 2195*22ce4affSfengbojiang /// name associated with this request. 2196*22ce4affSfengbojiang /// 2197*22ce4affSfengbojiang CHAR8 *PcdName; 2198*22ce4affSfengbojiang } PCD_INFO; 2199*22ce4affSfengbojiang 2200*22ce4affSfengbojiang 2201*22ce4affSfengbojiang /** 2202*22ce4affSfengbojiang Retrieve additional information associated with a PCD token. 2203*22ce4affSfengbojiang 2204*22ce4affSfengbojiang This includes information such as the type of value the TokenNumber is associated with as well as possible 2205*22ce4affSfengbojiang human readable name that is associated with the token. 2206*22ce4affSfengbojiang 2207*22ce4affSfengbojiang If TokenNumber is not in the default token space specified, then ASSERT(). 2208*22ce4affSfengbojiang 2209*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number. 2210*22ce4affSfengbojiang @param[out] PcdInfo The returned information associated with the requested TokenNumber. 2211*22ce4affSfengbojiang The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 2212*22ce4affSfengbojiang **/ 2213*22ce4affSfengbojiang VOID 2214*22ce4affSfengbojiang EFIAPI 2215*22ce4affSfengbojiang LibPcdGetInfo ( 2216*22ce4affSfengbojiang IN UINTN TokenNumber, 2217*22ce4affSfengbojiang OUT PCD_INFO *PcdInfo 2218*22ce4affSfengbojiang ); 2219*22ce4affSfengbojiang 2220*22ce4affSfengbojiang /** 2221*22ce4affSfengbojiang Retrieve additional information associated with a PCD token. 2222*22ce4affSfengbojiang 2223*22ce4affSfengbojiang This includes information such as the type of value the TokenNumber is associated with as well as possible 2224*22ce4affSfengbojiang human readable name that is associated with the token. 2225*22ce4affSfengbojiang 2226*22ce4affSfengbojiang If TokenNumber is not in the token space specified by Guid, then ASSERT(). 2227*22ce4affSfengbojiang 2228*22ce4affSfengbojiang @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. 2229*22ce4affSfengbojiang @param[in] TokenNumber The PCD token number. 2230*22ce4affSfengbojiang @param[out] PcdInfo The returned information associated with the requested TokenNumber. 2231*22ce4affSfengbojiang The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 2232*22ce4affSfengbojiang **/ 2233*22ce4affSfengbojiang VOID 2234*22ce4affSfengbojiang EFIAPI 2235*22ce4affSfengbojiang LibPcdGetInfoEx ( 2236*22ce4affSfengbojiang IN CONST GUID *Guid, 2237*22ce4affSfengbojiang IN UINTN TokenNumber, 2238*22ce4affSfengbojiang OUT PCD_INFO *PcdInfo 2239*22ce4affSfengbojiang ); 2240*22ce4affSfengbojiang 2241*22ce4affSfengbojiang /** 2242*22ce4affSfengbojiang Retrieve the currently set SKU Id. 2243*22ce4affSfengbojiang 2244*22ce4affSfengbojiang @return The currently set SKU Id. If the platform has not set at a SKU Id, then the 2245*22ce4affSfengbojiang default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU 2246*22ce4affSfengbojiang Id is returned. 2247*22ce4affSfengbojiang **/ 2248*22ce4affSfengbojiang UINTN 2249*22ce4affSfengbojiang EFIAPI 2250*22ce4affSfengbojiang LibPcdGetSku ( 2251*22ce4affSfengbojiang VOID 2252*22ce4affSfengbojiang ); 2253*22ce4affSfengbojiang 2254*22ce4affSfengbojiang #endif 2255