Commit | Line | Data |
---|---|---|
80408db0 | 1 | /** @file\r |
2 | Private functions used by PCD DXE driver.\r | |
3 | \r | |
e5eed7d3 HT |
4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
c52fa98c | 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 | |
2ab6330e | 15 | #ifndef _PCD_DXE_SERVICE_H_\r |
16 | #define _PCD_DXE_SERVICE_H_\r | |
80408db0 | 17 | \r |
859b72fa | 18 | #include <PiDxe.h>\r |
98b15cf1 | 19 | #include <Guid/PcdDataBaseHobGuid.h>\r |
859b72fa | 20 | #include <Protocol/Pcd.h>\r |
c896d682 | 21 | #include <Protocol/PiPcd.h>\r |
859b72fa A |
22 | #include <Library/BaseLib.h>\r |
23 | #include <Library/DebugLib.h>\r | |
24 | #include <Library/UefiLib.h>\r | |
25 | #include <Library/UefiDriverEntryPoint.h>\r | |
26 | #include <Library/PcdLib.h>\r | |
27 | #include <Library/HobLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/UefiBootServicesTableLib.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
80408db0 | 32 | \r |
80408db0 | 33 | //\r |
34 | // Protocol Interface function declaration.\r | |
35 | //\r | |
2ab6330e | 36 | /**\r |
37 | Sets the SKU value for subsequent calls to set or get PCD token values.\r | |
38 | \r | |
39 | SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. \r | |
40 | SetSku() is normally called only once by the system.\r | |
41 | \r | |
42 | For each item (token), the database can hold a single value that applies to all SKUs, \r | |
43 | or multiple values, where each value is associated with a specific SKU Id. Items with multiple, \r | |
44 | SKU-specific values are called SKU enabled. \r | |
45 | \r | |
46 | The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. \r | |
47 | For tokens that are not SKU enabled, the system ignores any set SKU Id and works with the \r | |
48 | single value for that token. For SKU-enabled tokens, the system will use the SKU Id set by the \r | |
49 | last call to SetSku(). If no SKU Id is set or the currently set SKU Id isn't valid for the specified token, \r | |
50 | the system uses the default SKU Id. If the system attempts to use the default SKU Id and no value has been \r | |
51 | set for that Id, the results are unpredictable.\r | |
52 | \r | |
53 | @param[in] SkuId The SKU value that will be used when the PCD service will retrieve and \r | |
54 | set values associated with a PCD token.\r | |
55 | \r | |
2ab6330e | 56 | **/\r |
80408db0 | 57 | VOID\r |
58 | EFIAPI\r | |
59 | DxePcdSetSku (\r | |
60 | IN UINTN SkuId\r | |
ed66e1bc | 61 | );\r |
80408db0 | 62 | \r |
2ab6330e | 63 | /**\r |
64 | Retrieves an 8-bit value for a given PCD token.\r | |
65 | \r | |
66 | Retrieves the current byte-sized value for a PCD token number. \r | |
67 | If the TokenNumber is invalid, the results are unpredictable.\r | |
68 | \r | |
69 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 70 | \r |
2ab6330e | 71 | @return The UINT8 value.\r |
72 | \r | |
73 | **/\r | |
80408db0 | 74 | UINT8\r |
75 | EFIAPI\r | |
76 | DxePcdGet8 (\r | |
77 | IN UINTN TokenNumber\r | |
ed66e1bc | 78 | );\r |
80408db0 | 79 | \r |
2ab6330e | 80 | /**\r |
81 | Retrieves an 16-bit value for a given PCD token.\r | |
80408db0 | 82 | \r |
2ab6330e | 83 | Retrieves the current 16-bits value for a PCD token number. \r |
84 | If the TokenNumber is invalid, the results are unpredictable.\r | |
85 | \r | |
86 | @param[in] TokenNumber The PCD token number. \r | |
87 | \r | |
88 | @return The UINT16 value.\r | |
89 | \r | |
90 | **/\r | |
80408db0 | 91 | UINT16\r |
92 | EFIAPI\r | |
93 | DxePcdGet16 (\r | |
94 | IN UINTN TokenNumber\r | |
ed66e1bc | 95 | );\r |
80408db0 | 96 | \r |
2ab6330e | 97 | /**\r |
98 | Retrieves an 32-bit value for a given PCD token.\r | |
80408db0 | 99 | \r |
2ab6330e | 100 | Retrieves the current 32-bits value for a PCD token number. \r |
101 | If the TokenNumber is invalid, the results are unpredictable.\r | |
102 | \r | |
103 | @param[in] TokenNumber The PCD token number. \r | |
104 | \r | |
105 | @return The UINT32 value.\r | |
106 | \r | |
107 | **/\r | |
80408db0 | 108 | UINT32\r |
109 | EFIAPI\r | |
110 | DxePcdGet32 (\r | |
111 | IN UINTN TokenNumber\r | |
ed66e1bc | 112 | );\r |
80408db0 | 113 | \r |
2ab6330e | 114 | /**\r |
115 | Retrieves an 64-bit value for a given PCD token.\r | |
116 | \r | |
117 | Retrieves the current 64-bits value for a PCD token number. \r | |
118 | If the TokenNumber is invalid, the results are unpredictable.\r | |
119 | \r | |
120 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 121 | \r |
2ab6330e | 122 | @return The UINT64 value.\r |
123 | \r | |
124 | **/\r | |
80408db0 | 125 | UINT64\r |
126 | EFIAPI\r | |
127 | DxePcdGet64 (\r | |
128 | IN UINTN TokenNumber\r | |
ed66e1bc | 129 | );\r |
80408db0 | 130 | \r |
2ab6330e | 131 | /**\r |
132 | Retrieves a pointer to a value for a given PCD token.\r | |
133 | \r | |
134 | Retrieves the current pointer to the buffer for a PCD token number. \r | |
135 | Do not make any assumptions about the alignment of the pointer that \r | |
136 | is returned by this function call. If the TokenNumber is invalid, \r | |
137 | the results are unpredictable.\r | |
80408db0 | 138 | \r |
2ab6330e | 139 | @param[in] TokenNumber The PCD token number. \r |
140 | \r | |
3fd8027e | 141 | @return The pointer to the buffer to be retrieved.\r |
2ab6330e | 142 | \r |
143 | **/\r | |
80408db0 | 144 | VOID *\r |
145 | EFIAPI\r | |
146 | DxePcdGetPtr (\r | |
147 | IN UINTN TokenNumber\r | |
ed66e1bc | 148 | );\r |
80408db0 | 149 | \r |
2ab6330e | 150 | /**\r |
151 | Retrieves a Boolean value for a given PCD token.\r | |
152 | \r | |
153 | Retrieves the current boolean value for a PCD token number. \r | |
154 | Do not make any assumptions about the alignment of the pointer that \r | |
155 | is returned by this function call. If the TokenNumber is invalid, \r | |
156 | the results are unpredictable.\r | |
157 | \r | |
158 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 159 | \r |
2ab6330e | 160 | @return The Boolean value.\r |
161 | \r | |
162 | **/\r | |
80408db0 | 163 | BOOLEAN\r |
164 | EFIAPI\r | |
165 | DxePcdGetBool (\r | |
166 | IN UINTN TokenNumber\r | |
ed66e1bc | 167 | );\r |
80408db0 | 168 | \r |
2ab6330e | 169 | /**\r |
170 | Retrieves the size of the value for a given PCD token.\r | |
171 | \r | |
172 | Retrieves the current size of a particular PCD token. \r | |
173 | If the TokenNumber is invalid, the results are unpredictable.\r | |
174 | \r | |
175 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 176 | \r |
2ab6330e | 177 | @return The size of the value for the PCD token.\r |
178 | \r | |
179 | **/\r | |
80408db0 | 180 | UINTN\r |
181 | EFIAPI\r | |
182 | DxePcdGetSize (\r | |
183 | IN UINTN TokenNumber\r | |
ed66e1bc | 184 | );\r |
80408db0 | 185 | \r |
2ab6330e | 186 | /**\r |
187 | Retrieves an 8-bit value for a given PCD token.\r | |
188 | \r | |
189 | Retrieves the 8-bit value of a particular PCD token. \r | |
190 | If the TokenNumber is invalid or the token space\r | |
191 | specified by Guid does not exist, the results are \r | |
192 | unpredictable.\r | |
80408db0 | 193 | \r |
2ab6330e | 194 | @param[in] Guid The token space for the token number.\r |
195 | @param[in] TokenNumber The PCD token number. \r | |
196 | \r | |
197 | @return The size 8-bit value for the PCD token.\r | |
198 | \r | |
199 | **/\r | |
80408db0 | 200 | UINT8\r |
201 | EFIAPI\r | |
202 | DxePcdGet8Ex (\r | |
203 | IN CONST EFI_GUID *Guid,\r | |
204 | IN UINTN TokenNumber\r | |
ed66e1bc | 205 | );\r |
80408db0 | 206 | \r |
2ab6330e | 207 | /**\r |
208 | Retrieves an 16-bit value for a given PCD token.\r | |
209 | \r | |
210 | Retrieves the 16-bit value of a particular PCD token. \r | |
211 | If the TokenNumber is invalid or the token space\r | |
212 | specified by Guid does not exist, the results are \r | |
213 | unpredictable.\r | |
214 | \r | |
215 | @param[in] Guid The token space for the token number.\r | |
216 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 217 | \r |
2ab6330e | 218 | @return The size 16-bit value for the PCD token.\r |
219 | \r | |
220 | **/\r | |
80408db0 | 221 | UINT16\r |
222 | EFIAPI\r | |
223 | DxePcdGet16Ex (\r | |
224 | IN CONST EFI_GUID *Guid,\r | |
225 | IN UINTN TokenNumber\r | |
ed66e1bc | 226 | );\r |
80408db0 | 227 | \r |
2ab6330e | 228 | /**\r |
229 | Retrieves an 32-bit value for a given PCD token.\r | |
230 | \r | |
231 | Retrieves the 32-bit value of a particular PCD token. \r | |
232 | If the TokenNumber is invalid or the token space\r | |
233 | specified by Guid does not exist, the results are \r | |
234 | unpredictable.\r | |
235 | \r | |
236 | @param[in] Guid The token space for the token number.\r | |
237 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 238 | \r |
2ab6330e | 239 | @return The size 32-bit value for the PCD token.\r |
240 | \r | |
241 | **/\r | |
80408db0 | 242 | UINT32\r |
243 | EFIAPI\r | |
244 | DxePcdGet32Ex (\r | |
245 | IN CONST EFI_GUID *Guid,\r | |
246 | IN UINTN TokenNumber\r | |
ed66e1bc | 247 | );\r |
80408db0 | 248 | \r |
2ab6330e | 249 | /**\r |
250 | Retrieves an 64-bit value for a given PCD token.\r | |
251 | \r | |
252 | Retrieves the 64-bit value of a particular PCD token. \r | |
253 | If the TokenNumber is invalid or the token space\r | |
254 | specified by Guid does not exist, the results are \r | |
255 | unpredictable.\r | |
80408db0 | 256 | \r |
2ab6330e | 257 | @param[in] Guid The token space for the token number.\r |
258 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 259 | \r |
2ab6330e | 260 | @return The size 64-bit value for the PCD token.\r |
261 | \r | |
262 | **/\r | |
80408db0 | 263 | UINT64\r |
264 | EFIAPI\r | |
265 | DxePcdGet64Ex (\r | |
266 | IN CONST EFI_GUID *Guid,\r | |
267 | IN UINTN TokenNumber\r | |
ed66e1bc | 268 | );\r |
80408db0 | 269 | \r |
2ab6330e | 270 | /**\r |
271 | Retrieves a pointer to a value for a given PCD token.\r | |
272 | \r | |
273 | Retrieves the current pointer to the buffer for a PCD token number. \r | |
274 | Do not make any assumptions about the alignment of the pointer that \r | |
275 | is returned by this function call. If the TokenNumber is invalid, \r | |
276 | the results are unpredictable.\r | |
80408db0 | 277 | \r |
2ab6330e | 278 | @param[in] Guid The token space for the token number.\r |
279 | @param[in] TokenNumber The PCD token number. \r | |
80408db0 | 280 | \r |
3fd8027e | 281 | @return The pointer to the buffer to be retrieved.\r |
2ab6330e | 282 | \r |
283 | **/\r | |
80408db0 | 284 | VOID *\r |
285 | EFIAPI\r | |
286 | DxePcdGetPtrEx (\r | |
287 | IN CONST EFI_GUID *Guid,\r | |
288 | IN UINTN TokenNumber\r | |
ed66e1bc | 289 | );\r |
80408db0 | 290 | \r |
2ab6330e | 291 | /**\r |
292 | Retrieves an Boolean value for a given PCD token.\r | |
293 | \r | |
294 | Retrieves the Boolean value of a particular PCD token. \r | |
295 | If the TokenNumber is invalid or the token space\r | |
296 | specified by Guid does not exist, the results are \r | |
297 | unpredictable.\r | |
80408db0 | 298 | \r |
2ab6330e | 299 | @param[in] Guid The token space for the token number.\r |
300 | @param[in] TokenNumber The PCD token number. \r | |
301 | \r | |
302 | @return The size Boolean value for the PCD token.\r | |
303 | \r | |
304 | **/\r | |
80408db0 | 305 | BOOLEAN\r |
306 | EFIAPI\r | |
307 | DxePcdGetBoolEx (\r | |
308 | IN CONST EFI_GUID *Guid,\r | |
309 | IN UINTN TokenNumber\r | |
ed66e1bc | 310 | );\r |
80408db0 | 311 | \r |
2ab6330e | 312 | /**\r |
313 | Retrieves the size of the value for a given PCD token.\r | |
314 | \r | |
315 | Retrieves the current size of a particular PCD token. \r | |
316 | If the TokenNumber is invalid, the results are unpredictable.\r | |
80408db0 | 317 | \r |
2ab6330e | 318 | @param[in] Guid The token space for the token number.\r |
319 | @param[in] TokenNumber The PCD token number. \r | |
320 | \r | |
321 | @return The size of the value for the PCD token.\r | |
322 | \r | |
323 | **/\r | |
80408db0 | 324 | UINTN\r |
325 | EFIAPI\r | |
326 | DxePcdGetSizeEx (\r | |
327 | IN CONST EFI_GUID *Guid,\r | |
328 | IN UINTN TokenNumber\r | |
ed66e1bc | 329 | );\r |
80408db0 | 330 | \r |
2ab6330e | 331 | /**\r |
332 | Sets an 8-bit value for a given PCD token.\r | |
80408db0 | 333 | \r |
2ab6330e | 334 | When the PCD service sets a value, it will check to ensure that the \r |
335 | size of the value being set is compatible with the Token's existing definition. \r | |
336 | If it is not, an error will be returned.\r | |
337 | \r | |
338 | @param[in] TokenNumber The PCD token number. \r | |
339 | @param[in] Value The value to set for the PCD token.\r | |
340 | \r | |
341 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
342 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
343 | being set was incompatible with a call to this function. \r | |
344 | Use GetSize() to retrieve the size of the target data.\r | |
345 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
346 | \r | |
347 | **/\r | |
80408db0 | 348 | EFI_STATUS\r |
349 | EFIAPI\r | |
350 | DxePcdSet8 (\r | |
351 | IN UINTN TokenNumber,\r | |
352 | IN UINT8 Value\r | |
ed66e1bc | 353 | );\r |
80408db0 | 354 | \r |
2ab6330e | 355 | /**\r |
356 | Sets an 16-bit value for a given PCD token.\r | |
357 | \r | |
358 | When the PCD service sets a value, it will check to ensure that the \r | |
359 | size of the value being set is compatible with the Token's existing definition. \r | |
360 | If it is not, an error will be returned.\r | |
361 | \r | |
362 | @param[in] TokenNumber The PCD token number. \r | |
363 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 364 | \r |
2ab6330e | 365 | @retval EFI_SUCCESS Procedure returned successfully.\r |
366 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
367 | being set was incompatible with a call to this function. \r | |
368 | Use GetSize() to retrieve the size of the target data.\r | |
369 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
370 | \r | |
371 | **/\r | |
80408db0 | 372 | EFI_STATUS\r |
373 | EFIAPI\r | |
374 | DxePcdSet16 (\r | |
375 | IN UINTN TokenNumber,\r | |
376 | IN UINT16 Value\r | |
ed66e1bc | 377 | );\r |
80408db0 | 378 | \r |
2ab6330e | 379 | /**\r |
380 | Sets an 32-bit value for a given PCD token.\r | |
381 | \r | |
382 | When the PCD service sets a value, it will check to ensure that the \r | |
383 | size of the value being set is compatible with the Token's existing definition. \r | |
384 | If it is not, an error will be returned.\r | |
385 | \r | |
386 | @param[in] TokenNumber The PCD token number. \r | |
387 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 388 | \r |
2ab6330e | 389 | @retval EFI_SUCCESS Procedure returned successfully.\r |
390 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
391 | being set was incompatible with a call to this function. \r | |
392 | Use GetSize() to retrieve the size of the target data.\r | |
393 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
394 | \r | |
395 | **/\r | |
80408db0 | 396 | EFI_STATUS\r |
397 | EFIAPI\r | |
398 | DxePcdSet32 (\r | |
399 | IN UINTN TokenNumber,\r | |
400 | IN UINT32 Value\r | |
ed66e1bc | 401 | );\r |
80408db0 | 402 | \r |
2ab6330e | 403 | /**\r |
404 | Sets an 64-bit value for a given PCD token.\r | |
405 | \r | |
406 | When the PCD service sets a value, it will check to ensure that the \r | |
407 | size of the value being set is compatible with the Token's existing definition. \r | |
408 | If it is not, an error will be returned.\r | |
80408db0 | 409 | \r |
2ab6330e | 410 | @param[in] TokenNumber The PCD token number. \r |
411 | @param[in] Value The value to set for the PCD token.\r | |
412 | \r | |
413 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
414 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
415 | being set was incompatible with a call to this function. \r | |
416 | Use GetSize() to retrieve the size of the target data.\r | |
417 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
418 | \r | |
419 | **/\r | |
80408db0 | 420 | EFI_STATUS\r |
421 | EFIAPI\r | |
422 | DxePcdSet64 (\r | |
423 | IN UINTN TokenNumber,\r | |
424 | IN UINT64 Value\r | |
ed66e1bc | 425 | );\r |
80408db0 | 426 | \r |
427 | \r | |
2ab6330e | 428 | /**\r |
429 | Sets a value of a specified size 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 | |
436 | @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. \r | |
437 | On input, if the SizeOfValue is greater than the maximum size supported \r | |
438 | for this TokenNumber then the output value of SizeOfValue will reflect \r | |
439 | the maximum size supported for this TokenNumber.\r | |
440 | @param[in] Buffer The buffer to set for the PCD token.\r | |
441 | \r | |
442 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
443 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
444 | being set was incompatible with a call to this function. \r | |
445 | Use GetSize() to retrieve the size of the target data.\r | |
446 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
447 | \r | |
448 | **/\r | |
80408db0 | 449 | EFI_STATUS\r |
450 | EFIAPI\r | |
451 | DxePcdSetPtr (\r | |
452 | IN UINTN TokenNumber,\r | |
2ab6330e | 453 | IN OUT UINTN *SizeOfBuffer,\r |
80408db0 | 454 | IN VOID *Buffer\r |
ed66e1bc | 455 | );\r |
80408db0 | 456 | \r |
2ab6330e | 457 | /**\r |
458 | Sets an Boolean value for a given PCD token.\r | |
459 | \r | |
460 | When the PCD service sets a value, it will check to ensure that the \r | |
461 | size of the value being set is compatible with the Token's existing definition. \r | |
462 | If it is not, an error will be returned.\r | |
463 | \r | |
464 | @param[in] TokenNumber The PCD token number. \r | |
465 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 466 | \r |
2ab6330e | 467 | @retval EFI_SUCCESS Procedure returned successfully.\r |
468 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
469 | being set was incompatible with a call to this function. \r | |
470 | Use GetSize() to retrieve the size of the target data.\r | |
471 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
472 | \r | |
473 | **/\r | |
80408db0 | 474 | EFI_STATUS\r |
475 | EFIAPI\r | |
476 | DxePcdSetBool (\r | |
477 | IN UINTN TokenNumber,\r | |
478 | IN BOOLEAN Value\r | |
ed66e1bc | 479 | );\r |
80408db0 | 480 | \r |
481 | \r | |
2ab6330e | 482 | /**\r |
483 | Sets an 8-bit value for a given PCD token.\r | |
484 | \r | |
485 | When the PCD service sets a value, it will check to ensure that the \r | |
486 | size of the value being set is compatible with the Token's existing definition. \r | |
487 | If it is not, an error will be returned.\r | |
488 | \r | |
489 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
490 | @param[in] TokenNumber The PCD token number. \r | |
491 | @param[in] Value The value to set for the PCD token.\r | |
492 | \r | |
493 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
494 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
495 | being set was incompatible with a call to this function. \r | |
496 | Use GetSize() to retrieve the size of the target data.\r | |
497 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
498 | \r | |
499 | **/\r | |
80408db0 | 500 | EFI_STATUS\r |
501 | EFIAPI\r | |
502 | DxePcdSet8Ex (\r | |
503 | IN CONST EFI_GUID *Guid,\r | |
504 | IN UINTN TokenNumber,\r | |
505 | IN UINT8 Value\r | |
ed66e1bc | 506 | );\r |
80408db0 | 507 | \r |
2ab6330e | 508 | /**\r |
509 | Sets an 16-bit value for a given PCD token.\r | |
510 | \r | |
511 | When the PCD service sets a value, it will check to ensure that the \r | |
512 | size of the value being set is compatible with the Token's existing definition. \r | |
513 | If it is not, an error will be returned.\r | |
514 | \r | |
515 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
516 | @param[in] TokenNumber The PCD token number. \r | |
517 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 518 | \r |
2ab6330e | 519 | @retval EFI_SUCCESS Procedure returned successfully.\r |
520 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
521 | being set was incompatible with a call to this function. \r | |
522 | Use GetSize() to retrieve the size of the target data.\r | |
523 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
524 | \r | |
525 | **/\r | |
80408db0 | 526 | EFI_STATUS\r |
527 | EFIAPI\r | |
528 | DxePcdSet16Ex (\r | |
529 | IN CONST EFI_GUID *Guid,\r | |
530 | IN UINTN TokenNumber,\r | |
531 | IN UINT16 Value\r | |
ed66e1bc | 532 | );\r |
80408db0 | 533 | \r |
2ab6330e | 534 | /**\r |
535 | Sets an 32-bit value for a given PCD token.\r | |
536 | \r | |
537 | When the PCD service sets a value, it will check to ensure that the \r | |
538 | size of the value being set is compatible with the Token's existing definition. \r | |
539 | If it is not, an error will be returned.\r | |
80408db0 | 540 | \r |
2ab6330e | 541 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r |
542 | @param[in] TokenNumber The PCD token number. \r | |
543 | @param[in] Value The value to set for the PCD token.\r | |
544 | \r | |
545 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
546 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
547 | being set was incompatible with a call to this function. \r | |
548 | Use GetSize() to retrieve the size of the target data.\r | |
549 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
550 | \r | |
551 | **/\r | |
80408db0 | 552 | EFI_STATUS\r |
553 | EFIAPI\r | |
554 | DxePcdSet32Ex (\r | |
555 | IN CONST EFI_GUID *Guid,\r | |
556 | IN UINTN TokenNumber,\r | |
557 | IN UINT32 Value\r | |
ed66e1bc | 558 | );\r |
80408db0 | 559 | \r |
2ab6330e | 560 | /**\r |
561 | Sets an 64-bit value for a given PCD token.\r | |
562 | \r | |
563 | When the PCD service sets a value, it will check to ensure that the \r | |
564 | size of the value being set is compatible with the Token's existing definition. \r | |
565 | If it is not, an error will be returned.\r | |
566 | \r | |
567 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
568 | @param[in] TokenNumber The PCD token number. \r | |
569 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 570 | \r |
2ab6330e | 571 | @retval EFI_SUCCESS Procedure returned successfully.\r |
572 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
573 | being set was incompatible with a call to this function. \r | |
574 | Use GetSize() to retrieve the size of the target data.\r | |
575 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
576 | \r | |
577 | **/\r | |
80408db0 | 578 | EFI_STATUS\r |
579 | EFIAPI\r | |
580 | DxePcdSet64Ex (\r | |
581 | IN CONST EFI_GUID *Guid,\r | |
582 | IN UINTN TokenNumber,\r | |
583 | IN UINT64 Value\r | |
ed66e1bc | 584 | );\r |
80408db0 | 585 | \r |
2ab6330e | 586 | /**\r |
587 | Sets a value of a specified size for a given PCD token.\r | |
588 | \r | |
589 | When the PCD service sets a value, it will check to ensure that the \r | |
590 | size of the value being set is compatible with the Token's existing definition. \r | |
591 | If it is not, an error will be returned.\r | |
592 | \r | |
593 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
594 | @param[in] TokenNumber The PCD token number. \r | |
595 | @param[in, out] SizeOfBuffer A pointer to the length of the value being set for the PCD token. \r | |
596 | On input, if the SizeOfValue is greater than the maximum size supported \r | |
597 | for this TokenNumber then the output value of SizeOfValue will reflect \r | |
598 | the maximum size supported for this TokenNumber.\r | |
599 | @param[in] Buffer The buffer to set for the PCD token.\r | |
600 | \r | |
601 | @retval EFI_SUCCESS Procedure returned successfully.\r | |
602 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
603 | being set was incompatible with a call to this function. \r | |
604 | Use GetSize() to retrieve the size of the target data.\r | |
605 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
606 | \r | |
607 | **/\r | |
80408db0 | 608 | EFI_STATUS\r |
609 | EFIAPI\r | |
610 | DxePcdSetPtrEx (\r | |
611 | IN CONST EFI_GUID *Guid,\r | |
612 | IN UINTN TokenNumber,\r | |
613 | IN OUT UINTN *SizeOfBuffer,\r | |
614 | IN VOID *Buffer\r | |
ed66e1bc | 615 | );\r |
80408db0 | 616 | \r |
2ab6330e | 617 | /**\r |
618 | Sets an Boolean value for a given PCD token.\r | |
619 | \r | |
620 | When the PCD service sets a value, it will check to ensure that the \r | |
621 | size of the value being set is compatible with the Token's existing definition. \r | |
622 | If it is not, an error will be returned.\r | |
623 | \r | |
624 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
625 | @param[in] TokenNumber The PCD token number. \r | |
626 | @param[in] Value The value to set for the PCD token.\r | |
80408db0 | 627 | \r |
2ab6330e | 628 | @retval EFI_SUCCESS Procedure returned successfully.\r |
629 | @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data \r | |
630 | being set was incompatible with a call to this function. \r | |
631 | Use GetSize() to retrieve the size of the target data.\r | |
632 | @retval EFI_NOT_FOUND The PCD service could not find the requested token number.\r | |
633 | \r | |
634 | **/\r | |
80408db0 | 635 | EFI_STATUS\r |
636 | EFIAPI\r | |
637 | DxePcdSetBoolEx (\r | |
638 | IN CONST EFI_GUID *Guid,\r | |
639 | IN UINTN TokenNumber,\r | |
640 | IN BOOLEAN Value\r | |
ed66e1bc | 641 | );\r |
80408db0 | 642 | \r |
2ab6330e | 643 | /**\r |
644 | Specifies a function to be called anytime the value of a designated token is changed.\r | |
645 | \r | |
646 | @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.\r | |
647 | @param[in] TokenNumber The PCD token number. \r | |
648 | @param[in] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. \r | |
80408db0 | 649 | \r |
2ab6330e | 650 | @retval EFI_SUCCESS The PCD service has successfully established a call event \r |
651 | for the CallBackToken requested.\r | |
652 | @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r | |
80408db0 | 653 | \r |
2ab6330e | 654 | **/\r |
80408db0 | 655 | EFI_STATUS\r |
656 | EFIAPI\r | |
657 | DxeRegisterCallBackOnSet (\r | |
658 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
659 | IN UINTN TokenNumber,\r | |
660 | IN PCD_PROTOCOL_CALLBACK CallBackFunction\r | |
ed66e1bc | 661 | );\r |
80408db0 | 662 | \r |
2ab6330e | 663 | /**\r |
664 | Cancels a previously set callback function for a particular PCD token number.\r | |
665 | \r | |
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] CallBackFunction The function prototype called when the value associated with the CallBackToken is set. \r | |
669 | \r | |
670 | @retval EFI_SUCCESS The PCD service has successfully established a call event \r | |
671 | for the CallBackToken requested.\r | |
672 | @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.\r | |
80408db0 | 673 | \r |
2ab6330e | 674 | **/\r |
80408db0 | 675 | EFI_STATUS\r |
676 | EFIAPI\r | |
677 | DxeUnRegisterCallBackOnSet (\r | |
678 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
679 | IN UINTN TokenNumber,\r | |
680 | IN PCD_PROTOCOL_CALLBACK CallBackFunction\r | |
ed66e1bc | 681 | );\r |
80408db0 | 682 | \r |
2ab6330e | 683 | /**\r |
90e06556 | 684 | Retrieves the next valid token number in a given namespace. \r |
685 | \r | |
686 | This is useful since the PCD infrastructure contains a sparse list of token numbers, \r | |
687 | and one cannot a priori know what token numbers are valid in the database. \r | |
688 | \r | |
689 | If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. \r | |
690 | If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. \r | |
691 | If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. \r | |
692 | If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. \r | |
693 | The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. \r | |
694 | If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. \r | |
695 | If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. \r | |
696 | If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.\r | |
697 | \r | |
698 | \r | |
699 | @param[in] Guid The 128-bit unique value that designates the namespace from which to retrieve the next token. \r | |
700 | This is an optional parameter that may be NULL. If this parameter is NULL, then a request is \r | |
701 | being made to retrieve tokens from the default token space.\r | |
4140a663 | 702 | @param[in, out] TokenNumber \r |
90e06556 | 703 | A pointer to the PCD token number to use to find the subsequent token number. \r |
704 | \r | |
705 | @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number \r | |
2ab6330e | 706 | is already the last valid token number in the PCD database. \r |
707 | In the later case, *TokenNumber is updated with the value of 0.\r | |
708 | @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.\r | |
80408db0 | 709 | \r |
2ab6330e | 710 | **/\r |
80408db0 | 711 | EFI_STATUS\r |
712 | EFIAPI\r | |
713 | DxePcdGetNextToken (\r | |
714 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
715 | IN OUT UINTN *TokenNumber\r | |
ed66e1bc | 716 | );\r |
80408db0 | 717 | \r |
2ab6330e | 718 | /**\r |
719 | Get next token space in PCD database according to given token space guid.\r | |
720 | \r | |
2ab6330e | 721 | @param Guid Given token space guid. If NULL, then Guid will be set to \r |
722 | the first PCD token space in PCD database, If not NULL, then\r | |
723 | Guid will be set to next PCD token space.\r | |
724 | \r | |
2ab6330e | 725 | @retval EFI_NOT_FOUND If PCD database has no token space table or can not find given\r |
726 | token space in PCD database.\r | |
727 | @retval EFI_SUCCESS Success to get next token space guid.\r | |
728 | **/\r | |
80408db0 | 729 | EFI_STATUS\r |
730 | EFIAPI\r | |
731 | DxePcdGetNextTokenSpace (\r | |
732 | IN OUT CONST EFI_GUID **Guid\r | |
ed66e1bc | 733 | );\r |
80408db0 | 734 | \r |
80408db0 | 735 | typedef struct {\r |
736 | LIST_ENTRY Node;\r | |
737 | PCD_PROTOCOL_CALLBACK CallbackFn;\r | |
738 | } CALLBACK_FN_ENTRY;\r | |
739 | \r | |
50d7ebad | 740 | #define CR_FNENTRY_FROM_LISTNODE(Record, Type, Field) BASE_CR(Record, Type, Field)\r |
80408db0 | 741 | \r |
742 | //\r | |
743 | // Internal Functions\r | |
744 | //\r | |
745 | \r | |
2ab6330e | 746 | /**\r |
747 | Wrapper function for setting non-pointer type value for a PCD entry.\r | |
748 | \r | |
749 | @param TokenNumber Pcd token number autogenerated by build tools.\r | |
750 | @param Data Value want to be set for PCD entry\r | |
751 | @param Size Size of value.\r | |
752 | \r | |
753 | @return status of SetWorker.\r | |
754 | \r | |
755 | **/\r | |
80408db0 | 756 | EFI_STATUS\r |
757 | SetValueWorker (\r | |
758 | IN UINTN TokenNumber,\r | |
759 | IN VOID *Data,\r | |
760 | IN UINTN Size\r | |
ed66e1bc | 761 | );\r |
80408db0 | 762 | \r |
2ab6330e | 763 | /**\r |
764 | Set value for an PCD entry\r | |
765 | \r | |
766 | @param TokenNumber Pcd token number autogenerated by build tools.\r | |
767 | @param Data Value want to be set for PCD entry\r | |
768 | @param Size Size of value.\r | |
769 | @param PtrType If TRUE, the type of PCD entry's value is Pointer.\r | |
770 | If False, the type of PCD entry's value is not Pointer.\r | |
771 | \r | |
772 | @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set.\r | |
773 | @retval EFI_INVALID_PARAMETER If Size can not be set to size table.\r | |
149fb6d6 | 774 | @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database. \r |
2ab6330e | 775 | @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in\r |
776 | range of UINT8, UINT16, UINT32, UINT64\r | |
777 | @retval EFI_NOT_FOUND Can not find the PCD type according to token number. \r | |
778 | **/\r | |
80408db0 | 779 | EFI_STATUS\r |
780 | SetWorker (\r | |
781 | IN UINTN TokenNumber,\r | |
782 | IN VOID *Data,\r | |
783 | IN OUT UINTN *Size,\r | |
784 | IN BOOLEAN PtrType\r | |
ed66e1bc | 785 | );\r |
80408db0 | 786 | \r |
2ab6330e | 787 | /**\r |
788 | Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.\r | |
789 | \r | |
790 | @param ExTokenNumber Token number for dynamic-ex PCD.\r | |
791 | @param Guid Token space guid for dynamic-ex PCD.\r | |
792 | @param Data Value want to be set.\r | |
793 | @param SetSize The size of value.\r | |
80408db0 | 794 | \r |
2ab6330e | 795 | @return status of ExSetWorker().\r |
796 | \r | |
797 | **/\r | |
80408db0 | 798 | EFI_STATUS\r |
799 | ExSetValueWorker (\r | |
800 | IN UINTN ExTokenNumber,\r | |
801 | IN CONST EFI_GUID *Guid,\r | |
802 | IN VOID *Data,\r | |
803 | IN UINTN SetSize\r | |
ed66e1bc | 804 | );\r |
80408db0 | 805 | \r |
2ab6330e | 806 | /**\r |
807 | Set value for a dynamic PCD entry.\r | |
808 | \r | |
809 | This routine find the local token number according to dynamic-ex PCD's token \r | |
810 | space guid and token number firstly, and invoke callback function if this PCD\r | |
811 | entry registered callback function. Finally, invoken general SetWorker to set\r | |
812 | PCD value.\r | |
813 | \r | |
814 | @param ExTokenNumber Dynamic-ex PCD token number.\r | |
815 | @param Guid Token space guid for dynamic-ex PCD.\r | |
816 | @param Data PCD value want to be set\r | |
817 | @param SetSize Size of value.\r | |
818 | @param PtrType If TRUE, this PCD entry is pointer type.\r | |
819 | If FALSE, this PCD entry is not pointer type.\r | |
820 | \r | |
821 | @return status of SetWorker().\r | |
80408db0 | 822 | \r |
2ab6330e | 823 | **/\r |
80408db0 | 824 | EFI_STATUS\r |
825 | ExSetWorker (\r | |
826 | IN UINTN ExTokenNumber,\r | |
827 | IN CONST EFI_GUID *Guid,\r | |
828 | IN VOID *Data,\r | |
829 | IN OUT UINTN *Size,\r | |
830 | IN BOOLEAN PtrType\r | |
ed66e1bc | 831 | );\r |
80408db0 | 832 | \r |
2ab6330e | 833 | /**\r |
834 | Get the PCD entry pointer in PCD database.\r | |
835 | \r | |
836 | This routine will visit PCD database to find the PCD entry according to given\r | |
837 | token number. The given token number is autogened by build tools and it will be \r | |
838 | translated to local token number. Local token number contains PCD's type and \r | |
839 | offset of PCD entry in PCD database.\r | |
840 | \r | |
841 | @param TokenNumber Token's number, it is autogened by build tools\r | |
842 | @param GetSize The size of token's value\r | |
80408db0 | 843 | \r |
2ab6330e | 844 | @return PCD entry pointer in PCD database\r |
845 | \r | |
846 | **/\r | |
80408db0 | 847 | VOID *\r |
848 | GetWorker (\r | |
849 | IN UINTN TokenNumber,\r | |
850 | IN UINTN GetSize\r | |
ed66e1bc | 851 | );\r |
80408db0 | 852 | \r |
2ab6330e | 853 | /**\r |
854 | Wrapper function for get PCD value for dynamic-ex PCD.\r | |
855 | \r | |
856 | @param Guid Token space guid for dynamic-ex PCD.\r | |
3fd8027e | 857 | @param ExTokenNumber Token number for dynamic-ex PCD.\r |
2ab6330e | 858 | @param GetSize The size of dynamic-ex PCD value.\r |
859 | \r | |
860 | @return PCD entry in PCD database.\r | |
861 | \r | |
862 | **/\r | |
80408db0 | 863 | VOID *\r |
864 | ExGetWorker (\r | |
865 | IN CONST EFI_GUID *Guid,\r | |
866 | IN UINTN ExTokenNumber,\r | |
867 | IN UINTN GetSize\r | |
ed66e1bc | 868 | );\r |
80408db0 | 869 | \r |
2ab6330e | 870 | /**\r |
871 | Find the local token number according to system SKU ID.\r | |
872 | \r | |
873 | @param LocalTokenNumber PCD token number\r | |
874 | @param Size The size of PCD entry.\r | |
875 | @param IsPeiDb If TRUE, the PCD entry is initialized in PEI phase.\r | |
876 | If False, the PCD entry is initialized in DXE phase.\r | |
877 | \r | |
878 | @return Token number according to system SKU ID.\r | |
879 | \r | |
880 | **/\r | |
80408db0 | 881 | UINT32\r |
882 | GetSkuEnabledTokenNumber (\r | |
883 | UINT32 LocalTokenNumber,\r | |
884 | UINTN Size,\r | |
885 | BOOLEAN IsPeiDb\r | |
ed66e1bc | 886 | );\r |
80408db0 | 887 | \r |
2ab6330e | 888 | /**\r |
889 | Get Variable which contains HII type PCD entry.\r | |
890 | \r | |
891 | @param VariableGuid Variable's guid\r | |
892 | @param VariableName Variable's unicode name string\r | |
893 | @param VariableData Variable's data pointer, \r | |
894 | @param VariableSize Variable's size.\r | |
895 | \r | |
896 | @return the status of gRT->GetVariable\r | |
897 | **/\r | |
80408db0 | 898 | EFI_STATUS\r |
899 | GetHiiVariable (\r | |
900 | IN EFI_GUID *VariableGuid,\r | |
901 | IN UINT16 *VariableName,\r | |
902 | OUT UINT8 **VariableData,\r | |
903 | OUT UINTN *VariableSize\r | |
ed66e1bc | 904 | );\r |
80408db0 | 905 | \r |
2ab6330e | 906 | /**\r |
907 | Set value for HII-type PCD.\r | |
908 | \r | |
909 | A HII-type PCD's value is stored in a variable. Setting/Getting the value of \r | |
910 | HII-type PCD is to visit this variable.\r | |
911 | \r | |
912 | @param VariableGuid Guid of variable which stored value of a HII-type PCD.\r | |
913 | @param VariableName Unicode name of variable which stored value of a HII-type PCD.\r | |
914 | @param Data Value want to be set.\r | |
915 | @param DataSize Size of value\r | |
916 | @param Offset Value offset of HII-type PCD in variable.\r | |
917 | \r | |
918 | @return status of GetVariable()/SetVariable().\r | |
919 | \r | |
920 | **/\r | |
80408db0 | 921 | EFI_STATUS\r |
922 | SetHiiVariable (\r | |
923 | IN EFI_GUID *VariableGuid,\r | |
924 | IN UINT16 *VariableName,\r | |
925 | IN CONST VOID *Data,\r | |
926 | IN UINTN DataSize,\r | |
927 | IN UINTN Offset\r | |
ed66e1bc | 928 | );\r |
80408db0 | 929 | \r |
2ab6330e | 930 | /**\r |
931 | Register the callback function for a PCD entry.\r | |
932 | \r | |
933 | This routine will register a callback function to a PCD entry by given token number\r | |
934 | and token space guid.\r | |
935 | \r | |
936 | @param TokenNumber PCD token's number, it is autogened by build tools.\r | |
937 | @param Guid PCD token space's guid, \r | |
938 | if not NULL, this PCD is dynamicEx type PCD.\r | |
939 | @param CallBackFunction Callback function pointer\r | |
940 | \r | |
941 | @return EFI_SUCCESS Always success for registering callback function.\r | |
942 | \r | |
943 | **/\r | |
80408db0 | 944 | EFI_STATUS\r |
945 | DxeRegisterCallBackWorker (\r | |
946 | IN UINTN TokenNumber,\r | |
947 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
948 | IN PCD_PROTOCOL_CALLBACK CallBackFunction\r | |
ed66e1bc | 949 | );\r |
2ab6330e | 950 | \r |
951 | /**\r | |
952 | UnRegister the callback function for a PCD entry.\r | |
80408db0 | 953 | \r |
2ab6330e | 954 | This routine will unregister a callback function to a PCD entry by given token number\r |
955 | and token space guid.\r | |
956 | \r | |
957 | @param TokenNumber PCD token's number, it is autogened by build tools.\r | |
958 | @param Guid PCD token space's guid.\r | |
959 | if not NULL, this PCD is dynamicEx type PCD.\r | |
960 | @param CallBackFunction Callback function pointer\r | |
961 | \r | |
962 | @retval EFI_SUCCESS Callback function is success to be unregister.\r | |
963 | @retval EFI_INVALID_PARAMETER Can not find the PCD entry by given token number.\r | |
964 | **/\r | |
80408db0 | 965 | EFI_STATUS\r |
966 | DxeUnRegisterCallBackWorker (\r | |
967 | IN UINTN TokenNumber,\r | |
968 | IN CONST EFI_GUID *Guid, OPTIONAL\r | |
969 | IN PCD_PROTOCOL_CALLBACK CallBackFunction\r | |
ed66e1bc | 970 | );\r |
80408db0 | 971 | \r |
2ab6330e | 972 | /**\r |
973 | Initialize the PCD database in DXE phase.\r | |
974 | \r | |
975 | PCD database in DXE phase also contains PCD database in PEI phase which is copied\r | |
976 | from GUID Hob.\r | |
977 | \r | |
978 | **/\r | |
80408db0 | 979 | VOID\r |
980 | BuildPcdDxeDataBase (\r | |
981 | VOID\r | |
ed66e1bc | 982 | );\r |
80408db0 | 983 | \r |
2ab6330e | 984 | /**\r |
985 | Get local token number according to dynamic-ex PCD's {token space guid:token number}\r | |
80408db0 | 986 | \r |
2ab6330e | 987 | A dynamic-ex type PCD, developer must provide pair of token space guid: token number\r |
988 | in DEC file. PCD database maintain a mapping table that translate pair of {token\r | |
989 | space guid: token number} to local token number.\r | |
990 | \r | |
991 | @param Guid Token space guid for dynamic-ex PCD entry.\r | |
b9982883 | 992 | @param ExTokenNumber Dynamic-ex PCD token number.\r |
2ab6330e | 993 | \r |
994 | @return local token number for dynamic-ex PCD.\r | |
995 | \r | |
996 | **/\r | |
c52fa98c | 997 | UINTN\r |
80408db0 | 998 | GetExPcdTokenNumber (\r |
999 | IN CONST EFI_GUID *Guid,\r | |
1000 | IN UINT32 ExTokenNumber\r | |
ed66e1bc | 1001 | );\r |
80408db0 | 1002 | \r |
2ab6330e | 1003 | /**\r |
1004 | Get next token number in given token space.\r | |
1005 | \r | |
1006 | This routine is used for dynamicEx type PCD. It will firstly scan token space\r | |
1007 | table to get token space according to given token space guid. Then scan given \r | |
1008 | token number in found token space, if found, then return next token number in \r | |
1009 | this token space.\r | |
1010 | \r | |
1011 | @param Guid Token space guid. Next token number will be scaned in \r | |
1012 | this token space.\r | |
1013 | @param TokenNumber Token number. \r | |
1014 | If PCD_INVALID_TOKEN_NUMBER, return first token number in \r | |
1015 | token space table.\r | |
1016 | If not PCD_INVALID_TOKEN_NUMBER, return next token number\r | |
1017 | in token space table.\r | |
1018 | @param GuidTable Token space guid table. It will be used for scan token space\r | |
1019 | by given token space guid.\r | |
1020 | @param SizeOfGuidTable The size of guid table.\r | |
1021 | @param ExMapTable DynamicEx token number mapping table.\r | |
1022 | @param SizeOfExMapTable The size of dynamicEx token number mapping table.\r | |
1023 | \r | |
1024 | @retval EFI_NOT_FOUND Can not given token space or token number.\r | |
1025 | @retval EFI_SUCCESS Success to get next token number.\r | |
80408db0 | 1026 | \r |
2ab6330e | 1027 | **/\r |
c52fa98c | 1028 | EFI_STATUS\r |
80408db0 | 1029 | ExGetNextTokeNumber (\r |
1030 | IN CONST EFI_GUID *Guid,\r | |
1031 | IN OUT UINTN *TokenNumber,\r | |
1032 | IN EFI_GUID *GuidTable,\r | |
1033 | IN UINTN SizeOfGuidTable,\r | |
1034 | IN DYNAMICEX_MAPPING *ExMapTable,\r | |
1035 | IN UINTN SizeOfExMapTable\r | |
ed66e1bc | 1036 | );\r |
80408db0 | 1037 | \r |
2ab6330e | 1038 | /**\r |
1039 | Get size of POINTER type PCD value.\r | |
80408db0 | 1040 | \r |
2ab6330e | 1041 | @param LocalTokenNumberTableIdx Index of local token number in local token number table.\r |
3fd8027e | 1042 | @param MaxSize Maximum size of POINTER type PCD value.\r |
2ab6330e | 1043 | \r |
1044 | @return size of POINTER type PCD value.\r | |
1045 | \r | |
1046 | **/\r | |
80408db0 | 1047 | UINTN\r |
1048 | GetPtrTypeSize (\r | |
1049 | IN UINTN LocalTokenNumberTableIdx,\r | |
1050 | OUT UINTN *MaxSize\r | |
ed66e1bc | 1051 | );\r |
80408db0 | 1052 | \r |
2ab6330e | 1053 | /**\r |
3fd8027e | 1054 | Set size of POINTER type PCD value. The size should not exceed the maximum size\r |
2ab6330e | 1055 | of this PCD value.\r |
80408db0 | 1056 | \r |
2ab6330e | 1057 | @param LocalTokenNumberTableIdx Index of local token number in local token number table.\r |
1058 | @param CurrentSize Size of POINTER type PCD value.\r | |
80408db0 | 1059 | \r |
2ab6330e | 1060 | @retval TRUE Success to set size of PCD value.\r |
1061 | @retval FALSE Fail to set size of PCD value.\r | |
1062 | **/\r | |
80408db0 | 1063 | BOOLEAN\r |
1064 | SetPtrTypeSize (\r | |
1065 | IN UINTN LocalTokenNumberTableIdx,\r | |
1066 | IN OUT UINTN *CurrentSize\r | |
ed66e1bc | 1067 | );\r |
80408db0 | 1068 | \r |
80408db0 | 1069 | extern PCD_DATABASE * mPcdDatabase;\r |
1070 | \r | |
1071 | extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit;\r | |
1072 | \r | |
1073 | extern EFI_LOCK mPcdDatabaseLock;\r | |
1074 | \r | |
1075 | #endif\r | |
599a55a5 | 1076 | \r |