2 Platform Configuration Database (PCD) Protocol defined in PI 1.2 Vol3
4 A platform database that contains a variety of current platform settings or
5 directives that can be accessed by a driver or application.
6 PI PCD protocol only provide the accessing interfaces for Dynamic-Ex type PCD.
8 Callers to this protocol must be at a TPL_APPLICATION task priority level.
9 This is the base PCD service API that provides an abstraction for accessing configuration content in
10 the platform. It a seamless mechanism for extracting information regardless of where the
11 information is stored (such as in Read-only data, or an EFI Variable).
12 This protocol allows access to data through size-granular APIs and provides a mechanism for a
13 firmware component to monitor specific settings and be alerted when a setting is changed.
15 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
16 This program and the accompanying materials
17 are licensed and made available under the terms and conditions of the BSD License
18 which accompanies this distribution. The full text of the license may be found at
19 http://opensource.org/licenses/bsd-license.php
21 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
22 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24 @par Revision Reference:
28 #ifndef __PI_PCD_PPI_H__
29 #define __PI_PCD_PPI_H__
31 extern EFI_GUID gEfiPeiPcdPpiGuid
;
33 #define EFI_PEI_PCD_PPI_GUID \
34 { 0x1f34d25, 0x4de2, 0x23ad, { 0x3f, 0xf3, 0x36, 0x35, 0x3f, 0xf3, 0x23, 0xf1 } }
36 #define EFI_PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)
39 SetSku() sets the SKU Id to be used for subsequent calls to set or get PCD values. SetSku() is
40 normally called only once by the system.
41 For each item (token), the database can hold a single value that applies to all SKUs, or multiple
42 values, where each value is associated with a specific SKU Id. Items with multiple, SKU-specific
43 values are called SKU enabled.
44 The SKU Id of zero is reserved as a default. The valid SkuId range is 1 to 255. For tokens that are
45 not SKU enabled, the system ignores any set SKU Id and works with the single value for that token.
46 For SKU-enabled tokens, the system will use the SKU Id set by the last call to SetSku(). If no
47 SKU Id is set or the currently set SKU Id isn't valid for the specified token, the system uses the
48 default SKU Id. If the system attempts to use the default SKU Id and no value has been set for that
49 Id, the results are unpredictable.
51 @param[in] SkuId The SKU value to set.
55 (EFIAPI
*EFI_PEI_PCD_PPI_SET_SKU
)(
60 Retrieves the current byte-sized value for a PCD token number. If the TokenNumber is invalid,
61 the results are unpredictable.
63 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
64 @param[in] TokenNumber The PCD token number.
66 @return 8-bit value for a given PCD token.
70 (EFIAPI
*EFI_PEI_PCD_PPI_GET_8
)(
71 IN CONST EFI_GUID
*Guid
,
76 Retrieves the current byte-sized value for a PCD token number. If the TokenNumber is invalid,
77 the results are unpredictable.
79 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
80 @param[in] TokenNumber The PCD token number.
82 @return 16-bit value for a given PCD token.
86 (EFIAPI
*EFI_PEI_PCD_PPI_GET_16
)(
87 IN CONST EFI_GUID
*Guid
,
92 Retrieves the current 32-bit value for a PCD token number. If the TokenNumber is invalid, the
93 results are unpredictable.
95 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
96 @param[in] TokenNumber The PCD token number.
98 @return 32-bit value for a given PCD token.
102 (EFIAPI
*EFI_PEI_PCD_PPI_GET_32
)(
103 IN CONST EFI_GUID
*Guid
,
108 Retrieves the current 64-bit value for a PCD token number. If the TokenNumber is invalid, the
109 results are unpredictable.
111 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
112 @param[in] TokenNumber The PCD token number.
114 @return 64-bit value for a given PCD token.
118 (EFIAPI
*EFI_PEI_PCD_PPI_GET_64
)(
119 IN CONST EFI_GUID
*Guid
,
124 Retrieves the current pointer to the value for a PCD token number. There should not be any
125 alignment assumptions about the pointer that is returned by this function call. If the TokenNumber
126 is invalid, the results are unpredictable.
128 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
129 @param[in] TokenNumber The PCD token number.
133 (EFIAPI
*EFI_PEI_PCD_PPI_GET_POINTER
)(
134 IN CONST EFI_GUID
*Guid
,
139 Retrieves the current Boolean-sized value for a PCD token number. If the TokenNumber is
140 invalid, the results are unpredictable.
142 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
143 @param[in] TokenNumber The PCD token number.
145 @return Boolean value for a given PCD token.
149 (EFIAPI
*EFI_PEI_PCD_PPI_GET_BOOLEAN
)(
150 IN CONST EFI_GUID
*Guid
,
155 Retrieves the current size of a particular PCD token. If the TokenNumber is invalid, the results are
158 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
159 @param[in] TokenNumber The PCD token number.
161 @return the size of the value for a given PCD token.
165 (EFIAPI
*EFI_PEI_PCD_PPI_GET_SIZE
)(
166 IN CONST EFI_GUID
*Guid
,
171 Sets an 8-bit value for a given PCD token.
173 When the PCD service sets a value, it will check to ensure that the size of the value being set is
174 compatible with the Token's existing definition. If it is not, an error will be returned.
176 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
177 @param[in] TokenNumber The PCD token number.
178 @param[in] Value The value to set for the PCD token.
180 @retval EFI_SUCCESS The PCD service has set the value requested
181 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
182 incompatible with a call to this function. Use GetSizeEx() to
183 retrieve the size of the target data.
184 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
188 (EFIAPI
*EFI_PEI_PCD_PPI_SET_8
)(
189 IN CONST EFI_GUID
*Guid
,
190 IN UINTN TokenNumber
,
195 Sets an 16-bit value for a given PCD token.
197 When the PCD service sets a value, it will check to ensure that the size of the value being set is
198 compatible with the Token's existing definition. If it is not, an error will be returned.
200 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
201 @param[in] TokenNumber The PCD token number.
202 @param[in] Value The value to set for the PCD token.
204 @retval EFI_SUCCESS The PCD service has set the value requested
205 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
206 incompatible with a call to this function. Use GetSizeEx() to
207 retrieve the size of the target data.
208 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
212 (EFIAPI
*EFI_PEI_PCD_PPI_SET_16
)(
213 IN CONST EFI_GUID
*Guid
,
214 IN UINTN TokenNumber
,
219 Sets an 32-bit value for a given PCD token.
221 When the PCD service sets a value, it will check to ensure that the size of the value being set is
222 compatible with the Token's existing definition. If it is not, an error will be returned.
224 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
225 @param[in] TokenNumber The PCD token number.
226 @param[in] Value The value to set for the PCD token.
228 @retval EFI_SUCCESS The PCD service has set the value requested
229 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
230 incompatible with a call to this function. Use GetSizeEx() to
231 retrieve the size of the target data.
232 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
236 (EFIAPI
*EFI_PEI_PCD_PPI_SET_32
)(
237 IN CONST EFI_GUID
*Guid
,
238 IN UINTN TokenNumber
,
243 Sets an 64-bit value for a given PCD token.
245 When the PCD service sets a value, it will check to ensure that the size of the value being set is
246 compatible with the Token's existing definition. If it is not, an error will be returned.
248 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
249 @param[in] TokenNumber The PCD token number.
250 @param[in] Value The value to set for the PCD token.
252 @retval EFI_SUCCESS The PCD service has set the value requested
253 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
254 incompatible with a call to this function. Use GetSizeEx() to
255 retrieve the size of the target data.
256 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
260 (EFIAPI
*EFI_PEI_PCD_PPI_SET_64
)(
261 IN CONST EFI_GUID
*Guid
,
262 IN UINTN TokenNumber
,
267 Sets a value of the specified size for a given PCD token.
269 When the PCD service sets a value, it will check to ensure that the size of the value being set is
270 compatible with the Token's existing definition. If it is not, an error will be returned.
272 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
273 @param[in] TokenNumber The PCD token number.
274 @param[in] SizeOfValue The length of the value being set for the PCD token. If too large of a length is
275 specified, upon return from this function the value of SizeOfValue will reflect the
276 maximum size for the PCD token.
277 @param[in] Buffer A pointer to the buffer containing the value to set for the PCD token.
279 @retval EFI_SUCCESS The PCD service has set the value requested
280 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
281 incompatible with a call to this function. Use GetSizeEx() to
282 retrieve the size of the target data.
283 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
287 (EFIAPI
*EFI_PEI_PCD_PPI_SET_POINTER
)(
288 IN CONST EFI_GUID
*Guid
,
289 IN UINTN TokenNumber
,
290 IN OUT UINTN
*SizeOfValue
,
295 Sets a Boolean value for a given PCD token.
297 When the PCD service sets a value, it will check to ensure that the size of the value being set is
298 compatible with the Token's existing definition. If it is not, an error will be returned.
300 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
301 @param[in] TokenNumber The PCD token number.
302 @param[in] Value The value to set for the PCD token.
304 @retval EFI_SUCCESS The PCD service has set the value requested
305 @retval EFI_INVALID_PARAMETER The PCD service determined that the size of the data being set was
306 incompatible with a call to this function. Use GetSizeEx() to
307 retrieve the size of the target data.
308 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
312 (EFIAPI
*EFI_PEI_PCD_PPI_SET_BOOLEAN
)(
313 IN CONST EFI_GUID
*Guid
,
314 IN UINTN TokenNumber
,
320 (EFIAPI
*EFI_PEI_PCD_PPI_CALLBACK
)(
321 IN EFI_GUID
*Guid OPTIONAL
,
322 IN UINTN CallBackToken
,
323 IN OUT VOID
*TokenData
,
324 IN UINTN TokenDatSize
328 Specifies a function to be called anytime the value of a designated token is changed.
330 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
331 the standard platform namespace.
332 @param[in] CallBackToken The PCD token number to monitor.
333 @param[in] CallBackFunction The function prototype that will be called when the value associated with the
334 CallBackToken is set.
336 @retval EFI_SUCCESS The PCD service has successfully established a call event for the
337 CallBackToken requested.
338 @retval EFI_NOT_FOUND The PCD service could not find the referenced token number.
342 (EFIAPI
*EFI_PEI_PCD_PPI_CALLBACK_ON_SET
)(
343 IN CONST EFI_GUID
*Guid OPTIONAL
,
344 IN UINTN CallBackToken
,
345 IN EFI_PEI_PCD_PPI_CALLBACK CallBackFunction
349 Cancels a previously set callback function for a particular PCD token number.
351 @param[in] Guid The 128-bit unique value that designates which namespace to monitor. If NULL, use
352 the standard platform namespace.
353 @param[in] CallBackToken The PCD token number to cancel monitoring.
354 @param[in] CallBackFunction The function prototype that was originally passed to the CallBackOnSet function.
356 @retval EFI_SUCCESS The PCD service has cancelled the call event associated with the
358 @retval EFI_INVALID_PARAMETER The PCD service did not match the CallBackFunction to one
359 that is currently being monitored.
360 @retval EFI_NOT_FOUND The PCD service could not find data the requested token number.
364 (EFIAPI
*EFI_PEI_PCD_PPI_CANCEL_CALLBACK
)(
365 IN CONST EFI_GUID
*Guid OPTIONAL
,
366 IN UINTN CallBackToken
,
367 IN EFI_PEI_PCD_PPI_CALLBACK CallBackFunction
371 Retrieves the next valid PCD token for a given namespace.
373 This provides a means by which to get the next valid token number in a given namespace. This is
374 useful since the PCD infrastructure has a sparse list of token numbers in it, and one cannot a priori
375 know what token numbers are valid in the database.
377 @param[in] Guid The 128-bit unique value that designates which namespace to extract the value from.
378 @param[in] TokenNumber The PCD token number.
380 @retval EFI_SUCCESS The PCD service has retrieved the value requested.
381 @retval EFI_NOT_FOUND The PCD service could not find data from the requested token number.
385 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN
)(
386 IN CONST EFI_GUID
*Guid OPTIONAL
,
387 IN UINTN
*TokenNumber
391 Retrieves the next valid PCD token namespace for a given namespace.
393 Gets the next valid token namespace for a given namespace. This is useful to traverse the valid
394 token namespaces on a platform.
396 @param[in, out] Guid An indirect pointer to EFI_GUID. On input it designates a known token
397 namespace from which the search will start. On output, it designates the next valid
398 token namespace on the platform. If *Guid is NULL, then the GUID of the first token
399 space of the current platform is returned. If the search cannot locate the next valid
400 token namespace, an error is returned and the value of *Guid is undefined.
402 @retval EFI_SUCCESS The PCD service retrieved the value requested.
403 @retval EFI_NOT_FOUND The PCD service could not find the next valid token namespace.
407 (EFIAPI
*EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE
)(
408 IN OUT CONST EFI_GUID
**Guid
412 EFI_PEI_PCD_PPI_SET_SKU SetSku
;
413 EFI_PEI_PCD_PPI_GET_8 Get8
;
414 EFI_PEI_PCD_PPI_GET_16 Get16
;
415 EFI_PEI_PCD_PPI_GET_32 Get32
;
416 EFI_PEI_PCD_PPI_GET_64 Get64
;
417 EFI_PEI_PCD_PPI_GET_POINTER GetPtr
;
418 EFI_PEI_PCD_PPI_GET_BOOLEAN GetBool
;
419 EFI_PEI_PCD_PPI_GET_SIZE GetSize
;
420 EFI_PEI_PCD_PPI_SET_8 Set8
;
421 EFI_PEI_PCD_PPI_SET_16 Set16
;
422 EFI_PEI_PCD_PPI_SET_32 Set32
;
423 EFI_PEI_PCD_PPI_SET_64 Set64
;
424 EFI_PEI_PCD_PPI_SET_POINTER SetPtr
;
425 EFI_PEI_PCD_PPI_SET_BOOLEAN SetBool
;
426 EFI_PEI_PCD_PPI_CALLBACK_ON_SET CallbackOnSet
;
427 EFI_PEI_PCD_PPI_CANCEL_CALLBACK CancelCallback
;
428 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN GetNextToken
;
429 EFI_PEI_PCD_PPI_GET_NEXT_TOKEN_SPACE GetNextTokenSpace
;