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