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