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