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