]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Pcd.h
1. Add the fix for the following Bugs:
[mirror_edk2.git] / MdePkg / Include / Protocol / Pcd.h
CommitLineData
878ddf1f 1/** @file\r
2 Platform Configuration Database (PCD) Protocol\r
3\r
4 Copyright (c) 2006, 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_H__\r
18#define __PCD_H__\r
19\r
20extern EFI_GUID gPcdProtocolGuid;\r
21\r
22#define PCD_PROTOCOL_GUID \\r
23 { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }\r
24\r
58f1099f 25#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)\r
8a43e8dd 26\r
a7c5092f 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
2a870f53 45 @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r
a7c5092f 46 set values associated with a PCD token.\r
47\r
48 @retval VOID\r
49\r
50**/\r
878ddf1f 51typedef \r
b16ef805 52VOID\r
878ddf1f 53(EFIAPI *PCD_PROTOCOL_SET_SKU) (\r
8a43e8dd 54 IN UINTN SkuId\r
878ddf1f 55 );\r
56\r
a7c5092f 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
2a870f53 65 @param[in] TokenNumber The PCD token number. \r
a7c5092f 66\r
67 @return The UINT8 value.\r
68 \r
69**/\r
878ddf1f 70typedef\r
71UINT8\r
72(EFIAPI *PCD_PROTOCOL_GET8) (\r
8a43e8dd 73 IN UINTN TokenNumber\r
878ddf1f 74 );\r
75\r
a7c5092f 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
2a870f53 84 @param[in] TokenNumber The PCD token number. \r
a7c5092f 85\r
86 @return The UINT16 value.\r
87 \r
88**/\r
878ddf1f 89typedef\r
90UINT16\r
91(EFIAPI *PCD_PROTOCOL_GET16) (\r
8a43e8dd 92 IN UINTN TokenNumber\r
878ddf1f 93 );\r
94\r
a7c5092f 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
2a870f53 103 @param[in] TokenNumber The PCD token number. \r
a7c5092f 104\r
105 @return The UINT32 value.\r
106 \r
107**/\r
878ddf1f 108typedef\r
109UINT32\r
110(EFIAPI *PCD_PROTOCOL_GET32) (\r
8a43e8dd 111 IN UINTN TokenNumber\r
878ddf1f 112 );\r
113\r
a7c5092f 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
2a870f53 122 @param[in] TokenNumber The PCD token number. \r
a7c5092f 123\r
124 @return The UINT64 value.\r
125 \r
126**/\r
878ddf1f 127typedef\r
128UINT64\r
129(EFIAPI *PCD_PROTOCOL_GET64) (\r
8a43e8dd 130 IN UINTN TokenNumber\r
878ddf1f 131 );\r
132\r
a7c5092f 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
2a870f53 143 @param[in] TokenNumber The PCD token number. \r
a7c5092f 144\r
145 @return The pointer to the buffer to be retrived.\r
146 \r
147**/\r
878ddf1f 148typedef\r
149VOID *\r
150(EFIAPI *PCD_PROTOCOL_GET_POINTER) (\r
8a43e8dd 151 IN UINTN TokenNumber\r
878ddf1f 152 );\r
153\r
a7c5092f 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
2a870f53 164 @param[in] TokenNumber The PCD token number. \r
a7c5092f 165\r
166 @return The Boolean value.\r
167 \r
168**/\r
878ddf1f 169typedef\r
170BOOLEAN\r
171(EFIAPI *PCD_PROTOCOL_GET_BOOLEAN) (\r
8a43e8dd 172 IN UINTN TokenNumber\r
878ddf1f 173 );\r
174\r
a7c5092f 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
2a870f53 183 @param[in] TokenNumber The PCD token number. \r
a7c5092f 184\r
185 @return The size of the value for the PCD token.\r
186 \r
187**/\r
878ddf1f 188typedef\r
189UINTN\r
190(EFIAPI *PCD_PROTOCOL_GET_SIZE) (\r
8a43e8dd 191 IN UINTN TokenNumber\r
878ddf1f 192 );\r
193\r
a7c5092f 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
2a870f53 204 @param[in] Guid The token space for the token number.\r
205 @param[in] TokenNumber The PCD token number. \r
a7c5092f 206\r
207 @return The size 8-bit value for the PCD token.\r
208 \r
209**/\r
878ddf1f 210typedef\r
211UINT8\r
212(EFIAPI *PCD_PROTOCOL_GET_EX_8) (\r
213 IN CONST EFI_GUID *Guid,\r
8a43e8dd 214 IN UINTN TokenNumber\r
878ddf1f 215 );\r
216\r
a7c5092f 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
2a870f53 227 @param[in] Guid The token space for the token number.\r
228 @param[in] TokenNumber The PCD token number. \r
a7c5092f 229\r
230 @return The size 16-bit value for the PCD token.\r
231 \r
232**/\r
878ddf1f 233typedef\r
234UINT16\r
235(EFIAPI *PCD_PROTOCOL_GET_EX_16) (\r
236 IN CONST EFI_GUID *Guid,\r
8a43e8dd 237 IN UINTN TokenNumber\r
878ddf1f 238 );\r
239\r
a7c5092f 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
2a870f53 250 @param[in] Guid The token space for the token number.\r
251 @param[in] TokenNumber The PCD token number. \r
a7c5092f 252\r
253 @return The size 32-bit value for the PCD token.\r
254 \r
255**/typedef\r
878ddf1f 256UINT32\r
257(EFIAPI *PCD_PROTOCOL_GET_EX_32) (\r
258 IN CONST EFI_GUID *Guid,\r
8a43e8dd 259 IN UINTN TokenNumber\r
878ddf1f 260 );\r
261\r
a7c5092f 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
2a870f53 272 @param[in] Guid The token space for the token number.\r
273 @param[in] TokenNumber The PCD token number. \r
a7c5092f 274\r
275 @return The size 64-bit value for the PCD token.\r
276 \r
277**/\r
878ddf1f 278typedef\r
279UINT64\r
280(EFIAPI *PCD_PROTOCOL_GET_EX_64) (\r
281 IN CONST EFI_GUID *Guid,\r
8a43e8dd 282 IN UINTN TokenNumber\r
878ddf1f 283 );\r
284\r
a7c5092f 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
2a870f53 295 @param[in] Guid The token space for the token number.\r
296 @param[in] TokenNumber The PCD token number. \r
a7c5092f 297\r
298 @return The pointer to the buffer to be retrived.\r
299 \r
300**/\r
878ddf1f 301typedef\r
302VOID *\r
303(EFIAPI *PCD_PROTOCOL_GET_EX_POINTER) (\r
304 IN CONST EFI_GUID *Guid,\r
8a43e8dd 305 IN UINTN TokenNumber\r
878ddf1f 306 );\r
307\r
a7c5092f 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
2a870f53 318 @param[in] Guid The token space for the token number.\r
319 @param[in] TokenNumber The PCD token number. \r
a7c5092f 320\r
321 @return The size Boolean value for the PCD token.\r
322 \r
323**/\r
878ddf1f 324typedef\r
325BOOLEAN\r
326(EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN) (\r
327 IN CONST EFI_GUID *Guid,\r
8a43e8dd 328 IN UINTN TokenNumber\r
878ddf1f 329 );\r
330\r
a7c5092f 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
2a870f53 339 @param[in] Guid The token space for the token number.\r
340 @param[in] TokenNumber The PCD token number. \r
a7c5092f 341\r
342 @return The size of the value for the PCD token.\r
343 \r
344**/\r
878ddf1f 345typedef\r
346UINTN\r
347(EFIAPI *PCD_PROTOCOL_GET_EX_SIZE) (\r
348 IN CONST EFI_GUID *Guid,\r
8a43e8dd 349 IN UINTN TokenNumber\r
878ddf1f 350 );\r
351\r
a7c5092f 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
2a870f53 361 @param[in] TokenNumber The PCD token number. \r
362 @param[in] Value The value to set for the PCD token.\r
a7c5092f 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
878ddf1f 371typedef\r
372EFI_STATUS\r
373(EFIAPI *PCD_PROTOCOL_SET8) (\r
8a43e8dd 374 IN UINTN TokenNumber,\r
878ddf1f 375 IN UINT8 Value\r
376 );\r
377\r
a7c5092f 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
2a870f53 387 @param[in] TokenNumber The PCD token number. \r
388 @param[in] Value The value to set for the PCD token.\r
a7c5092f 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
878ddf1f 397typedef\r
398EFI_STATUS\r
399(EFIAPI *PCD_PROTOCOL_SET16) (\r
8a43e8dd 400 IN UINTN TokenNumber,\r
878ddf1f 401 IN UINT16 Value\r
402 );\r
403\r
a7c5092f 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
2a870f53 413 @param[in] TokenNumber The PCD token number. \r
414 @param[in] Value The value to set for the PCD token.\r
a7c5092f 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
878ddf1f 423typedef\r
424EFI_STATUS\r
425(EFIAPI *PCD_PROTOCOL_SET32) (\r
8a43e8dd 426 IN UINTN TokenNumber,\r
878ddf1f 427 IN UINT32 Value\r
428 );\r
429\r
a7c5092f 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
2a870f53 439 @param[in] TokenNumber The PCD token number. \r
440 @param[in] Value The value to set for the PCD token.\r
a7c5092f 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
878ddf1f 449typedef\r
450EFI_STATUS\r
451(EFIAPI *PCD_PROTOCOL_SET64) (\r
8a43e8dd 452 IN UINTN TokenNumber,\r
878ddf1f 453 IN UINT64 Value\r
454 );\r
455\r
a7c5092f 456\r
457\r
458/**\r
459 Sets a value of a specified size for a given PCD token.\r
460\r
461 When the PCD service sets a value, it will check to ensure that the \r
462 size of the value being set is compatible with the Token's existing definition. \r
463 If it is not, an error will be returned.\r
464\r
2a870f53 465 @param[in] TokenNumber The PCD token number. \r
466 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. \r
a7c5092f 467 On input, if the SizeOfValue is greater than the maximum size supported \r
468 for this TokenNumber then the output value of SizeOfValue will reflect \r
469 the maximum size supported for this TokenNumber.\r
2a870f53 470 @param[in] Buffer The buffer to set for the PCD token.\r
a7c5092f 471\r
472 @retval EFI_SUCCESS Procedure returned successfully.\r
473 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
474 being set was incompatible with a call to this function. \r
475 Use GetSize() to retrieve the size of the target data.\r
476 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
477 \r
478**/\r
878ddf1f 479typedef\r
480EFI_STATUS\r
481(EFIAPI *PCD_PROTOCOL_SET_POINTER) (\r
1de04b4f 482 IN UINTN TokenNumber,\r
483 IN OUT UINTN *SizeOfBuffer,\r
484 IN VOID *Buffer\r
878ddf1f 485 );\r
486\r
a7c5092f 487\r
488\r
489/**\r
490 Sets an Boolean value for a given PCD token.\r
491\r
492 When the PCD service sets a value, it will check to ensure that the \r
493 size of the value being set is compatible with the Token's existing definition. \r
494 If it is not, an error will be returned.\r
495\r
2a870f53 496 @param[in] TokenNumber The PCD token number. \r
497 @param[in] Value The value to set for the PCD token.\r
a7c5092f 498\r
499 @retval EFI_SUCCESS Procedure returned successfully.\r
500 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
501 being set was incompatible with a call to this function. \r
502 Use GetSize() to retrieve the size of the target data.\r
503 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
504 \r
505**/\r
878ddf1f 506typedef\r
507EFI_STATUS\r
508(EFIAPI *PCD_PROTOCOL_SET_BOOLEAN) (\r
8a43e8dd 509 IN UINTN TokenNumber,\r
878ddf1f 510 IN BOOLEAN Value\r
511 );\r
512\r
a7c5092f 513\r
514\r
515/**\r
516 Sets an 8-bit value for a given PCD token.\r
517\r
518 When the PCD service sets a value, it will check to ensure that the \r
519 size of the value being set is compatible with the Token's existing definition. \r
520 If it is not, an error will be returned.\r
521\r
2a870f53 522 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
523 @param[in] TokenNumber The PCD token number. \r
524 @param[in] Value The value to set for the PCD token.\r
a7c5092f 525\r
526 @retval EFI_SUCCESS Procedure returned successfully.\r
527 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
528 being set was incompatible with a call to this function. \r
529 Use GetSize() to retrieve the size of the target data.\r
530 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
531 \r
532**/\r
878ddf1f 533typedef\r
534EFI_STATUS\r
535(EFIAPI *PCD_PROTOCOL_SET_EX_8) (\r
536 IN CONST EFI_GUID *Guid,\r
8a43e8dd 537 IN UINTN TokenNumber,\r
878ddf1f 538 IN UINT8 Value\r
539 );\r
540\r
a7c5092f 541\r
542\r
543/**\r
544 Sets an 16-bit value for a given PCD token.\r
545\r
546 When the PCD service sets a value, it will check to ensure that the \r
547 size of the value being set is compatible with the Token's existing definition. \r
548 If it is not, an error will be returned.\r
549\r
2a870f53 550 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
551 @param[in] TokenNumber The PCD token number. \r
552 @param[in] Value The value to set for the PCD token.\r
a7c5092f 553\r
554 @retval EFI_SUCCESS Procedure returned successfully.\r
555 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
556 being set was incompatible with a call to this function. \r
557 Use GetSize() to retrieve the size of the target data.\r
558 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
559 \r
560**/\r
878ddf1f 561typedef\r
562EFI_STATUS\r
563(EFIAPI *PCD_PROTOCOL_SET_EX_16) (\r
564 IN CONST EFI_GUID *Guid,\r
8a43e8dd 565 IN UINTN TokenNumber,\r
878ddf1f 566 IN UINT16 Value\r
567 );\r
568\r
a7c5092f 569\r
570\r
571/**\r
572 Sets an 32-bit value for a given PCD token.\r
573\r
574 When the PCD service sets a value, it will check to ensure that the \r
575 size of the value being set is compatible with the Token's existing definition. \r
576 If it is not, an error will be returned.\r
577\r
2a870f53 578 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
579 @param[in] TokenNumber The PCD token number. \r
580 @param[in] Value The value to set for the PCD token.\r
a7c5092f 581\r
582 @retval EFI_SUCCESS Procedure returned successfully.\r
583 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
584 being set was incompatible with a call to this function. \r
585 Use GetSize() to retrieve the size of the target data.\r
586 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
587 \r
588**/\r
878ddf1f 589typedef\r
590EFI_STATUS\r
591(EFIAPI *PCD_PROTOCOL_SET_EX_32) (\r
592 IN CONST EFI_GUID *Guid,\r
8a43e8dd 593 IN UINTN TokenNumber,\r
878ddf1f 594 IN UINT32 Value\r
595 );\r
596\r
a7c5092f 597\r
598\r
599/**\r
600 Sets an 64-bit value for a given PCD token.\r
601\r
602 When the PCD service sets a value, it will check to ensure that the \r
603 size of the value being set is compatible with the Token's existing definition. \r
604 If it is not, an error will be returned.\r
605\r
2a870f53 606 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
607 @param[in] TokenNumber The PCD token number. \r
608 @param[in] Value The value to set for the PCD token.\r
a7c5092f 609\r
610 @retval EFI_SUCCESS Procedure returned successfully.\r
611 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
612 being set was incompatible with a call to this function. \r
613 Use GetSize() to retrieve the size of the target data.\r
614 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
615 \r
616**/\r
878ddf1f 617typedef\r
618EFI_STATUS\r
619(EFIAPI *PCD_PROTOCOL_SET_EX_64) (\r
620 IN CONST EFI_GUID *Guid,\r
8a43e8dd 621 IN UINTN TokenNumber,\r
878ddf1f 622 IN UINT64 Value\r
623 );\r
624\r
a7c5092f 625\r
626\r
627/**\r
628 Sets a value of a specified size for a given PCD token.\r
629\r
630 When the PCD service sets a value, it will check to ensure that the \r
631 size of the value being set is compatible with the Token's existing definition. \r
632 If it is not, an error will be returned.\r
633\r
2a870f53 634 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
635 @param[in] TokenNumber The PCD token number. \r
636 @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. \r
a7c5092f 637 On input, if the SizeOfValue is greater than the maximum size supported \r
638 for this TokenNumber then the output value of SizeOfValue will reflect \r
639 the maximum size supported for this TokenNumber.\r
2a870f53 640 @param[in] Buffer The buffer to set for the PCD token.\r
a7c5092f 641\r
642 @retval EFI_SUCCESS Procedure returned successfully.\r
643 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
644 being set was incompatible with a call to this function. \r
645 Use GetSize() to retrieve the size of the target data.\r
646 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
647 \r
648**/\r
878ddf1f 649typedef\r
650EFI_STATUS\r
651(EFIAPI *PCD_PROTOCOL_SET_EX_POINTER) (\r
1de04b4f 652 IN CONST EFI_GUID *Guid,\r
653 IN UINTN TokenNumber,\r
654 IN OUT UINTN *SizeOfBuffer,\r
655 IN VOID *Buffer\r
878ddf1f 656 );\r
657\r
a7c5092f 658\r
659\r
660/**\r
661 Sets an Boolean value for a given PCD token.\r
662\r
663 When the PCD service sets a value, it will check to ensure that the \r
664 size of the value being set is compatible with the Token's existing definition. \r
665 If it is not, an error will be returned.\r
666\r
2a870f53 667 @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
668 @param[in] TokenNumber The PCD token number. \r
669 @param[in] Value The value to set for the PCD token.\r
a7c5092f 670\r
671 @retval EFI_SUCCESS Procedure returned successfully.\r
672 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r
673 being set was incompatible with a call to this function. \r
674 Use GetSize() to retrieve the size of the target data.\r
675 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r
676 \r
677**/\r
878ddf1f 678typedef\r
679EFI_STATUS\r
680(EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN) (\r
681 IN CONST EFI_GUID *Guid,\r
8a43e8dd 682 IN UINTN TokenNumber,\r
878ddf1f 683 IN BOOLEAN Value\r
684 );\r
685 \r
a7c5092f 686\r
687\r
878ddf1f 688/**\r
689 Callback on SET function prototype definition.\r
690\r
2a870f53 691 This notification function serves two purposes. \r
692 Firstly, it notifies the module which did the registration that the value \r
693 of this PCD token has been set. Secondly, it provides a mechanism for the \r
694 module which did the registration to intercept the set operation and override \r
695 the value been set if necessary. After the invocation of the callback function, \r
696 TokenData will be used by PCD service DXE driver to modify the internal data in \r
697 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
878ddf1f 703\r
704 @retval VOID\r
705\r
a7c5092f 706**/\r
878ddf1f 707typedef\r
708VOID\r
709(EFIAPI *PCD_PROTOCOL_CALLBACK) (\r
b16ef805 710 IN CONST EFI_GUID *CallBackGuid, OPTIONAL\r
1de04b4f 711 IN UINTN CallBackToken,\r
b16ef805 712 IN OUT VOID *TokenData,\r
713 IN UINTN TokenDataSize\r
878ddf1f 714 );\r
715\r
a7c5092f 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
2a870f53 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
a7c5092f 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
878ddf1f 730typedef\r
731EFI_STATUS\r
732(EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET) (\r
878ddf1f 733 IN CONST EFI_GUID *Guid, OPTIONAL\r
2a870f53 734 IN UINTN TokenNumber,\r
878ddf1f 735 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
736 );\r
737\r
a7c5092f 738\r
739\r
740/**\r
741 Cancels a previously set callback function for a particular PCD token number.\r
742\r
2a870f53 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
a7c5092f 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
878ddf1f 752typedef\r
753EFI_STATUS\r
754(EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK) (\r
878ddf1f 755 IN CONST EFI_GUID *Guid, OPTIONAL\r
2a870f53 756 IN UINTN TokenNumber,\r
878ddf1f 757 IN PCD_PROTOCOL_CALLBACK CallBackFunction\r
758 );\r
759\r
a7c5092f 760\r
761\r
762/**\r
763 Retrieves the next valid PCD token for a given namespace.\r
764\r
2a870f53 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, \r
511710d6 768 an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, \r
2a870f53 769 have the pointer reference a TokenNumber value of 0. If the input token number is 0 and \r
770 there is no valid token number for this token namespace, *TokenNumber will be assigned to \r
771 0 and the function return EFI_SUCCESS. If the token number is the last valid token number, \r
772 *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.\r
a7c5092f 773\r
2a870f53 774 @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number \r
775 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
a7c5092f 778\r
779**/\r
878ddf1f 780typedef \r
781EFI_STATUS\r
782(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (\r
783 IN CONST EFI_GUID *Guid, OPTIONAL\r
8a43e8dd 784 IN OUT UINTN *TokenNumber\r
878ddf1f 785 );\r
786\r
4276d5da 787\r
a7c5092f 788\r
789/**\r
790 Retrieves the next valid PCD token namespace for a given namespace.\r
791\r
2a870f53 792 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates \r
793 a known token namespace from which the search will start. On output, \r
794 it designates the next valid token namespace on the platform. If the input \r
795 token namespace does not exist on the platform, an error is returned and \r
796 the value of *Guid is undefined. If *Guid is NULL, then the GUID of the \r
797 first token space of the current platform is assigned to *Guid the function \r
798 return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in \r
799 the platform other than the default (NULL) tokennamespace, *Guid is unchanged \r
800 and the function return EFI_SUCCESS. If this input token namespace is the last \r
801 namespace on the platform, *Guid will be assigned to NULL and the function return \r
802 EFI_SUCCESS. \r
a7c5092f 803\r
2a870f53 804 @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid. \r
805 Or the input token space Guid is already the last valid token space Guid \r
806 in the PCD database. In the later case, *Guid is updated with the value of NULL.\r
807 @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.\r
a7c5092f 808\r
809**/\r
4276d5da 810typedef \r
811EFI_STATUS\r
812(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKENSPACE) (\r
2a870f53 813 IN OUT CONST EFI_GUID **Guid\r
4276d5da 814 );\r
815\r
816\r
a7c5092f 817\r
818//\r
819// Interface structure for the PCD Protocol\r
820//\r
878ddf1f 821typedef struct {\r
822 PCD_PROTOCOL_SET_SKU SetSku;\r
823\r
824 PCD_PROTOCOL_GET8 Get8;\r
825 PCD_PROTOCOL_GET16 Get16;\r
826 PCD_PROTOCOL_GET32 Get32;\r
827 PCD_PROTOCOL_GET64 Get64;\r
828 PCD_PROTOCOL_GET_POINTER GetPtr;\r
829 PCD_PROTOCOL_GET_BOOLEAN GetBool;\r
830 PCD_PROTOCOL_GET_SIZE GetSize;\r
831\r
832 PCD_PROTOCOL_GET_EX_8 Get8Ex;\r
833 PCD_PROTOCOL_GET_EX_16 Get16Ex;\r
834 PCD_PROTOCOL_GET_EX_32 Get32Ex;\r
835 PCD_PROTOCOL_GET_EX_64 Get64Ex;\r
836 PCD_PROTOCOL_GET_EX_POINTER GetPtrEx;\r
837 PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx;\r
838 PCD_PROTOCOL_GET_EX_SIZE GetSizeEx;\r
839\r
840 PCD_PROTOCOL_SET8 Set8;\r
841 PCD_PROTOCOL_SET16 Set16;\r
842 PCD_PROTOCOL_SET32 Set32;\r
843 PCD_PROTOCOL_SET64 Set64;\r
844 PCD_PROTOCOL_SET_POINTER SetPtr;\r
845 PCD_PROTOCOL_SET_BOOLEAN SetBool;\r
846\r
847 PCD_PROTOCOL_SET_EX_8 Set8Ex;\r
848 PCD_PROTOCOL_SET_EX_16 Set16Ex;\r
849 PCD_PROTOCOL_SET_EX_32 Set32Ex;\r
850 PCD_PROTOCOL_SET_EX_64 Set64Ex;\r
851 PCD_PROTOCOL_SET_EX_POINTER SetPtrEx;\r
852 PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx;\r
853\r
854 PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet;\r
855 PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;\r
856 PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;\r
4276d5da 857 PCD_PROTOCOL_GET_NEXT_TOKENSPACE GetNextTokenSpace;\r
878ddf1f 858} PCD_PROTOCOL;\r
859\r
860#endif\r