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