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