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