summaryrefslogtreecommitdiff
path: root/MdePkg/Include/Protocol/Pcd.h
blob: 07517ffbb1d5d72413b903ee2b2c5815818a3382 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
/** @file
  Platform Configuration Database (PCD) Protocol

  Copyright (c) 2006, Intel Corporation                                                         
  All rights reserved. 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.             

  Module Name:  Pcd.h

**/

#ifndef __PCD_H__
#define __PCD_H__

extern EFI_GUID gPcdProtocolGuid;

#define PCD_PROTOCOL_GUID \
  { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }

#define PCD_INVALID_TOKEN_NUMBER ((UINTN) 0)

typedef 
VOID
(EFIAPI *PCD_PROTOCOL_SET_SKU) (
  IN  UINTN                  SkuId
  );

typedef
UINT8
(EFIAPI *PCD_PROTOCOL_GET8) (
  IN UINTN             TokenNumber
  );

typedef
UINT16
(EFIAPI *PCD_PROTOCOL_GET16) (
  IN UINTN             TokenNumber
  );

typedef
UINT32
(EFIAPI *PCD_PROTOCOL_GET32) (
  IN UINTN             TokenNumber
  );

typedef
UINT64
(EFIAPI *PCD_PROTOCOL_GET64) (
  IN UINTN             TokenNumber
  );

typedef
VOID *
(EFIAPI *PCD_PROTOCOL_GET_POINTER) (
  IN UINTN             TokenNumber
  );

typedef
BOOLEAN
(EFIAPI *PCD_PROTOCOL_GET_BOOLEAN) (
  IN UINTN             TokenNumber
  );

typedef
UINTN
(EFIAPI *PCD_PROTOCOL_GET_SIZE) (
  IN UINTN             TokenNumber
  );

typedef
UINT8
(EFIAPI *PCD_PROTOCOL_GET_EX_8) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
UINT16
(EFIAPI *PCD_PROTOCOL_GET_EX_16) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
UINT32
(EFIAPI *PCD_PROTOCOL_GET_EX_32) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
UINT64
(EFIAPI *PCD_PROTOCOL_GET_EX_64) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
VOID *
(EFIAPI *PCD_PROTOCOL_GET_EX_POINTER) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
BOOLEAN
(EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
UINTN
(EFIAPI *PCD_PROTOCOL_GET_EX_SIZE) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET8) (
  IN UINTN             TokenNumber,
  IN UINT8             Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET16) (
  IN UINTN              TokenNumber,
  IN UINT16             Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET32) (
  IN UINTN              TokenNumber,
  IN UINT32             Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET64) (
  IN UINTN             TokenNumber,
  IN UINT64            Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_POINTER) (
  IN UINTN             TokenNumber,
  IN UINTN             SizeOfBuffer,
  IN VOID              *Buffer
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_BOOLEAN) (
  IN UINTN             TokenNumber,
  IN BOOLEAN           Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_8) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber,
  IN UINT8             Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_16) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber,
  IN UINT16            Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_32) (
  IN CONST EFI_GUID     *Guid,
  IN UINTN              TokenNumber,
  IN UINT32             Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_64) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber,
  IN UINT64            Value
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_POINTER) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber,
  IN UINTN             SizeOfBuffer,
  IN VOID              *Buffer
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN) (
  IN CONST EFI_GUID    *Guid,
  IN UINTN             TokenNumber,
  IN BOOLEAN           Value
  );
  
/**
  Callback on SET function prototype definition.

  @param[in]  CallBackGuid The PCD token GUID being set.
  @param[in]  CallBackToken The PCD token number being set.
  @param[in]  TokenData A pointer to the token data being set.
  @param[in]  TokenDataSize The size, in bytes, of the data being set.

  @retval VOID

--*/
typedef
VOID
(EFIAPI *PCD_PROTOCOL_CALLBACK) (
  IN      CONST EFI_GUID   *CallBackGuid, OPTIONAL
  IN      UINTN                       CallBackToken,
  IN  OUT VOID             *TokenData,
  IN      UINTN            TokenDataSize
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET) (
  IN  UINTN                   TokenNumber,
  IN  CONST EFI_GUID          *Guid, OPTIONAL
  IN  PCD_PROTOCOL_CALLBACK   CallBackFunction
  );

typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK) (
  IN  UINTN                   TokenNumber,
  IN  CONST EFI_GUID          *Guid, OPTIONAL
  IN  PCD_PROTOCOL_CALLBACK   CallBackFunction
  );

typedef 
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (
  IN      CONST EFI_GUID      *Guid, OPTIONAL
  IN OUT  UINTN               *TokenNumber
  );

typedef struct {
  PCD_PROTOCOL_SET_SKU              SetSku;

  PCD_PROTOCOL_GET8                 Get8;
  PCD_PROTOCOL_GET16                Get16;
  PCD_PROTOCOL_GET32                Get32;
  PCD_PROTOCOL_GET64                Get64;
  PCD_PROTOCOL_GET_POINTER          GetPtr;
  PCD_PROTOCOL_GET_BOOLEAN          GetBool;
  PCD_PROTOCOL_GET_SIZE             GetSize;

  PCD_PROTOCOL_GET_EX_8             Get8Ex;
  PCD_PROTOCOL_GET_EX_16            Get16Ex;
  PCD_PROTOCOL_GET_EX_32            Get32Ex;
  PCD_PROTOCOL_GET_EX_64            Get64Ex;
  PCD_PROTOCOL_GET_EX_POINTER       GetPtrEx;
  PCD_PROTOCOL_GET_EX_BOOLEAN       GetBoolEx;
  PCD_PROTOCOL_GET_EX_SIZE          GetSizeEx;

  PCD_PROTOCOL_SET8                 Set8;
  PCD_PROTOCOL_SET16                Set16;
  PCD_PROTOCOL_SET32                Set32;
  PCD_PROTOCOL_SET64                Set64;
  PCD_PROTOCOL_SET_POINTER          SetPtr;
  PCD_PROTOCOL_SET_BOOLEAN          SetBool;

  PCD_PROTOCOL_SET_EX_8             Set8Ex;
  PCD_PROTOCOL_SET_EX_16            Set16Ex;
  PCD_PROTOCOL_SET_EX_32            Set32Ex;
  PCD_PROTOCOL_SET_EX_64            Set64Ex;
  PCD_PROTOCOL_SET_EX_POINTER       SetPtrEx;
  PCD_PROTOCOL_SET_EX_BOOLEAN       SetBoolEx;

  PCD_PROTOCOL_CALLBACK_ONSET       CallbackOnSet;
  PCD_PROTOCOL_CANCEL_CALLBACK      CancelCallback;
  PCD_PROTOCOL_GET_NEXT_TOKEN       GetNextToken;
} PCD_PROTOCOL;

#endif