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