]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/Pcd.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Ppi / Pcd.h
CommitLineData
c311f86b 1/** @file\r
9dbad162 2 Native Platform Configuration Database (PCD) PPI\r
9095d37b 3\r
9dbad162 4 Different with the EFI_PCD_PPI defined in PI 1.2 specification, the native\r
9095d37b 5 PCD PPI provide interfaces for dynamic and dynamic-ex type PCD.\r
9dbad162 6 The interfaces for dynamic type PCD do not require the token space guid as parameter,\r
7 but interfaces for dynamic-ex type PCD require token space guid as parameter.\r
5879b875 8\r
9095d37b 9Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 10SPDX-License-Identifier: BSD-2-Clause-Patent\r
5879b875 11\r
5879b875 12**/\r
13\r
14#ifndef __PCD_PPI_H__\r
15#define __PCD_PPI_H__\r
16\r
5879b875 17#define PCD_PPI_GUID \\r
18 { 0x6e81c58, 0x4ad7, 0x44bc, { 0x83, 0x90, 0xf1, 0x2, 0x65, 0xf7, 0x24, 0x80 } }\r
19\r
19fd6450 20#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)\r
21\r
5879b875 22\r
23/**\r
24 Sets the SKU value for subsequent calls to set or get PCD token values.\r
25\r
9095d37b 26 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values.\r
5879b875 27 SetSku() is normally called only once by the system.\r
28\r
9095d37b
LG
29 For each item (token), the database can hold a single value that applies to all SKUs,\r
30 or multiple values, where each value is associated with a specific SKU Id. Items with multiple,\r
31 SKU-specific values are called SKU enabled.\r
32\r
33 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255.\r
34 For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the\r
35 single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the\r
36 last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token,\r
37 the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been\r
5879b875 38 set for that Id, the results are unpredictable.\r
39\r
9095d37b 40 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and\r
5879b875 41 set values associated with a PCD token.\r
42\r
43 @retval VOID\r
44\r
45**/\r
9095d37b 46typedef\r
5879b875 47VOID\r
8b13229b 48(EFIAPI *PCD_PPI_SET_SKU)(\r
5879b875 49 IN UINTN SkuId\r
50 );\r
51\r
52\r
53\r
54/**\r
55 Retrieves an 8-bit value for a given PCD token.\r
56\r
9095d37b 57 Retrieves the current byte-sized value for a PCD token number.\r
5879b875 58 If the TokenNumber is invalid, the results are unpredictable.\r
9095d37b
LG
59\r
60 @param[in] TokenNumber The PCD token number.\r
5879b875 61\r
62 @return The UINT8 value.\r
9095d37b 63\r
5879b875 64**/\r
65typedef\r
66UINT8\r
8b13229b 67(EFIAPI *PCD_PPI_GET8)(\r
5879b875 68 IN UINTN TokenNumber\r
69 );\r
70\r
71\r
72\r
73/**\r
b05ac954 74 Retrieves a 16-bit value for a given PCD token.\r
5879b875 75\r
9095d37b 76 Retrieves the current 16-bit value for a PCD token number.\r
5879b875 77 If the TokenNumber is invalid, the results are unpredictable.\r
9095d37b
LG
78\r
79 @param[in] TokenNumber The PCD token number.\r
5879b875 80\r
81 @return The UINT16 value.\r
9095d37b 82\r
5879b875 83**/\r
84typedef\r
85UINT16\r
8b13229b 86(EFIAPI *PCD_PPI_GET16)(\r
5879b875 87 IN UINTN TokenNumber\r
88 );\r
89\r
90\r
91\r
92/**\r
b05ac954 93 Retrieves a 32-bit value for a given PCD token.\r
5879b875 94\r
9095d37b 95 Retrieves the current 32-bit value for a PCD token number.\r
5879b875 96 If the TokenNumber is invalid, the results are unpredictable.\r
9095d37b
LG
97\r
98 @param[in] TokenNumber The PCD token number.\r
5879b875 99\r
100 @return The UINT32 value.\r
9095d37b 101\r
5879b875 102**/\r
103typedef\r
104UINT32\r
8b13229b 105(EFIAPI *PCD_PPI_GET32)(\r
5879b875 106 IN UINTN TokenNumber\r
107 );\r
108\r
109\r
110\r
111/**\r
b05ac954 112 Retrieves a 64-bit value for a given PCD token.\r
5879b875 113\r
9095d37b 114 Retrieves the current 64-bit value for a PCD token number.\r
5879b875 115 If the TokenNumber is invalid, the results are unpredictable.\r
9095d37b
LG
116\r
117 @param[in] TokenNumber The PCD token number.\r
5879b875 118\r
119 @return The UINT64 value.\r
9095d37b 120\r
5879b875 121**/\r
122typedef\r
123UINT64\r
8b13229b 124(EFIAPI *PCD_PPI_GET64)(\r
5879b875 125 IN UINTN TokenNumber\r
126 );\r
127\r
128\r
129\r
130/**\r
131 Retrieves a pointer to a value for a given PCD token.\r
132\r
9095d37b
LG
133 Retrieves the current pointer to the buffer for a PCD token number.\r
134 Do not make any assumptions about the alignment of the pointer that\r
135 is returned by this function call. If the TokenNumber is invalid,\r
5879b875 136 the results are unpredictable.\r
137\r
9095d37b 138 @param[in] TokenNumber The PCD token number.\r
5879b875 139\r
140 @return The pointer to the buffer to be retrived.\r
9095d37b 141\r
5879b875 142**/\r
143typedef\r
144VOID *\r
8b13229b 145(EFIAPI *PCD_PPI_GET_POINTER)(\r
5879b875 146 IN UINTN TokenNumber\r
147 );\r
148\r
149\r
150\r
151/**\r
152 Retrieves a Boolean value for a given PCD token.\r
153\r
9095d37b
LG
154 Retrieves the current boolean value for a PCD token number.\r
155 Do not make any assumptions about the alignment of the pointer that\r
156 is returned by this function call. If the TokenNumber is invalid,\r
5879b875 157 the results are unpredictable.\r
158\r
9095d37b 159 @param[in] TokenNumber The PCD token number.\r
5879b875 160\r
161 @return The Boolean value.\r
9095d37b 162\r
5879b875 163**/\r
164typedef\r
165BOOLEAN\r
8b13229b 166(EFIAPI *PCD_PPI_GET_BOOLEAN)(\r
5879b875 167 IN UINTN TokenNumber\r
168 );\r
169\r
170\r
171\r
172/**\r
173 Retrieves the size of the value for a given PCD token.\r
174\r
9095d37b 175 Retrieves the current size of a particular PCD token.\r
5879b875 176 If the TokenNumber is invalid, the results are unpredictable.\r
177\r
9095d37b 178 @param[in] TokenNumber The PCD token number.\r
5879b875 179\r
180 @return The size of the value for the PCD token.\r
9095d37b 181\r
5879b875 182**/\r
183typedef\r
184UINTN\r
8b13229b 185(EFIAPI *PCD_PPI_GET_SIZE)(\r
5879b875 186 IN UINTN TokenNumber\r
187 );\r
188\r
189\r
190\r
191/**\r
4ca9b6c4 192 Retrieves an 8-bit value for a given PCD token and token space.\r
5879b875 193\r
9095d37b 194 Retrieves the 8-bit value of a particular PCD token.\r
5879b875 195 If the TokenNumber is invalid or the token space\r
9095d37b 196 specified by Guid does not exist, the results are\r
5879b875 197 unpredictable.\r
198\r
b05ac954 199 @param[in] Guid The token space for the token number.\r
9095d37b 200 @param[in] TokenNumber The PCD token number.\r
5879b875 201\r
202 @return The size 8-bit value for the PCD token.\r
9095d37b 203\r
5879b875 204**/\r
205typedef\r
206UINT8\r
8b13229b 207(EFIAPI *PCD_PPI_GET_EX_8)(\r
5879b875 208 IN CONST EFI_GUID *Guid,\r
19fd6450 209 IN UINTN TokenNumber\r
5879b875 210 );\r
211\r
212\r
213\r
214/**\r
b05ac954 215 Retrieves a 16-bit value for a given PCD token and token space.\r
5879b875 216\r
9095d37b 217 Retrieves the 16-bit value of a particular PCD token.\r
5879b875 218 If the TokenNumber is invalid or the token space\r
9095d37b 219 specified by Guid does not exist, the results are\r
5879b875 220 unpredictable.\r
221\r
b05ac954 222 @param[in] Guid The token space for the token number.\r
9095d37b 223 @param[in] TokenNumber The PCD token number.\r
5879b875 224\r
225 @return The size 16-bit value for the PCD token.\r
9095d37b 226\r
5879b875 227**/\r
228typedef\r
229UINT16\r
8b13229b 230(EFIAPI *PCD_PPI_GET_EX_16)(\r
5879b875 231 IN CONST EFI_GUID *Guid,\r
19fd6450 232 IN UINTN TokenNumber\r
5879b875 233 );\r
234\r
235\r
236\r
237/**\r
b05ac954 238 Retrieves a 32-bit value for a given PCD token and token space.\r
5879b875 239\r
9095d37b 240 Retrieves the 32-bit value of a particular PCD token.\r
5879b875 241 If the TokenNumber is invalid or the token space\r
9095d37b 242 specified by Guid does not exist, the results are\r
5879b875 243 unpredictable.\r
244\r
b05ac954 245 @param[in] Guid The token space for the token number.\r
9095d37b 246 @param[in] TokenNumber The PCD token number.\r
5879b875 247\r
248 @return The size 32-bit value for the PCD token.\r
9095d37b 249\r
5879b875 250**/\r
251typedef\r
252UINT32\r
8b13229b 253(EFIAPI *PCD_PPI_GET_EX_32)(\r
5879b875 254 IN CONST EFI_GUID *Guid,\r
19fd6450 255 IN UINTN TokenNumber\r
5879b875 256 );\r
257\r
258\r
259\r
260/**\r
b05ac954 261 Retrieves a 64-bit value for a given PCD token and token space.\r
5879b875 262\r
9095d37b 263 Retrieves the 64-bit value of a particular PCD token.\r
5879b875 264 If the TokenNumber is invalid or the token space\r
9095d37b 265 specified by Guid does not exist, the results are\r
5879b875 266 unpredictable.\r
267\r
b05ac954 268 @param[in] Guid The token space for the token number.\r
9095d37b 269 @param[in] TokenNumber The PCD token number.\r
5879b875 270\r
271 @return The size 64-bit value for the PCD token.\r
9095d37b 272\r
5879b875 273**/\r
274typedef\r
275UINT64\r
8b13229b 276(EFIAPI *PCD_PPI_GET_EX_64)(\r
5879b875 277 IN CONST EFI_GUID *Guid,\r
19fd6450 278 IN UINTN TokenNumber\r
5879b875 279 );\r
280\r
281\r
282\r
283/**\r
4ca9b6c4 284 Retrieves a pointer to a value for a given PCD token and token space.\r
5879b875 285\r
9095d37b
LG
286 Retrieves the current pointer to the buffer for a PCD token number.\r
287 Do not make any assumptions about the alignment of the pointer that\r
288 is returned by this function call. If the TokenNumber is invalid,\r
5879b875 289 the results are unpredictable.\r
290\r
b05ac954 291 @param[in] Guid The token space for the token number.\r
9095d37b 292 @param[in] TokenNumber The PCD token number.\r
5879b875 293\r
294 @return The pointer to the buffer to be retrived.\r
9095d37b 295\r
5879b875 296**/\r
297typedef\r
298VOID *\r
8b13229b 299(EFIAPI *PCD_PPI_GET_EX_POINTER)(\r
5879b875 300 IN CONST EFI_GUID *Guid,\r
19fd6450 301 IN UINTN TokenNumber\r
5879b875 302 );\r
303\r
304\r
305\r
306/**\r
4ca9b6c4 307 Retrieves an Boolean value for a given PCD token and token space.\r
5879b875 308\r
9095d37b 309 Retrieves the Boolean value of a particular PCD token.\r
5879b875 310 If the TokenNumber is invalid or the token space\r
9095d37b 311 specified by Guid does not exist, the results are\r
5879b875 312 unpredictable.\r
313\r
314 @param[in] Guid The token space for the token number.\r
9095d37b 315 @param[in] TokenNumber The PCD token number.\r
5879b875 316\r
317 @return The size Boolean value for the PCD token.\r
9095d37b 318\r
5879b875 319**/\r
320typedef\r
321BOOLEAN\r
8b13229b 322(EFIAPI *PCD_PPI_GET_EX_BOOLEAN)(\r
5879b875 323 IN CONST EFI_GUID *Guid,\r
19fd6450 324 IN UINTN TokenNumber\r
5879b875 325 );\r
326\r
327\r
328\r
329/**\r
4ca9b6c4 330 Retrieves the size of the value for a given PCD token and token space.\r
5879b875 331\r
9095d37b 332 Retrieves the current size of a particular PCD token.\r
5879b875 333 If the TokenNumber is invalid, the results are unpredictable.\r
334\r
b05ac954 335 @param[in] Guid The token space for the token number.\r
9095d37b 336 @param[in] TokenNumber The PCD token number.\r
5879b875 337\r
338 @return The size of the value for the PCD token.\r
9095d37b 339\r
5879b875 340**/\r
341typedef\r
342UINTN\r
8b13229b 343(EFIAPI *PCD_PPI_GET_EX_SIZE)(\r
5879b875 344 IN CONST EFI_GUID *Guid,\r
19fd6450 345 IN UINTN TokenNumber\r
5879b875 346 );\r
347\r
348\r
349\r
350/**\r
351 Sets an 8-bit value for a given PCD token.\r
352\r
9095d37b
LG
353 When the PCD service sets a value, it will check to ensure that the\r
354 size of the value being set is compatible with the Token's existing definition.\r
5879b875 355 If it is not, an error will be returned.\r
356\r
9095d37b 357 @param[in] TokenNumber The PCD token number.\r
b05ac954 358 @param[in] Value The value to set for the PCD token.\r
5879b875 359\r
af2dc6a7 360 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
361 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
362 being set was incompatible with a call to this function.\r
b05ac954 363 Use GetSize() to retrieve the size of the target data.\r
364 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 365\r
5879b875 366**/\r
367typedef\r
368EFI_STATUS\r
8b13229b 369(EFIAPI *PCD_PPI_SET8)(\r
5879b875 370 IN UINTN TokenNumber,\r
371 IN UINT8 Value\r
372 );\r
373\r
374\r
375\r
376/**\r
b05ac954 377 Sets a 16-bit value for a given PCD token.\r
5879b875 378\r
9095d37b
LG
379 When the PCD service sets a value, it will check to ensure that the\r
380 size of the value being set is compatible with the Token's existing definition.\r
5879b875 381 If it is not, an error will be returned.\r
382\r
9095d37b 383 @param[in] TokenNumber The PCD token number.\r
b05ac954 384 @param[in] Value The value to set for the PCD token.\r
5879b875 385\r
af2dc6a7 386 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
387 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
388 being set was incompatible with a call to this function.\r
b05ac954 389 Use GetSize() to retrieve the size of the target data.\r
390 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 391\r
5879b875 392**/\r
393typedef\r
394EFI_STATUS\r
8b13229b 395(EFIAPI *PCD_PPI_SET16)(\r
5879b875 396 IN UINTN TokenNumber,\r
397 IN UINT16 Value\r
398 );\r
399\r
400\r
401\r
402/**\r
b05ac954 403 Sets a 32-bit value for a given PCD token.\r
5879b875 404\r
9095d37b
LG
405 When the PCD service sets a value, it will check to ensure that the\r
406 size of the value being set is compatible with the Token's existing definition.\r
5879b875 407 If it is not, an error will be returned.\r
408\r
9095d37b 409 @param[in] TokenNumber The PCD token number.\r
b05ac954 410 @param[in] Value The value to set for the PCD token.\r
5879b875 411\r
af2dc6a7 412 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
413 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
414 being set was incompatible with a call to this function.\r
b05ac954 415 Use GetSize() to retrieve the size of the target data.\r
416 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 417\r
5879b875 418**/\r
419typedef\r
420EFI_STATUS\r
8b13229b 421(EFIAPI *PCD_PPI_SET32)(\r
5879b875 422 IN UINTN TokenNumber,\r
423 IN UINT32 Value\r
424 );\r
425\r
426\r
427\r
428/**\r
b05ac954 429 Sets a 64-bit value for a given PCD token.\r
5879b875 430\r
9095d37b
LG
431 When the PCD service sets a value, it will check to ensure that the\r
432 size of the value being set is compatible with the Token's existing definition.\r
5879b875 433 If it is not, an error will be returned.\r
434\r
9095d37b 435 @param[in] TokenNumber The PCD token number.\r
b05ac954 436 @param[in] Value The value to set for the PCD token.\r
5879b875 437\r
af2dc6a7 438 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
439 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
440 being set was incompatible with a call to this function.\r
b05ac954 441 Use GetSize() to retrieve the size of the target data.\r
442 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 443\r
5879b875 444**/\r
445typedef\r
446EFI_STATUS\r
8b13229b 447(EFIAPI *PCD_PPI_SET64)(\r
5879b875 448 IN UINTN TokenNumber,\r
449 IN UINT64 Value\r
450 );\r
451\r
5879b875 452/**\r
453 Sets a value of a specified size for a given PCD token.\r
454\r
9095d37b
LG
455 When the PCD service sets a value, it will check to ensure that the\r
456 size of the value being set is compatible with the Token's existing definition.\r
5879b875 457 If it is not, an error will be returned.\r
458\r
9095d37b
LG
459 @param[in] TokenNumber The PCD token number.\r
460 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.\r
461 On input, if the SizeOfValue is greater than the maximum size supported\r
462 for this TokenNumber then the output value of SizeOfValue will reflect\r
b05ac954 463 the maximum size supported for this TokenNumber.\r
464 @param[in] Buffer The buffer to set for the PCD token.\r
5879b875 465\r
af2dc6a7 466 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
467 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
468 being set was incompatible with a call to this function.\r
b05ac954 469 Use GetSize() to retrieve the size of the target data.\r
470 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 471\r
5879b875 472**/\r
473typedef\r
474EFI_STATUS\r
8b13229b 475(EFIAPI *PCD_PPI_SET_POINTER)(\r
5879b875 476 IN UINTN TokenNumber,\r
19fd6450 477 IN OUT UINTN *SizeOfValue,\r
5879b875 478 IN VOID *Buffer\r
479 );\r
5879b875 480\r
481/**\r
482 Sets an Boolean value for a given PCD token.\r
483\r
9095d37b
LG
484 When the PCD service sets a value, it will check to ensure that the\r
485 size of the value being set is compatible with the Token's existing definition.\r
5879b875 486 If it is not, an error will be returned.\r
487\r
9095d37b 488 @param[in] TokenNumber The PCD token number.\r
b05ac954 489 @param[in] Value The value to set for the PCD token.\r
5879b875 490\r
af2dc6a7 491 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
492 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
493 being set was incompatible with a call to this function.\r
b05ac954 494 Use GetSize() to retrieve the size of the target data.\r
495 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 496\r
5879b875 497**/\r
498typedef\r
499EFI_STATUS\r
8b13229b 500(EFIAPI *PCD_PPI_SET_BOOLEAN)(\r
5879b875 501 IN UINTN TokenNumber,\r
502 IN BOOLEAN Value\r
503 );\r
504\r
505\r
506\r
507/**\r
508 Sets an 8-bit value for a given PCD token.\r
509\r
9095d37b
LG
510 When the PCD service sets a value, it will check to ensure that the\r
511 size of the value being set is compatible with the Token's existing definition.\r
5879b875 512 If it is not, an error will be returned.\r
513\r
b05ac954 514 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 515 @param[in] TokenNumber The PCD token number.\r
b05ac954 516 @param[in] Value The value to set for the PCD token.\r
5879b875 517\r
af2dc6a7 518 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
519 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
520 being set was incompatible with a call to this function.\r
b05ac954 521 Use GetSize() to retrieve the size of the target data.\r
522 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 523\r
5879b875 524**/\r
525typedef\r
526EFI_STATUS\r
8b13229b 527(EFIAPI *PCD_PPI_SET_EX_8)(\r
5879b875 528 IN CONST EFI_GUID *Guid,\r
19fd6450 529 IN UINTN TokenNumber,\r
530 IN UINT8 Value\r
5879b875 531 );\r
532\r
533\r
534\r
535/**\r
b05ac954 536 Sets a 16-bit value for a given PCD token.\r
5879b875 537\r
9095d37b
LG
538 When the PCD service sets a value, it will check to ensure that the\r
539 size of the value being set is compatible with the Token's existing definition.\r
5879b875 540 If it is not, an error will be returned.\r
541\r
b05ac954 542 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 543 @param[in] TokenNumber The PCD token number.\r
b05ac954 544 @param[in] Value The value to set for the PCD token.\r
5879b875 545\r
af2dc6a7 546 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
547 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
548 being set was incompatible with a call to this function.\r
b05ac954 549 Use GetSize() to retrieve the size of the target data.\r
550 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 551\r
5879b875 552**/\r
553typedef\r
554EFI_STATUS\r
8b13229b 555(EFIAPI *PCD_PPI_SET_EX_16)(\r
5879b875 556 IN CONST EFI_GUID *Guid,\r
19fd6450 557 IN UINTN TokenNumber,\r
558 IN UINT16 Value\r
5879b875 559 );\r
560\r
561\r
562\r
563/**\r
b05ac954 564 Sets a 32-bit value for a given PCD token.\r
5879b875 565\r
9095d37b
LG
566 When the PCD service sets a value, it will check to ensure that the\r
567 size of the value being set is compatible with the Token's existing definition.\r
5879b875 568 If it is not, an error will be returned.\r
569\r
b05ac954 570 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 571 @param[in] TokenNumber The PCD token number.\r
b05ac954 572 @param[in] Value The value to set for the PCD token.\r
5879b875 573\r
af2dc6a7 574 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
575 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
576 being set was incompatible with a call to this function.\r
b05ac954 577 Use GetSize() to retrieve the size of the target data.\r
578 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 579\r
5879b875 580**/\r
581typedef\r
582EFI_STATUS\r
8b13229b 583(EFIAPI *PCD_PPI_SET_EX_32)(\r
5879b875 584 IN CONST EFI_GUID *Guid,\r
19fd6450 585 IN UINTN TokenNumber,\r
586 IN UINT32 Value\r
5879b875 587 );\r
588\r
589\r
590\r
591/**\r
b05ac954 592 Sets a 64-bit value for a given PCD token.\r
5879b875 593\r
9095d37b
LG
594 When the PCD service sets a value, it will check to ensure that the\r
595 size of the value being set is compatible with the Token's existing definition.\r
5879b875 596 If it is not, an error will be returned.\r
597\r
b05ac954 598 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 599 @param[in] TokenNumber The PCD token number.\r
b05ac954 600 @param[in] Value The value to set for the PCD token.\r
5879b875 601\r
af2dc6a7 602 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
603 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
604 being set was incompatible with a call to this function.\r
b05ac954 605 Use GetSize() to retrieve the size of the target data.\r
606 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 607\r
5879b875 608**/\r
609typedef\r
610EFI_STATUS\r
8b13229b 611(EFIAPI *PCD_PPI_SET_EX_64)(\r
19fd6450 612 IN CONST EFI_GUID *Guid,\r
613 IN UINTN TokenNumber,\r
614 IN UINT64 Value\r
5879b875 615 );\r
616\r
617\r
618\r
619/**\r
620 Sets a value of a specified size for a given PCD token.\r
621\r
9095d37b
LG
622 When the PCD service sets a value, it will check to ensure that the\r
623 size of the value being set is compatible with the Token's existing definition.\r
5879b875 624 If it is not, an error will be returned.\r
625\r
b05ac954 626 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b
LG
627 @param[in] TokenNumber The PCD token number.\r
628 @param[in, out] SizeOfValue A pointer to the length of the value being set for the PCD token.\r
629 On input, if the SizeOfValue is greater than the maximum size supported\r
630 for this TokenNumber then the output value of SizeOfValue will reflect\r
b05ac954 631 the maximum size supported for this TokenNumber.\r
632 @param[in] Buffer The buffer to set for the PCD token.\r
5879b875 633\r
af2dc6a7 634 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
635 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
636 being set was incompatible with a call to this function.\r
b05ac954 637 Use GetSize() to retrieve the size of the target data.\r
638 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 639\r
5879b875 640**/\r
641typedef\r
642EFI_STATUS\r
8b13229b 643(EFIAPI *PCD_PPI_SET_EX_POINTER)(\r
19fd6450 644 IN CONST EFI_GUID *Guid,\r
645 IN UINTN TokenNumber,\r
646 IN OUT UINTN *SizeOfValue,\r
647 IN VOID *Buffer\r
5879b875 648 );\r
5879b875 649\r
650/**\r
651 Sets an Boolean value for a given PCD token.\r
652\r
9095d37b
LG
653 When the PCD service sets a value, it will check to ensure that the\r
654 size of the value being set is compatible with the Token's existing definition.\r
5879b875 655 If it is not, an error will be returned.\r
656\r
b05ac954 657 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 658 @param[in] TokenNumber The PCD token number.\r
b05ac954 659 @param[in] Value The value to set for the PCD token.\r
5879b875 660\r
af2dc6a7 661 @retval EFI_SUCCESS The procedure returned successfully.\r
9095d37b
LG
662 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data\r
663 being set was incompatible with a call to this function.\r
b05ac954 664 Use GetSize() to retrieve the size of the target data.\r
665 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
9095d37b 666\r
5879b875 667**/\r
668typedef\r
669EFI_STATUS\r
8b13229b 670(EFIAPI *PCD_PPI_SET_EX_BOOLEAN)(\r
19fd6450 671 IN CONST EFI_GUID *Guid,\r
672 IN UINTN TokenNumber,\r
673 IN BOOLEAN Value\r
5879b875 674 );\r
675\r
676\r
677\r
678/**\r
679 Callback on SET function prototype definition.\r
680\r
9095d37b
LG
681 This notification function serves two purposes. Firstly, it notifies the module\r
682 which did the registration that the value of this PCD token has been set. Secondly,\r
683 it provides a mechanism for the module which did the registration to intercept the set\r
684 operation and override the value been set if necessary. After the invocation of the\r
685 callback function, TokenData will be used by PCD service PEIM to modify the internal data\r
5879b875 686 in PCD database.\r
687\r
b05ac954 688 @param[in] CallBackGuid The PCD token GUID being set.\r
689 @param[in] CallBackToken The PCD token number being set.\r
690 @param[in, out] TokenData A pointer to the token data being set.\r
691 @param[in] TokenDataSize The size, in bytes, of the data being set.\r
5879b875 692\r
693 @retval VOID\r
694\r
695**/\r
696typedef\r
697VOID\r
8b13229b 698(EFIAPI *PCD_PPI_CALLBACK)(\r
19fd6450 699 IN CONST EFI_GUID *CallBackGuid, OPTIONAL\r
700 IN UINTN CallBackToken,\r
701 IN OUT VOID *TokenData,\r
702 IN UINTN TokenDataSize\r
5879b875 703 );\r
704\r
705\r
706\r
707/**\r
708 Specifies a function to be called anytime the value of a designated token is changed.\r
709\r
9095d37b 710 @param[in] TokenNumber The PCD token number.\r
5879b875 711 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 712 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.\r
5879b875 713\r
9095d37b 714 @retval EFI_SUCCESS The PCD service has successfully established a call event\r
5879b875 715 for the CallBackToken requested.\r
716 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r
717\r
718**/\r
719typedef\r
720EFI_STATUS\r
8b13229b 721(EFIAPI *PCD_PPI_CALLBACK_ONSET)(\r
19fd6450 722 IN CONST EFI_GUID *Guid, OPTIONAL\r
723 IN UINTN TokenNumber,\r
724 IN PCD_PPI_CALLBACK CallBackFunction\r
5879b875 725 );\r
726\r
727\r
728\r
729/**\r
730 Cancels a previously set callback function for a particular PCD token number.\r
731\r
9095d37b 732 @param[in] TokenNumber The PCD token number.\r
5879b875 733 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
9095d37b 734 @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set.\r
5879b875 735\r
9095d37b 736 @retval EFI_SUCCESS The PCD service has successfully established a call event\r
5879b875 737 for the CallBackToken requested.\r
738 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r
739\r
740**/\r
741typedef\r
742EFI_STATUS\r
8b13229b 743(EFIAPI *PCD_PPI_CANCEL_CALLBACK)(\r
19fd6450 744 IN CONST EFI_GUID *Guid, OPTIONAL\r
745 IN UINTN TokenNumber,\r
746 IN PCD_PPI_CALLBACK CallBackFunction\r
5879b875 747 );\r
748\r
749\r
750\r
751/**\r
9095d37b
LG
752 Retrieves the next valid token number in a given namespace.\r
753\r
754 This is useful since the PCD infrastructure contains a sparse list of token numbers,\r
755 and one cannot a priori know what token numbers are valid in the database.\r
756\r
757 If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.\r
758 If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.\r
759 If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.\r
760 If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.\r
761 The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.\r
762 If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.\r
763 If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.\r
75070952 764 If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.\r
5879b875 765\r
b05ac954 766\r
9095d37b
LG
767 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
768 This is an optional parameter that may be NULL. If this parameter is NULL, then a request\r
75070952 769 is being made to retrieve tokens from the default token space.\r
5879b875 770 @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number.\r
9095d37b 771\r
419db80b
BF
772 @retval EFI_SUCCESS The PCD service has retrieved the next valid token number.\r
773 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.\r
5879b875 774\r
775**/\r
9095d37b 776typedef\r
5879b875 777EFI_STATUS\r
8b13229b 778(EFIAPI *PCD_PPI_GET_NEXT_TOKEN)(\r
5879b875 779 IN CONST EFI_GUID *Guid, OPTIONAL\r
19fd6450 780 IN OUT UINTN *TokenNumber\r
5879b875 781 );\r
782\r
783\r
784\r
785/**\r
786 Retrieves the next valid PCD token namespace for a given namespace.\r
787\r
419db80b
BF
788 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid\r
789 token namespaces on a platform.\r
790\r
791 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token\r
792 namespace from which the search will start. On output, it designates the next valid\r
793 token namespace on the platform. If *Guid is NULL, then the GUID of the first token\r
794 space of the current platform is returned. If the search cannot locate the next valid\r
795 token namespace, an error is returned and the value of *Guid is undefined.\r
9095d37b 796\r
419db80b
BF
797 @retval EFI_SUCCESS The PCD service retrieved the value requested.\r
798 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.\r
5879b875 799\r
800**/\r
801typedef\r
802EFI_STATUS\r
8b13229b 803(EFIAPI *PCD_PPI_GET_NEXT_TOKENSPACE)(\r
5879b875 804 IN OUT CONST EFI_GUID **Guid\r
805 );\r
806\r
807\r
808\r
44717a39 809///\r
810/// This service abstracts the ability to set/get Platform Configuration Database (PCD).\r
811///\r
5879b875 812typedef struct {\r
813 PCD_PPI_SET_SKU SetSku;\r
814\r
815 PCD_PPI_GET8 Get8;\r
816 PCD_PPI_GET16 Get16;\r
817 PCD_PPI_GET32 Get32;\r
818 PCD_PPI_GET64 Get64;\r
819 PCD_PPI_GET_POINTER GetPtr;\r
820 PCD_PPI_GET_BOOLEAN GetBool;\r
821 PCD_PPI_GET_SIZE GetSize;\r
822\r
823 PCD_PPI_GET_EX_8 Get8Ex;\r
824 PCD_PPI_GET_EX_16 Get16Ex;\r
825 PCD_PPI_GET_EX_32 Get32Ex;\r
826 PCD_PPI_GET_EX_64 Get64Ex;\r
827 PCD_PPI_GET_EX_POINTER GetPtrEx;\r
828 PCD_PPI_GET_EX_BOOLEAN GetBoolEx;\r
829 PCD_PPI_GET_EX_SIZE GetSizeEx;\r
830\r
831 PCD_PPI_SET8 Set8;\r
832 PCD_PPI_SET16 Set16;\r
833 PCD_PPI_SET32 Set32;\r
834 PCD_PPI_SET64 Set64;\r
835 PCD_PPI_SET_POINTER SetPtr;\r
836 PCD_PPI_SET_BOOLEAN SetBool;\r
837\r
838 PCD_PPI_SET_EX_8 Set8Ex;\r
839 PCD_PPI_SET_EX_16 Set16Ex;\r
840 PCD_PPI_SET_EX_32 Set32Ex;\r
841 PCD_PPI_SET_EX_64 Set64Ex;\r
842 PCD_PPI_SET_EX_POINTER SetPtrEx;\r
843 PCD_PPI_SET_EX_BOOLEAN SetBoolEx;\r
844\r
845 PCD_PPI_CALLBACK_ONSET CallbackOnSet;\r
846 PCD_PPI_CANCEL_CALLBACK CancelCallback;\r
847 PCD_PPI_GET_NEXT_TOKEN GetNextToken;\r
848 PCD_PPI_GET_NEXT_TOKENSPACE GetNextTokenSpace;\r
849} PCD_PPI;\r
850\r
851\r
852extern EFI_GUID gPcdPpiGuid;\r
853\r
854#endif\r