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