1*1370a723SSascha Wildner /** @file 2*1370a723SSascha Wildner Provides library services to get and set Platform Configuration Database entries. 3*1370a723SSascha Wildner 4*1370a723SSascha Wildner PCD Library Class provides a PCD usage macro interface for all PCD types. 5*1370a723SSascha Wildner It should be included in any module that uses PCD. If a module uses dynamic/dynamicex 6*1370a723SSascha Wildner PCD, module should be linked to a PEIM/DXE library instance to access that PCD. 7*1370a723SSascha Wildner If a module uses PatchableInModule type PCD, it also needs the library instance to produce 8*1370a723SSascha Wildner LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is 9*1370a723SSascha Wildner translated to a variable or macro that is auto-generated by build tool in 10*1370a723SSascha Wildner module's autogen.h/autogen.c. 11*1370a723SSascha Wildner The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are 12*1370a723SSascha Wildner only available prior to ExitBootServices(). If access to PCD values are required 13*1370a723SSascha Wildner at runtime, then their values must be collected prior to ExitBootServices(). 14*1370a723SSascha Wildner There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(), 15*1370a723SSascha Wildner PatchPcdGetXX(), and PatchPcdSetXX(). 16*1370a723SSascha Wildner 17*1370a723SSascha Wildner Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> 18*1370a723SSascha Wildner SPDX-License-Identifier: BSD-2-Clause-Patent 19*1370a723SSascha Wildner 20*1370a723SSascha Wildner **/ 21*1370a723SSascha Wildner 22*1370a723SSascha Wildner #ifndef __PCD_LIB_H__ 23*1370a723SSascha Wildner #define __PCD_LIB_H__ 24*1370a723SSascha Wildner 25*1370a723SSascha Wildner /** 26*1370a723SSascha Wildner Retrieves a token number based on a token name. 27*1370a723SSascha Wildner 28*1370a723SSascha Wildner Returns the token number associated with the PCD token specified by TokenName. 29*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 30*1370a723SSascha Wildner 31*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve the token number for. 32*1370a723SSascha Wildner 33*1370a723SSascha Wildner @return The token number associated with the PCD. 34*1370a723SSascha Wildner 35*1370a723SSascha Wildner **/ 36*1370a723SSascha Wildner #define PcdToken(TokenName) _PCD_TOKEN_##TokenName 37*1370a723SSascha Wildner 38*1370a723SSascha Wildner /** 39*1370a723SSascha Wildner Retrieves a Boolean PCD feature flag based on a token name. 40*1370a723SSascha Wildner 41*1370a723SSascha Wildner Returns the Boolean value for the PCD feature flag specified by TokenName. 42*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 43*1370a723SSascha Wildner If TokenName is not a feature flag PCD, then the module will not build. 44*1370a723SSascha Wildner 45*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 46*1370a723SSascha Wildner 47*1370a723SSascha Wildner @return Boolean value for the PCD feature flag. 48*1370a723SSascha Wildner 49*1370a723SSascha Wildner **/ 50*1370a723SSascha Wildner #define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName 51*1370a723SSascha Wildner 52*1370a723SSascha Wildner /** 53*1370a723SSascha Wildner Retrieves an 8-bit fixed PCD token value based on a token name. 54*1370a723SSascha Wildner 55*1370a723SSascha Wildner Returns the 8-bit value for the token specified by TokenName. 56*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 57*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 58*1370a723SSascha Wildner 59*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 60*1370a723SSascha Wildner 61*1370a723SSascha Wildner @return 8-bit value for the token specified by TokenName. 62*1370a723SSascha Wildner 63*1370a723SSascha Wildner **/ 64*1370a723SSascha Wildner #define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName 65*1370a723SSascha Wildner 66*1370a723SSascha Wildner /** 67*1370a723SSascha Wildner Retrieves a 16-bit fixed PCD token value based on a token name. 68*1370a723SSascha Wildner 69*1370a723SSascha Wildner Returns the 16-bit value for the token specified by TokenName. 70*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 71*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 72*1370a723SSascha Wildner 73*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 74*1370a723SSascha Wildner 75*1370a723SSascha Wildner @return 16-bit value for the token specified by TokenName. 76*1370a723SSascha Wildner 77*1370a723SSascha Wildner **/ 78*1370a723SSascha Wildner #define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName 79*1370a723SSascha Wildner 80*1370a723SSascha Wildner /** 81*1370a723SSascha Wildner Retrieves a 32-bit fixed PCD token value based on a token name. 82*1370a723SSascha Wildner 83*1370a723SSascha Wildner Returns the 32-bit value for the token specified by TokenName. 84*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 85*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 86*1370a723SSascha Wildner 87*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 88*1370a723SSascha Wildner 89*1370a723SSascha Wildner @return 32-bit value for the token specified by TokenName. 90*1370a723SSascha Wildner 91*1370a723SSascha Wildner **/ 92*1370a723SSascha Wildner #define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName 93*1370a723SSascha Wildner 94*1370a723SSascha Wildner /** 95*1370a723SSascha Wildner Retrieves a 64-bit fixed PCD token value based on a token name. 96*1370a723SSascha Wildner 97*1370a723SSascha Wildner Returns the 64-bit value for the token specified by TokenName. 98*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 99*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 100*1370a723SSascha Wildner 101*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 102*1370a723SSascha Wildner 103*1370a723SSascha Wildner @return 64-bit value for the token specified by TokenName. 104*1370a723SSascha Wildner 105*1370a723SSascha Wildner **/ 106*1370a723SSascha Wildner #define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName 107*1370a723SSascha Wildner 108*1370a723SSascha Wildner /** 109*1370a723SSascha Wildner Retrieves a Boolean fixed PCD token value based on a token name. 110*1370a723SSascha Wildner 111*1370a723SSascha Wildner Returns the Boolean value for the token specified by TokenName. 112*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 113*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 114*1370a723SSascha Wildner 115*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 116*1370a723SSascha Wildner 117*1370a723SSascha Wildner @return The Boolean value for the token. 118*1370a723SSascha Wildner 119*1370a723SSascha Wildner **/ 120*1370a723SSascha Wildner #define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName 121*1370a723SSascha Wildner 122*1370a723SSascha Wildner /** 123*1370a723SSascha Wildner Retrieves a pointer to a fixed PCD token buffer based on a token name. 124*1370a723SSascha Wildner 125*1370a723SSascha Wildner Returns a pointer to the buffer for the token specified by TokenName. 126*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 127*1370a723SSascha Wildner If TokenName is not a fixed at build PCD, then the module will not build. 128*1370a723SSascha Wildner 129*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 130*1370a723SSascha Wildner 131*1370a723SSascha Wildner @return A pointer to the buffer. 132*1370a723SSascha Wildner 133*1370a723SSascha Wildner **/ 134*1370a723SSascha Wildner #define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName) 135*1370a723SSascha Wildner 136*1370a723SSascha Wildner /** 137*1370a723SSascha Wildner Retrieves an 8-bit binary patchable PCD token value based on a token name. 138*1370a723SSascha Wildner 139*1370a723SSascha Wildner Returns the 8-bit value for the token specified by TokenName. 140*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 141*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 142*1370a723SSascha Wildner 143*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 144*1370a723SSascha Wildner 145*1370a723SSascha Wildner @return An 8-bit binary patchable PCD token value. 146*1370a723SSascha Wildner 147*1370a723SSascha Wildner **/ 148*1370a723SSascha Wildner #define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName 149*1370a723SSascha Wildner 150*1370a723SSascha Wildner /** 151*1370a723SSascha Wildner Retrieves a 16-bit binary patchable PCD token value based on a token name. 152*1370a723SSascha Wildner 153*1370a723SSascha Wildner Returns the 16-bit value for the token specified by TokenName. 154*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 155*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 156*1370a723SSascha Wildner 157*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 158*1370a723SSascha Wildner 159*1370a723SSascha Wildner @return A 16-bit binary patchable PCD token value. 160*1370a723SSascha Wildner 161*1370a723SSascha Wildner **/ 162*1370a723SSascha Wildner #define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName 163*1370a723SSascha Wildner 164*1370a723SSascha Wildner /** 165*1370a723SSascha Wildner Retrieves a 32-bit binary patchable PCD token value based on a token name. 166*1370a723SSascha Wildner 167*1370a723SSascha Wildner Returns the 32-bit value for the token specified by TokenName. 168*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 169*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 170*1370a723SSascha Wildner 171*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 172*1370a723SSascha Wildner 173*1370a723SSascha Wildner @return A 32-bit binary patchable PCD token value. 174*1370a723SSascha Wildner 175*1370a723SSascha Wildner **/ 176*1370a723SSascha Wildner #define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName 177*1370a723SSascha Wildner 178*1370a723SSascha Wildner /** 179*1370a723SSascha Wildner Retrieves a 64-bit binary patchable PCD token value based on a token name. 180*1370a723SSascha Wildner 181*1370a723SSascha Wildner Returns the 64-bit value for the token specified by TokenName. 182*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 183*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 184*1370a723SSascha Wildner 185*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 186*1370a723SSascha Wildner 187*1370a723SSascha Wildner @return A 64-bit binary patchable PCD token value. 188*1370a723SSascha Wildner 189*1370a723SSascha Wildner **/ 190*1370a723SSascha Wildner #define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName 191*1370a723SSascha Wildner 192*1370a723SSascha Wildner /** 193*1370a723SSascha Wildner Retrieves a Boolean binary patchable PCD token value based on a token name. 194*1370a723SSascha Wildner 195*1370a723SSascha Wildner Returns the Boolean value for the token specified by TokenName. 196*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 197*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 198*1370a723SSascha Wildner 199*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 200*1370a723SSascha Wildner 201*1370a723SSascha Wildner @return The Boolean value for the token. 202*1370a723SSascha Wildner 203*1370a723SSascha Wildner **/ 204*1370a723SSascha Wildner #define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName 205*1370a723SSascha Wildner 206*1370a723SSascha Wildner /** 207*1370a723SSascha Wildner Retrieves a pointer to a binary patchable PCD token buffer based on a token name. 208*1370a723SSascha Wildner 209*1370a723SSascha Wildner Returns a pointer to the buffer for the token specified by TokenName. 210*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 211*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 212*1370a723SSascha Wildner 213*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 214*1370a723SSascha Wildner 215*1370a723SSascha Wildner @return A pointer to the buffer for the token. 216*1370a723SSascha Wildner 217*1370a723SSascha Wildner **/ 218*1370a723SSascha Wildner #define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName) 219*1370a723SSascha Wildner 220*1370a723SSascha Wildner /** 221*1370a723SSascha Wildner Sets an 8-bit binary patchable PCD token value based on a token name. 222*1370a723SSascha Wildner 223*1370a723SSascha Wildner Sets the 8-bit value for the token specified by TokenName. Value is returned. 224*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 225*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 226*1370a723SSascha Wildner 227*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 228*1370a723SSascha Wildner @param Value The 8-bit value to set. 229*1370a723SSascha Wildner 230*1370a723SSascha Wildner @return Return the Value that was set. 231*1370a723SSascha Wildner 232*1370a723SSascha Wildner **/ 233*1370a723SSascha Wildner #define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 234*1370a723SSascha Wildner 235*1370a723SSascha Wildner /** 236*1370a723SSascha Wildner Sets a 16-bit binary patchable PCD token value based on a token name. 237*1370a723SSascha Wildner 238*1370a723SSascha Wildner Sets the 16-bit value for the token specified by TokenName. Value is returned. 239*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 240*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 241*1370a723SSascha Wildner 242*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 243*1370a723SSascha Wildner @param Value The 16-bit value to set. 244*1370a723SSascha Wildner 245*1370a723SSascha Wildner @return Return the Value that was set. 246*1370a723SSascha Wildner 247*1370a723SSascha Wildner **/ 248*1370a723SSascha Wildner #define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 249*1370a723SSascha Wildner 250*1370a723SSascha Wildner /** 251*1370a723SSascha Wildner Sets a 32-bit binary patchable PCD token value based on a token name. 252*1370a723SSascha Wildner 253*1370a723SSascha Wildner Sets the 32-bit value for the token specified by TokenName. Value is returned. 254*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 255*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 256*1370a723SSascha Wildner 257*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 258*1370a723SSascha Wildner @param Value The 32-bit value to set. 259*1370a723SSascha Wildner 260*1370a723SSascha Wildner @return Return the Value that was set. 261*1370a723SSascha Wildner 262*1370a723SSascha Wildner **/ 263*1370a723SSascha Wildner #define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 264*1370a723SSascha Wildner 265*1370a723SSascha Wildner /** 266*1370a723SSascha Wildner Sets a 64-bit binary patchable PCD token value based on a token name. 267*1370a723SSascha Wildner 268*1370a723SSascha Wildner Sets the 64-bit value for the token specified by TokenName. Value is returned. 269*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 270*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 271*1370a723SSascha Wildner 272*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 273*1370a723SSascha Wildner @param Value The 64-bit value to set. 274*1370a723SSascha Wildner 275*1370a723SSascha Wildner @return Return the Value that was set. 276*1370a723SSascha Wildner 277*1370a723SSascha Wildner **/ 278*1370a723SSascha Wildner #define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 279*1370a723SSascha Wildner 280*1370a723SSascha Wildner /** 281*1370a723SSascha Wildner Sets a Boolean binary patchable PCD token value based on a token name. 282*1370a723SSascha Wildner 283*1370a723SSascha Wildner Sets the Boolean value for the token specified by TokenName. Value is returned. 284*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 285*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 286*1370a723SSascha Wildner 287*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 288*1370a723SSascha Wildner @param Value The boolean value to set. 289*1370a723SSascha Wildner 290*1370a723SSascha Wildner @return Return the Value that was set. 291*1370a723SSascha Wildner 292*1370a723SSascha Wildner **/ 293*1370a723SSascha Wildner #define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value)) 294*1370a723SSascha Wildner 295*1370a723SSascha Wildner /** 296*1370a723SSascha Wildner Sets a pointer to a binary patchable PCD token buffer based on a token name. 297*1370a723SSascha Wildner 298*1370a723SSascha Wildner Sets the buffer for the token specified by TokenName. Buffer is returned. 299*1370a723SSascha Wildner If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer 300*1370a723SSascha Wildner to the maximum size supported by TokenName and return NULL to indicate that the set operation 301*1370a723SSascha Wildner was not actually performed. If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be 302*1370a723SSascha Wildner set to the maximum size supported by TokenName and NULL must be returned. 303*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 304*1370a723SSascha Wildner If TokenName is not a patchable in module PCD, then the module will not build. 305*1370a723SSascha Wildner 306*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 307*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 308*1370a723SSascha Wildner 309*1370a723SSascha Wildner @param TokenName The name of the binary patchable PCD token to set the current value for. 310*1370a723SSascha Wildner @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 311*1370a723SSascha Wildner @param Buffer Pointer to the value to set. 312*1370a723SSascha Wildner 313*1370a723SSascha Wildner @return Return the pointer to the Buffer that was set. 314*1370a723SSascha Wildner 315*1370a723SSascha Wildner **/ 316*1370a723SSascha Wildner #define PatchPcdSetPtr(TokenName, Size, Buffer) \ 317*1370a723SSascha Wildner LibPatchPcdSetPtrAndSize ( \ 318*1370a723SSascha Wildner (VOID *)_gPcd_BinaryPatch_##TokenName, \ 319*1370a723SSascha Wildner &_gPcd_BinaryPatch_Size_##TokenName, \ 320*1370a723SSascha Wildner (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \ 321*1370a723SSascha Wildner (Size), \ 322*1370a723SSascha Wildner (Buffer) \ 323*1370a723SSascha Wildner ) 324*1370a723SSascha Wildner 325*1370a723SSascha Wildner /** 326*1370a723SSascha Wildner Retrieves an 8-bit PCD token value based on a token name. 327*1370a723SSascha Wildner 328*1370a723SSascha Wildner Returns the 8-bit value for the token specified by TokenName. 329*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 330*1370a723SSascha Wildner 331*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 332*1370a723SSascha Wildner 333*1370a723SSascha Wildner @return 8-bit value for the token specified by TokenName. 334*1370a723SSascha Wildner 335*1370a723SSascha Wildner **/ 336*1370a723SSascha Wildner #define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName 337*1370a723SSascha Wildner 338*1370a723SSascha Wildner /** 339*1370a723SSascha Wildner Retrieves a 16-bit PCD token value based on a token name. 340*1370a723SSascha Wildner 341*1370a723SSascha Wildner Returns the 16-bit value for the token specified by TokenName. 342*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 343*1370a723SSascha Wildner 344*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 345*1370a723SSascha Wildner 346*1370a723SSascha Wildner @return 16-bit value for the token specified by TokenName. 347*1370a723SSascha Wildner 348*1370a723SSascha Wildner **/ 349*1370a723SSascha Wildner #define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName 350*1370a723SSascha Wildner 351*1370a723SSascha Wildner /** 352*1370a723SSascha Wildner Retrieves a 32-bit PCD token value based on a token name. 353*1370a723SSascha Wildner 354*1370a723SSascha Wildner Returns the 32-bit value for the token specified by TokenName. 355*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 356*1370a723SSascha Wildner 357*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 358*1370a723SSascha Wildner 359*1370a723SSascha Wildner @return 32-bit value for the token specified by TokenName. 360*1370a723SSascha Wildner 361*1370a723SSascha Wildner **/ 362*1370a723SSascha Wildner #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName 363*1370a723SSascha Wildner 364*1370a723SSascha Wildner /** 365*1370a723SSascha Wildner Retrieves a 64-bit PCD token value based on a token name. 366*1370a723SSascha Wildner 367*1370a723SSascha Wildner Returns the 64-bit value for the token specified by TokenName. 368*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 369*1370a723SSascha Wildner 370*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 371*1370a723SSascha Wildner 372*1370a723SSascha Wildner @return 64-bit value for the token specified by TokenName. 373*1370a723SSascha Wildner 374*1370a723SSascha Wildner **/ 375*1370a723SSascha Wildner #define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName 376*1370a723SSascha Wildner 377*1370a723SSascha Wildner /** 378*1370a723SSascha Wildner Retrieves a pointer to a PCD token buffer based on a token name. 379*1370a723SSascha Wildner 380*1370a723SSascha Wildner Returns a pointer to the buffer for the token specified by TokenName. 381*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 382*1370a723SSascha Wildner 383*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 384*1370a723SSascha Wildner 385*1370a723SSascha Wildner @return A pointer to the buffer. 386*1370a723SSascha Wildner 387*1370a723SSascha Wildner **/ 388*1370a723SSascha Wildner #define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName 389*1370a723SSascha Wildner 390*1370a723SSascha Wildner /** 391*1370a723SSascha Wildner Retrieves a Boolean PCD token value based on a token name. 392*1370a723SSascha Wildner 393*1370a723SSascha Wildner Returns the Boolean value for the token specified by TokenName. 394*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 395*1370a723SSascha Wildner 396*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 397*1370a723SSascha Wildner 398*1370a723SSascha Wildner @return A Boolean PCD token value. 399*1370a723SSascha Wildner 400*1370a723SSascha Wildner **/ 401*1370a723SSascha Wildner #define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName 402*1370a723SSascha Wildner 403*1370a723SSascha Wildner /** 404*1370a723SSascha Wildner Retrieves the size of a fixed PCD token based on a token name. 405*1370a723SSascha Wildner 406*1370a723SSascha Wildner Returns the size of the token specified by TokenName. 407*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 408*1370a723SSascha Wildner 409*1370a723SSascha Wildner @param[in] TokenName The name of the PCD token to retrieve a current value size for. 410*1370a723SSascha Wildner 411*1370a723SSascha Wildner @return Return the size 412*1370a723SSascha Wildner 413*1370a723SSascha Wildner **/ 414*1370a723SSascha Wildner #define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName 415*1370a723SSascha Wildner 416*1370a723SSascha Wildner /** 417*1370a723SSascha Wildner Retrieves the size of a binary patchable PCD token based on a token name. 418*1370a723SSascha Wildner 419*1370a723SSascha Wildner Returns the size of the token specified by TokenName. 420*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 421*1370a723SSascha Wildner 422*1370a723SSascha Wildner @param[in] TokenName The name of the PCD token to retrieve a current value size for. 423*1370a723SSascha Wildner 424*1370a723SSascha Wildner @return Return the size 425*1370a723SSascha Wildner 426*1370a723SSascha Wildner **/ 427*1370a723SSascha Wildner #define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName 428*1370a723SSascha Wildner 429*1370a723SSascha Wildner /** 430*1370a723SSascha Wildner Retrieves the size of the PCD token based on a token name. 431*1370a723SSascha Wildner 432*1370a723SSascha Wildner Returns the size of the token specified by TokenName. 433*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 434*1370a723SSascha Wildner 435*1370a723SSascha Wildner @param[in] TokenName The name of the PCD token to retrieve a current value size for. 436*1370a723SSascha Wildner 437*1370a723SSascha Wildner @return Return the size 438*1370a723SSascha Wildner 439*1370a723SSascha Wildner **/ 440*1370a723SSascha Wildner #define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName 441*1370a723SSascha Wildner 442*1370a723SSascha Wildner /** 443*1370a723SSascha Wildner Retrieve the size of a given PCD token. 444*1370a723SSascha Wildner 445*1370a723SSascha Wildner Returns the size of the token specified by TokenNumber and Guid. 446*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 447*1370a723SSascha Wildner 448*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 449*1370a723SSascha Wildner which namespace to retrieve a value from. 450*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value size for. 451*1370a723SSascha Wildner 452*1370a723SSascha Wildner @return Return the size. 453*1370a723SSascha Wildner 454*1370a723SSascha Wildner **/ 455*1370a723SSascha Wildner #define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName)) 456*1370a723SSascha Wildner 457*1370a723SSascha Wildner /** 458*1370a723SSascha Wildner Sets a 8-bit PCD token value based on a token name. 459*1370a723SSascha Wildner 460*1370a723SSascha Wildner Sets the 8-bit value for the token specified by TokenName. 461*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 462*1370a723SSascha Wildner 463*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 464*1370a723SSascha Wildner @param Value The 8-bit value to set. 465*1370a723SSascha Wildner 466*1370a723SSascha Wildner @return The status of the set operation. 467*1370a723SSascha Wildner 468*1370a723SSascha Wildner **/ 469*1370a723SSascha Wildner #define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value)) 470*1370a723SSascha Wildner 471*1370a723SSascha Wildner /** 472*1370a723SSascha Wildner Sets a 16-bit PCD token value based on a token name. 473*1370a723SSascha Wildner 474*1370a723SSascha Wildner Sets the 16-bit value for the token specified by TokenName. 475*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 476*1370a723SSascha Wildner 477*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 478*1370a723SSascha Wildner @param Value The 16-bit value to set. 479*1370a723SSascha Wildner 480*1370a723SSascha Wildner @return The status of the set operation. 481*1370a723SSascha Wildner 482*1370a723SSascha Wildner **/ 483*1370a723SSascha Wildner #define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value)) 484*1370a723SSascha Wildner 485*1370a723SSascha Wildner /** 486*1370a723SSascha Wildner Sets a 32-bit PCD token value based on a token name. 487*1370a723SSascha Wildner 488*1370a723SSascha Wildner Sets the 32-bit value for the token specified by TokenName. 489*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 490*1370a723SSascha Wildner 491*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 492*1370a723SSascha Wildner @param Value The 32-bit value to set. 493*1370a723SSascha Wildner 494*1370a723SSascha Wildner @return The status of the set operation. 495*1370a723SSascha Wildner 496*1370a723SSascha Wildner **/ 497*1370a723SSascha Wildner #define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value)) 498*1370a723SSascha Wildner 499*1370a723SSascha Wildner /** 500*1370a723SSascha Wildner Sets a 64-bit PCD token value based on a token name. 501*1370a723SSascha Wildner 502*1370a723SSascha Wildner Sets the 64-bit value for the token specified by TokenName. 503*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 504*1370a723SSascha Wildner 505*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 506*1370a723SSascha Wildner @param Value The 64-bit value to set. 507*1370a723SSascha Wildner 508*1370a723SSascha Wildner @return The status of the set operation. 509*1370a723SSascha Wildner 510*1370a723SSascha Wildner **/ 511*1370a723SSascha Wildner #define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value)) 512*1370a723SSascha Wildner 513*1370a723SSascha Wildner /** 514*1370a723SSascha Wildner Sets a pointer to a PCD token buffer based on a token name. 515*1370a723SSascha Wildner 516*1370a723SSascha Wildner Sets the buffer for the token specified by TokenName. 517*1370a723SSascha Wildner If SizeOfBuffer is greater than the maximum size supported by TokenName, 518*1370a723SSascha Wildner then set SizeOfBuffer to the maximum size supported by TokenName and return 519*1370a723SSascha Wildner RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed. 520*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size 521*1370a723SSascha Wildner supported by TokenName and RETURN_INVALID_PARAMETER must be returned. 522*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 523*1370a723SSascha Wildner 524*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 525*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 526*1370a723SSascha Wildner 527*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 528*1370a723SSascha Wildner @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 529*1370a723SSascha Wildner @param Buffer A pointer to the buffer to set. 530*1370a723SSascha Wildner 531*1370a723SSascha Wildner @return The status of the set operation. 532*1370a723SSascha Wildner 533*1370a723SSascha Wildner **/ 534*1370a723SSascha Wildner #define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \ 535*1370a723SSascha Wildner _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer)) 536*1370a723SSascha Wildner 537*1370a723SSascha Wildner /** 538*1370a723SSascha Wildner Sets a boolean PCD token value based on a token name. 539*1370a723SSascha Wildner 540*1370a723SSascha Wildner Sets the boolean value for the token specified by TokenName. 541*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 542*1370a723SSascha Wildner 543*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 544*1370a723SSascha Wildner @param Value The boolean value to set. 545*1370a723SSascha Wildner 546*1370a723SSascha Wildner @return The status of the set operation. 547*1370a723SSascha Wildner 548*1370a723SSascha Wildner **/ 549*1370a723SSascha Wildner #define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value)) 550*1370a723SSascha Wildner 551*1370a723SSascha Wildner /** 552*1370a723SSascha Wildner Retrieves a token number based on a GUID and a token name. 553*1370a723SSascha Wildner 554*1370a723SSascha Wildner Returns the token number for the token specified by Guid and TokenName. 555*1370a723SSascha Wildner If TokenName is not a valid token in the token space, then the module will not build. 556*1370a723SSascha Wildner 557*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 558*1370a723SSascha Wildner which namespace to retrieve a value from. 559*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 560*1370a723SSascha Wildner 561*1370a723SSascha Wildner @return Return the token number. 562*1370a723SSascha Wildner 563*1370a723SSascha Wildner **/ 564*1370a723SSascha Wildner #define PcdTokenEx(Guid,TokenName) _PCD_TOKEN_EX_##TokenName(Guid) 565*1370a723SSascha Wildner 566*1370a723SSascha Wildner /** 567*1370a723SSascha Wildner Retrieves an 8-bit PCD token value based on a GUID and a token name. 568*1370a723SSascha Wildner 569*1370a723SSascha Wildner Returns the 8-bit value for the token specified by Guid and TokenName. 570*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 571*1370a723SSascha Wildner then the module will not build. 572*1370a723SSascha Wildner 573*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 574*1370a723SSascha Wildner 575*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 576*1370a723SSascha Wildner which namespace to retrieve a value from. 577*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 578*1370a723SSascha Wildner 579*1370a723SSascha Wildner @return An 8-bit PCD token value. 580*1370a723SSascha Wildner 581*1370a723SSascha Wildner **/ 582*1370a723SSascha Wildner #define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName)) 583*1370a723SSascha Wildner 584*1370a723SSascha Wildner /** 585*1370a723SSascha Wildner Retrieves a 16-bit PCD token value based on a GUID and a token name. 586*1370a723SSascha Wildner 587*1370a723SSascha Wildner Returns the 16-bit value for the token specified by Guid and TokenName. 588*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 589*1370a723SSascha Wildner then the module will not build. 590*1370a723SSascha Wildner 591*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 592*1370a723SSascha Wildner 593*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 594*1370a723SSascha Wildner which namespace to retrieve a value from. 595*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 596*1370a723SSascha Wildner 597*1370a723SSascha Wildner @return A 16-bit PCD token value. 598*1370a723SSascha Wildner 599*1370a723SSascha Wildner **/ 600*1370a723SSascha Wildner #define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName)) 601*1370a723SSascha Wildner 602*1370a723SSascha Wildner /** 603*1370a723SSascha Wildner Retrieves a 32-bit PCD token value based on a GUID and a token name. 604*1370a723SSascha Wildner 605*1370a723SSascha Wildner Returns the 32-bit value for the token specified by Guid and TokenName. 606*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 607*1370a723SSascha Wildner then the module will not build. 608*1370a723SSascha Wildner 609*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 610*1370a723SSascha Wildner 611*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 612*1370a723SSascha Wildner which namespace to retrieve a value from. 613*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 614*1370a723SSascha Wildner 615*1370a723SSascha Wildner @return A 32-bit PCD token value. 616*1370a723SSascha Wildner 617*1370a723SSascha Wildner **/ 618*1370a723SSascha Wildner #define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName)) 619*1370a723SSascha Wildner 620*1370a723SSascha Wildner /** 621*1370a723SSascha Wildner Retrieves a 64-bit PCD token value based on a GUID and a token name. 622*1370a723SSascha Wildner 623*1370a723SSascha Wildner Returns the 64-bit value for the token specified by Guid and TokenName. 624*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 625*1370a723SSascha Wildner then the module will not build. 626*1370a723SSascha Wildner 627*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 628*1370a723SSascha Wildner 629*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 630*1370a723SSascha Wildner which namespace to retrieve a value from. 631*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 632*1370a723SSascha Wildner 633*1370a723SSascha Wildner @return A 64-bit PCD token value. 634*1370a723SSascha Wildner 635*1370a723SSascha Wildner **/ 636*1370a723SSascha Wildner #define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName)) 637*1370a723SSascha Wildner 638*1370a723SSascha Wildner /** 639*1370a723SSascha Wildner Retrieves a pointer to a PCD token buffer based on a GUID and a token name. 640*1370a723SSascha Wildner 641*1370a723SSascha Wildner Returns a pointer to the buffer for the token specified by Guid and TokenName. 642*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 643*1370a723SSascha Wildner then the module will not build. 644*1370a723SSascha Wildner 645*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 646*1370a723SSascha Wildner 647*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 648*1370a723SSascha Wildner which namespace to retrieve a value from. 649*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 650*1370a723SSascha Wildner 651*1370a723SSascha Wildner @return A pointer to a PCD token buffer. 652*1370a723SSascha Wildner 653*1370a723SSascha Wildner **/ 654*1370a723SSascha Wildner #define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName)) 655*1370a723SSascha Wildner 656*1370a723SSascha Wildner /** 657*1370a723SSascha Wildner Retrieves a Boolean PCD token value based on a GUID and a token name. 658*1370a723SSascha Wildner 659*1370a723SSascha Wildner Returns the Boolean value for the token specified by Guid and TokenName. 660*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 661*1370a723SSascha Wildner then the module will not build. 662*1370a723SSascha Wildner 663*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 664*1370a723SSascha Wildner 665*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 666*1370a723SSascha Wildner which namespace to retrieve a value from. 667*1370a723SSascha Wildner @param TokenName The name of the PCD token to retrieve a current value for. 668*1370a723SSascha Wildner 669*1370a723SSascha Wildner @return A Boolean PCD token value. 670*1370a723SSascha Wildner 671*1370a723SSascha Wildner **/ 672*1370a723SSascha Wildner #define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName)) 673*1370a723SSascha Wildner 674*1370a723SSascha Wildner /** 675*1370a723SSascha Wildner Sets an 8-bit PCD token value based on a GUID and a token name. 676*1370a723SSascha Wildner 677*1370a723SSascha Wildner Sets the 8-bit value for the token specified by Guid and TokenName. 678*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 679*1370a723SSascha Wildner then the module will not build. 680*1370a723SSascha Wildner 681*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 682*1370a723SSascha Wildner 683*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 684*1370a723SSascha Wildner which namespace to retrieve a value from. 685*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 686*1370a723SSascha Wildner @param Value The 8-bit value to set. 687*1370a723SSascha Wildner 688*1370a723SSascha Wildner @return The status of the set operation. 689*1370a723SSascha Wildner 690*1370a723SSascha Wildner **/ 691*1370a723SSascha Wildner #define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 692*1370a723SSascha Wildner 693*1370a723SSascha Wildner /** 694*1370a723SSascha Wildner Sets an 16-bit PCD token value based on a GUID and a token name. 695*1370a723SSascha Wildner 696*1370a723SSascha Wildner Sets the 16-bit value for the token specified by Guid and TokenName. 697*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 698*1370a723SSascha Wildner then the module will not build. 699*1370a723SSascha Wildner 700*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 701*1370a723SSascha Wildner 702*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 703*1370a723SSascha Wildner which namespace to retrieve a value from. 704*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 705*1370a723SSascha Wildner @param Value The 16-bit value to set. 706*1370a723SSascha Wildner 707*1370a723SSascha Wildner @return The status of the set operation. 708*1370a723SSascha Wildner 709*1370a723SSascha Wildner **/ 710*1370a723SSascha Wildner #define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 711*1370a723SSascha Wildner 712*1370a723SSascha Wildner /** 713*1370a723SSascha Wildner Sets an 32-bit PCD token value based on a GUID and a token name. 714*1370a723SSascha Wildner 715*1370a723SSascha Wildner Sets the 32-bit value for the token specified by Guid and TokenName. 716*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 717*1370a723SSascha Wildner then the module will not build. 718*1370a723SSascha Wildner 719*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 720*1370a723SSascha Wildner 721*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 722*1370a723SSascha Wildner which namespace to retrieve a value from. 723*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 724*1370a723SSascha Wildner @param Value The 32-bit value to set. 725*1370a723SSascha Wildner 726*1370a723SSascha Wildner @return The status of the set operation. 727*1370a723SSascha Wildner 728*1370a723SSascha Wildner **/ 729*1370a723SSascha Wildner #define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 730*1370a723SSascha Wildner 731*1370a723SSascha Wildner /** 732*1370a723SSascha Wildner Sets an 64-bit PCD token value based on a GUID and a token name. 733*1370a723SSascha Wildner 734*1370a723SSascha Wildner Sets the 64-bit value for the token specified by Guid and TokenName. 735*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 736*1370a723SSascha Wildner then the module will not build. 737*1370a723SSascha Wildner 738*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 739*1370a723SSascha Wildner 740*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 741*1370a723SSascha Wildner which namespace to retrieve a value from. 742*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 743*1370a723SSascha Wildner @param Value The 64-bit value to set. 744*1370a723SSascha Wildner 745*1370a723SSascha Wildner @return The status of the set operation. 746*1370a723SSascha Wildner 747*1370a723SSascha Wildner **/ 748*1370a723SSascha Wildner #define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 749*1370a723SSascha Wildner 750*1370a723SSascha Wildner /** 751*1370a723SSascha Wildner Sets a pointer to a PCD token buffer based on a GUID and a token name. 752*1370a723SSascha Wildner 753*1370a723SSascha Wildner Sets the buffer for the token specified by Guid and TokenName. 754*1370a723SSascha Wildner If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName, 755*1370a723SSascha Wildner then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return 756*1370a723SSascha Wildner RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed. 757*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size 758*1370a723SSascha Wildner supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned. 759*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 760*1370a723SSascha Wildner then the module will not build. 761*1370a723SSascha Wildner 762*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 763*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 764*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 765*1370a723SSascha Wildner 766*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 767*1370a723SSascha Wildner which namespace to retrieve a value from. 768*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 769*1370a723SSascha Wildner @param SizeOfBuffer A pointer to the size, in bytes, of Buffer. 770*1370a723SSascha Wildner @param Buffer Pointer to the buffer to set. 771*1370a723SSascha Wildner 772*1370a723SSascha Wildner @return The status of the set operation. 773*1370a723SSascha Wildner 774*1370a723SSascha Wildner **/ 775*1370a723SSascha Wildner #define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \ 776*1370a723SSascha Wildner LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer)) 777*1370a723SSascha Wildner 778*1370a723SSascha Wildner /** 779*1370a723SSascha Wildner Sets an boolean PCD token value based on a GUID and a token name. 780*1370a723SSascha Wildner 781*1370a723SSascha Wildner Sets the boolean value for the token specified by Guid and TokenName. 782*1370a723SSascha Wildner If TokenName is not a valid token in the token space specified by Guid, 783*1370a723SSascha Wildner then the module will not build. 784*1370a723SSascha Wildner 785*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 786*1370a723SSascha Wildner 787*1370a723SSascha Wildner @param Guid Pointer to a 128-bit unique value that designates 788*1370a723SSascha Wildner which namespace to retrieve a value from. 789*1370a723SSascha Wildner @param TokenName The name of the PCD token to set the current value for. 790*1370a723SSascha Wildner @param Value The boolean value to set. 791*1370a723SSascha Wildner 792*1370a723SSascha Wildner @return The status of the set operation. 793*1370a723SSascha Wildner 794*1370a723SSascha Wildner **/ 795*1370a723SSascha Wildner #define PcdSetExBoolS(Guid, TokenName, Value) \ 796*1370a723SSascha Wildner LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value)) 797*1370a723SSascha Wildner 798*1370a723SSascha Wildner /** 799*1370a723SSascha Wildner This function provides a means by which SKU support can be established in the PCD infrastructure. 800*1370a723SSascha Wildner 801*1370a723SSascha Wildner Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned. 802*1370a723SSascha Wildner 803*1370a723SSascha Wildner @param SkuId The SKU value that will be used when the PCD service retrieves and sets values 804*1370a723SSascha Wildner associated with a PCD token. 805*1370a723SSascha Wildner 806*1370a723SSascha Wildner @return Return the SKU ID that was set. 807*1370a723SSascha Wildner 808*1370a723SSascha Wildner **/ 809*1370a723SSascha Wildner UINTN 810*1370a723SSascha Wildner EFIAPI 811*1370a723SSascha Wildner LibPcdSetSku ( 812*1370a723SSascha Wildner IN UINTN SkuId 813*1370a723SSascha Wildner ); 814*1370a723SSascha Wildner 815*1370a723SSascha Wildner /** 816*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 817*1370a723SSascha Wildner 818*1370a723SSascha Wildner Returns the 8-bit value for the token specified by TokenNumber. 819*1370a723SSascha Wildner 820*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 821*1370a723SSascha Wildner 822*1370a723SSascha Wildner @return Returns the 8-bit value for the token specified by TokenNumber. 823*1370a723SSascha Wildner 824*1370a723SSascha Wildner **/ 825*1370a723SSascha Wildner UINT8 826*1370a723SSascha Wildner EFIAPI 827*1370a723SSascha Wildner LibPcdGet8 ( 828*1370a723SSascha Wildner IN UINTN TokenNumber 829*1370a723SSascha Wildner ); 830*1370a723SSascha Wildner 831*1370a723SSascha Wildner /** 832*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 833*1370a723SSascha Wildner 834*1370a723SSascha Wildner Returns the 16-bit value for the token specified by TokenNumber. 835*1370a723SSascha Wildner 836*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 837*1370a723SSascha Wildner 838*1370a723SSascha Wildner @return Returns the 16-bit value for the token specified by TokenNumber. 839*1370a723SSascha Wildner 840*1370a723SSascha Wildner **/ 841*1370a723SSascha Wildner UINT16 842*1370a723SSascha Wildner EFIAPI 843*1370a723SSascha Wildner LibPcdGet16 ( 844*1370a723SSascha Wildner IN UINTN TokenNumber 845*1370a723SSascha Wildner ); 846*1370a723SSascha Wildner 847*1370a723SSascha Wildner /** 848*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 849*1370a723SSascha Wildner 850*1370a723SSascha Wildner Returns the 32-bit value for the token specified by TokenNumber. 851*1370a723SSascha Wildner 852*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 853*1370a723SSascha Wildner 854*1370a723SSascha Wildner @return Returns the 32-bit value for the token specified by TokenNumber. 855*1370a723SSascha Wildner 856*1370a723SSascha Wildner **/ 857*1370a723SSascha Wildner UINT32 858*1370a723SSascha Wildner EFIAPI 859*1370a723SSascha Wildner LibPcdGet32 ( 860*1370a723SSascha Wildner IN UINTN TokenNumber 861*1370a723SSascha Wildner ); 862*1370a723SSascha Wildner 863*1370a723SSascha Wildner /** 864*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 865*1370a723SSascha Wildner 866*1370a723SSascha Wildner Returns the 64-bit value for the token specified by TokenNumber. 867*1370a723SSascha Wildner 868*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 869*1370a723SSascha Wildner 870*1370a723SSascha Wildner @return Returns the 64-bit value for the token specified by TokenNumber. 871*1370a723SSascha Wildner 872*1370a723SSascha Wildner **/ 873*1370a723SSascha Wildner UINT64 874*1370a723SSascha Wildner EFIAPI 875*1370a723SSascha Wildner LibPcdGet64 ( 876*1370a723SSascha Wildner IN UINTN TokenNumber 877*1370a723SSascha Wildner ); 878*1370a723SSascha Wildner 879*1370a723SSascha Wildner /** 880*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 881*1370a723SSascha Wildner 882*1370a723SSascha Wildner Returns the pointer to the buffer of the token specified by TokenNumber. 883*1370a723SSascha Wildner 884*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 885*1370a723SSascha Wildner 886*1370a723SSascha Wildner @return Returns the pointer to the token specified by TokenNumber. 887*1370a723SSascha Wildner 888*1370a723SSascha Wildner **/ 889*1370a723SSascha Wildner VOID * 890*1370a723SSascha Wildner EFIAPI 891*1370a723SSascha Wildner LibPcdGetPtr ( 892*1370a723SSascha Wildner IN UINTN TokenNumber 893*1370a723SSascha Wildner ); 894*1370a723SSascha Wildner 895*1370a723SSascha Wildner /** 896*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 897*1370a723SSascha Wildner 898*1370a723SSascha Wildner Returns the Boolean value of the token specified by TokenNumber. 899*1370a723SSascha Wildner 900*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 901*1370a723SSascha Wildner 902*1370a723SSascha Wildner @return Returns the Boolean value of the token specified by TokenNumber. 903*1370a723SSascha Wildner 904*1370a723SSascha Wildner **/ 905*1370a723SSascha Wildner BOOLEAN 906*1370a723SSascha Wildner EFIAPI 907*1370a723SSascha Wildner LibPcdGetBool ( 908*1370a723SSascha Wildner IN UINTN TokenNumber 909*1370a723SSascha Wildner ); 910*1370a723SSascha Wildner 911*1370a723SSascha Wildner /** 912*1370a723SSascha Wildner This function provides a means by which to retrieve the size of a given PCD token. 913*1370a723SSascha Wildner 914*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 915*1370a723SSascha Wildner 916*1370a723SSascha Wildner @return Returns the size of the token specified by TokenNumber. 917*1370a723SSascha Wildner 918*1370a723SSascha Wildner **/ 919*1370a723SSascha Wildner UINTN 920*1370a723SSascha Wildner EFIAPI 921*1370a723SSascha Wildner LibPcdGetSize ( 922*1370a723SSascha Wildner IN UINTN TokenNumber 923*1370a723SSascha Wildner ); 924*1370a723SSascha Wildner 925*1370a723SSascha Wildner /** 926*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 927*1370a723SSascha Wildner 928*1370a723SSascha Wildner Returns the 8-bit value for the token specified by TokenNumber and Guid. 929*1370a723SSascha Wildner 930*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 931*1370a723SSascha Wildner 932*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 933*1370a723SSascha Wildner which namespace to retrieve a value from. 934*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 935*1370a723SSascha Wildner 936*1370a723SSascha Wildner @return Return the UINT8. 937*1370a723SSascha Wildner 938*1370a723SSascha Wildner **/ 939*1370a723SSascha Wildner UINT8 940*1370a723SSascha Wildner EFIAPI 941*1370a723SSascha Wildner LibPcdGetEx8 ( 942*1370a723SSascha Wildner IN CONST GUID *Guid, 943*1370a723SSascha Wildner IN UINTN TokenNumber 944*1370a723SSascha Wildner ); 945*1370a723SSascha Wildner 946*1370a723SSascha Wildner /** 947*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 948*1370a723SSascha Wildner 949*1370a723SSascha Wildner Returns the 16-bit value for the token specified by TokenNumber and Guid. 950*1370a723SSascha Wildner 951*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 952*1370a723SSascha Wildner 953*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 954*1370a723SSascha Wildner which namespace to retrieve a value from. 955*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 956*1370a723SSascha Wildner 957*1370a723SSascha Wildner @return Return the UINT16. 958*1370a723SSascha Wildner 959*1370a723SSascha Wildner **/ 960*1370a723SSascha Wildner UINT16 961*1370a723SSascha Wildner EFIAPI 962*1370a723SSascha Wildner LibPcdGetEx16 ( 963*1370a723SSascha Wildner IN CONST GUID *Guid, 964*1370a723SSascha Wildner IN UINTN TokenNumber 965*1370a723SSascha Wildner ); 966*1370a723SSascha Wildner 967*1370a723SSascha Wildner /** 968*1370a723SSascha Wildner Returns the 32-bit value for the token specified by TokenNumber and Guid. 969*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 970*1370a723SSascha Wildner 971*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 972*1370a723SSascha Wildner which namespace to retrieve a value from. 973*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 974*1370a723SSascha Wildner 975*1370a723SSascha Wildner @return Return the UINT32. 976*1370a723SSascha Wildner 977*1370a723SSascha Wildner **/ 978*1370a723SSascha Wildner UINT32 979*1370a723SSascha Wildner EFIAPI 980*1370a723SSascha Wildner LibPcdGetEx32 ( 981*1370a723SSascha Wildner IN CONST GUID *Guid, 982*1370a723SSascha Wildner IN UINTN TokenNumber 983*1370a723SSascha Wildner ); 984*1370a723SSascha Wildner 985*1370a723SSascha Wildner /** 986*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 987*1370a723SSascha Wildner 988*1370a723SSascha Wildner Returns the 64-bit value for the token specified by TokenNumber and Guid. 989*1370a723SSascha Wildner 990*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 991*1370a723SSascha Wildner 992*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 993*1370a723SSascha Wildner which namespace to retrieve a value from. 994*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 995*1370a723SSascha Wildner 996*1370a723SSascha Wildner @return Return the UINT64. 997*1370a723SSascha Wildner 998*1370a723SSascha Wildner **/ 999*1370a723SSascha Wildner UINT64 1000*1370a723SSascha Wildner EFIAPI 1001*1370a723SSascha Wildner LibPcdGetEx64 ( 1002*1370a723SSascha Wildner IN CONST GUID *Guid, 1003*1370a723SSascha Wildner IN UINTN TokenNumber 1004*1370a723SSascha Wildner ); 1005*1370a723SSascha Wildner 1006*1370a723SSascha Wildner /** 1007*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 1008*1370a723SSascha Wildner 1009*1370a723SSascha Wildner Returns the pointer to the buffer of token specified by TokenNumber and Guid. 1010*1370a723SSascha Wildner 1011*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1012*1370a723SSascha Wildner 1013*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 1014*1370a723SSascha Wildner which namespace to retrieve a value from. 1015*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 1016*1370a723SSascha Wildner 1017*1370a723SSascha Wildner @return Return the VOID* pointer. 1018*1370a723SSascha Wildner 1019*1370a723SSascha Wildner **/ 1020*1370a723SSascha Wildner VOID * 1021*1370a723SSascha Wildner EFIAPI 1022*1370a723SSascha Wildner LibPcdGetExPtr ( 1023*1370a723SSascha Wildner IN CONST GUID *Guid, 1024*1370a723SSascha Wildner IN UINTN TokenNumber 1025*1370a723SSascha Wildner ); 1026*1370a723SSascha Wildner 1027*1370a723SSascha Wildner /** 1028*1370a723SSascha Wildner This function provides a means by which to retrieve a value for a given PCD token. 1029*1370a723SSascha Wildner 1030*1370a723SSascha Wildner Returns the Boolean value of the token specified by TokenNumber and Guid. 1031*1370a723SSascha Wildner 1032*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1033*1370a723SSascha Wildner 1034*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 1035*1370a723SSascha Wildner which namespace to retrieve a value from. 1036*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 1037*1370a723SSascha Wildner 1038*1370a723SSascha Wildner @return Return the BOOLEAN. 1039*1370a723SSascha Wildner 1040*1370a723SSascha Wildner **/ 1041*1370a723SSascha Wildner BOOLEAN 1042*1370a723SSascha Wildner EFIAPI 1043*1370a723SSascha Wildner LibPcdGetExBool ( 1044*1370a723SSascha Wildner IN CONST GUID *Guid, 1045*1370a723SSascha Wildner IN UINTN TokenNumber 1046*1370a723SSascha Wildner ); 1047*1370a723SSascha Wildner 1048*1370a723SSascha Wildner /** 1049*1370a723SSascha Wildner This function provides a means by which to retrieve the size of a given PCD token. 1050*1370a723SSascha Wildner 1051*1370a723SSascha Wildner Returns the size of the token specified by TokenNumber and Guid. 1052*1370a723SSascha Wildner 1053*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1054*1370a723SSascha Wildner 1055*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates 1056*1370a723SSascha Wildner which namespace to retrieve a value from. 1057*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to retrieve a current value for. 1058*1370a723SSascha Wildner 1059*1370a723SSascha Wildner @return Return the size. 1060*1370a723SSascha Wildner 1061*1370a723SSascha Wildner **/ 1062*1370a723SSascha Wildner UINTN 1063*1370a723SSascha Wildner EFIAPI 1064*1370a723SSascha Wildner LibPcdGetExSize ( 1065*1370a723SSascha Wildner IN CONST GUID *Guid, 1066*1370a723SSascha Wildner IN UINTN TokenNumber 1067*1370a723SSascha Wildner ); 1068*1370a723SSascha Wildner 1069*1370a723SSascha Wildner /** 1070*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1071*1370a723SSascha Wildner 1072*1370a723SSascha Wildner Sets the 8-bit value for the token specified by TokenNumber 1073*1370a723SSascha Wildner to the value specified by Value. 1074*1370a723SSascha Wildner 1075*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1076*1370a723SSascha Wildner @param[in] Value The 8-bit value to set. 1077*1370a723SSascha Wildner 1078*1370a723SSascha Wildner @return The status of the set operation. 1079*1370a723SSascha Wildner 1080*1370a723SSascha Wildner **/ 1081*1370a723SSascha Wildner RETURN_STATUS 1082*1370a723SSascha Wildner EFIAPI 1083*1370a723SSascha Wildner LibPcdSet8S ( 1084*1370a723SSascha Wildner IN UINTN TokenNumber, 1085*1370a723SSascha Wildner IN UINT8 Value 1086*1370a723SSascha Wildner ); 1087*1370a723SSascha Wildner 1088*1370a723SSascha Wildner /** 1089*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1090*1370a723SSascha Wildner 1091*1370a723SSascha Wildner Sets the 16-bit value for the token specified by TokenNumber 1092*1370a723SSascha Wildner to the value specified by Value. 1093*1370a723SSascha Wildner 1094*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1095*1370a723SSascha Wildner @param[in] Value The 16-bit value to set. 1096*1370a723SSascha Wildner 1097*1370a723SSascha Wildner @return The status of the set operation. 1098*1370a723SSascha Wildner 1099*1370a723SSascha Wildner **/ 1100*1370a723SSascha Wildner RETURN_STATUS 1101*1370a723SSascha Wildner EFIAPI 1102*1370a723SSascha Wildner LibPcdSet16S ( 1103*1370a723SSascha Wildner IN UINTN TokenNumber, 1104*1370a723SSascha Wildner IN UINT16 Value 1105*1370a723SSascha Wildner ); 1106*1370a723SSascha Wildner 1107*1370a723SSascha Wildner /** 1108*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1109*1370a723SSascha Wildner 1110*1370a723SSascha Wildner Sets the 32-bit value for the token specified by TokenNumber 1111*1370a723SSascha Wildner to the value specified by Value. 1112*1370a723SSascha Wildner 1113*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1114*1370a723SSascha Wildner @param[in] Value The 32-bit value to set. 1115*1370a723SSascha Wildner 1116*1370a723SSascha Wildner @return The status of the set operation. 1117*1370a723SSascha Wildner 1118*1370a723SSascha Wildner **/ 1119*1370a723SSascha Wildner RETURN_STATUS 1120*1370a723SSascha Wildner EFIAPI 1121*1370a723SSascha Wildner LibPcdSet32S ( 1122*1370a723SSascha Wildner IN UINTN TokenNumber, 1123*1370a723SSascha Wildner IN UINT32 Value 1124*1370a723SSascha Wildner ); 1125*1370a723SSascha Wildner 1126*1370a723SSascha Wildner /** 1127*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1128*1370a723SSascha Wildner 1129*1370a723SSascha Wildner Sets the 64-bit value for the token specified by TokenNumber 1130*1370a723SSascha Wildner to the value specified by Value. 1131*1370a723SSascha Wildner 1132*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1133*1370a723SSascha Wildner @param[in] Value The 64-bit value to set. 1134*1370a723SSascha Wildner 1135*1370a723SSascha Wildner @return The status of the set operation. 1136*1370a723SSascha Wildner 1137*1370a723SSascha Wildner **/ 1138*1370a723SSascha Wildner RETURN_STATUS 1139*1370a723SSascha Wildner EFIAPI 1140*1370a723SSascha Wildner LibPcdSet64S ( 1141*1370a723SSascha Wildner IN UINTN TokenNumber, 1142*1370a723SSascha Wildner IN UINT64 Value 1143*1370a723SSascha Wildner ); 1144*1370a723SSascha Wildner 1145*1370a723SSascha Wildner /** 1146*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1147*1370a723SSascha Wildner 1148*1370a723SSascha Wildner Sets a buffer for the token specified by TokenNumber to the value specified 1149*1370a723SSascha Wildner by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size 1150*1370a723SSascha Wildner support by TokenNumber, then set SizeOfBuffer to the maximum size supported by 1151*1370a723SSascha Wildner TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation 1152*1370a723SSascha Wildner was not actually performed. 1153*1370a723SSascha Wildner 1154*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the 1155*1370a723SSascha Wildner maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned. 1156*1370a723SSascha Wildner 1157*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1158*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1159*1370a723SSascha Wildner 1160*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1161*1370a723SSascha Wildner @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1162*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to set. 1163*1370a723SSascha Wildner 1164*1370a723SSascha Wildner @return The status of the set operation. 1165*1370a723SSascha Wildner 1166*1370a723SSascha Wildner **/ 1167*1370a723SSascha Wildner RETURN_STATUS 1168*1370a723SSascha Wildner EFIAPI 1169*1370a723SSascha Wildner LibPcdSetPtrS ( 1170*1370a723SSascha Wildner IN UINTN TokenNumber, 1171*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1172*1370a723SSascha Wildner IN CONST VOID *Buffer 1173*1370a723SSascha Wildner ); 1174*1370a723SSascha Wildner 1175*1370a723SSascha Wildner /** 1176*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1177*1370a723SSascha Wildner 1178*1370a723SSascha Wildner Sets the boolean value for the token specified by TokenNumber 1179*1370a723SSascha Wildner to the value specified by Value. 1180*1370a723SSascha Wildner 1181*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1182*1370a723SSascha Wildner @param[in] Value The boolean value to set. 1183*1370a723SSascha Wildner 1184*1370a723SSascha Wildner @return The status of the set operation. 1185*1370a723SSascha Wildner 1186*1370a723SSascha Wildner **/ 1187*1370a723SSascha Wildner RETURN_STATUS 1188*1370a723SSascha Wildner EFIAPI 1189*1370a723SSascha Wildner LibPcdSetBoolS ( 1190*1370a723SSascha Wildner IN UINTN TokenNumber, 1191*1370a723SSascha Wildner IN BOOLEAN Value 1192*1370a723SSascha Wildner ); 1193*1370a723SSascha Wildner 1194*1370a723SSascha Wildner /** 1195*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1196*1370a723SSascha Wildner 1197*1370a723SSascha Wildner Sets the 8-bit value for the token specified by TokenNumber 1198*1370a723SSascha Wildner to the value specified by Value. 1199*1370a723SSascha Wildner 1200*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1201*1370a723SSascha Wildner 1202*1370a723SSascha Wildner @param[in] Guid The pointer to a 128-bit unique value that 1203*1370a723SSascha Wildner designates which namespace to set a value from. 1204*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1205*1370a723SSascha Wildner @param[in] Value The 8-bit value to set. 1206*1370a723SSascha Wildner 1207*1370a723SSascha Wildner @return The status of the set operation. 1208*1370a723SSascha Wildner 1209*1370a723SSascha Wildner **/ 1210*1370a723SSascha Wildner RETURN_STATUS 1211*1370a723SSascha Wildner EFIAPI 1212*1370a723SSascha Wildner LibPcdSetEx8S ( 1213*1370a723SSascha Wildner IN CONST GUID *Guid, 1214*1370a723SSascha Wildner IN UINTN TokenNumber, 1215*1370a723SSascha Wildner IN UINT8 Value 1216*1370a723SSascha Wildner ); 1217*1370a723SSascha Wildner 1218*1370a723SSascha Wildner /** 1219*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1220*1370a723SSascha Wildner 1221*1370a723SSascha Wildner Sets the 16-bit value for the token specified by TokenNumber 1222*1370a723SSascha Wildner to the value specified by Value. 1223*1370a723SSascha Wildner 1224*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1225*1370a723SSascha Wildner 1226*1370a723SSascha Wildner @param[in] Guid The pointer to a 128-bit unique value that 1227*1370a723SSascha Wildner designates which namespace to set a value from. 1228*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1229*1370a723SSascha Wildner @param[in] Value The 16-bit value to set. 1230*1370a723SSascha Wildner 1231*1370a723SSascha Wildner @return The status of the set operation. 1232*1370a723SSascha Wildner 1233*1370a723SSascha Wildner **/ 1234*1370a723SSascha Wildner RETURN_STATUS 1235*1370a723SSascha Wildner EFIAPI 1236*1370a723SSascha Wildner LibPcdSetEx16S ( 1237*1370a723SSascha Wildner IN CONST GUID *Guid, 1238*1370a723SSascha Wildner IN UINTN TokenNumber, 1239*1370a723SSascha Wildner IN UINT16 Value 1240*1370a723SSascha Wildner ); 1241*1370a723SSascha Wildner 1242*1370a723SSascha Wildner /** 1243*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1244*1370a723SSascha Wildner 1245*1370a723SSascha Wildner Sets the 32-bit value for the token specified by TokenNumber 1246*1370a723SSascha Wildner to the value specified by Value. 1247*1370a723SSascha Wildner 1248*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1249*1370a723SSascha Wildner 1250*1370a723SSascha Wildner @param[in] Guid The pointer to a 128-bit unique value that 1251*1370a723SSascha Wildner designates which namespace to set a value from. 1252*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1253*1370a723SSascha Wildner @param[in] Value The 32-bit value to set. 1254*1370a723SSascha Wildner 1255*1370a723SSascha Wildner @return The status of the set operation. 1256*1370a723SSascha Wildner 1257*1370a723SSascha Wildner **/ 1258*1370a723SSascha Wildner RETURN_STATUS 1259*1370a723SSascha Wildner EFIAPI 1260*1370a723SSascha Wildner LibPcdSetEx32S ( 1261*1370a723SSascha Wildner IN CONST GUID *Guid, 1262*1370a723SSascha Wildner IN UINTN TokenNumber, 1263*1370a723SSascha Wildner IN UINT32 Value 1264*1370a723SSascha Wildner ); 1265*1370a723SSascha Wildner 1266*1370a723SSascha Wildner /** 1267*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1268*1370a723SSascha Wildner 1269*1370a723SSascha Wildner Sets the 64-bit value for the token specified by TokenNumber 1270*1370a723SSascha Wildner to the value specified by Value. 1271*1370a723SSascha Wildner 1272*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1273*1370a723SSascha Wildner 1274*1370a723SSascha Wildner @param[in] Guid The pointer to a 128-bit unique value that 1275*1370a723SSascha Wildner designates which namespace to set a value from. 1276*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1277*1370a723SSascha Wildner @param[in] Value The 64-bit value to set. 1278*1370a723SSascha Wildner 1279*1370a723SSascha Wildner @return The status of the set operation. 1280*1370a723SSascha Wildner 1281*1370a723SSascha Wildner **/ 1282*1370a723SSascha Wildner RETURN_STATUS 1283*1370a723SSascha Wildner EFIAPI 1284*1370a723SSascha Wildner LibPcdSetEx64S ( 1285*1370a723SSascha Wildner IN CONST GUID *Guid, 1286*1370a723SSascha Wildner IN UINTN TokenNumber, 1287*1370a723SSascha Wildner IN UINT64 Value 1288*1370a723SSascha Wildner ); 1289*1370a723SSascha Wildner 1290*1370a723SSascha Wildner /** 1291*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1292*1370a723SSascha Wildner 1293*1370a723SSascha Wildner Sets a buffer for the token specified by TokenNumber to the value specified by 1294*1370a723SSascha Wildner Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size 1295*1370a723SSascha Wildner support by TokenNumber, then set SizeOfBuffer to the maximum size supported by 1296*1370a723SSascha Wildner TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation 1297*1370a723SSascha Wildner was not actually performed. 1298*1370a723SSascha Wildner 1299*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1300*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1301*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1302*1370a723SSascha Wildner 1303*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that 1304*1370a723SSascha Wildner designates which namespace to set a value from. 1305*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1306*1370a723SSascha Wildner @param[in, out] SizeOfBuffer The size, in bytes, of Buffer. 1307*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to set. 1308*1370a723SSascha Wildner 1309*1370a723SSascha Wildner @return The status of the set operation. 1310*1370a723SSascha Wildner 1311*1370a723SSascha Wildner **/ 1312*1370a723SSascha Wildner RETURN_STATUS 1313*1370a723SSascha Wildner EFIAPI 1314*1370a723SSascha Wildner LibPcdSetExPtrS ( 1315*1370a723SSascha Wildner IN CONST GUID *Guid, 1316*1370a723SSascha Wildner IN UINTN TokenNumber, 1317*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1318*1370a723SSascha Wildner IN VOID *Buffer 1319*1370a723SSascha Wildner ); 1320*1370a723SSascha Wildner 1321*1370a723SSascha Wildner /** 1322*1370a723SSascha Wildner This function provides a means by which to set a value for a given PCD token. 1323*1370a723SSascha Wildner 1324*1370a723SSascha Wildner Sets the boolean value for the token specified by TokenNumber 1325*1370a723SSascha Wildner to the value specified by Value. 1326*1370a723SSascha Wildner 1327*1370a723SSascha Wildner If Guid is NULL, then ASSERT(). 1328*1370a723SSascha Wildner 1329*1370a723SSascha Wildner @param[in] Guid The pointer to a 128-bit unique value that 1330*1370a723SSascha Wildner designates which namespace to set a value from. 1331*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to set a current value for. 1332*1370a723SSascha Wildner @param[in] Value The boolean value to set. 1333*1370a723SSascha Wildner 1334*1370a723SSascha Wildner @return The status of the set operation. 1335*1370a723SSascha Wildner 1336*1370a723SSascha Wildner **/ 1337*1370a723SSascha Wildner RETURN_STATUS 1338*1370a723SSascha Wildner EFIAPI 1339*1370a723SSascha Wildner LibPcdSetExBoolS ( 1340*1370a723SSascha Wildner IN CONST GUID *Guid, 1341*1370a723SSascha Wildner IN UINTN TokenNumber, 1342*1370a723SSascha Wildner IN BOOLEAN Value 1343*1370a723SSascha Wildner ); 1344*1370a723SSascha Wildner 1345*1370a723SSascha Wildner /** 1346*1370a723SSascha Wildner This notification function serves two purposes. 1347*1370a723SSascha Wildner 1348*1370a723SSascha Wildner Firstly, it notifies the module that did the registration that the value of this 1349*1370a723SSascha Wildner PCD token has been set. 1350*1370a723SSascha Wildner Secondly, it provides a mechanism for the module that did the registration to intercept 1351*1370a723SSascha Wildner the set operation and override the value been set if necessary. After the invocation of 1352*1370a723SSascha Wildner the callback function, TokenData will be used by PCD service PEIM or driver to modify th 1353*1370a723SSascha Wildner internal data in PCD database. 1354*1370a723SSascha Wildner 1355*1370a723SSascha Wildner @param[in] CallBackGuid The PCD token GUID being set. 1356*1370a723SSascha Wildner @param[in] CallBackToken The PCD token number being set. 1357*1370a723SSascha Wildner @param[in, out] TokenData A pointer to the token data being set. 1358*1370a723SSascha Wildner @param[in] TokenDataSize The size, in bytes, of the data being set. 1359*1370a723SSascha Wildner 1360*1370a723SSascha Wildner **/ 1361*1370a723SSascha Wildner typedef 1362*1370a723SSascha Wildner VOID 1363*1370a723SSascha Wildner (EFIAPI *PCD_CALLBACK)( 1364*1370a723SSascha Wildner IN CONST GUID *CallBackGuid OPTIONAL, 1365*1370a723SSascha Wildner IN UINTN CallBackToken, 1366*1370a723SSascha Wildner IN OUT VOID *TokenData, 1367*1370a723SSascha Wildner IN UINTN TokenDataSize 1368*1370a723SSascha Wildner ); 1369*1370a723SSascha Wildner 1370*1370a723SSascha Wildner /** 1371*1370a723SSascha Wildner Set up a notification function that is called when a specified token is set. 1372*1370a723SSascha Wildner 1373*1370a723SSascha Wildner When the token specified by TokenNumber and Guid is set, 1374*1370a723SSascha Wildner then notification function specified by NotificationFunction is called. 1375*1370a723SSascha Wildner If Guid is NULL, then the default token space is used. 1376*1370a723SSascha Wildner If NotificationFunction is NULL, then ASSERT(). 1377*1370a723SSascha Wildner 1378*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates which 1379*1370a723SSascha Wildner namespace to set a value from. If NULL, then the default 1380*1370a723SSascha Wildner token space is used. 1381*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number to monitor. 1382*1370a723SSascha Wildner @param[in] NotificationFunction The function to call when the token 1383*1370a723SSascha Wildner specified by Guid and TokenNumber is set. 1384*1370a723SSascha Wildner 1385*1370a723SSascha Wildner **/ 1386*1370a723SSascha Wildner VOID 1387*1370a723SSascha Wildner EFIAPI 1388*1370a723SSascha Wildner LibPcdCallbackOnSet ( 1389*1370a723SSascha Wildner IN CONST GUID *Guid OPTIONAL, 1390*1370a723SSascha Wildner IN UINTN TokenNumber, 1391*1370a723SSascha Wildner IN PCD_CALLBACK NotificationFunction 1392*1370a723SSascha Wildner ); 1393*1370a723SSascha Wildner 1394*1370a723SSascha Wildner /** 1395*1370a723SSascha Wildner Disable a notification function that was established with LibPcdCallbackonSet(). 1396*1370a723SSascha Wildner 1397*1370a723SSascha Wildner Disable a notification function that was previously established with LibPcdCallbackOnSet(). 1398*1370a723SSascha Wildner If NotificationFunction is NULL, then ASSERT(). 1399*1370a723SSascha Wildner If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber, 1400*1370a723SSascha Wildner and NotificationFunction, then ASSERT(). 1401*1370a723SSascha Wildner 1402*1370a723SSascha Wildner @param[in] Guid Specify the GUID token space. 1403*1370a723SSascha Wildner @param[in] TokenNumber Specify the token number. 1404*1370a723SSascha Wildner @param[in] NotificationFunction The callback function to be unregistered. 1405*1370a723SSascha Wildner 1406*1370a723SSascha Wildner **/ 1407*1370a723SSascha Wildner VOID 1408*1370a723SSascha Wildner EFIAPI 1409*1370a723SSascha Wildner LibPcdCancelCallback ( 1410*1370a723SSascha Wildner IN CONST GUID *Guid OPTIONAL, 1411*1370a723SSascha Wildner IN UINTN TokenNumber, 1412*1370a723SSascha Wildner IN PCD_CALLBACK NotificationFunction 1413*1370a723SSascha Wildner ); 1414*1370a723SSascha Wildner 1415*1370a723SSascha Wildner /** 1416*1370a723SSascha Wildner Retrieves the next token in a token space. 1417*1370a723SSascha Wildner 1418*1370a723SSascha Wildner Retrieves the next PCD token number from the token space specified by Guid. 1419*1370a723SSascha Wildner If Guid is NULL, then the default token space is used. If TokenNumber is 0, 1420*1370a723SSascha Wildner then the first token number is returned. Otherwise, the token number that 1421*1370a723SSascha Wildner follows TokenNumber in the token space is returned. If TokenNumber is the last 1422*1370a723SSascha Wildner token number in the token space, then 0 is returned. 1423*1370a723SSascha Wildner 1424*1370a723SSascha Wildner If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT(). 1425*1370a723SSascha Wildner 1426*1370a723SSascha Wildner @param[in] Guid Pointer to a 128-bit unique value that designates which namespace 1427*1370a723SSascha Wildner to set a value from. If NULL, then the default token space is used. 1428*1370a723SSascha Wildner @param[in] TokenNumber The previous PCD token number. If 0, then retrieves the first PCD 1429*1370a723SSascha Wildner token number. 1430*1370a723SSascha Wildner 1431*1370a723SSascha Wildner @return The next valid token number. 1432*1370a723SSascha Wildner 1433*1370a723SSascha Wildner **/ 1434*1370a723SSascha Wildner UINTN 1435*1370a723SSascha Wildner EFIAPI 1436*1370a723SSascha Wildner LibPcdGetNextToken ( 1437*1370a723SSascha Wildner IN CONST GUID *Guid OPTIONAL, 1438*1370a723SSascha Wildner IN UINTN TokenNumber 1439*1370a723SSascha Wildner ); 1440*1370a723SSascha Wildner 1441*1370a723SSascha Wildner /** 1442*1370a723SSascha Wildner Used to retrieve the list of available PCD token space GUIDs. 1443*1370a723SSascha Wildner 1444*1370a723SSascha Wildner Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces 1445*1370a723SSascha Wildner in the platform. 1446*1370a723SSascha Wildner If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned. 1447*1370a723SSascha Wildner If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned. 1448*1370a723SSascha Wildner 1449*1370a723SSascha Wildner @param TokenSpaceGuid Pointer to the a PCD token space GUID 1450*1370a723SSascha Wildner 1451*1370a723SSascha Wildner @return The next valid token namespace. 1452*1370a723SSascha Wildner 1453*1370a723SSascha Wildner **/ 1454*1370a723SSascha Wildner GUID * 1455*1370a723SSascha Wildner EFIAPI 1456*1370a723SSascha Wildner LibPcdGetNextTokenSpace ( 1457*1370a723SSascha Wildner IN CONST GUID *TokenSpaceGuid 1458*1370a723SSascha Wildner ); 1459*1370a723SSascha Wildner 1460*1370a723SSascha Wildner /** 1461*1370a723SSascha Wildner Sets a value of a patchable PCD entry that is type pointer. 1462*1370a723SSascha Wildner 1463*1370a723SSascha Wildner Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1464*1370a723SSascha Wildner and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1465*1370a723SSascha Wildner MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1466*1370a723SSascha Wildner NULL to indicate that the set operation was not actually performed. 1467*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1468*1370a723SSascha Wildner MaximumDatumSize and NULL must be returned. 1469*1370a723SSascha Wildner 1470*1370a723SSascha Wildner If PatchVariable is NULL, then ASSERT(). 1471*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1472*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1473*1370a723SSascha Wildner 1474*1370a723SSascha Wildner @param[out] PatchVariable A pointer to the global variable in a module that is 1475*1370a723SSascha Wildner the target of the set operation. 1476*1370a723SSascha Wildner @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1477*1370a723SSascha Wildner @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1478*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to used to set the target variable. 1479*1370a723SSascha Wildner 1480*1370a723SSascha Wildner @return Return the pointer to the Buffer that was set. 1481*1370a723SSascha Wildner 1482*1370a723SSascha Wildner **/ 1483*1370a723SSascha Wildner VOID * 1484*1370a723SSascha Wildner EFIAPI 1485*1370a723SSascha Wildner LibPatchPcdSetPtr ( 1486*1370a723SSascha Wildner OUT VOID *PatchVariable, 1487*1370a723SSascha Wildner IN UINTN MaximumDatumSize, 1488*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1489*1370a723SSascha Wildner IN CONST VOID *Buffer 1490*1370a723SSascha Wildner ); 1491*1370a723SSascha Wildner 1492*1370a723SSascha Wildner /** 1493*1370a723SSascha Wildner Sets a value of a patchable PCD entry that is type pointer. 1494*1370a723SSascha Wildner 1495*1370a723SSascha Wildner Sets the PCD entry specified by PatchVariable to the value specified 1496*1370a723SSascha Wildner by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, 1497*1370a723SSascha Wildner then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER 1498*1370a723SSascha Wildner to indicate that the set operation was not actually performed. 1499*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1500*1370a723SSascha Wildner MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. 1501*1370a723SSascha Wildner 1502*1370a723SSascha Wildner If PatchVariable is NULL, then ASSERT(). 1503*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1504*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1505*1370a723SSascha Wildner 1506*1370a723SSascha Wildner @param[out] PatchVariable A pointer to the global variable in a module that is 1507*1370a723SSascha Wildner the target of the set operation. 1508*1370a723SSascha Wildner @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1509*1370a723SSascha Wildner @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1510*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to used to set the target variable. 1511*1370a723SSascha Wildner 1512*1370a723SSascha Wildner @return The status of the set operation. 1513*1370a723SSascha Wildner 1514*1370a723SSascha Wildner **/ 1515*1370a723SSascha Wildner RETURN_STATUS 1516*1370a723SSascha Wildner EFIAPI 1517*1370a723SSascha Wildner LibPatchPcdSetPtrS ( 1518*1370a723SSascha Wildner OUT VOID *PatchVariable, 1519*1370a723SSascha Wildner IN UINTN MaximumDatumSize, 1520*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1521*1370a723SSascha Wildner IN CONST VOID *Buffer 1522*1370a723SSascha Wildner ); 1523*1370a723SSascha Wildner 1524*1370a723SSascha Wildner /** 1525*1370a723SSascha Wildner Sets a value and size of a patchable PCD entry that is type pointer. 1526*1370a723SSascha Wildner 1527*1370a723SSascha Wildner Sets the PCD entry specified by PatchVariable to the value specified by Buffer 1528*1370a723SSascha Wildner and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than 1529*1370a723SSascha Wildner MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return 1530*1370a723SSascha Wildner NULL to indicate that the set operation was not actually performed. 1531*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1532*1370a723SSascha Wildner MaximumDatumSize and NULL must be returned. 1533*1370a723SSascha Wildner 1534*1370a723SSascha Wildner If PatchVariable is NULL, then ASSERT(). 1535*1370a723SSascha Wildner If SizeOfPatchVariable is NULL, then ASSERT(). 1536*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1537*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1538*1370a723SSascha Wildner 1539*1370a723SSascha Wildner @param[out] PatchVariable A pointer to the global variable in a module that is 1540*1370a723SSascha Wildner the target of the set operation. 1541*1370a723SSascha Wildner @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. 1542*1370a723SSascha Wildner @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1543*1370a723SSascha Wildner @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1544*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to used to set the target variable. 1545*1370a723SSascha Wildner 1546*1370a723SSascha Wildner @return Return the pointer to the Buffer that was set. 1547*1370a723SSascha Wildner 1548*1370a723SSascha Wildner **/ 1549*1370a723SSascha Wildner VOID * 1550*1370a723SSascha Wildner EFIAPI 1551*1370a723SSascha Wildner LibPatchPcdSetPtrAndSize ( 1552*1370a723SSascha Wildner OUT VOID *PatchVariable, 1553*1370a723SSascha Wildner OUT UINTN *SizeOfPatchVariable, 1554*1370a723SSascha Wildner IN UINTN MaximumDatumSize, 1555*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1556*1370a723SSascha Wildner IN CONST VOID *Buffer 1557*1370a723SSascha Wildner ); 1558*1370a723SSascha Wildner 1559*1370a723SSascha Wildner /** 1560*1370a723SSascha Wildner Sets a value and size of a patchable PCD entry that is type pointer. 1561*1370a723SSascha Wildner 1562*1370a723SSascha Wildner Sets the PCD entry specified by PatchVariable to the value specified 1563*1370a723SSascha Wildner by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize, 1564*1370a723SSascha Wildner then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER 1565*1370a723SSascha Wildner to indicate that the set operation was not actually performed. 1566*1370a723SSascha Wildner If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to 1567*1370a723SSascha Wildner MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned. 1568*1370a723SSascha Wildner 1569*1370a723SSascha Wildner If PatchVariable is NULL, then ASSERT(). 1570*1370a723SSascha Wildner If SizeOfPatchVariable is NULL, then ASSERT(). 1571*1370a723SSascha Wildner If SizeOfBuffer is NULL, then ASSERT(). 1572*1370a723SSascha Wildner If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT(). 1573*1370a723SSascha Wildner 1574*1370a723SSascha Wildner @param[out] PatchVariable A pointer to the global variable in a module that is 1575*1370a723SSascha Wildner the target of the set operation. 1576*1370a723SSascha Wildner @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable. 1577*1370a723SSascha Wildner @param[in] MaximumDatumSize The maximum size allowed for the PCD entry specified by PatchVariable. 1578*1370a723SSascha Wildner @param[in, out] SizeOfBuffer A pointer to the size, in bytes, of Buffer. 1579*1370a723SSascha Wildner @param[in] Buffer A pointer to the buffer to used to set the target variable. 1580*1370a723SSascha Wildner 1581*1370a723SSascha Wildner @return The status of the set operation. 1582*1370a723SSascha Wildner 1583*1370a723SSascha Wildner **/ 1584*1370a723SSascha Wildner RETURN_STATUS 1585*1370a723SSascha Wildner EFIAPI 1586*1370a723SSascha Wildner LibPatchPcdSetPtrAndSizeS ( 1587*1370a723SSascha Wildner OUT VOID *PatchVariable, 1588*1370a723SSascha Wildner OUT UINTN *SizeOfPatchVariable, 1589*1370a723SSascha Wildner IN UINTN MaximumDatumSize, 1590*1370a723SSascha Wildner IN OUT UINTN *SizeOfBuffer, 1591*1370a723SSascha Wildner IN CONST VOID *Buffer 1592*1370a723SSascha Wildner ); 1593*1370a723SSascha Wildner 1594*1370a723SSascha Wildner typedef enum { 1595*1370a723SSascha Wildner PCD_TYPE_8, 1596*1370a723SSascha Wildner PCD_TYPE_16, 1597*1370a723SSascha Wildner PCD_TYPE_32, 1598*1370a723SSascha Wildner PCD_TYPE_64, 1599*1370a723SSascha Wildner PCD_TYPE_BOOL, 1600*1370a723SSascha Wildner PCD_TYPE_PTR 1601*1370a723SSascha Wildner } PCD_TYPE; 1602*1370a723SSascha Wildner 1603*1370a723SSascha Wildner typedef struct { 1604*1370a723SSascha Wildner /// 1605*1370a723SSascha Wildner /// The returned information associated with the requested TokenNumber. If 1606*1370a723SSascha Wildner /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8. 1607*1370a723SSascha Wildner /// 1608*1370a723SSascha Wildner PCD_TYPE PcdType; 1609*1370a723SSascha Wildner /// 1610*1370a723SSascha Wildner /// The size of the data in bytes associated with the TokenNumber specified. If 1611*1370a723SSascha Wildner /// TokenNumber is 0, then PcdSize is set 0. 1612*1370a723SSascha Wildner /// 1613*1370a723SSascha Wildner UINTN PcdSize; 1614*1370a723SSascha Wildner /// 1615*1370a723SSascha Wildner /// The null-terminated ASCII string associated with a given token. If the 1616*1370a723SSascha Wildner /// TokenNumber specified was 0, then this field corresponds to the null-terminated 1617*1370a723SSascha Wildner /// ASCII string associated with the token's namespace Guid. If NULL, there is no 1618*1370a723SSascha Wildner /// name associated with this request. 1619*1370a723SSascha Wildner /// 1620*1370a723SSascha Wildner CHAR8 *PcdName; 1621*1370a723SSascha Wildner } PCD_INFO; 1622*1370a723SSascha Wildner 1623*1370a723SSascha Wildner /** 1624*1370a723SSascha Wildner Retrieve additional information associated with a PCD token. 1625*1370a723SSascha Wildner 1626*1370a723SSascha Wildner This includes information such as the type of value the TokenNumber is associated with as well as possible 1627*1370a723SSascha Wildner human readable name that is associated with the token. 1628*1370a723SSascha Wildner 1629*1370a723SSascha Wildner If TokenNumber is not in the default token space specified, then ASSERT(). 1630*1370a723SSascha Wildner 1631*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number. 1632*1370a723SSascha Wildner @param[out] PcdInfo The returned information associated with the requested TokenNumber. 1633*1370a723SSascha Wildner The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 1634*1370a723SSascha Wildner **/ 1635*1370a723SSascha Wildner VOID 1636*1370a723SSascha Wildner EFIAPI 1637*1370a723SSascha Wildner LibPcdGetInfo ( 1638*1370a723SSascha Wildner IN UINTN TokenNumber, 1639*1370a723SSascha Wildner OUT PCD_INFO *PcdInfo 1640*1370a723SSascha Wildner ); 1641*1370a723SSascha Wildner 1642*1370a723SSascha Wildner /** 1643*1370a723SSascha Wildner Retrieve additional information associated with a PCD token. 1644*1370a723SSascha Wildner 1645*1370a723SSascha Wildner This includes information such as the type of value the TokenNumber is associated with as well as possible 1646*1370a723SSascha Wildner human readable name that is associated with the token. 1647*1370a723SSascha Wildner 1648*1370a723SSascha Wildner If TokenNumber is not in the token space specified by Guid, then ASSERT(). 1649*1370a723SSascha Wildner 1650*1370a723SSascha Wildner @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. 1651*1370a723SSascha Wildner @param[in] TokenNumber The PCD token number. 1652*1370a723SSascha Wildner @param[out] PcdInfo The returned information associated with the requested TokenNumber. 1653*1370a723SSascha Wildner The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. 1654*1370a723SSascha Wildner **/ 1655*1370a723SSascha Wildner VOID 1656*1370a723SSascha Wildner EFIAPI 1657*1370a723SSascha Wildner LibPcdGetInfoEx ( 1658*1370a723SSascha Wildner IN CONST GUID *Guid, 1659*1370a723SSascha Wildner IN UINTN TokenNumber, 1660*1370a723SSascha Wildner OUT PCD_INFO *PcdInfo 1661*1370a723SSascha Wildner ); 1662*1370a723SSascha Wildner 1663*1370a723SSascha Wildner /** 1664*1370a723SSascha Wildner Retrieve the currently set SKU Id. 1665*1370a723SSascha Wildner 1666*1370a723SSascha Wildner @return The currently set SKU Id. If the platform has not set at a SKU Id, then the 1667*1370a723SSascha Wildner default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU 1668*1370a723SSascha Wildner Id is returned. 1669*1370a723SSascha Wildner **/ 1670*1370a723SSascha Wildner UINTN 1671*1370a723SSascha Wildner EFIAPI 1672*1370a723SSascha Wildner LibPcdGetSku ( 1673*1370a723SSascha Wildner VOID 1674*1370a723SSascha Wildner ); 1675*1370a723SSascha Wildner 1676*1370a723SSascha Wildner #endif 1677