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