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