]>
Commit | Line | Data |
---|---|---|
80408db0 | 1 | /** @file\r |
2 | Private functions used by PCD PEIM.\r | |
3 | \r | |
c52fa98c | 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 | |
80408db0 | 12 | \r |
13 | \r | |
14 | Module Name: Service.h\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
fc547e08 | 18 | #ifndef _PEI_PCD_SERVICE_H_\r |
19 | #define _PEI_PCD_SERVICE_H_\r | |
80408db0 | 20 | \r |
97a079ed A |
21 | #include <PiPei.h>\r |
22 | #include <Ppi/ReadOnlyVariable2.h>\r | |
23 | #include <Ppi/Pcd.h>\r | |
24 | #include <Library/DebugLib.h>\r | |
25 | #include <Library/PeimEntryPoint.h>\r | |
26 | #include <Library/BaseLib.h>\r | |
27 | #include <Library/HobLib.h>\r | |
28 | #include <Library/PeiServicesLib.h>\r | |
29 | #include <Library/PcdLib.h>\r | |
30 | #include <Library/PeiServicesTablePointerLib.h>\r | |
31 | #include <Library/BaseMemoryLib.h>\r | |
32 | \r | |
80408db0 | 33 | \r |
34 | //\r | |
35 | // Please make sure the PCD Serivce PEIM Version is consistent with\r | |
36 | // the version of PCD Database generation tool\r | |
37 | //\r | |
38 | #define PCD_SERVICE_PEIM_VERSION 2\r | |
39 | \r | |
40 | //\r | |
41 | // PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h\r | |
42 | // and generated by PCD Database generation tool.\r | |
43 | //\r | |
c52fa98c | 44 | //#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )\r |
be82f9ff | 45 | // #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"\r |
c52fa98c | 46 | //#endif\r |
80408db0 | 47 | \r |
48 | //\r | |
49 | // PPI Interface Implementation Declaration.\r | |
50 | //\r | |
fc547e08 | 51 | \r |
52 | /**\r | |
53 | Sets the SKU value for subsequent calls to set or get PCD token values.\r | |
54 | \r | |
55 | SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. \r | |
56 | SetSku() is normally called only once by the system.\r | |
57 | \r | |
58 | For each item (token), the database can hold a single value that applies to all SKUs, \r | |
59 | or multiple values, where each value is associated with a specific SKU Id. Items with multiple, \r | |
60 | SKU-specific values are called SKU enabled. \r | |
61 | \r | |
62 | The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. \r | |
63 | For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the \r | |
64 | single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the \r | |
65 | last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, \r | |
66 | the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been \r | |
67 | set for that Id, the results are unpredictable.\r | |
68 | \r | |
69 | @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r | |
70 | set values associated with a PCD token.\r | |
71 | \r | |
72 | @retval VOID\r | |
73 | \r | |
74 | **/\r | |
80408db0 | 75 | VOID\r |
76 | EFIAPI\r | |
77 | PeiPcdSetSku (\r | |
78 | IN UINTN SkuId\r | |
79 | )\r | |
80 | ;\r | |
81 | \r | |
fc547e08 | 82 | /**\r |
83 | Retrieves an 8-bit value for a given PCD token.\r | |
84 | \r | |
85 | Retrieves the current byte-sized value for a PCD token number. \r | |
86 | If the TokenNumber is invalid, the results are unpredictable.\r | |
87 | \r | |
88 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 89 | \r |
fc547e08 | 90 | @return The UINT8 value.\r |
91 | \r | |
92 | **/\r | |
80408db0 | 93 | UINT8\r |
94 | EFIAPI\r | |
95 | PeiPcdGet8 (\r | |
96 | IN UINTN TokenNumber\r | |
97 | )\r | |
98 | ;\r | |
99 | \r | |
fc547e08 | 100 | /**\r |
101 | Retrieves an 16-bit value for a given PCD token.\r | |
102 | \r | |
103 | Retrieves the current 16-bits value for a PCD token number. \r | |
104 | If the TokenNumber is invalid, the results are unpredictable.\r | |
105 | \r | |
106 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 107 | \r |
fc547e08 | 108 | @return The UINT16 value.\r |
109 | \r | |
110 | **/\r | |
80408db0 | 111 | UINT16\r |
112 | EFIAPI\r | |
113 | PeiPcdGet16 (\r | |
114 | IN UINTN TokenNumber\r | |
115 | )\r | |
116 | ;\r | |
117 | \r | |
fc547e08 | 118 | /**\r |
119 | Retrieves an 32-bit value for a given PCD token.\r | |
120 | \r | |
121 | Retrieves the current 32-bits value for a PCD token number. \r | |
122 | If the TokenNumber is invalid, the results are unpredictable.\r | |
123 | \r | |
124 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 125 | \r |
fc547e08 | 126 | @return The UINT32 value.\r |
127 | \r | |
128 | **/\r | |
80408db0 | 129 | UINT32\r |
130 | EFIAPI\r | |
131 | PeiPcdGet32 (\r | |
132 | IN UINTN TokenNumber\r | |
133 | )\r | |
134 | ;\r | |
135 | \r | |
fc547e08 | 136 | /**\r |
137 | Retrieves an 64-bit value for a given PCD token.\r | |
138 | \r | |
139 | Retrieves the current 64-bits value for a PCD token number. \r | |
140 | If the TokenNumber is invalid, the results are unpredictable.\r | |
141 | \r | |
142 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 143 | \r |
fc547e08 | 144 | @return The UINT64 value.\r |
145 | \r | |
146 | **/\r | |
80408db0 | 147 | UINT64\r |
148 | EFIAPI\r | |
149 | PeiPcdGet64 (\r | |
150 | IN UINTN TokenNumber\r | |
151 | )\r | |
152 | ;\r | |
153 | \r | |
fc547e08 | 154 | /**\r |
155 | Retrieves a pointer to a value for a given PCD token.\r | |
156 | \r | |
157 | Retrieves the current pointer to the buffer 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 | |
80408db0 | 161 | \r |
fc547e08 | 162 | @param[in] TokenNumber The PCD token number. \r |
163 | \r | |
164 | @return The pointer to the buffer to be retrived.\r | |
165 | \r | |
166 | **/\r | |
80408db0 | 167 | VOID *\r |
168 | EFIAPI\r | |
169 | PeiPcdGetPtr (\r | |
170 | IN UINTN TokenNumber\r | |
171 | )\r | |
172 | ;\r | |
173 | \r | |
fc547e08 | 174 | /**\r |
175 | Retrieves a Boolean value for a given PCD token.\r | |
176 | \r | |
177 | Retrieves the current boolean value for a PCD token number. \r | |
178 | Do not make any assumptions about the alignment of the pointer that \r | |
179 | is returned by this function call. If the TokenNumber is invalid, \r | |
180 | the results are unpredictable.\r | |
181 | \r | |
182 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 183 | \r |
fc547e08 | 184 | @return The Boolean value.\r |
185 | \r | |
186 | **/\r | |
80408db0 | 187 | BOOLEAN\r |
188 | EFIAPI\r | |
189 | PeiPcdGetBool (\r | |
190 | IN UINTN TokenNumber\r | |
191 | )\r | |
192 | ;\r | |
193 | \r | |
fc547e08 | 194 | /**\r |
195 | Retrieves the size of the value for a given PCD token.\r | |
196 | \r | |
197 | Retrieves the current size of a particular PCD token. \r | |
198 | If the TokenNumber is invalid, the results are unpredictable.\r | |
80408db0 | 199 | \r |
fc547e08 | 200 | @param[in] TokenNumber The PCD token number. \r |
201 | \r | |
202 | @return The size of the value for the PCD token.\r | |
203 | \r | |
204 | **/\r | |
80408db0 | 205 | UINTN\r |
206 | EFIAPI\r | |
207 | PeiPcdGetSize (\r | |
208 | IN UINTN TokenNumber\r | |
209 | )\r | |
210 | ;\r | |
211 | \r | |
fc547e08 | 212 | /**\r |
213 | Retrieves an 8-bit value for a given PCD token.\r | |
80408db0 | 214 | \r |
fc547e08 | 215 | Retrieves the 8-bit value of a particular PCD token. \r |
216 | If the TokenNumber is invalid or the token space\r | |
217 | specified by Guid does not exist, the results are \r | |
218 | unpredictable.\r | |
219 | \r | |
220 | @param[in] Guid The token space for the token number.\r | |
221 | @param[in] TokenNumber The PCD token number. \r | |
222 | \r | |
223 | @return The size 8-bit value for the PCD token.\r | |
224 | \r | |
225 | **/\r | |
80408db0 | 226 | UINT8\r |
227 | EFIAPI\r | |
228 | PeiPcdGet8Ex (\r | |
229 | IN CONST EFI_GUID *Guid,\r | |
230 | IN UINTN TokenNumber\r | |
231 | )\r | |
232 | ;\r | |
233 | \r | |
fc547e08 | 234 | /**\r |
235 | Retrieves an 16-bit value for a given PCD token.\r | |
236 | \r | |
237 | Retrieves the 16-bit value of a particular PCD token. \r | |
238 | If the TokenNumber is invalid or the token space\r | |
239 | specified by Guid does not exist, the results are \r | |
240 | unpredictable.\r | |
80408db0 | 241 | \r |
fc547e08 | 242 | @param[in] Guid The token space for the token number.\r |
243 | @param[in] TokenNumber The PCD token number. \r | |
244 | \r | |
245 | @return The size 16-bit value for the PCD token.\r | |
246 | \r | |
247 | **/\r | |
80408db0 | 248 | UINT16\r |
249 | EFIAPI\r | |
250 | PeiPcdGet16Ex (\r | |
251 | IN CONST EFI_GUID *Guid,\r | |
252 | IN UINTN TokenNumber\r | |
253 | )\r | |
254 | ;\r | |
255 | \r | |
fc547e08 | 256 | /**\r |
257 | Retrieves an 32-bit value for a given PCD token.\r | |
258 | \r | |
259 | Retrieves the 32-bit value of a particular PCD token. \r | |
260 | If the TokenNumber is invalid or the token space\r | |
261 | specified by Guid does not exist, the results are \r | |
262 | unpredictable.\r | |
263 | \r | |
264 | @param[in] Guid The token space for the token number.\r | |
265 | @param[in] TokenNumber The PCD token number. \r | |
266 | \r | |
267 | @return The size 32-bit value for the PCD token.\r | |
268 | \r | |
269 | **/\r | |
80408db0 | 270 | UINT32\r |
271 | EFIAPI\r | |
272 | PeiPcdGet32Ex (\r | |
273 | IN CONST EFI_GUID *Guid,\r | |
274 | IN UINTN TokenNumber\r | |
275 | )\r | |
276 | ;\r | |
277 | \r | |
fc547e08 | 278 | /**\r |
279 | Retrieves an 64-bit value for a given PCD token.\r | |
280 | \r | |
281 | Retrieves the 64-bit value of a particular PCD token. \r | |
282 | If the TokenNumber is invalid or the token space\r | |
283 | specified by Guid does not exist, the results are \r | |
284 | unpredictable.\r | |
285 | \r | |
286 | @param[in] Guid The token space for the token number.\r | |
287 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 288 | \r |
fc547e08 | 289 | @return The size 64-bit value for the PCD token.\r |
290 | \r | |
291 | **/\r | |
80408db0 | 292 | UINT64\r |
293 | EFIAPI\r | |
294 | PeiPcdGet64Ex (\r | |
295 | IN CONST EFI_GUID *Guid,\r | |
296 | IN UINTN TokenNumber\r | |
297 | )\r | |
298 | ;\r | |
299 | \r | |
fc547e08 | 300 | /**\r |
301 | Retrieves a pointer to a value for a given PCD token.\r | |
302 | \r | |
303 | Retrieves the current pointer to the buffer for a PCD token number. \r | |
304 | Do not make any assumptions about the alignment of the pointer that \r | |
305 | is returned by this function call. If the TokenNumber is invalid, \r | |
306 | the results are unpredictable.\r | |
80408db0 | 307 | \r |
fc547e08 | 308 | @param[in] Guid The token space for the token number.\r |
309 | @param[in] TokenNumber The PCD token number. \r | |
310 | \r | |
311 | @return The pointer to the buffer to be retrived.\r | |
312 | \r | |
313 | **/\r | |
80408db0 | 314 | VOID *\r |
315 | EFIAPI\r | |
316 | PeiPcdGetPtrEx (\r | |
317 | IN CONST EFI_GUID *Guid,\r | |
318 | IN UINTN TokenNumber\r | |
319 | )\r | |
320 | ;\r | |
321 | \r | |
fc547e08 | 322 | /**\r |
323 | Retrieves an Boolean value for a given PCD token.\r | |
80408db0 | 324 | \r |
fc547e08 | 325 | Retrieves the Boolean value of a particular PCD token. \r |
326 | If the TokenNumber is invalid or the token space\r | |
327 | specified by Guid does not exist, the results are \r | |
328 | unpredictable.\r | |
329 | \r | |
330 | @param[in] Guid The token space for the token number.\r | |
331 | @param[in] TokenNumber The PCD token number. \r | |
332 | \r | |
333 | @return The size Boolean value for the PCD token.\r | |
334 | \r | |
335 | **/\r | |
80408db0 | 336 | BOOLEAN\r |
337 | EFIAPI\r | |
338 | PeiPcdGetBoolEx (\r | |
339 | IN CONST EFI_GUID *Guid,\r | |
340 | IN UINTN TokenNumber\r | |
341 | )\r | |
342 | ;\r | |
343 | \r | |
fc547e08 | 344 | /**\r |
345 | Retrieves the size of the value for a given PCD token.\r | |
346 | \r | |
347 | Retrieves the current size of a particular PCD token. \r | |
348 | If the TokenNumber is invalid, the results are unpredictable.\r | |
80408db0 | 349 | \r |
fc547e08 | 350 | @param[in] Guid The token space for the token number.\r |
351 | @param[in] TokenNumber The PCD token number. \r | |
352 | \r | |
353 | @return The size of the value for the PCD token.\r | |
354 | \r | |
355 | **/\r | |
80408db0 | 356 | UINTN\r |
357 | EFIAPI\r | |
358 | PeiPcdGetSizeEx (\r | |
359 | IN CONST EFI_GUID *Guid,\r | |
360 | IN UINTN TokenNumber\r | |
361 | )\r | |
362 | ;\r | |
363 | \r | |
fc547e08 | 364 | /**\r |
365 | Sets an 8-bit value for a given PCD token.\r | |
366 | \r | |
367 | When the PCD service sets a value, it will check to ensure that the \r | |
368 | size of the value being set is compatible with the Token's existing definition. \r | |
369 | If it is not, an error will be returned.\r | |
370 | \r | |
371 | @param[in] TokenNumber The PCD token number. \r | |
372 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 373 | \r |
fc547e08 | 374 | @retval EFI_SUCCESS Procedure returned successfully.\r |
375 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
376 | being set was incompatible with a call to this function. \r | |
377 | Use GetSize() to retrieve the size of the target data.\r | |
378 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
379 | \r | |
380 | **/\r | |
80408db0 | 381 | EFI_STATUS\r |
382 | EFIAPI\r | |
383 | PeiPcdSet8 (\r | |
384 | IN UINTN TokenNumber,\r | |
385 | IN UINT8 Value\r | |
386 | )\r | |
387 | ;\r | |
388 | \r | |
fc547e08 | 389 | /**\r |
390 | Sets an 16-bit value for a given PCD token.\r | |
391 | \r | |
392 | When the PCD service sets a value, it will check to ensure that the \r | |
393 | size of the value being set is compatible with the Token's existing definition. \r | |
394 | If it is not, an error will be returned.\r | |
80408db0 | 395 | \r |
fc547e08 | 396 | @param[in] TokenNumber The PCD token number. \r |
397 | @param[in] Value The value to set for the PCD token.\r | |
398 | \r | |
399 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
400 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
401 | being set was incompatible with a call to this function. \r | |
402 | Use GetSize() to retrieve the size of the target data.\r | |
403 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
404 | \r | |
405 | **/\r | |
80408db0 | 406 | EFI_STATUS\r |
407 | EFIAPI\r | |
408 | PeiPcdSet16 (\r | |
409 | IN UINTN TokenNumber,\r | |
410 | IN UINT16 Value\r | |
411 | )\r | |
412 | ;\r | |
413 | \r | |
fc547e08 | 414 | /**\r |
415 | Sets an 32-bit value for a given PCD token.\r | |
80408db0 | 416 | \r |
fc547e08 | 417 | When the PCD service sets a value, it will check to ensure that the \r |
418 | size of the value being set is compatible with the Token's existing definition. \r | |
419 | If it is not, an error will be returned.\r | |
420 | \r | |
421 | @param[in] TokenNumber The PCD token number. \r | |
422 | @param[in] Value The value to set for the PCD token.\r | |
423 | \r | |
424 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
425 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
426 | being set was incompatible with a call to this function. \r | |
427 | Use GetSize() to retrieve the size of the target data.\r | |
428 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
429 | \r | |
430 | **/\r | |
80408db0 | 431 | EFI_STATUS\r |
432 | EFIAPI\r | |
433 | PeiPcdSet32 (\r | |
434 | IN UINTN TokenNumber,\r | |
435 | IN UINT32 Value\r | |
436 | )\r | |
437 | ;\r | |
438 | \r | |
fc547e08 | 439 | /**\r |
440 | Sets an 64-bit value for a given PCD token.\r | |
441 | \r | |
442 | When the PCD service sets a value, it will check to ensure that the \r | |
443 | size of the value being set is compatible with the Token's existing definition. \r | |
444 | If it is not, an error will be returned.\r | |
80408db0 | 445 | \r |
fc547e08 | 446 | @param[in] TokenNumber The PCD token number. \r |
447 | @param[in] Value The value to set for the PCD token.\r | |
448 | \r | |
449 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
450 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
451 | being set was incompatible with a call to this function. \r | |
452 | Use GetSize() to retrieve the size of the target data.\r | |
453 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
454 | \r | |
455 | **/\r | |
80408db0 | 456 | EFI_STATUS\r |
457 | EFIAPI\r | |
458 | PeiPcdSet64 (\r | |
459 | IN UINTN TokenNumber,\r | |
460 | IN UINT64 Value\r | |
461 | )\r | |
462 | ;\r | |
463 | \r | |
fc547e08 | 464 | /**\r |
465 | Sets a value of a specified size for a given PCD token.\r | |
466 | \r | |
467 | When the PCD service sets a value, it will check to ensure that the \r | |
468 | size of the value being set is compatible with the Token's existing definition. \r | |
469 | If it is not, an error will be returned.\r | |
470 | \r | |
471 | @param[in] TokenNumber The PCD token number. \r | |
472 | @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. \r | |
473 | On input, if the SizeOfValue is greater than the maximum size supported \r | |
474 | for this TokenNumber then the output value of SizeOfValue will reflect \r | |
475 | the maximum size supported for this TokenNumber.\r | |
476 | @param[in] Buffer The buffer to set for the PCD token.\r | |
477 | \r | |
478 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
479 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
480 | being set was incompatible with a call to this function. \r | |
481 | Use GetSize() to retrieve the size of the target data.\r | |
482 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
483 | \r | |
484 | **/\r | |
80408db0 | 485 | EFI_STATUS\r |
486 | EFIAPI\r | |
487 | PeiPcdSetPtr (\r | |
488 | IN UINTN TokenNumber,\r | |
489 | IN OUT UINTN *SizeOfBuffer,\r | |
490 | IN VOID *Buffer\r | |
491 | )\r | |
492 | ;\r | |
493 | \r | |
fc547e08 | 494 | /**\r |
495 | Sets an Boolean value for a given PCD token.\r | |
496 | \r | |
497 | When the PCD service sets a value, it will check to ensure that the \r | |
498 | size of the value being set is compatible with the Token's existing definition. \r | |
499 | If it is not, an error will be returned.\r | |
80408db0 | 500 | \r |
fc547e08 | 501 | @param[in] TokenNumber The PCD token number. \r |
502 | @param[in] Value The value to set for the PCD token.\r | |
503 | \r | |
504 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
505 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
506 | being set was incompatible with a call to this function. \r | |
507 | Use GetSize() to retrieve the size of the target data.\r | |
508 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
509 | \r | |
510 | **/\r | |
80408db0 | 511 | EFI_STATUS\r |
512 | EFIAPI\r | |
513 | PeiPcdSetBool (\r | |
514 | IN UINTN TokenNumber,\r | |
515 | IN BOOLEAN Value\r | |
516 | )\r | |
517 | ;\r | |
518 | \r | |
fc547e08 | 519 | /**\r |
520 | Sets an 8-bit value for a given PCD token.\r | |
521 | \r | |
522 | When the PCD service sets a value, it will check to ensure that the \r | |
523 | size of the value being set is compatible with the Token's existing definition. \r | |
524 | If it is not, an error will be returned.\r | |
525 | \r | |
526 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
527 | @param[in] TokenNumber The PCD token number. \r | |
528 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 529 | \r |
fc547e08 | 530 | @retval EFI_SUCCESS Procedure returned successfully.\r |
531 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
532 | being set was incompatible with a call to this function. \r | |
533 | Use GetSize() to retrieve the size of the target data.\r | |
534 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
535 | \r | |
536 | **/\r | |
80408db0 | 537 | EFI_STATUS\r |
538 | EFIAPI\r | |
539 | PeiPcdSet8Ex (\r | |
540 | IN CONST EFI_GUID *Guid,\r | |
541 | IN UINTN TokenNumber,\r | |
542 | IN UINT8 Value\r | |
543 | )\r | |
544 | ;\r | |
545 | \r | |
fc547e08 | 546 | /**\r |
547 | Sets an 16-bit value for a given PCD token.\r | |
548 | \r | |
549 | When the PCD service sets a value, it will check to ensure that the \r | |
550 | size of the value being set is compatible with the Token's existing definition. \r | |
551 | If it is not, an error will be returned.\r | |
552 | \r | |
553 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
554 | @param[in] TokenNumber The PCD token number. \r | |
555 | @param[in] Value The value to set for the PCD token.\r | |
556 | \r | |
557 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
558 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
559 | being set was incompatible with a call to this function. \r | |
560 | Use GetSize() to retrieve the size of the target data.\r | |
561 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
562 | \r | |
563 | **/\r | |
80408db0 | 564 | EFI_STATUS\r |
565 | EFIAPI\r | |
566 | PeiPcdSet16Ex (\r | |
567 | IN CONST EFI_GUID *Guid,\r | |
568 | IN UINTN TokenNumber,\r | |
569 | IN UINT16 Value\r | |
570 | )\r | |
571 | ;\r | |
572 | \r | |
fc547e08 | 573 | /**\r |
574 | Sets an 32-bit value for a given PCD token.\r | |
575 | \r | |
576 | When the PCD service sets a value, it will check to ensure that the \r | |
577 | size of the value being set is compatible with the Token's existing definition. \r | |
578 | If it is not, an error will be returned.\r | |
80408db0 | 579 | \r |
fc547e08 | 580 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r |
581 | @param[in] TokenNumber The PCD token number. \r | |
582 | @param[in] Value The value to set for the PCD token.\r | |
583 | \r | |
584 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
585 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
586 | being set was incompatible with a call to this function. \r | |
587 | Use GetSize() to retrieve the size of the target data.\r | |
588 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
589 | \r | |
590 | **/\r | |
80408db0 | 591 | EFI_STATUS\r |
592 | EFIAPI\r | |
593 | PeiPcdSet32Ex (\r | |
594 | IN CONST EFI_GUID *Guid,\r | |
595 | IN UINTN TokenNumber,\r | |
596 | IN UINT32 Value\r | |
597 | )\r | |
598 | ;\r | |
599 | \r | |
fc547e08 | 600 | /**\r |
601 | Sets an 64-bit value for a given PCD token.\r | |
80408db0 | 602 | \r |
fc547e08 | 603 | When the PCD service sets a value, it will check to ensure that the \r |
604 | size of the value being set is compatible with the Token's existing definition. \r | |
605 | If it is not, an error will be returned.\r | |
606 | \r | |
607 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
608 | @param[in] TokenNumber The PCD token number. \r | |
609 | @param[in] Value The value to set for the PCD token.\r | |
610 | \r | |
611 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
612 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
613 | being set was incompatible with a call to this function. \r | |
614 | Use GetSize() to retrieve the size of the target data.\r | |
615 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
616 | \r | |
617 | **/\r | |
80408db0 | 618 | EFI_STATUS\r |
619 | EFIAPI\r | |
620 | PeiPcdSet64Ex (\r | |
621 | IN CONST EFI_GUID *Guid,\r | |
622 | IN UINTN TokenNumber,\r | |
623 | IN UINT64 Value\r | |
624 | )\r | |
625 | ;\r | |
626 | \r | |
fc547e08 | 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 | |
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 | |
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 | |
640 | @param[in] Buffer The buffer to set for the PCD token.\r | |
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 | |
80408db0 | 649 | EFI_STATUS\r |
650 | EFIAPI\r | |
651 | PeiPcdSetPtrEx (\r | |
652 | IN CONST EFI_GUID *Guid,\r | |
653 | IN UINTN TokenNumber,\r | |
654 | IN OUT UINTN *SizeOfBuffer,\r | |
655 | IN VOID *Buffer\r | |
656 | )\r | |
657 | ;\r | |
658 | \r | |
fc547e08 | 659 | /**\r |
660 | Sets an Boolean value for a given PCD token.\r | |
661 | \r | |
662 | When the PCD service sets a value, it will check to ensure that the \r | |
663 | size of the value being set is compatible with the Token's existing definition. \r | |
664 | If it is not, an error will be returned.\r | |
80408db0 | 665 | \r |
fc547e08 | 666 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r |
667 | @param[in] TokenNumber The PCD token number. \r | |
668 | @param[in] Value The value to set for the PCD token.\r | |
669 | \r | |
670 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
671 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
672 | being set was incompatible with a call to this function. \r | |
673 | Use GetSize() to retrieve the size of the target data.\r | |
674 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
675 | \r | |
676 | **/\r | |
80408db0 | 677 | EFI_STATUS\r |
678 | EFIAPI\r | |
679 | PeiPcdSetBoolEx (\r | |
680 | IN CONST EFI_GUID *Guid,\r | |
681 | IN UINTN TokenNumber,\r | |
682 | IN BOOLEAN Value\r | |
683 | )\r | |
684 | ;\r | |
685 | \r | |
fc547e08 | 686 | /**\r |
687 | Specifies a function to be called anytime the value of a designated token is changed.\r | |
80408db0 | 688 | \r |
fc547e08 | 689 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r |
690 | @param[in] TokenNumber The PCD token number. \r | |
691 | @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. \r | |
80408db0 | 692 | \r |
fc547e08 | 693 | @retval EFI_SUCCESS The PCD service has successfully established a call event \r |
694 | for the CallBackToken requested.\r | |
695 | @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r | |
696 | \r | |
697 | **/\r | |
80408db0 | 698 | EFI_STATUS\r |
699 | EFIAPI\r | |
700 | PeiRegisterCallBackOnSet (\r | |
701 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
702 | IN UINTN TokenNumber,\r | |
703 | IN PCD_PPI_CALLBACK CallBackFunction\r | |
704 | )\r | |
705 | ;\r | |
706 | \r | |
fc547e08 | 707 | /**\r |
708 | Cancels a previously set callback function for a particular PCD token number.\r | |
709 | \r | |
710 | @param [in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
711 | @param [in] TokenNumber The PCD token number. \r | |
712 | @param [in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. \r | |
713 | \r | |
714 | @retval EFI_SUCCESS The PCD service has successfully established a call event \r | |
715 | for the CallBackToken requested.\r | |
716 | @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r | |
80408db0 | 717 | \r |
fc547e08 | 718 | **/\r |
80408db0 | 719 | EFI_STATUS\r |
720 | EFIAPI\r | |
721 | PcdUnRegisterCallBackOnSet (\r | |
722 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
723 | IN UINTN TokenNumber,\r | |
724 | IN PCD_PPI_CALLBACK CallBackFunction\r | |
725 | )\r | |
726 | ;\r | |
727 | \r | |
fc547e08 | 728 | /**\r |
729 | Retrieves the next valid PCD token for a given namespace.\r | |
730 | \r | |
731 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
732 | @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. \r | |
733 | If the input token namespace or token number does not exist on the platform, \r | |
734 | an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, \r | |
735 | have the pointer reference a TokenNumber value of 0. If the input token number is 0 and \r | |
736 | there is no valid token number for this token namespace, *TokenNumber will be assigned to \r | |
737 | 0 and the function return EFI_SUCCESS. If the token number is the last valid token number, \r | |
738 | *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.\r | |
80408db0 | 739 | \r |
fc547e08 | 740 | @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number \r |
741 | is already the last valid token number in the PCD database. \r | |
742 | In the later case, *TokenNumber is updated with the value of 0.\r | |
743 | @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.\r | |
744 | \r | |
745 | **/\r | |
80408db0 | 746 | EFI_STATUS\r |
747 | EFIAPI\r | |
748 | PeiPcdGetNextToken (\r | |
749 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
750 | IN OUT UINTN *TokenNumber\r | |
751 | )\r | |
752 | ;\r | |
753 | \r | |
fc547e08 | 754 | /**\r |
755 | Retrieves the next valid PCD token namespace for a given namespace.\r | |
756 | \r | |
757 | @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates \r | |
758 | a known token namespace from which the search will start. On output, \r | |
759 | it designates the next valid token namespace on the platform. If the input \r | |
760 | token namespace does not exist on the platform, an error is returned and \r | |
761 | the value of *Guid is undefined. If *Guid is NULL, then the GUID of the \r | |
762 | first token space of the current platform is assigned to *Guid the function \r | |
763 | return EFI_SUCCESS. If *Guid is NULL and there is no namespace exist in \r | |
764 | the platform other than the default (NULL) tokennamespace, *Guid is unchanged \r | |
765 | and the function return EFI_SUCCESS. If this input token namespace is the last \r | |
766 | namespace on the platform, *Guid will be assigned to NULL and the function return \r | |
767 | EFI_SUCCESS. \r | |
768 | \r | |
769 | @retval EFI_SUCCESS The PCD service retrieved the next valid token space Guid. \r | |
770 | Or the input token space Guid is already the last valid token space Guid \r | |
771 | in the PCD database. In the later case, *Guid is updated with the value of NULL.\r | |
772 | @retval EFI_NOT_FOUND If the input token namespace does not exist on the platform.\r | |
80408db0 | 773 | \r |
fc547e08 | 774 | **/\r |
80408db0 | 775 | EFI_STATUS\r |
776 | EFIAPI\r | |
777 | PeiPcdGetNextTokenSpace (\r | |
fc547e08 | 778 | IN OUT CONST EFI_GUID **Guid\r |
80408db0 | 779 | )\r |
780 | ;\r | |
781 | \r | |
782 | \r | |
783 | /* Internal Function definitions */\r | |
fc547e08 | 784 | /**\r |
785 | Get PCD database from GUID HOB in PEI phase.\r | |
786 | \r | |
787 | @return Pointer to PCD database.\r | |
80408db0 | 788 | \r |
fc547e08 | 789 | **/\r |
80408db0 | 790 | PEI_PCD_DATABASE *\r |
791 | GetPcdDatabase (\r | |
792 | VOID\r | |
793 | )\r | |
794 | ;\r | |
795 | \r | |
fc547e08 | 796 | /**\r |
797 | Wrapper function for setting non-pointer type value for a PCD entry.\r | |
798 | \r | |
799 | @param TokenNumber Pcd token number autogenerated by build tools.\r | |
800 | @param Data Value want to be set for PCD entry\r | |
801 | @param Size Size of value.\r | |
80408db0 | 802 | \r |
fc547e08 | 803 | @return status of SetWorker.\r |
804 | \r | |
805 | **/\r | |
80408db0 | 806 | EFI_STATUS\r |
807 | SetValueWorker (\r | |
808 | IN UINTN TokenNumber,\r | |
809 | IN VOID *Data,\r | |
810 | IN UINTN Size\r | |
811 | )\r | |
812 | ;\r | |
813 | \r | |
fc547e08 | 814 | /**\r |
815 | Set value for an PCD entry\r | |
80408db0 | 816 | \r |
fc547e08 | 817 | @param TokenNumber Pcd token number autogenerated by build tools.\r |
818 | @param Data Value want to be set for PCD entry\r | |
819 | @param Size Size of value.\r | |
820 | @param PtrType If TRUE, the type of PCD entry's value is Pointer.\r | |
821 | If False, the type of PCD entry's value is not Pointer.\r | |
822 | \r | |
823 | @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.\r | |
824 | @retval EFI_INVALID_PARAMETER If Size can not be set to size table.\r | |
825 | @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in\r | |
826 | range of UINT8, UINT16, UINT32, UINT64\r | |
827 | @retval EFI_NOT_FOUND Can not find the PCD type according to token number. \r | |
828 | **/\r | |
80408db0 | 829 | EFI_STATUS\r |
830 | SetWorker (\r | |
831 | IN UINTN TokenNumber,\r | |
832 | IN VOID *Data,\r | |
833 | IN OUT UINTN *Size,\r | |
834 | IN BOOLEAN PtrType\r | |
835 | )\r | |
836 | ;\r | |
837 | \r | |
fc547e08 | 838 | /**\r |
839 | Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.\r | |
80408db0 | 840 | \r |
fc547e08 | 841 | @param ExTokenNumber Token number for dynamic-ex PCD.\r |
842 | @param Guid Token space guid for dynamic-ex PCD.\r | |
843 | @param Data Value want to be set.\r | |
844 | @param SetSize The size of value.\r | |
845 | \r | |
846 | @return status of ExSetWorker().\r | |
847 | \r | |
848 | **/\r | |
80408db0 | 849 | EFI_STATUS\r |
850 | ExSetValueWorker (\r | |
851 | IN UINTN ExTokenNumber,\r | |
852 | IN CONST EFI_GUID *Guid,\r | |
853 | IN VOID *Data,\r | |
854 | IN UINTN Size\r | |
855 | )\r | |
856 | ;\r | |
857 | \r | |
fc547e08 | 858 | /**\r |
859 | Set value for a dynamic PCD entry.\r | |
860 | \r | |
861 | This routine find the local token number according to dynamic-ex PCD's token \r | |
862 | space guid and token number firstly, and invoke callback function if this PCD\r | |
863 | entry registered callback function. Finally, invoken general SetWorker to set\r | |
864 | PCD value.\r | |
865 | \r | |
866 | @param ExTokenNumber Dynamic-ex PCD token number.\r | |
867 | @param Guid Token space guid for dynamic-ex PCD.\r | |
868 | @param Data PCD value want to be set\r | |
869 | @param SetSize Size of value.\r | |
870 | @param PtrType If TRUE, this PCD entry is pointer type.\r | |
871 | If FALSE, this PCD entry is not pointer type.\r | |
872 | \r | |
873 | @return status of SetWorker().\r | |
80408db0 | 874 | \r |
fc547e08 | 875 | **/\r |
80408db0 | 876 | EFI_STATUS\r |
877 | ExSetWorker (\r | |
878 | IN UINTN ExTokenNumber,\r | |
879 | IN CONST EFI_GUID *Guid,\r | |
880 | IN VOID *Data,\r | |
881 | IN OUT UINTN *Size,\r | |
882 | IN BOOLEAN PtrType\r | |
883 | )\r | |
884 | ;\r | |
885 | \r | |
fc547e08 | 886 | /**\r |
887 | Get the PCD entry pointer in PCD database.\r | |
888 | \r | |
889 | This routine will visit PCD database to find the PCD entry according to given\r | |
890 | token number. The given token number is autogened by build tools and it will be \r | |
891 | translated to local token number. Local token number contains PCD's type and \r | |
892 | offset of PCD entry in PCD database.\r | |
893 | \r | |
894 | @param TokenNumber Token's number, it is autogened by build tools\r | |
895 | @param GetSize The size of token's value\r | |
80408db0 | 896 | \r |
fc547e08 | 897 | @return PCD entry pointer in PCD database\r |
80408db0 | 898 | \r |
fc547e08 | 899 | **/\r |
80408db0 | 900 | VOID *\r |
901 | GetWorker (\r | |
902 | IN UINTN TokenNumber,\r | |
903 | IN UINTN GetSize\r | |
904 | )\r | |
905 | ;\r | |
906 | \r | |
fc547e08 | 907 | /**\r |
908 | Wrapper function for get PCD value for dynamic-ex PCD.\r | |
909 | \r | |
910 | @param Guid Token space guid for dynamic-ex PCD.\r | |
911 | @param ExTokenNumber Token number for dyanmic-ex PCD.\r | |
912 | @param GetSize The size of dynamic-ex PCD value.\r | |
80408db0 | 913 | \r |
fc547e08 | 914 | @return PCD entry in PCD database.\r |
80408db0 | 915 | \r |
fc547e08 | 916 | **/\r |
80408db0 | 917 | VOID *\r |
918 | ExGetWorker (\r | |
919 | IN CONST EFI_GUID *Guid,\r | |
920 | IN UINTN ExTokenNumber,\r | |
921 | IN UINTN GetSize\r | |
922 | )\r | |
923 | ;\r | |
924 | \r | |
925 | typedef struct {\r | |
926 | UINTN TokenNumber;\r | |
927 | UINTN Size;\r | |
928 | UINT32 LocalTokenNumberAlias;\r | |
929 | } EX_PCD_ENTRY_ATTRIBUTE;\r | |
930 | \r | |
fc547e08 | 931 | /**\r |
932 | Get local token number according to dynamic-ex PCD's {token space guid:token number}\r | |
933 | \r | |
934 | A dynamic-ex type PCD, developer must provide pair of token space guid: token number\r | |
935 | in DEC file. PCD database maintain a mapping table that translate pair of {token\r | |
936 | space guid: token number} to local token number.\r | |
937 | \r | |
938 | @param Guid Token space guid for dynamic-ex PCD entry.\r | |
939 | @param ExTokenNumber EDES_TODO: Add parameter description\r | |
80408db0 | 940 | \r |
fc547e08 | 941 | @return local token number for dynamic-ex PCD.\r |
942 | \r | |
943 | **/\r | |
c52fa98c | 944 | UINTN\r |
80408db0 | 945 | GetExPcdTokenNumber (\r |
946 | IN CONST EFI_GUID *Guid,\r | |
947 | IN UINTN ExTokenNumber\r | |
948 | )\r | |
949 | ;\r | |
950 | \r | |
fc547e08 | 951 | /**\r |
952 | The function registers the CallBackOnSet fucntion\r | |
953 | according to TokenNumber and EFI_GUID space.\r | |
80408db0 | 954 | \r |
fc547e08 | 955 | @param TokenNumber The token number.\r |
956 | @param Guid The GUID space.\r | |
957 | @param CallBackFunction The Callback function to be registered.\r | |
958 | @param Register To register or unregister the callback function.\r | |
80408db0 | 959 | \r |
fc547e08 | 960 | @retval EFI_SUCCESS If the Callback function is registered.\r |
961 | @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.\r | |
962 | @retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free\r | |
963 | slot left in the CallbackFnTable.\r | |
964 | **/\r | |
80408db0 | 965 | EFI_STATUS\r |
966 | PeiRegisterCallBackWorker (\r | |
967 | IN UINTN TokenNumber,\r | |
fc547e08 | 968 | IN CONST EFI_GUID *Guid, OPTIONAL\r |
80408db0 | 969 | IN PCD_PPI_CALLBACK CallBackFunction,\r |
970 | IN BOOLEAN Register\r | |
971 | );\r | |
972 | \r | |
fc547e08 | 973 | /**\r |
974 | The function builds the PCD database.\r | |
975 | **/\r | |
80408db0 | 976 | VOID\r |
977 | BuildPcdDatabase (\r | |
978 | VOID\r | |
979 | )\r | |
980 | ;\r | |
981 | \r | |
fc547e08 | 982 | /**\r |
983 | Get SKU ID tabble from PCD database.\r | |
984 | \r | |
985 | @param LocalTokenNumberTableIdx Index of local token number in token number table.\r | |
986 | @param Database PCD Database in PEI phase\r | |
987 | \r | |
988 | @return Pointer to SKU ID array table\r | |
989 | \r | |
990 | **/\r | |
80408db0 | 991 | SKU_ID *\r |
992 | GetSkuIdArray (\r | |
993 | IN UINTN LocalTokenNumberTableIdx,\r | |
994 | IN PEI_PCD_DATABASE *Database\r | |
995 | )\r | |
996 | ;\r | |
997 | \r | |
fc547e08 | 998 | /**\r |
999 | Get index of PCD entry in size table.\r | |
1000 | \r | |
1001 | @param LocalTokenNumberTableIdx Index of this PCD in local token number table.\r | |
1002 | @param Database Pointer to PCD database.\r | |
1003 | \r | |
1004 | @return index of PCD entry in size table.\r | |
1005 | \r | |
1006 | **/\r | |
80408db0 | 1007 | UINTN\r |
1008 | GetSizeTableIndex (\r | |
1009 | IN UINTN LocalTokenNumberTableIdx,\r | |
1010 | IN PEI_PCD_DATABASE *Database\r | |
1011 | )\r | |
1012 | ;\r | |
1013 | \r | |
fc547e08 | 1014 | /**\r |
1015 | Get PCD value's size for POINTER type PCD.\r | |
1016 | \r | |
1017 | The POINTER type PCD's value will be stored into a buffer in specificed size.\r | |
1018 | The max size of this PCD's value is described in PCD's definition in DEC file.\r | |
1019 | \r | |
1020 | @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table\r | |
1021 | @param MaxSize Maxmium size of PCD's value\r | |
1022 | @param Database Pcd database in PEI phase.\r | |
1023 | \r | |
1024 | @return PCD value's size for POINTER type PCD.\r | |
1025 | \r | |
1026 | **/\r | |
80408db0 | 1027 | UINTN\r |
1028 | GetPtrTypeSize (\r | |
1029 | IN UINTN LocalTokenNumberTableIdx,\r | |
1030 | OUT UINTN *MaxSize,\r | |
1031 | IN PEI_PCD_DATABASE *Database\r | |
1032 | )\r | |
1033 | ;\r | |
1034 | \r | |
fc547e08 | 1035 | /**\r |
1036 | Set PCD value's size for POINTER type PCD.\r | |
1037 | \r | |
1038 | The POINTER type PCD's value will be stored into a buffer in specificed size.\r | |
1039 | The max size of this PCD's value is described in PCD's definition in DEC file.\r | |
80408db0 | 1040 | \r |
fc547e08 | 1041 | @param LocalTokenNumberTableIdx Index of PCD token number in PCD token table\r |
1042 | @param CurrentSize Maxmium size of PCD's value\r | |
1043 | @param Database Pcd database in PEI phase.\r | |
80408db0 | 1044 | \r |
fc547e08 | 1045 | @retval TRUE Success to set PCD's value size, which is not exceed maxmium size\r |
1046 | @retval FALSE Fail to set PCD's value size, which maybe exceed maxmium size\r | |
1047 | \r | |
1048 | **/\r | |
80408db0 | 1049 | BOOLEAN\r |
1050 | SetPtrTypeSize (\r | |
1051 | IN UINTN LocalTokenNumberTableIdx,\r | |
1052 | IN OUT UINTN *CurrentSize,\r | |
1053 | IN PEI_PCD_DATABASE *Database\r | |
1054 | )\r | |
1055 | ;\r | |
1056 | \r | |
1057 | \r | |
1058 | extern EFI_GUID gPcdDataBaseHobGuid;\r | |
1059 | \r | |
1060 | extern EFI_GUID gPcdPeiCallbackFnTableHobGuid;\r | |
1061 | \r | |
1062 | extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit;\r | |
1063 | \r | |
1064 | #endif\r |