summaryrefslogtreecommitdiff
path: root/MdePkg/Include/Protocol/PcdInfo.h
blob: 00edd1b50c72c22e3ff3dc53348fbf85c97a01a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/** @file
  Native Platform Configuration Database (PCD) INFO PROTOCOL.

  The protocol that provides additional information about items that reside in the PCD database.

  Different with the EFI_GET_PCD_INFO_PROTOCOL defined in PI 1.2.1 specification,
  the native PCD INFO PROTOCOL provide interfaces for dynamic and dynamic-ex type PCD. 
  The interfaces for dynamic type PCD do not require the token space guid as parameter,
  but interfaces for dynamic-ex type PCD require token space guid as parameter.

  Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef __PCD_INFO_H__
#define __PCD_INFO_H__

extern EFI_GUID gGetPcdInfoProtocolGuid;

#define GET_PCD_INFO_PROTOCOL_GUID \
  { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }

///
/// The forward declaration for GET_PCD_INFO_PROTOCOL.
///
typedef struct _GET_PCD_INFO_PROTOCOL  GET_PCD_INFO_PROTOCOL;

/**
  Retrieve additional information associated with a PCD token.

  This includes information such as the type of value the TokenNumber is associated with as well as possible
  human readable name that is associated with the token.

  @param[in]    TokenNumber The PCD token number.
  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.

  @retval  EFI_SUCCESS      The PCD information was returned successfully
  @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.
**/
typedef
EFI_STATUS
(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO) (
  IN        UINTN           TokenNumber,
  OUT       EFI_PCD_INFO    *PcdInfo
);

/**
  Retrieve additional information associated with a PCD token.

  This includes information such as the type of value the TokenNumber is associated with as well as possible
  human readable name that is associated with the token.

  @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.
  @param[in]    TokenNumber The PCD token number.
  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.

  @retval  EFI_SUCCESS      The PCD information was returned successfully
  @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.
**/
typedef
EFI_STATUS
(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO_EX) (
  IN CONST  EFI_GUID        *Guid,
  IN        UINTN           TokenNumber,
  OUT       EFI_PCD_INFO    *PcdInfo
);

/**
  Retrieve the currently set SKU Id.

  @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the
            default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
            Id is returned.
**/
typedef
UINTN
(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_SKU) (
  VOID
);

///
/// This is the PCD service to use when querying for some additional data that can be contained in the
/// PCD database.
///
struct _GET_PCD_INFO_PROTOCOL {
  ///
  /// Retrieve additional information associated with a PCD.
  ///
  GET_PCD_INFO_PROTOCOL_GET_INFO             GetInfo;
  GET_PCD_INFO_PROTOCOL_GET_INFO_EX          GetInfoEx;
  ///
  /// Retrieve the currently set SKU Id.
  ///
  GET_PCD_INFO_PROTOCOL_GET_SKU              GetSku;
};

#endif