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