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