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