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