xref: /freebsd/sys/contrib/edk2/Include/Library/PcdLib.h (revision 0d1ba6657e90b1f9b76e1c393b1555d6cf6cf260)
1*0d1ba665SWarner Losh /** @file
2*0d1ba665SWarner Losh   Provides library services to get and set Platform Configuration Database entries.
3*0d1ba665SWarner Losh 
4*0d1ba665SWarner Losh   PCD Library Class provides a PCD usage macro interface for all PCD types.
5*0d1ba665SWarner Losh   It should be included in any module that uses PCD. If a module uses dynamic/dynamicex
6*0d1ba665SWarner Losh   PCD, module should be linked to a PEIM/DXE library instance to access that PCD.
7*0d1ba665SWarner Losh   If a module uses PatchableInModule type PCD, it also needs the library instance to produce
8*0d1ba665SWarner Losh   LibPatchPcdSetPtr() interface. For FeatureFlag/Fixed PCD, the macro interface is
9*0d1ba665SWarner Losh   translated to a variable or macro that is auto-generated by build tool in
10*0d1ba665SWarner Losh   module's autogen.h/autogen.c.
11*0d1ba665SWarner Losh   The PcdGetXX(), PcdSetXX(), PcdToken(), and PcdGetNextTokenSpace() operations are
12*0d1ba665SWarner Losh   only available prior to ExitBootServices().  If access to PCD values are required
13*0d1ba665SWarner Losh   at runtime, then their values must be collected prior to ExitBootServices().
14*0d1ba665SWarner Losh   There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),
15*0d1ba665SWarner Losh   PatchPcdGetXX(), and PatchPcdSetXX().
16*0d1ba665SWarner Losh 
17*0d1ba665SWarner Losh Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
18*0d1ba665SWarner Losh This program and the accompanying materials
19*0d1ba665SWarner Losh are licensed and made available under the terms and conditions of the BSD License
20*0d1ba665SWarner Losh which accompanies this distribution.  The full text of the license may be found at
21*0d1ba665SWarner Losh http://opensource.org/licenses/bsd-license.php
22*0d1ba665SWarner Losh 
23*0d1ba665SWarner Losh THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
24*0d1ba665SWarner Losh WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25*0d1ba665SWarner Losh 
26*0d1ba665SWarner Losh **/
27*0d1ba665SWarner Losh 
28*0d1ba665SWarner Losh #ifndef __PCD_LIB_H__
29*0d1ba665SWarner Losh #define __PCD_LIB_H__
30*0d1ba665SWarner Losh 
31*0d1ba665SWarner Losh 
32*0d1ba665SWarner Losh /**
33*0d1ba665SWarner Losh   Retrieves a token number based on a token name.
34*0d1ba665SWarner Losh 
35*0d1ba665SWarner Losh   Returns the token number associated with the PCD token specified by TokenName.
36*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
37*0d1ba665SWarner Losh 
38*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve the token number for.
39*0d1ba665SWarner Losh 
40*0d1ba665SWarner Losh   @return  The token number associated with the PCD.
41*0d1ba665SWarner Losh 
42*0d1ba665SWarner Losh **/
43*0d1ba665SWarner Losh #define PcdToken(TokenName)                 _PCD_TOKEN_##TokenName
44*0d1ba665SWarner Losh 
45*0d1ba665SWarner Losh 
46*0d1ba665SWarner Losh /**
47*0d1ba665SWarner Losh   Retrieves a Boolean PCD feature flag based on a token name.
48*0d1ba665SWarner Losh 
49*0d1ba665SWarner Losh   Returns the Boolean value for the PCD feature flag specified by TokenName.
50*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
51*0d1ba665SWarner Losh   If TokenName is not a feature flag PCD, then the module will not build.
52*0d1ba665SWarner Losh 
53*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
54*0d1ba665SWarner Losh 
55*0d1ba665SWarner Losh   @return  Boolean value for the PCD feature flag.
56*0d1ba665SWarner Losh 
57*0d1ba665SWarner Losh **/
58*0d1ba665SWarner Losh #define FeaturePcdGet(TokenName)            _PCD_GET_MODE_BOOL_##TokenName
59*0d1ba665SWarner Losh 
60*0d1ba665SWarner Losh 
61*0d1ba665SWarner Losh /**
62*0d1ba665SWarner Losh   Retrieves an 8-bit fixed PCD token value based on a token name.
63*0d1ba665SWarner Losh 
64*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by TokenName.
65*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
66*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
67*0d1ba665SWarner Losh 
68*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
69*0d1ba665SWarner Losh 
70*0d1ba665SWarner Losh   @return  8-bit value for the token specified by TokenName.
71*0d1ba665SWarner Losh 
72*0d1ba665SWarner Losh **/
73*0d1ba665SWarner Losh #define FixedPcdGet8(TokenName)             _PCD_VALUE_##TokenName
74*0d1ba665SWarner Losh 
75*0d1ba665SWarner Losh 
76*0d1ba665SWarner Losh /**
77*0d1ba665SWarner Losh   Retrieves a 16-bit fixed PCD token value based on a token name.
78*0d1ba665SWarner Losh 
79*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by TokenName.
80*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
81*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
82*0d1ba665SWarner Losh 
83*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
84*0d1ba665SWarner Losh 
85*0d1ba665SWarner Losh   @return  16-bit value for the token specified by TokenName.
86*0d1ba665SWarner Losh 
87*0d1ba665SWarner Losh **/
88*0d1ba665SWarner Losh #define FixedPcdGet16(TokenName)            _PCD_VALUE_##TokenName
89*0d1ba665SWarner Losh 
90*0d1ba665SWarner Losh 
91*0d1ba665SWarner Losh /**
92*0d1ba665SWarner Losh   Retrieves a 32-bit fixed PCD token value based on a token name.
93*0d1ba665SWarner Losh 
94*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by TokenName.
95*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
96*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
97*0d1ba665SWarner Losh 
98*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
99*0d1ba665SWarner Losh 
100*0d1ba665SWarner Losh   @return  32-bit value for the token specified by TokenName.
101*0d1ba665SWarner Losh 
102*0d1ba665SWarner Losh **/
103*0d1ba665SWarner Losh #define FixedPcdGet32(TokenName)            _PCD_VALUE_##TokenName
104*0d1ba665SWarner Losh 
105*0d1ba665SWarner Losh 
106*0d1ba665SWarner Losh /**
107*0d1ba665SWarner Losh   Retrieves a 64-bit fixed PCD token value based on a token name.
108*0d1ba665SWarner Losh 
109*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by TokenName.
110*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
111*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
112*0d1ba665SWarner Losh 
113*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
114*0d1ba665SWarner Losh 
115*0d1ba665SWarner Losh   @return  64-bit value for the token specified by TokenName.
116*0d1ba665SWarner Losh 
117*0d1ba665SWarner Losh **/
118*0d1ba665SWarner Losh #define FixedPcdGet64(TokenName)            _PCD_VALUE_##TokenName
119*0d1ba665SWarner Losh 
120*0d1ba665SWarner Losh 
121*0d1ba665SWarner Losh /**
122*0d1ba665SWarner Losh   Retrieves a Boolean fixed PCD token value based on a token name.
123*0d1ba665SWarner Losh 
124*0d1ba665SWarner Losh   Returns the Boolean value for the token specified by TokenName.
125*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
126*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
127*0d1ba665SWarner Losh 
128*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
129*0d1ba665SWarner Losh 
130*0d1ba665SWarner Losh   @return  The Boolean value for the token.
131*0d1ba665SWarner Losh 
132*0d1ba665SWarner Losh **/
133*0d1ba665SWarner Losh #define FixedPcdGetBool(TokenName)          _PCD_VALUE_##TokenName
134*0d1ba665SWarner Losh 
135*0d1ba665SWarner Losh 
136*0d1ba665SWarner Losh /**
137*0d1ba665SWarner Losh   Retrieves a pointer to a fixed PCD token buffer based on a token name.
138*0d1ba665SWarner Losh 
139*0d1ba665SWarner Losh   Returns a pointer to the buffer for the token specified by TokenName.
140*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
141*0d1ba665SWarner Losh   If TokenName is not a fixed at build PCD, then the module will not build.
142*0d1ba665SWarner Losh 
143*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
144*0d1ba665SWarner Losh 
145*0d1ba665SWarner Losh   @return  A pointer to the buffer.
146*0d1ba665SWarner Losh 
147*0d1ba665SWarner Losh **/
148*0d1ba665SWarner Losh #define FixedPcdGetPtr(TokenName)           ((VOID *)_PCD_VALUE_##TokenName)
149*0d1ba665SWarner Losh 
150*0d1ba665SWarner Losh 
151*0d1ba665SWarner Losh /**
152*0d1ba665SWarner Losh   Retrieves an 8-bit binary patchable PCD token value based on a token name.
153*0d1ba665SWarner Losh 
154*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by TokenName.
155*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
156*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
157*0d1ba665SWarner Losh 
158*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
159*0d1ba665SWarner Losh 
160*0d1ba665SWarner Losh   @return  An 8-bit binary patchable PCD token value.
161*0d1ba665SWarner Losh 
162*0d1ba665SWarner Losh **/
163*0d1ba665SWarner Losh #define PatchPcdGet8(TokenName)             _gPcd_BinaryPatch_##TokenName
164*0d1ba665SWarner Losh 
165*0d1ba665SWarner Losh /**
166*0d1ba665SWarner Losh   Retrieves a 16-bit binary patchable PCD token value based on a token name.
167*0d1ba665SWarner Losh 
168*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by TokenName.
169*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
170*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
171*0d1ba665SWarner Losh 
172*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
173*0d1ba665SWarner Losh 
174*0d1ba665SWarner Losh   @return  A 16-bit binary patchable PCD token value.
175*0d1ba665SWarner Losh 
176*0d1ba665SWarner Losh **/
177*0d1ba665SWarner Losh #define PatchPcdGet16(TokenName)            _gPcd_BinaryPatch_##TokenName
178*0d1ba665SWarner Losh 
179*0d1ba665SWarner Losh 
180*0d1ba665SWarner Losh /**
181*0d1ba665SWarner Losh   Retrieves a 32-bit binary patchable PCD token value based on a token name.
182*0d1ba665SWarner Losh 
183*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by TokenName.
184*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
185*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
186*0d1ba665SWarner Losh 
187*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
188*0d1ba665SWarner Losh 
189*0d1ba665SWarner Losh   @return  A 32-bit binary patchable PCD token value.
190*0d1ba665SWarner Losh 
191*0d1ba665SWarner Losh **/
192*0d1ba665SWarner Losh #define PatchPcdGet32(TokenName)            _gPcd_BinaryPatch_##TokenName
193*0d1ba665SWarner Losh 
194*0d1ba665SWarner Losh 
195*0d1ba665SWarner Losh /**
196*0d1ba665SWarner Losh   Retrieves a 64-bit binary patchable PCD token value based on a token name.
197*0d1ba665SWarner Losh 
198*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by TokenName.
199*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
200*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
201*0d1ba665SWarner Losh 
202*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
203*0d1ba665SWarner Losh 
204*0d1ba665SWarner Losh   @return  A 64-bit binary patchable PCD token value.
205*0d1ba665SWarner Losh 
206*0d1ba665SWarner Losh **/
207*0d1ba665SWarner Losh #define PatchPcdGet64(TokenName)            _gPcd_BinaryPatch_##TokenName
208*0d1ba665SWarner Losh 
209*0d1ba665SWarner Losh 
210*0d1ba665SWarner Losh /**
211*0d1ba665SWarner Losh   Retrieves a Boolean binary patchable PCD token value based on a token name.
212*0d1ba665SWarner Losh 
213*0d1ba665SWarner Losh   Returns the Boolean value for the token specified by TokenName.
214*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
215*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
216*0d1ba665SWarner Losh 
217*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
218*0d1ba665SWarner Losh 
219*0d1ba665SWarner Losh   @return  The Boolean value for the token.
220*0d1ba665SWarner Losh 
221*0d1ba665SWarner Losh **/
222*0d1ba665SWarner Losh #define PatchPcdGetBool(TokenName)          _gPcd_BinaryPatch_##TokenName
223*0d1ba665SWarner Losh 
224*0d1ba665SWarner Losh 
225*0d1ba665SWarner Losh /**
226*0d1ba665SWarner Losh   Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
227*0d1ba665SWarner Losh 
228*0d1ba665SWarner Losh   Returns a pointer to the buffer for the token specified by TokenName.
229*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
230*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
231*0d1ba665SWarner Losh 
232*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
233*0d1ba665SWarner Losh 
234*0d1ba665SWarner Losh   @return  A pointer to the buffer for the token.
235*0d1ba665SWarner Losh 
236*0d1ba665SWarner Losh **/
237*0d1ba665SWarner Losh #define PatchPcdGetPtr(TokenName)           ((VOID *)_gPcd_BinaryPatch_##TokenName)
238*0d1ba665SWarner Losh 
239*0d1ba665SWarner Losh 
240*0d1ba665SWarner Losh /**
241*0d1ba665SWarner Losh   Sets an 8-bit binary patchable PCD token value based on a token name.
242*0d1ba665SWarner Losh 
243*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenName. Value is returned.
244*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
245*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
246*0d1ba665SWarner Losh 
247*0d1ba665SWarner Losh   @param   TokenName  The name of the binary patchable PCD token to set the current value for.
248*0d1ba665SWarner Losh   @param   Value      The 8-bit value to set.
249*0d1ba665SWarner Losh 
250*0d1ba665SWarner Losh   @return Return the Value that was set.
251*0d1ba665SWarner Losh 
252*0d1ba665SWarner Losh **/
253*0d1ba665SWarner Losh #define PatchPcdSet8(TokenName, Value)      (_gPcd_BinaryPatch_##TokenName = (Value))
254*0d1ba665SWarner Losh 
255*0d1ba665SWarner Losh 
256*0d1ba665SWarner Losh /**
257*0d1ba665SWarner Losh   Sets a 16-bit binary patchable PCD token value based on a token name.
258*0d1ba665SWarner Losh 
259*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenName. Value is returned.
260*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
261*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
262*0d1ba665SWarner Losh 
263*0d1ba665SWarner Losh   @param   TokenName  The name of the binary patchable PCD token to set the current value for.
264*0d1ba665SWarner Losh   @param   Value      The 16-bit value to set.
265*0d1ba665SWarner Losh 
266*0d1ba665SWarner Losh   @return Return the Value that was set.
267*0d1ba665SWarner Losh 
268*0d1ba665SWarner Losh **/
269*0d1ba665SWarner Losh #define PatchPcdSet16(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
270*0d1ba665SWarner Losh 
271*0d1ba665SWarner Losh 
272*0d1ba665SWarner Losh /**
273*0d1ba665SWarner Losh   Sets a 32-bit binary patchable PCD token value based on a token name.
274*0d1ba665SWarner Losh 
275*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenName. Value is returned.
276*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
277*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
278*0d1ba665SWarner Losh 
279*0d1ba665SWarner Losh   @param   TokenName  The name of the binary patchable PCD token to set the current value for.
280*0d1ba665SWarner Losh   @param   Value      The 32-bit value to set.
281*0d1ba665SWarner Losh 
282*0d1ba665SWarner Losh   @return Return the Value that was set.
283*0d1ba665SWarner Losh 
284*0d1ba665SWarner Losh **/
285*0d1ba665SWarner Losh #define PatchPcdSet32(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
286*0d1ba665SWarner Losh 
287*0d1ba665SWarner Losh 
288*0d1ba665SWarner Losh /**
289*0d1ba665SWarner Losh   Sets a 64-bit binary patchable PCD token value based on a token name.
290*0d1ba665SWarner Losh 
291*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenName. Value is returned.
292*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
293*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
294*0d1ba665SWarner Losh 
295*0d1ba665SWarner Losh   @param   TokenName  The name of the binary patchable PCD token to set the current value for.
296*0d1ba665SWarner Losh   @param   Value      The 64-bit value to set.
297*0d1ba665SWarner Losh 
298*0d1ba665SWarner Losh   @return Return the Value that was set.
299*0d1ba665SWarner Losh 
300*0d1ba665SWarner Losh **/
301*0d1ba665SWarner Losh #define PatchPcdSet64(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
302*0d1ba665SWarner Losh 
303*0d1ba665SWarner Losh 
304*0d1ba665SWarner Losh /**
305*0d1ba665SWarner Losh   Sets a Boolean binary patchable PCD token value based on a token name.
306*0d1ba665SWarner Losh 
307*0d1ba665SWarner Losh   Sets the Boolean value for the token specified by TokenName. Value is returned.
308*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
309*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
310*0d1ba665SWarner Losh 
311*0d1ba665SWarner Losh   @param   TokenName  The name of the binary patchable PCD token to set the current value for.
312*0d1ba665SWarner Losh   @param   Value      The boolean value to set.
313*0d1ba665SWarner Losh 
314*0d1ba665SWarner Losh   @return Return the Value that was set.
315*0d1ba665SWarner Losh 
316*0d1ba665SWarner Losh **/
317*0d1ba665SWarner Losh #define PatchPcdSetBool(TokenName, Value)   (_gPcd_BinaryPatch_##TokenName = (Value))
318*0d1ba665SWarner Losh 
319*0d1ba665SWarner Losh 
320*0d1ba665SWarner Losh /**
321*0d1ba665SWarner Losh   Sets a pointer to a binary patchable PCD token buffer based on a token name.
322*0d1ba665SWarner Losh 
323*0d1ba665SWarner Losh   Sets the buffer for the token specified by TokenName.  Buffer is returned.
324*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size supported by TokenName, then set SizeOfBuffer
325*0d1ba665SWarner Losh   to the maximum size supported by TokenName and return NULL to indicate that the set operation
326*0d1ba665SWarner Losh   was not actually performed.  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be
327*0d1ba665SWarner Losh   set to the maximum size supported by TokenName and NULL must be returned.
328*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
329*0d1ba665SWarner Losh   If TokenName is not a patchable in module PCD, then the module will not build.
330*0d1ba665SWarner Losh 
331*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
332*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
333*0d1ba665SWarner Losh 
334*0d1ba665SWarner Losh   @param   TokenName      The name of the binary patchable PCD token to set the current value for.
335*0d1ba665SWarner Losh   @param   SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
336*0d1ba665SWarner Losh   @param   Buffer         Pointer to the value to set.
337*0d1ba665SWarner Losh 
338*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
339*0d1ba665SWarner Losh 
340*0d1ba665SWarner Losh **/
341*0d1ba665SWarner Losh #define PatchPcdSetPtr(TokenName, Size, Buffer) \
342*0d1ba665SWarner Losh                                             LibPatchPcdSetPtrAndSize (                 \
343*0d1ba665SWarner Losh                                               (VOID *)_gPcd_BinaryPatch_##TokenName,   \
344*0d1ba665SWarner Losh                                               &_gPcd_BinaryPatch_Size_##TokenName,     \
345*0d1ba665SWarner Losh                                               (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
346*0d1ba665SWarner Losh                                               (Size),                                  \
347*0d1ba665SWarner Losh                                               (Buffer)                                 \
348*0d1ba665SWarner Losh                                               )
349*0d1ba665SWarner Losh /**
350*0d1ba665SWarner Losh   Retrieves an 8-bit PCD token value based on a token name.
351*0d1ba665SWarner Losh 
352*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by TokenName.
353*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
354*0d1ba665SWarner Losh 
355*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
356*0d1ba665SWarner Losh 
357*0d1ba665SWarner Losh   @return  8-bit value for the token specified by TokenName.
358*0d1ba665SWarner Losh 
359*0d1ba665SWarner Losh **/
360*0d1ba665SWarner Losh #define PcdGet8(TokenName)                  _PCD_GET_MODE_8_##TokenName
361*0d1ba665SWarner Losh 
362*0d1ba665SWarner Losh 
363*0d1ba665SWarner Losh /**
364*0d1ba665SWarner Losh   Retrieves a 16-bit PCD token value based on a token name.
365*0d1ba665SWarner Losh 
366*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by TokenName.
367*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
368*0d1ba665SWarner Losh 
369*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
370*0d1ba665SWarner Losh 
371*0d1ba665SWarner Losh   @return  16-bit value for the token specified by TokenName.
372*0d1ba665SWarner Losh 
373*0d1ba665SWarner Losh **/
374*0d1ba665SWarner Losh #define PcdGet16(TokenName)                 _PCD_GET_MODE_16_##TokenName
375*0d1ba665SWarner Losh 
376*0d1ba665SWarner Losh 
377*0d1ba665SWarner Losh /**
378*0d1ba665SWarner Losh   Retrieves a 32-bit PCD token value based on a token name.
379*0d1ba665SWarner Losh 
380*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by TokenName.
381*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
382*0d1ba665SWarner Losh 
383*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
384*0d1ba665SWarner Losh 
385*0d1ba665SWarner Losh   @return  32-bit value for the token specified by TokenName.
386*0d1ba665SWarner Losh 
387*0d1ba665SWarner Losh **/
388*0d1ba665SWarner Losh #define PcdGet32(TokenName)                 _PCD_GET_MODE_32_##TokenName
389*0d1ba665SWarner Losh 
390*0d1ba665SWarner Losh 
391*0d1ba665SWarner Losh /**
392*0d1ba665SWarner Losh   Retrieves a 64-bit PCD token value based on a token name.
393*0d1ba665SWarner Losh 
394*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by TokenName.
395*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
396*0d1ba665SWarner Losh 
397*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
398*0d1ba665SWarner Losh 
399*0d1ba665SWarner Losh   @return  64-bit value for the token specified by TokenName.
400*0d1ba665SWarner Losh 
401*0d1ba665SWarner Losh **/
402*0d1ba665SWarner Losh #define PcdGet64(TokenName)                 _PCD_GET_MODE_64_##TokenName
403*0d1ba665SWarner Losh 
404*0d1ba665SWarner Losh 
405*0d1ba665SWarner Losh /**
406*0d1ba665SWarner Losh   Retrieves a pointer to a PCD token buffer based on a token name.
407*0d1ba665SWarner Losh 
408*0d1ba665SWarner Losh   Returns a pointer to the buffer for the token specified by TokenName.
409*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
410*0d1ba665SWarner Losh 
411*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
412*0d1ba665SWarner Losh 
413*0d1ba665SWarner Losh   @return  A pointer to the buffer.
414*0d1ba665SWarner Losh 
415*0d1ba665SWarner Losh **/
416*0d1ba665SWarner Losh #define PcdGetPtr(TokenName)                _PCD_GET_MODE_PTR_##TokenName
417*0d1ba665SWarner Losh 
418*0d1ba665SWarner Losh 
419*0d1ba665SWarner Losh /**
420*0d1ba665SWarner Losh   Retrieves a Boolean PCD token value based on a token name.
421*0d1ba665SWarner Losh 
422*0d1ba665SWarner Losh   Returns the Boolean value for the token specified by TokenName.
423*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
424*0d1ba665SWarner Losh 
425*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
426*0d1ba665SWarner Losh 
427*0d1ba665SWarner Losh   @return  A Boolean PCD token value.
428*0d1ba665SWarner Losh 
429*0d1ba665SWarner Losh **/
430*0d1ba665SWarner Losh #define PcdGetBool(TokenName)               _PCD_GET_MODE_BOOL_##TokenName
431*0d1ba665SWarner Losh 
432*0d1ba665SWarner Losh 
433*0d1ba665SWarner Losh /**
434*0d1ba665SWarner Losh   Retrieves the size of a fixed PCD token based on a token name.
435*0d1ba665SWarner Losh 
436*0d1ba665SWarner Losh   Returns the size of the token specified by TokenName.
437*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
438*0d1ba665SWarner Losh 
439*0d1ba665SWarner Losh   @param[in]  TokenName  The name of the PCD token to retrieve a current value size for.
440*0d1ba665SWarner Losh 
441*0d1ba665SWarner Losh   @return     Return the size
442*0d1ba665SWarner Losh 
443*0d1ba665SWarner Losh **/
444*0d1ba665SWarner Losh #define FixedPcdGetSize(TokenName)    _PCD_SIZE_##TokenName
445*0d1ba665SWarner Losh 
446*0d1ba665SWarner Losh 
447*0d1ba665SWarner Losh /**
448*0d1ba665SWarner Losh   Retrieves the size of a binary patchable PCD token based on a token name.
449*0d1ba665SWarner Losh 
450*0d1ba665SWarner Losh   Returns the size of the token specified by TokenName.
451*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
452*0d1ba665SWarner Losh 
453*0d1ba665SWarner Losh   @param[in]  TokenName  The name of the PCD token to retrieve a current value size for.
454*0d1ba665SWarner Losh 
455*0d1ba665SWarner Losh   @return     Return the size
456*0d1ba665SWarner Losh 
457*0d1ba665SWarner Losh **/
458*0d1ba665SWarner Losh #define PatchPcdGetSize(TokenName)    _gPcd_BinaryPatch_Size_##TokenName
459*0d1ba665SWarner Losh 
460*0d1ba665SWarner Losh 
461*0d1ba665SWarner Losh /**
462*0d1ba665SWarner Losh   Retrieves the size of the PCD token based on a token name.
463*0d1ba665SWarner Losh 
464*0d1ba665SWarner Losh   Returns the size of the token specified by TokenName.
465*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
466*0d1ba665SWarner Losh 
467*0d1ba665SWarner Losh   @param[in]   TokenName  The name of the PCD token to retrieve a current value size for.
468*0d1ba665SWarner Losh 
469*0d1ba665SWarner Losh   @return      Return the size
470*0d1ba665SWarner Losh 
471*0d1ba665SWarner Losh **/
472*0d1ba665SWarner Losh #define PcdGetSize(TokenName)         _PCD_GET_MODE_SIZE_##TokenName
473*0d1ba665SWarner Losh 
474*0d1ba665SWarner Losh 
475*0d1ba665SWarner Losh /**
476*0d1ba665SWarner Losh   Retrieve the size of a given PCD token.
477*0d1ba665SWarner Losh 
478*0d1ba665SWarner Losh   Returns the size of the token specified by TokenNumber and Guid.
479*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
480*0d1ba665SWarner Losh 
481*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that designates
482*0d1ba665SWarner Losh                             which namespace to retrieve a value from.
483*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to retrieve a current value size for.
484*0d1ba665SWarner Losh 
485*0d1ba665SWarner Losh   @return     Return the size.
486*0d1ba665SWarner Losh 
487*0d1ba665SWarner Losh **/
488*0d1ba665SWarner Losh #define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))
489*0d1ba665SWarner Losh 
490*0d1ba665SWarner Losh #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
491*0d1ba665SWarner Losh /**
492*0d1ba665SWarner Losh   Sets an 8-bit PCD token value based on a token name.
493*0d1ba665SWarner Losh 
494*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenName. Value is returned.
495*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
496*0d1ba665SWarner Losh 
497*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
498*0d1ba665SWarner Losh   @param   Value      The 8-bit value to set.
499*0d1ba665SWarner Losh 
500*0d1ba665SWarner Losh   @return Return the Value that was set.
501*0d1ba665SWarner Losh 
502*0d1ba665SWarner Losh **/
503*0d1ba665SWarner Losh #define PcdSet8(TokenName, Value)           _PCD_SET_MODE_8_##TokenName     ((Value))
504*0d1ba665SWarner Losh 
505*0d1ba665SWarner Losh 
506*0d1ba665SWarner Losh /**
507*0d1ba665SWarner Losh   Sets a 16-bit PCD token value based on a token name.
508*0d1ba665SWarner Losh 
509*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenName. Value is returned.
510*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
511*0d1ba665SWarner Losh 
512*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
513*0d1ba665SWarner Losh   @param   Value      The 16-bit value to set.
514*0d1ba665SWarner Losh 
515*0d1ba665SWarner Losh   @return Return the Value that was set.
516*0d1ba665SWarner Losh 
517*0d1ba665SWarner Losh **/
518*0d1ba665SWarner Losh #define PcdSet16(TokenName, Value)          _PCD_SET_MODE_16_##TokenName    ((Value))
519*0d1ba665SWarner Losh 
520*0d1ba665SWarner Losh 
521*0d1ba665SWarner Losh /**
522*0d1ba665SWarner Losh   Sets a 32-bit PCD token value based on a token name.
523*0d1ba665SWarner Losh 
524*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenName. Value is returned.
525*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
526*0d1ba665SWarner Losh 
527*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
528*0d1ba665SWarner Losh   @param   Value      The 32-bit value to set.
529*0d1ba665SWarner Losh 
530*0d1ba665SWarner Losh   @return Return the Value that was set.
531*0d1ba665SWarner Losh 
532*0d1ba665SWarner Losh **/
533*0d1ba665SWarner Losh #define PcdSet32(TokenName, Value)          _PCD_SET_MODE_32_##TokenName    ((Value))
534*0d1ba665SWarner Losh 
535*0d1ba665SWarner Losh 
536*0d1ba665SWarner Losh /**
537*0d1ba665SWarner Losh   Sets a 64-bit PCD token value based on a token name.
538*0d1ba665SWarner Losh 
539*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenName. Value is returned.
540*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
541*0d1ba665SWarner Losh 
542*0d1ba665SWarner Losh   @param   TokenName  The name of the PCD token to retrieve a current value for.
543*0d1ba665SWarner Losh   @param   Value      The 64-bit value to set.
544*0d1ba665SWarner Losh 
545*0d1ba665SWarner Losh   @return Return the Value that was set.
546*0d1ba665SWarner Losh 
547*0d1ba665SWarner Losh **/
548*0d1ba665SWarner Losh #define PcdSet64(TokenName, Value)          _PCD_SET_MODE_64_##TokenName    ((Value))
549*0d1ba665SWarner Losh 
550*0d1ba665SWarner Losh 
551*0d1ba665SWarner Losh /**
552*0d1ba665SWarner Losh   Sets a pointer to a PCD token buffer based on a token name.
553*0d1ba665SWarner Losh 
554*0d1ba665SWarner Losh   Sets the buffer for the token specified by TokenName. Buffer is returned.
555*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size supported by TokenName,
556*0d1ba665SWarner Losh   then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
557*0d1ba665SWarner Losh   to indicate that the set operation was not actually performed.  If SizeOfBuffer
558*0d1ba665SWarner Losh   is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
559*0d1ba665SWarner Losh   by TokenName and NULL must be returned.
560*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
561*0d1ba665SWarner Losh 
562*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
563*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
564*0d1ba665SWarner Losh 
565*0d1ba665SWarner Losh   @param   TokenName      The name of the PCD token to set the current value for.
566*0d1ba665SWarner Losh   @param   SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
567*0d1ba665SWarner Losh   @param   Buffer         A pointer to the buffer to set.
568*0d1ba665SWarner Losh 
569*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
570*0d1ba665SWarner Losh 
571*0d1ba665SWarner Losh **/
572*0d1ba665SWarner Losh #define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
573*0d1ba665SWarner Losh                                             _PCD_SET_MODE_PTR_##TokenName   ((SizeOfBuffer), (Buffer))
574*0d1ba665SWarner Losh 
575*0d1ba665SWarner Losh /**
576*0d1ba665SWarner Losh   Sets a Boolean PCD token value based on a token name.
577*0d1ba665SWarner Losh 
578*0d1ba665SWarner Losh   Sets the Boolean value for the token specified by TokenName. Value is returned.
579*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
580*0d1ba665SWarner Losh 
581*0d1ba665SWarner Losh   @param   TokenName      The name of the PCD token to set the current value for.
582*0d1ba665SWarner Losh   @param   Buffer         The Boolean value to set.
583*0d1ba665SWarner Losh 
584*0d1ba665SWarner Losh   @return Return the Value that was set.
585*0d1ba665SWarner Losh 
586*0d1ba665SWarner Losh **/
587*0d1ba665SWarner Losh #define PcdSetBool(TokenName, Value)        _PCD_SET_MODE_BOOL_##TokenName  ((Value))
588*0d1ba665SWarner Losh #endif
589*0d1ba665SWarner Losh 
590*0d1ba665SWarner Losh /**
591*0d1ba665SWarner Losh   Sets a 8-bit PCD token value based on a token name.
592*0d1ba665SWarner Losh 
593*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenName.
594*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
595*0d1ba665SWarner Losh 
596*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to retrieve a current value for.
597*0d1ba665SWarner Losh   @param Value      The 8-bit value to set.
598*0d1ba665SWarner Losh 
599*0d1ba665SWarner Losh   @return The status of the set operation.
600*0d1ba665SWarner Losh 
601*0d1ba665SWarner Losh **/
602*0d1ba665SWarner Losh #define PcdSet8S(TokenName, Value)          _PCD_SET_MODE_8_S_##TokenName    ((Value))
603*0d1ba665SWarner Losh 
604*0d1ba665SWarner Losh /**
605*0d1ba665SWarner Losh   Sets a 16-bit PCD token value based on a token name.
606*0d1ba665SWarner Losh 
607*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenName.
608*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
609*0d1ba665SWarner Losh 
610*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to retrieve a current value for.
611*0d1ba665SWarner Losh   @param Value      The 16-bit value to set.
612*0d1ba665SWarner Losh 
613*0d1ba665SWarner Losh   @return The status of the set operation.
614*0d1ba665SWarner Losh 
615*0d1ba665SWarner Losh **/
616*0d1ba665SWarner Losh #define PcdSet16S(TokenName, Value)         _PCD_SET_MODE_16_S_##TokenName    ((Value))
617*0d1ba665SWarner Losh 
618*0d1ba665SWarner Losh /**
619*0d1ba665SWarner Losh   Sets a 32-bit PCD token value based on a token name.
620*0d1ba665SWarner Losh 
621*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenName.
622*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
623*0d1ba665SWarner Losh 
624*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to retrieve a current value for.
625*0d1ba665SWarner Losh   @param Value      The 32-bit value to set.
626*0d1ba665SWarner Losh 
627*0d1ba665SWarner Losh   @return The status of the set operation.
628*0d1ba665SWarner Losh 
629*0d1ba665SWarner Losh **/
630*0d1ba665SWarner Losh #define PcdSet32S(TokenName, Value)         _PCD_SET_MODE_32_S_##TokenName    ((Value))
631*0d1ba665SWarner Losh 
632*0d1ba665SWarner Losh /**
633*0d1ba665SWarner Losh   Sets a 64-bit PCD token value based on a token name.
634*0d1ba665SWarner Losh 
635*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenName.
636*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
637*0d1ba665SWarner Losh 
638*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to retrieve a current value for.
639*0d1ba665SWarner Losh   @param Value      The 64-bit value to set.
640*0d1ba665SWarner Losh 
641*0d1ba665SWarner Losh   @return The status of the set operation.
642*0d1ba665SWarner Losh 
643*0d1ba665SWarner Losh **/
644*0d1ba665SWarner Losh #define PcdSet64S(TokenName, Value)         _PCD_SET_MODE_64_S_##TokenName    ((Value))
645*0d1ba665SWarner Losh 
646*0d1ba665SWarner Losh /**
647*0d1ba665SWarner Losh   Sets a pointer to a PCD token buffer based on a token name.
648*0d1ba665SWarner Losh 
649*0d1ba665SWarner Losh   Sets the buffer for the token specified by TokenName.
650*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size supported by TokenName,
651*0d1ba665SWarner Losh   then set SizeOfBuffer to the maximum size supported by TokenName and return
652*0d1ba665SWarner Losh   RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.
653*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size
654*0d1ba665SWarner Losh   supported by TokenName and RETURN_INVALID_PARAMETER must be returned.
655*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
656*0d1ba665SWarner Losh 
657*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
658*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
659*0d1ba665SWarner Losh 
660*0d1ba665SWarner Losh   @param TokenName      The name of the PCD token to set the current value for.
661*0d1ba665SWarner Losh   @param SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
662*0d1ba665SWarner Losh   @param Buffer         A pointer to the buffer to set.
663*0d1ba665SWarner Losh 
664*0d1ba665SWarner Losh   @return The status of the set operation.
665*0d1ba665SWarner Losh 
666*0d1ba665SWarner Losh **/
667*0d1ba665SWarner Losh #define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \
668*0d1ba665SWarner Losh                                             _PCD_SET_MODE_PTR_S_##TokenName   ((SizeOfBuffer), (Buffer))
669*0d1ba665SWarner Losh 
670*0d1ba665SWarner Losh 
671*0d1ba665SWarner Losh 
672*0d1ba665SWarner Losh /**
673*0d1ba665SWarner Losh   Sets a boolean PCD token value based on a token name.
674*0d1ba665SWarner Losh 
675*0d1ba665SWarner Losh   Sets the boolean value for the token specified by TokenName.
676*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
677*0d1ba665SWarner Losh 
678*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to retrieve a current value for.
679*0d1ba665SWarner Losh   @param Value      The boolean value to set.
680*0d1ba665SWarner Losh 
681*0d1ba665SWarner Losh   @return The status of the set operation.
682*0d1ba665SWarner Losh 
683*0d1ba665SWarner Losh **/
684*0d1ba665SWarner Losh #define PcdSetBoolS(TokenName, Value)       _PCD_SET_MODE_BOOL_S_##TokenName    ((Value))
685*0d1ba665SWarner Losh 
686*0d1ba665SWarner Losh /**
687*0d1ba665SWarner Losh   Retrieves a token number based on a GUID and a token name.
688*0d1ba665SWarner Losh 
689*0d1ba665SWarner Losh   Returns the token number for the token specified by Guid and TokenName.
690*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space, then the module will not build.
691*0d1ba665SWarner Losh 
692*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
693*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
694*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
695*0d1ba665SWarner Losh 
696*0d1ba665SWarner Losh   @return  Return the token number.
697*0d1ba665SWarner Losh 
698*0d1ba665SWarner Losh **/
699*0d1ba665SWarner Losh #define PcdTokenEx(Guid,TokenName)  _PCD_TOKEN_EX_##TokenName(Guid)
700*0d1ba665SWarner Losh 
701*0d1ba665SWarner Losh /**
702*0d1ba665SWarner Losh   Retrieves an 8-bit PCD token value based on a GUID and a token name.
703*0d1ba665SWarner Losh 
704*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by Guid and TokenName.
705*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
706*0d1ba665SWarner Losh   then the module will not build.
707*0d1ba665SWarner Losh 
708*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
709*0d1ba665SWarner Losh 
710*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
711*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
712*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
713*0d1ba665SWarner Losh 
714*0d1ba665SWarner Losh   @return  An 8-bit PCD token value.
715*0d1ba665SWarner Losh 
716*0d1ba665SWarner Losh **/
717*0d1ba665SWarner Losh #define PcdGetEx8(Guid, TokenName)          LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
718*0d1ba665SWarner Losh 
719*0d1ba665SWarner Losh /**
720*0d1ba665SWarner Losh   Retrieves a 16-bit PCD token value based on a GUID and a token name.
721*0d1ba665SWarner Losh 
722*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by Guid and TokenName.
723*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
724*0d1ba665SWarner Losh   then the module will not build.
725*0d1ba665SWarner Losh 
726*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
727*0d1ba665SWarner Losh 
728*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
729*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
730*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
731*0d1ba665SWarner Losh 
732*0d1ba665SWarner Losh   @return  A 16-bit PCD token value.
733*0d1ba665SWarner Losh 
734*0d1ba665SWarner Losh **/
735*0d1ba665SWarner Losh #define PcdGetEx16(Guid, TokenName)         LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
736*0d1ba665SWarner Losh 
737*0d1ba665SWarner Losh 
738*0d1ba665SWarner Losh /**
739*0d1ba665SWarner Losh   Retrieves a 32-bit PCD token value based on a GUID and a token name.
740*0d1ba665SWarner Losh 
741*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by Guid and TokenName.
742*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
743*0d1ba665SWarner Losh   then the module will not build.
744*0d1ba665SWarner Losh 
745*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
746*0d1ba665SWarner Losh 
747*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
748*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
749*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
750*0d1ba665SWarner Losh 
751*0d1ba665SWarner Losh   @return  A 32-bit PCD token value.
752*0d1ba665SWarner Losh 
753*0d1ba665SWarner Losh **/
754*0d1ba665SWarner Losh #define PcdGetEx32(Guid, TokenName)         LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
755*0d1ba665SWarner Losh 
756*0d1ba665SWarner Losh 
757*0d1ba665SWarner Losh /**
758*0d1ba665SWarner Losh   Retrieves a 64-bit PCD token value based on a GUID and a token name.
759*0d1ba665SWarner Losh 
760*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by Guid and TokenName.
761*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
762*0d1ba665SWarner Losh   then the module will not build.
763*0d1ba665SWarner Losh 
764*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
765*0d1ba665SWarner Losh 
766*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
767*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
768*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
769*0d1ba665SWarner Losh 
770*0d1ba665SWarner Losh   @return  A 64-bit PCD token value.
771*0d1ba665SWarner Losh 
772*0d1ba665SWarner Losh **/
773*0d1ba665SWarner Losh #define PcdGetEx64(Guid, TokenName)         LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
774*0d1ba665SWarner Losh 
775*0d1ba665SWarner Losh 
776*0d1ba665SWarner Losh /**
777*0d1ba665SWarner Losh   Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
778*0d1ba665SWarner Losh 
779*0d1ba665SWarner Losh   Returns a pointer to the buffer for the token specified by Guid and TokenName.
780*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
781*0d1ba665SWarner Losh   then the module will not build.
782*0d1ba665SWarner Losh 
783*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
784*0d1ba665SWarner Losh 
785*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
786*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
787*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
788*0d1ba665SWarner Losh 
789*0d1ba665SWarner Losh   @return  A pointer to a PCD token buffer.
790*0d1ba665SWarner Losh 
791*0d1ba665SWarner Losh **/
792*0d1ba665SWarner Losh #define PcdGetExPtr(Guid, TokenName)        LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
793*0d1ba665SWarner Losh 
794*0d1ba665SWarner Losh 
795*0d1ba665SWarner Losh /**
796*0d1ba665SWarner Losh   Retrieves a Boolean PCD token value based on a GUID and a token name.
797*0d1ba665SWarner Losh 
798*0d1ba665SWarner Losh   Returns the Boolean value for the token specified by Guid and TokenName.
799*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
800*0d1ba665SWarner Losh   then the module will not build.
801*0d1ba665SWarner Losh 
802*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
803*0d1ba665SWarner Losh 
804*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
805*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
806*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to retrieve a current value for.
807*0d1ba665SWarner Losh 
808*0d1ba665SWarner Losh   @return  A Boolean PCD token value.
809*0d1ba665SWarner Losh 
810*0d1ba665SWarner Losh **/
811*0d1ba665SWarner Losh #define PcdGetExBool(Guid, TokenName)       LibPcdGetExBool  ((Guid), PcdTokenEx(Guid,TokenName))
812*0d1ba665SWarner Losh 
813*0d1ba665SWarner Losh 
814*0d1ba665SWarner Losh 
815*0d1ba665SWarner Losh #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
816*0d1ba665SWarner Losh /**
817*0d1ba665SWarner Losh   Sets an 8-bit PCD token value based on a GUID and a token name.
818*0d1ba665SWarner Losh 
819*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
820*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
821*0d1ba665SWarner Losh   then the module will not build.
822*0d1ba665SWarner Losh 
823*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
824*0d1ba665SWarner Losh 
825*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
826*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
827*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to set the current value for.
828*0d1ba665SWarner Losh   @param   Value       The 8-bit value to set.
829*0d1ba665SWarner Losh 
830*0d1ba665SWarner Losh   @return Return the Value that was set.
831*0d1ba665SWarner Losh 
832*0d1ba665SWarner Losh **/
833*0d1ba665SWarner Losh #define PcdSetEx8(Guid, TokenName, Value)   LibPcdSetEx8   ((Guid), PcdTokenEx(Guid,TokenName), (Value))
834*0d1ba665SWarner Losh 
835*0d1ba665SWarner Losh 
836*0d1ba665SWarner Losh /**
837*0d1ba665SWarner Losh   Sets a 16-bit PCD token value based on a GUID and a token name.
838*0d1ba665SWarner Losh 
839*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
840*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
841*0d1ba665SWarner Losh   then the module will not build.
842*0d1ba665SWarner Losh 
843*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
844*0d1ba665SWarner Losh 
845*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
846*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
847*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to set the current value for.
848*0d1ba665SWarner Losh   @param   Value       The 16-bit value to set.
849*0d1ba665SWarner Losh 
850*0d1ba665SWarner Losh   @return Return the Value that was set.
851*0d1ba665SWarner Losh 
852*0d1ba665SWarner Losh **/
853*0d1ba665SWarner Losh #define PcdSetEx16(Guid, TokenName, Value)  LibPcdSetEx16  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
854*0d1ba665SWarner Losh 
855*0d1ba665SWarner Losh 
856*0d1ba665SWarner Losh /**
857*0d1ba665SWarner Losh   Sets a 32-bit PCD token value based on a GUID and a token name.
858*0d1ba665SWarner Losh 
859*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
860*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
861*0d1ba665SWarner Losh   then the module will not build.
862*0d1ba665SWarner Losh 
863*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
864*0d1ba665SWarner Losh 
865*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
866*0d1ba665SWarner Losh                        which namespace to retrieve a value from.
867*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to set the current value for.
868*0d1ba665SWarner Losh   @param   Value       The 32-bit value to set.
869*0d1ba665SWarner Losh 
870*0d1ba665SWarner Losh   @return Return the Value that was set.
871*0d1ba665SWarner Losh 
872*0d1ba665SWarner Losh **/
873*0d1ba665SWarner Losh #define PcdSetEx32(Guid, TokenName, Value)  LibPcdSetEx32  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
874*0d1ba665SWarner Losh 
875*0d1ba665SWarner Losh 
876*0d1ba665SWarner Losh /**
877*0d1ba665SWarner Losh   Sets a 64-bit PCD token value based on a GUID and a token name.
878*0d1ba665SWarner Losh 
879*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
880*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
881*0d1ba665SWarner Losh   then the module will not build.
882*0d1ba665SWarner Losh 
883*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
884*0d1ba665SWarner Losh 
885*0d1ba665SWarner Losh   @param   Guid        Pointer to a 128-bit unique value that designates
886*0d1ba665SWarner Losh   which namespace to retrieve a value from.
887*0d1ba665SWarner Losh   @param   TokenName   The name of the PCD token to set the current value for.
888*0d1ba665SWarner Losh   @param   Value       The 64-bit value to set.
889*0d1ba665SWarner Losh 
890*0d1ba665SWarner Losh   @return Return the Value that was set.
891*0d1ba665SWarner Losh 
892*0d1ba665SWarner Losh **/
893*0d1ba665SWarner Losh #define PcdSetEx64(Guid, TokenName, Value)  LibPcdSetEx64  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
894*0d1ba665SWarner Losh 
895*0d1ba665SWarner Losh 
896*0d1ba665SWarner Losh /**
897*0d1ba665SWarner Losh   Sets a pointer to a PCD token buffer based on a GUID and a token name.
898*0d1ba665SWarner Losh 
899*0d1ba665SWarner Losh   Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
900*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
901*0d1ba665SWarner Losh   then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
902*0d1ba665SWarner Losh   NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
903*0d1ba665SWarner Losh   is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
904*0d1ba665SWarner Losh   Guid and TokenName and NULL must be returned.
905*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
906*0d1ba665SWarner Losh   then the module will not build.
907*0d1ba665SWarner Losh 
908*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
909*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
910*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
911*0d1ba665SWarner Losh 
912*0d1ba665SWarner Losh   @param   Guid           Pointer to a 128-bit unique value that designates
913*0d1ba665SWarner Losh                           which namespace to retrieve a value from.
914*0d1ba665SWarner Losh   @param   TokenName      The name of the PCD token to set the current value for.
915*0d1ba665SWarner Losh   @param   SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
916*0d1ba665SWarner Losh   @param   Buffer         Pointer to the buffer to set.
917*0d1ba665SWarner Losh 
918*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
919*0d1ba665SWarner Losh 
920*0d1ba665SWarner Losh **/
921*0d1ba665SWarner Losh #define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
922*0d1ba665SWarner Losh                                             LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
923*0d1ba665SWarner Losh 
924*0d1ba665SWarner Losh 
925*0d1ba665SWarner Losh /**
926*0d1ba665SWarner Losh   Sets a Boolean PCD token value based on a GUID and a token name.
927*0d1ba665SWarner Losh 
928*0d1ba665SWarner Losh   Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
929*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
930*0d1ba665SWarner Losh   then the module will not build.
931*0d1ba665SWarner Losh 
932*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
933*0d1ba665SWarner Losh 
934*0d1ba665SWarner Losh   @param   Guid           Pointer to a 128-bit unique value that designates
935*0d1ba665SWarner Losh                           which namespace to retrieve a value from.
936*0d1ba665SWarner Losh   @param   TokenName      The name of the PCD token to set the current value for.
937*0d1ba665SWarner Losh   @param   Value          The Boolean value to set.
938*0d1ba665SWarner Losh 
939*0d1ba665SWarner Losh   @return Return the Value that was set.
940*0d1ba665SWarner Losh 
941*0d1ba665SWarner Losh **/
942*0d1ba665SWarner Losh #define PcdSetExBool(Guid, TokenName, Value) \
943*0d1ba665SWarner Losh                                             LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))
944*0d1ba665SWarner Losh #endif
945*0d1ba665SWarner Losh 
946*0d1ba665SWarner Losh /**
947*0d1ba665SWarner Losh   Sets an 8-bit PCD token value based on a GUID and a token name.
948*0d1ba665SWarner Losh 
949*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by Guid and TokenName.
950*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
951*0d1ba665SWarner Losh   then the module will not build.
952*0d1ba665SWarner Losh 
953*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
954*0d1ba665SWarner Losh 
955*0d1ba665SWarner Losh   @param Guid       Pointer to a 128-bit unique value that designates
956*0d1ba665SWarner Losh                     which namespace to retrieve a value from.
957*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to set the current value for.
958*0d1ba665SWarner Losh   @param Value      The 8-bit value to set.
959*0d1ba665SWarner Losh 
960*0d1ba665SWarner Losh   @return The status of the set operation.
961*0d1ba665SWarner Losh 
962*0d1ba665SWarner Losh **/
963*0d1ba665SWarner Losh #define PcdSetEx8S(Guid, TokenName, Value)     LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
964*0d1ba665SWarner Losh 
965*0d1ba665SWarner Losh /**
966*0d1ba665SWarner Losh   Sets an 16-bit PCD token value based on a GUID and a token name.
967*0d1ba665SWarner Losh 
968*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by Guid and TokenName.
969*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
970*0d1ba665SWarner Losh   then the module will not build.
971*0d1ba665SWarner Losh 
972*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
973*0d1ba665SWarner Losh 
974*0d1ba665SWarner Losh   @param Guid       Pointer to a 128-bit unique value that designates
975*0d1ba665SWarner Losh                     which namespace to retrieve a value from.
976*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to set the current value for.
977*0d1ba665SWarner Losh   @param Value      The 16-bit value to set.
978*0d1ba665SWarner Losh 
979*0d1ba665SWarner Losh   @return The status of the set operation.
980*0d1ba665SWarner Losh 
981*0d1ba665SWarner Losh **/
982*0d1ba665SWarner Losh #define PcdSetEx16S(Guid, TokenName, Value)    LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
983*0d1ba665SWarner Losh 
984*0d1ba665SWarner Losh /**
985*0d1ba665SWarner Losh   Sets an 32-bit PCD token value based on a GUID and a token name.
986*0d1ba665SWarner Losh 
987*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by Guid and TokenName.
988*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
989*0d1ba665SWarner Losh   then the module will not build.
990*0d1ba665SWarner Losh 
991*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
992*0d1ba665SWarner Losh 
993*0d1ba665SWarner Losh   @param Guid       Pointer to a 128-bit unique value that designates
994*0d1ba665SWarner Losh                     which namespace to retrieve a value from.
995*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to set the current value for.
996*0d1ba665SWarner Losh   @param Value      The 32-bit value to set.
997*0d1ba665SWarner Losh 
998*0d1ba665SWarner Losh   @return The status of the set operation.
999*0d1ba665SWarner Losh 
1000*0d1ba665SWarner Losh **/
1001*0d1ba665SWarner Losh #define PcdSetEx32S(Guid, TokenName, Value)    LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
1002*0d1ba665SWarner Losh 
1003*0d1ba665SWarner Losh /**
1004*0d1ba665SWarner Losh   Sets an 64-bit PCD token value based on a GUID and a token name.
1005*0d1ba665SWarner Losh 
1006*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by Guid and TokenName.
1007*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
1008*0d1ba665SWarner Losh   then the module will not build.
1009*0d1ba665SWarner Losh 
1010*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1011*0d1ba665SWarner Losh 
1012*0d1ba665SWarner Losh   @param Guid       Pointer to a 128-bit unique value that designates
1013*0d1ba665SWarner Losh                     which namespace to retrieve a value from.
1014*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to set the current value for.
1015*0d1ba665SWarner Losh   @param Value      The 64-bit value to set.
1016*0d1ba665SWarner Losh 
1017*0d1ba665SWarner Losh   @return The status of the set operation.
1018*0d1ba665SWarner Losh 
1019*0d1ba665SWarner Losh **/
1020*0d1ba665SWarner Losh #define PcdSetEx64S(Guid, TokenName, Value)    LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
1021*0d1ba665SWarner Losh 
1022*0d1ba665SWarner Losh /**
1023*0d1ba665SWarner Losh   Sets a pointer to a PCD token buffer based on a GUID and a token name.
1024*0d1ba665SWarner Losh 
1025*0d1ba665SWarner Losh   Sets the buffer for the token specified by Guid and TokenName.
1026*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
1027*0d1ba665SWarner Losh   then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
1028*0d1ba665SWarner Losh   RETURN_INVALID_PARAMETER to indicate that the set operation was not actually performed.
1029*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size
1030*0d1ba665SWarner Losh   supported by Guid and TokenName and RETURN_INVALID_PARAMETER must be returned.
1031*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
1032*0d1ba665SWarner Losh   then the module will not build.
1033*0d1ba665SWarner Losh 
1034*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1035*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
1036*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1037*0d1ba665SWarner Losh 
1038*0d1ba665SWarner Losh   @param Guid           Pointer to a 128-bit unique value that designates
1039*0d1ba665SWarner Losh                         which namespace to retrieve a value from.
1040*0d1ba665SWarner Losh   @param TokenName      The name of the PCD token to set the current value for.
1041*0d1ba665SWarner Losh   @param SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
1042*0d1ba665SWarner Losh   @param Buffer         Pointer to the buffer to set.
1043*0d1ba665SWarner Losh 
1044*0d1ba665SWarner Losh   @return The status of the set operation.
1045*0d1ba665SWarner Losh 
1046*0d1ba665SWarner Losh **/
1047*0d1ba665SWarner Losh #define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \
1048*0d1ba665SWarner Losh                                             LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
1049*0d1ba665SWarner Losh 
1050*0d1ba665SWarner Losh 
1051*0d1ba665SWarner Losh /**
1052*0d1ba665SWarner Losh   Sets an boolean PCD token value based on a GUID and a token name.
1053*0d1ba665SWarner Losh 
1054*0d1ba665SWarner Losh   Sets the boolean value for the token specified by Guid and TokenName.
1055*0d1ba665SWarner Losh   If TokenName is not a valid token in the token space specified by Guid,
1056*0d1ba665SWarner Losh   then the module will not build.
1057*0d1ba665SWarner Losh 
1058*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1059*0d1ba665SWarner Losh 
1060*0d1ba665SWarner Losh   @param Guid       Pointer to a 128-bit unique value that designates
1061*0d1ba665SWarner Losh                     which namespace to retrieve a value from.
1062*0d1ba665SWarner Losh   @param TokenName  The name of the PCD token to set the current value for.
1063*0d1ba665SWarner Losh   @param Value      The boolean value to set.
1064*0d1ba665SWarner Losh 
1065*0d1ba665SWarner Losh   @return The status of the set operation.
1066*0d1ba665SWarner Losh 
1067*0d1ba665SWarner Losh **/
1068*0d1ba665SWarner Losh #define PcdSetExBoolS(Guid, TokenName, Value) \
1069*0d1ba665SWarner Losh                                             LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))
1070*0d1ba665SWarner Losh 
1071*0d1ba665SWarner Losh /**
1072*0d1ba665SWarner Losh   This function provides a means by which SKU support can be established in the PCD infrastructure.
1073*0d1ba665SWarner Losh 
1074*0d1ba665SWarner Losh   Sets the current SKU in the PCD database to the value specified by SkuId.  SkuId is returned.
1075*0d1ba665SWarner Losh 
1076*0d1ba665SWarner Losh   @param  SkuId   The SKU value that will be used when the PCD service retrieves and sets values
1077*0d1ba665SWarner Losh                   associated with a PCD token.
1078*0d1ba665SWarner Losh 
1079*0d1ba665SWarner Losh   @return  Return the SKU ID that was set.
1080*0d1ba665SWarner Losh 
1081*0d1ba665SWarner Losh **/
1082*0d1ba665SWarner Losh UINTN
1083*0d1ba665SWarner Losh EFIAPI
1084*0d1ba665SWarner Losh LibPcdSetSku (
1085*0d1ba665SWarner Losh   IN UINTN   SkuId
1086*0d1ba665SWarner Losh   );
1087*0d1ba665SWarner Losh 
1088*0d1ba665SWarner Losh 
1089*0d1ba665SWarner Losh /**
1090*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1091*0d1ba665SWarner Losh 
1092*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by TokenNumber.
1093*0d1ba665SWarner Losh 
1094*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1095*0d1ba665SWarner Losh 
1096*0d1ba665SWarner Losh   @return Returns the 8-bit value for the token specified by TokenNumber.
1097*0d1ba665SWarner Losh 
1098*0d1ba665SWarner Losh **/
1099*0d1ba665SWarner Losh UINT8
1100*0d1ba665SWarner Losh EFIAPI
1101*0d1ba665SWarner Losh LibPcdGet8 (
1102*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1103*0d1ba665SWarner Losh   );
1104*0d1ba665SWarner Losh 
1105*0d1ba665SWarner Losh 
1106*0d1ba665SWarner Losh /**
1107*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1108*0d1ba665SWarner Losh 
1109*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by TokenNumber.
1110*0d1ba665SWarner Losh 
1111*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1112*0d1ba665SWarner Losh 
1113*0d1ba665SWarner Losh   @return Returns the 16-bit value for the token specified by TokenNumber.
1114*0d1ba665SWarner Losh 
1115*0d1ba665SWarner Losh **/
1116*0d1ba665SWarner Losh UINT16
1117*0d1ba665SWarner Losh EFIAPI
1118*0d1ba665SWarner Losh LibPcdGet16 (
1119*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1120*0d1ba665SWarner Losh   );
1121*0d1ba665SWarner Losh 
1122*0d1ba665SWarner Losh 
1123*0d1ba665SWarner Losh /**
1124*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1125*0d1ba665SWarner Losh 
1126*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by TokenNumber.
1127*0d1ba665SWarner Losh 
1128*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1129*0d1ba665SWarner Losh 
1130*0d1ba665SWarner Losh   @return Returns the 32-bit value for the token specified by TokenNumber.
1131*0d1ba665SWarner Losh 
1132*0d1ba665SWarner Losh **/
1133*0d1ba665SWarner Losh UINT32
1134*0d1ba665SWarner Losh EFIAPI
1135*0d1ba665SWarner Losh LibPcdGet32 (
1136*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1137*0d1ba665SWarner Losh   );
1138*0d1ba665SWarner Losh 
1139*0d1ba665SWarner Losh 
1140*0d1ba665SWarner Losh /**
1141*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1142*0d1ba665SWarner Losh 
1143*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by TokenNumber.
1144*0d1ba665SWarner Losh 
1145*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1146*0d1ba665SWarner Losh 
1147*0d1ba665SWarner Losh   @return Returns the 64-bit value for the token specified by TokenNumber.
1148*0d1ba665SWarner Losh 
1149*0d1ba665SWarner Losh **/
1150*0d1ba665SWarner Losh UINT64
1151*0d1ba665SWarner Losh EFIAPI
1152*0d1ba665SWarner Losh LibPcdGet64 (
1153*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1154*0d1ba665SWarner Losh   );
1155*0d1ba665SWarner Losh 
1156*0d1ba665SWarner Losh 
1157*0d1ba665SWarner Losh /**
1158*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1159*0d1ba665SWarner Losh 
1160*0d1ba665SWarner Losh   Returns the pointer to the buffer of the token specified by TokenNumber.
1161*0d1ba665SWarner Losh 
1162*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1163*0d1ba665SWarner Losh 
1164*0d1ba665SWarner Losh   @return Returns the pointer to the token specified by TokenNumber.
1165*0d1ba665SWarner Losh 
1166*0d1ba665SWarner Losh **/
1167*0d1ba665SWarner Losh VOID *
1168*0d1ba665SWarner Losh EFIAPI
1169*0d1ba665SWarner Losh LibPcdGetPtr (
1170*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1171*0d1ba665SWarner Losh   );
1172*0d1ba665SWarner Losh 
1173*0d1ba665SWarner Losh 
1174*0d1ba665SWarner Losh /**
1175*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1176*0d1ba665SWarner Losh 
1177*0d1ba665SWarner Losh   Returns the Boolean value of the token specified by TokenNumber.
1178*0d1ba665SWarner Losh 
1179*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1180*0d1ba665SWarner Losh 
1181*0d1ba665SWarner Losh   @return Returns the Boolean value of the token specified by TokenNumber.
1182*0d1ba665SWarner Losh 
1183*0d1ba665SWarner Losh **/
1184*0d1ba665SWarner Losh BOOLEAN
1185*0d1ba665SWarner Losh EFIAPI
1186*0d1ba665SWarner Losh LibPcdGetBool (
1187*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1188*0d1ba665SWarner Losh   );
1189*0d1ba665SWarner Losh 
1190*0d1ba665SWarner Losh 
1191*0d1ba665SWarner Losh /**
1192*0d1ba665SWarner Losh   This function provides a means by which to retrieve the size of a given PCD token.
1193*0d1ba665SWarner Losh 
1194*0d1ba665SWarner Losh   @param[in]  TokenNumber The PCD token number to retrieve a current value for.
1195*0d1ba665SWarner Losh 
1196*0d1ba665SWarner Losh   @return Returns the size of the token specified by TokenNumber.
1197*0d1ba665SWarner Losh 
1198*0d1ba665SWarner Losh **/
1199*0d1ba665SWarner Losh UINTN
1200*0d1ba665SWarner Losh EFIAPI
1201*0d1ba665SWarner Losh LibPcdGetSize (
1202*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1203*0d1ba665SWarner Losh   );
1204*0d1ba665SWarner Losh 
1205*0d1ba665SWarner Losh 
1206*0d1ba665SWarner Losh /**
1207*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1208*0d1ba665SWarner Losh 
1209*0d1ba665SWarner Losh   Returns the 8-bit value for the token specified by TokenNumber and Guid.
1210*0d1ba665SWarner Losh 
1211*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1212*0d1ba665SWarner Losh 
1213*0d1ba665SWarner Losh   @param[in]  Guid         Pointer to a 128-bit unique value that designates
1214*0d1ba665SWarner Losh                            which namespace to retrieve a value from.
1215*0d1ba665SWarner Losh   @param[in]  TokenNumber  The PCD token number to retrieve a current value for.
1216*0d1ba665SWarner Losh 
1217*0d1ba665SWarner Losh   @return Return the UINT8.
1218*0d1ba665SWarner Losh 
1219*0d1ba665SWarner Losh **/
1220*0d1ba665SWarner Losh UINT8
1221*0d1ba665SWarner Losh EFIAPI
1222*0d1ba665SWarner Losh LibPcdGetEx8 (
1223*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1224*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1225*0d1ba665SWarner Losh   );
1226*0d1ba665SWarner Losh 
1227*0d1ba665SWarner Losh 
1228*0d1ba665SWarner Losh /**
1229*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1230*0d1ba665SWarner Losh 
1231*0d1ba665SWarner Losh   Returns the 16-bit value for the token specified by TokenNumber and Guid.
1232*0d1ba665SWarner Losh 
1233*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1234*0d1ba665SWarner Losh 
1235*0d1ba665SWarner Losh   @param[in]  Guid         Pointer to a 128-bit unique value that designates
1236*0d1ba665SWarner Losh                            which namespace to retrieve a value from.
1237*0d1ba665SWarner Losh   @param[in]  TokenNumber  The PCD token number to retrieve a current value for.
1238*0d1ba665SWarner Losh 
1239*0d1ba665SWarner Losh   @return Return the UINT16.
1240*0d1ba665SWarner Losh 
1241*0d1ba665SWarner Losh **/
1242*0d1ba665SWarner Losh UINT16
1243*0d1ba665SWarner Losh EFIAPI
1244*0d1ba665SWarner Losh LibPcdGetEx16 (
1245*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1246*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1247*0d1ba665SWarner Losh   );
1248*0d1ba665SWarner Losh 
1249*0d1ba665SWarner Losh 
1250*0d1ba665SWarner Losh /**
1251*0d1ba665SWarner Losh   Returns the 32-bit value for the token specified by TokenNumber and Guid.
1252*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1253*0d1ba665SWarner Losh 
1254*0d1ba665SWarner Losh   @param[in]  Guid         Pointer to a 128-bit unique value that designates
1255*0d1ba665SWarner Losh                            which namespace to retrieve a value from.
1256*0d1ba665SWarner Losh   @param[in]  TokenNumber  The PCD token number to retrieve a current value for.
1257*0d1ba665SWarner Losh 
1258*0d1ba665SWarner Losh   @return Return the UINT32.
1259*0d1ba665SWarner Losh 
1260*0d1ba665SWarner Losh **/
1261*0d1ba665SWarner Losh UINT32
1262*0d1ba665SWarner Losh EFIAPI
1263*0d1ba665SWarner Losh LibPcdGetEx32 (
1264*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1265*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1266*0d1ba665SWarner Losh   );
1267*0d1ba665SWarner Losh 
1268*0d1ba665SWarner Losh 
1269*0d1ba665SWarner Losh /**
1270*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1271*0d1ba665SWarner Losh 
1272*0d1ba665SWarner Losh   Returns the 64-bit value for the token specified by TokenNumber and Guid.
1273*0d1ba665SWarner Losh 
1274*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1275*0d1ba665SWarner Losh 
1276*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that designates
1277*0d1ba665SWarner Losh                             which namespace to retrieve a value from.
1278*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to retrieve a current value for.
1279*0d1ba665SWarner Losh 
1280*0d1ba665SWarner Losh   @return Return the UINT64.
1281*0d1ba665SWarner Losh 
1282*0d1ba665SWarner Losh **/
1283*0d1ba665SWarner Losh UINT64
1284*0d1ba665SWarner Losh EFIAPI
1285*0d1ba665SWarner Losh LibPcdGetEx64 (
1286*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1287*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1288*0d1ba665SWarner Losh   );
1289*0d1ba665SWarner Losh 
1290*0d1ba665SWarner Losh 
1291*0d1ba665SWarner Losh /**
1292*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1293*0d1ba665SWarner Losh 
1294*0d1ba665SWarner Losh   Returns the pointer to the buffer of token specified by TokenNumber and Guid.
1295*0d1ba665SWarner Losh 
1296*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1297*0d1ba665SWarner Losh 
1298*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that designates
1299*0d1ba665SWarner Losh                             which namespace to retrieve a value from.
1300*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to retrieve a current value for.
1301*0d1ba665SWarner Losh 
1302*0d1ba665SWarner Losh   @return Return the VOID* pointer.
1303*0d1ba665SWarner Losh 
1304*0d1ba665SWarner Losh **/
1305*0d1ba665SWarner Losh VOID *
1306*0d1ba665SWarner Losh EFIAPI
1307*0d1ba665SWarner Losh LibPcdGetExPtr (
1308*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1309*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1310*0d1ba665SWarner Losh   );
1311*0d1ba665SWarner Losh 
1312*0d1ba665SWarner Losh 
1313*0d1ba665SWarner Losh /**
1314*0d1ba665SWarner Losh   This function provides a means by which to retrieve a value for a given PCD token.
1315*0d1ba665SWarner Losh 
1316*0d1ba665SWarner Losh   Returns the Boolean value of the token specified by TokenNumber and Guid.
1317*0d1ba665SWarner Losh 
1318*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1319*0d1ba665SWarner Losh 
1320*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that designates
1321*0d1ba665SWarner Losh                             which namespace to retrieve a value from.
1322*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to retrieve a current value for.
1323*0d1ba665SWarner Losh 
1324*0d1ba665SWarner Losh   @return Return the BOOLEAN.
1325*0d1ba665SWarner Losh 
1326*0d1ba665SWarner Losh **/
1327*0d1ba665SWarner Losh BOOLEAN
1328*0d1ba665SWarner Losh EFIAPI
1329*0d1ba665SWarner Losh LibPcdGetExBool (
1330*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1331*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1332*0d1ba665SWarner Losh   );
1333*0d1ba665SWarner Losh 
1334*0d1ba665SWarner Losh 
1335*0d1ba665SWarner Losh /**
1336*0d1ba665SWarner Losh   This function provides a means by which to retrieve the size of a given PCD token.
1337*0d1ba665SWarner Losh 
1338*0d1ba665SWarner Losh   Returns the size of the token specified by TokenNumber and Guid.
1339*0d1ba665SWarner Losh 
1340*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1341*0d1ba665SWarner Losh 
1342*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that designates
1343*0d1ba665SWarner Losh                             which namespace to retrieve a value from.
1344*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to retrieve a current value for.
1345*0d1ba665SWarner Losh 
1346*0d1ba665SWarner Losh   @return Return the size.
1347*0d1ba665SWarner Losh 
1348*0d1ba665SWarner Losh **/
1349*0d1ba665SWarner Losh UINTN
1350*0d1ba665SWarner Losh EFIAPI
1351*0d1ba665SWarner Losh LibPcdGetExSize (
1352*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1353*0d1ba665SWarner Losh   IN UINTN             TokenNumber
1354*0d1ba665SWarner Losh   );
1355*0d1ba665SWarner Losh 
1356*0d1ba665SWarner Losh 
1357*0d1ba665SWarner Losh #ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1358*0d1ba665SWarner Losh /**
1359*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1360*0d1ba665SWarner Losh 
1361*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenNumber
1362*0d1ba665SWarner Losh   to the value specified by Value.  Value is returned.
1363*0d1ba665SWarner Losh 
1364*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1365*0d1ba665SWarner Losh   @param[in]  Value         The 8-bit value to set.
1366*0d1ba665SWarner Losh 
1367*0d1ba665SWarner Losh   @return Return the Value that was set.
1368*0d1ba665SWarner Losh 
1369*0d1ba665SWarner Losh **/
1370*0d1ba665SWarner Losh UINT8
1371*0d1ba665SWarner Losh EFIAPI
1372*0d1ba665SWarner Losh LibPcdSet8 (
1373*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1374*0d1ba665SWarner Losh   IN UINT8             Value
1375*0d1ba665SWarner Losh   );
1376*0d1ba665SWarner Losh 
1377*0d1ba665SWarner Losh 
1378*0d1ba665SWarner Losh /**
1379*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1380*0d1ba665SWarner Losh 
1381*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenNumber
1382*0d1ba665SWarner Losh   to the value specified by Value.  Value is returned.
1383*0d1ba665SWarner Losh 
1384*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1385*0d1ba665SWarner Losh   @param[in]  Value         The 16-bit value to set.
1386*0d1ba665SWarner Losh 
1387*0d1ba665SWarner Losh   @return Return the Value that was set.
1388*0d1ba665SWarner Losh 
1389*0d1ba665SWarner Losh **/
1390*0d1ba665SWarner Losh UINT16
1391*0d1ba665SWarner Losh EFIAPI
1392*0d1ba665SWarner Losh LibPcdSet16 (
1393*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1394*0d1ba665SWarner Losh   IN UINT16            Value
1395*0d1ba665SWarner Losh   );
1396*0d1ba665SWarner Losh 
1397*0d1ba665SWarner Losh 
1398*0d1ba665SWarner Losh /**
1399*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1400*0d1ba665SWarner Losh 
1401*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenNumber
1402*0d1ba665SWarner Losh   to the value specified by Value.  Value is returned.
1403*0d1ba665SWarner Losh 
1404*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1405*0d1ba665SWarner Losh   @param[in]  Value         The 32-bit value to set.
1406*0d1ba665SWarner Losh 
1407*0d1ba665SWarner Losh   @return Return the Value that was set.
1408*0d1ba665SWarner Losh 
1409*0d1ba665SWarner Losh **/
1410*0d1ba665SWarner Losh UINT32
1411*0d1ba665SWarner Losh EFIAPI
1412*0d1ba665SWarner Losh LibPcdSet32 (
1413*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1414*0d1ba665SWarner Losh   IN UINT32            Value
1415*0d1ba665SWarner Losh   );
1416*0d1ba665SWarner Losh 
1417*0d1ba665SWarner Losh 
1418*0d1ba665SWarner Losh /**
1419*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1420*0d1ba665SWarner Losh 
1421*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenNumber
1422*0d1ba665SWarner Losh   to the value specified by Value.  Value is returned.
1423*0d1ba665SWarner Losh 
1424*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1425*0d1ba665SWarner Losh   @param[in]  Value         The 64-bit value to set.
1426*0d1ba665SWarner Losh 
1427*0d1ba665SWarner Losh   @return Return the Value that was set.
1428*0d1ba665SWarner Losh 
1429*0d1ba665SWarner Losh **/
1430*0d1ba665SWarner Losh UINT64
1431*0d1ba665SWarner Losh EFIAPI
1432*0d1ba665SWarner Losh LibPcdSet64 (
1433*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1434*0d1ba665SWarner Losh   IN UINT64            Value
1435*0d1ba665SWarner Losh   );
1436*0d1ba665SWarner Losh 
1437*0d1ba665SWarner Losh 
1438*0d1ba665SWarner Losh /**
1439*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1440*0d1ba665SWarner Losh 
1441*0d1ba665SWarner Losh   Sets a buffer for the token specified by TokenNumber to the value
1442*0d1ba665SWarner Losh   specified by Buffer and SizeOfBuffer.  Buffer is returned.
1443*0d1ba665SWarner Losh   If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1444*0d1ba665SWarner Losh   then set SizeOfBuffer to the maximum size supported by TokenNumber and
1445*0d1ba665SWarner Losh   return NULL to indicate that the set operation was not actually performed.
1446*0d1ba665SWarner Losh 
1447*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1448*0d1ba665SWarner Losh   maximum size supported by TokenName and NULL must be returned.
1449*0d1ba665SWarner Losh 
1450*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
1451*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1452*0d1ba665SWarner Losh 
1453*0d1ba665SWarner Losh   @param[in]      TokenNumber   The PCD token number to set a current value for.
1454*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1455*0d1ba665SWarner Losh   @param[in]      Buffer        A pointer to the buffer to set.
1456*0d1ba665SWarner Losh 
1457*0d1ba665SWarner Losh   @return Return the pointer for the Buffer that was set.
1458*0d1ba665SWarner Losh 
1459*0d1ba665SWarner Losh **/
1460*0d1ba665SWarner Losh VOID *
1461*0d1ba665SWarner Losh EFIAPI
1462*0d1ba665SWarner Losh LibPcdSetPtr (
1463*0d1ba665SWarner Losh   IN        UINTN             TokenNumber,
1464*0d1ba665SWarner Losh   IN OUT    UINTN             *SizeOfBuffer,
1465*0d1ba665SWarner Losh   IN CONST  VOID              *Buffer
1466*0d1ba665SWarner Losh   );
1467*0d1ba665SWarner Losh 
1468*0d1ba665SWarner Losh 
1469*0d1ba665SWarner Losh /**
1470*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1471*0d1ba665SWarner Losh 
1472*0d1ba665SWarner Losh   Sets the Boolean value for the token specified by TokenNumber
1473*0d1ba665SWarner Losh   to the value specified by Value.  Value is returned.
1474*0d1ba665SWarner Losh 
1475*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1476*0d1ba665SWarner Losh   @param[in]  Value         The boolean value to set.
1477*0d1ba665SWarner Losh 
1478*0d1ba665SWarner Losh   @return Return the Value that was set.
1479*0d1ba665SWarner Losh 
1480*0d1ba665SWarner Losh **/
1481*0d1ba665SWarner Losh BOOLEAN
1482*0d1ba665SWarner Losh EFIAPI
1483*0d1ba665SWarner Losh LibPcdSetBool (
1484*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1485*0d1ba665SWarner Losh   IN BOOLEAN           Value
1486*0d1ba665SWarner Losh   );
1487*0d1ba665SWarner Losh 
1488*0d1ba665SWarner Losh 
1489*0d1ba665SWarner Losh /**
1490*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1491*0d1ba665SWarner Losh 
1492*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenNumber and
1493*0d1ba665SWarner Losh   Guid to the value specified by Value. Value is returned.
1494*0d1ba665SWarner Losh 
1495*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1496*0d1ba665SWarner Losh 
1497*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that
1498*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1499*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1500*0d1ba665SWarner Losh   @param[in]  Value         The 8-bit value to set.
1501*0d1ba665SWarner Losh 
1502*0d1ba665SWarner Losh   @return Return the Value that was set.
1503*0d1ba665SWarner Losh 
1504*0d1ba665SWarner Losh **/
1505*0d1ba665SWarner Losh UINT8
1506*0d1ba665SWarner Losh EFIAPI
1507*0d1ba665SWarner Losh LibPcdSetEx8 (
1508*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1509*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1510*0d1ba665SWarner Losh   IN UINT8             Value
1511*0d1ba665SWarner Losh   );
1512*0d1ba665SWarner Losh 
1513*0d1ba665SWarner Losh 
1514*0d1ba665SWarner Losh /**
1515*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1516*0d1ba665SWarner Losh 
1517*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenNumber and
1518*0d1ba665SWarner Losh   Guid to the value specified by Value. Value is returned.
1519*0d1ba665SWarner Losh 
1520*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1521*0d1ba665SWarner Losh 
1522*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that
1523*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1524*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1525*0d1ba665SWarner Losh   @param[in]  Value         The 16-bit value to set.
1526*0d1ba665SWarner Losh 
1527*0d1ba665SWarner Losh   @return Return the Value that was set.
1528*0d1ba665SWarner Losh 
1529*0d1ba665SWarner Losh **/
1530*0d1ba665SWarner Losh UINT16
1531*0d1ba665SWarner Losh EFIAPI
1532*0d1ba665SWarner Losh LibPcdSetEx16 (
1533*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1534*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1535*0d1ba665SWarner Losh   IN UINT16            Value
1536*0d1ba665SWarner Losh   );
1537*0d1ba665SWarner Losh 
1538*0d1ba665SWarner Losh 
1539*0d1ba665SWarner Losh /**
1540*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1541*0d1ba665SWarner Losh 
1542*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenNumber and
1543*0d1ba665SWarner Losh   Guid to the value specified by Value. Value is returned.
1544*0d1ba665SWarner Losh 
1545*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1546*0d1ba665SWarner Losh 
1547*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that
1548*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1549*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1550*0d1ba665SWarner Losh   @param[in]  Value         The 32-bit value to set.
1551*0d1ba665SWarner Losh 
1552*0d1ba665SWarner Losh   @return Return the Value that was set.
1553*0d1ba665SWarner Losh 
1554*0d1ba665SWarner Losh **/
1555*0d1ba665SWarner Losh UINT32
1556*0d1ba665SWarner Losh EFIAPI
1557*0d1ba665SWarner Losh LibPcdSetEx32 (
1558*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1559*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1560*0d1ba665SWarner Losh   IN UINT32            Value
1561*0d1ba665SWarner Losh   );
1562*0d1ba665SWarner Losh 
1563*0d1ba665SWarner Losh 
1564*0d1ba665SWarner Losh /**
1565*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1566*0d1ba665SWarner Losh 
1567*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenNumber and
1568*0d1ba665SWarner Losh   Guid to the value specified by Value. Value is returned.
1569*0d1ba665SWarner Losh 
1570*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1571*0d1ba665SWarner Losh 
1572*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that
1573*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1574*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1575*0d1ba665SWarner Losh   @param[in]  Value         The 64-bit value to set.
1576*0d1ba665SWarner Losh 
1577*0d1ba665SWarner Losh   @return Return the Value that was set.
1578*0d1ba665SWarner Losh 
1579*0d1ba665SWarner Losh **/
1580*0d1ba665SWarner Losh UINT64
1581*0d1ba665SWarner Losh EFIAPI
1582*0d1ba665SWarner Losh LibPcdSetEx64 (
1583*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1584*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1585*0d1ba665SWarner Losh   IN UINT64            Value
1586*0d1ba665SWarner Losh   );
1587*0d1ba665SWarner Losh 
1588*0d1ba665SWarner Losh 
1589*0d1ba665SWarner Losh /**
1590*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1591*0d1ba665SWarner Losh 
1592*0d1ba665SWarner Losh   Sets a buffer for the token specified by TokenNumber to the value specified by
1593*0d1ba665SWarner Losh   Buffer and SizeOfBuffer.  Buffer is returned.  If SizeOfBuffer is greater than
1594*0d1ba665SWarner Losh   the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1595*0d1ba665SWarner Losh   supported by TokenNumber and return NULL to indicate that the set operation
1596*0d1ba665SWarner Losh   was not actually performed.
1597*0d1ba665SWarner Losh 
1598*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1599*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
1600*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1601*0d1ba665SWarner Losh 
1602*0d1ba665SWarner Losh   @param[in]  Guid              Pointer to a 128-bit unique value that
1603*0d1ba665SWarner Losh                                 designates which namespace to set a value from.
1604*0d1ba665SWarner Losh   @param[in]  TokenNumber       The PCD token number to set a current value for.
1605*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1606*0d1ba665SWarner Losh   @param[in]  Buffer            A pointer to the buffer to set.
1607*0d1ba665SWarner Losh 
1608*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
1609*0d1ba665SWarner Losh 
1610*0d1ba665SWarner Losh **/
1611*0d1ba665SWarner Losh VOID *
1612*0d1ba665SWarner Losh EFIAPI
1613*0d1ba665SWarner Losh LibPcdSetExPtr (
1614*0d1ba665SWarner Losh   IN      CONST GUID        *Guid,
1615*0d1ba665SWarner Losh   IN      UINTN             TokenNumber,
1616*0d1ba665SWarner Losh   IN OUT  UINTN             *SizeOfBuffer,
1617*0d1ba665SWarner Losh   IN      VOID              *Buffer
1618*0d1ba665SWarner Losh   );
1619*0d1ba665SWarner Losh 
1620*0d1ba665SWarner Losh 
1621*0d1ba665SWarner Losh /**
1622*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1623*0d1ba665SWarner Losh 
1624*0d1ba665SWarner Losh   Sets the Boolean value for the token specified by TokenNumber and
1625*0d1ba665SWarner Losh   Guid to the value specified by Value. Value is returned.
1626*0d1ba665SWarner Losh 
1627*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1628*0d1ba665SWarner Losh 
1629*0d1ba665SWarner Losh   @param[in]  Guid          Pointer to a 128-bit unique value that
1630*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1631*0d1ba665SWarner Losh   @param[in]  TokenNumber   The PCD token number to set a current value for.
1632*0d1ba665SWarner Losh   @param[in]  Value         The Boolean value to set.
1633*0d1ba665SWarner Losh 
1634*0d1ba665SWarner Losh   @return Return the Value that was set.
1635*0d1ba665SWarner Losh 
1636*0d1ba665SWarner Losh **/
1637*0d1ba665SWarner Losh BOOLEAN
1638*0d1ba665SWarner Losh EFIAPI
1639*0d1ba665SWarner Losh LibPcdSetExBool (
1640*0d1ba665SWarner Losh   IN CONST GUID        *Guid,
1641*0d1ba665SWarner Losh   IN UINTN             TokenNumber,
1642*0d1ba665SWarner Losh   IN BOOLEAN           Value
1643*0d1ba665SWarner Losh   );
1644*0d1ba665SWarner Losh #endif
1645*0d1ba665SWarner Losh 
1646*0d1ba665SWarner Losh /**
1647*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1648*0d1ba665SWarner Losh 
1649*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenNumber
1650*0d1ba665SWarner Losh   to the value specified by Value.
1651*0d1ba665SWarner Losh 
1652*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1653*0d1ba665SWarner Losh   @param[in] Value          The 8-bit value to set.
1654*0d1ba665SWarner Losh 
1655*0d1ba665SWarner Losh   @return The status of the set operation.
1656*0d1ba665SWarner Losh 
1657*0d1ba665SWarner Losh **/
1658*0d1ba665SWarner Losh RETURN_STATUS
1659*0d1ba665SWarner Losh EFIAPI
1660*0d1ba665SWarner Losh LibPcdSet8S (
1661*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1662*0d1ba665SWarner Losh   IN UINT8          Value
1663*0d1ba665SWarner Losh   );
1664*0d1ba665SWarner Losh 
1665*0d1ba665SWarner Losh /**
1666*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1667*0d1ba665SWarner Losh 
1668*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenNumber
1669*0d1ba665SWarner Losh   to the value specified by Value.
1670*0d1ba665SWarner Losh 
1671*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1672*0d1ba665SWarner Losh   @param[in] Value          The 16-bit value to set.
1673*0d1ba665SWarner Losh 
1674*0d1ba665SWarner Losh   @return The status of the set operation.
1675*0d1ba665SWarner Losh 
1676*0d1ba665SWarner Losh **/
1677*0d1ba665SWarner Losh RETURN_STATUS
1678*0d1ba665SWarner Losh EFIAPI
1679*0d1ba665SWarner Losh LibPcdSet16S (
1680*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1681*0d1ba665SWarner Losh   IN UINT16         Value
1682*0d1ba665SWarner Losh   );
1683*0d1ba665SWarner Losh 
1684*0d1ba665SWarner Losh /**
1685*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1686*0d1ba665SWarner Losh 
1687*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenNumber
1688*0d1ba665SWarner Losh   to the value specified by Value.
1689*0d1ba665SWarner Losh 
1690*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1691*0d1ba665SWarner Losh   @param[in] Value          The 32-bit value to set.
1692*0d1ba665SWarner Losh 
1693*0d1ba665SWarner Losh   @return The status of the set operation.
1694*0d1ba665SWarner Losh 
1695*0d1ba665SWarner Losh **/
1696*0d1ba665SWarner Losh RETURN_STATUS
1697*0d1ba665SWarner Losh EFIAPI
1698*0d1ba665SWarner Losh LibPcdSet32S (
1699*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1700*0d1ba665SWarner Losh   IN UINT32         Value
1701*0d1ba665SWarner Losh   );
1702*0d1ba665SWarner Losh 
1703*0d1ba665SWarner Losh /**
1704*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1705*0d1ba665SWarner Losh 
1706*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenNumber
1707*0d1ba665SWarner Losh   to the value specified by Value.
1708*0d1ba665SWarner Losh 
1709*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1710*0d1ba665SWarner Losh   @param[in] Value          The 64-bit value to set.
1711*0d1ba665SWarner Losh 
1712*0d1ba665SWarner Losh   @return The status of the set operation.
1713*0d1ba665SWarner Losh 
1714*0d1ba665SWarner Losh **/
1715*0d1ba665SWarner Losh RETURN_STATUS
1716*0d1ba665SWarner Losh EFIAPI
1717*0d1ba665SWarner Losh LibPcdSet64S (
1718*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1719*0d1ba665SWarner Losh   IN UINT64         Value
1720*0d1ba665SWarner Losh   );
1721*0d1ba665SWarner Losh 
1722*0d1ba665SWarner Losh /**
1723*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1724*0d1ba665SWarner Losh 
1725*0d1ba665SWarner Losh   Sets a buffer for the token specified by TokenNumber to the value specified
1726*0d1ba665SWarner Losh   by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
1727*0d1ba665SWarner Losh   support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
1728*0d1ba665SWarner Losh   TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation
1729*0d1ba665SWarner Losh   was not actually performed.
1730*0d1ba665SWarner Losh 
1731*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1732*0d1ba665SWarner Losh   maximum size supported by TokenName and RETURN_INVALID_PARAMETER must be returned.
1733*0d1ba665SWarner Losh 
1734*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
1735*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1736*0d1ba665SWarner Losh 
1737*0d1ba665SWarner Losh   @param[in]      TokenNumber   The PCD token number to set a current value for.
1738*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1739*0d1ba665SWarner Losh   @param[in]      Buffer        A pointer to the buffer to set.
1740*0d1ba665SWarner Losh 
1741*0d1ba665SWarner Losh   @return The status of the set operation.
1742*0d1ba665SWarner Losh 
1743*0d1ba665SWarner Losh **/
1744*0d1ba665SWarner Losh RETURN_STATUS
1745*0d1ba665SWarner Losh EFIAPI
1746*0d1ba665SWarner Losh LibPcdSetPtrS (
1747*0d1ba665SWarner Losh   IN       UINTN    TokenNumber,
1748*0d1ba665SWarner Losh   IN OUT   UINTN    *SizeOfBuffer,
1749*0d1ba665SWarner Losh   IN CONST VOID     *Buffer
1750*0d1ba665SWarner Losh   );
1751*0d1ba665SWarner Losh 
1752*0d1ba665SWarner Losh /**
1753*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1754*0d1ba665SWarner Losh 
1755*0d1ba665SWarner Losh   Sets the boolean value for the token specified by TokenNumber
1756*0d1ba665SWarner Losh   to the value specified by Value.
1757*0d1ba665SWarner Losh 
1758*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1759*0d1ba665SWarner Losh   @param[in] Value          The boolean value to set.
1760*0d1ba665SWarner Losh 
1761*0d1ba665SWarner Losh   @return The status of the set operation.
1762*0d1ba665SWarner Losh 
1763*0d1ba665SWarner Losh **/
1764*0d1ba665SWarner Losh RETURN_STATUS
1765*0d1ba665SWarner Losh EFIAPI
1766*0d1ba665SWarner Losh LibPcdSetBoolS (
1767*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1768*0d1ba665SWarner Losh   IN BOOLEAN        Value
1769*0d1ba665SWarner Losh   );
1770*0d1ba665SWarner Losh 
1771*0d1ba665SWarner Losh /**
1772*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1773*0d1ba665SWarner Losh 
1774*0d1ba665SWarner Losh   Sets the 8-bit value for the token specified by TokenNumber
1775*0d1ba665SWarner Losh   to the value specified by Value.
1776*0d1ba665SWarner Losh 
1777*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1778*0d1ba665SWarner Losh 
1779*0d1ba665SWarner Losh   @param[in] Guid           The pointer to a 128-bit unique value that
1780*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1781*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1782*0d1ba665SWarner Losh   @param[in] Value          The 8-bit value to set.
1783*0d1ba665SWarner Losh 
1784*0d1ba665SWarner Losh   @return The status of the set operation.
1785*0d1ba665SWarner Losh 
1786*0d1ba665SWarner Losh **/
1787*0d1ba665SWarner Losh RETURN_STATUS
1788*0d1ba665SWarner Losh EFIAPI
1789*0d1ba665SWarner Losh LibPcdSetEx8S (
1790*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1791*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1792*0d1ba665SWarner Losh   IN UINT8          Value
1793*0d1ba665SWarner Losh   );
1794*0d1ba665SWarner Losh 
1795*0d1ba665SWarner Losh /**
1796*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1797*0d1ba665SWarner Losh 
1798*0d1ba665SWarner Losh   Sets the 16-bit value for the token specified by TokenNumber
1799*0d1ba665SWarner Losh   to the value specified by Value.
1800*0d1ba665SWarner Losh 
1801*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1802*0d1ba665SWarner Losh 
1803*0d1ba665SWarner Losh   @param[in] Guid           The pointer to a 128-bit unique value that
1804*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1805*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1806*0d1ba665SWarner Losh   @param[in] Value          The 16-bit value to set.
1807*0d1ba665SWarner Losh 
1808*0d1ba665SWarner Losh   @return The status of the set operation.
1809*0d1ba665SWarner Losh 
1810*0d1ba665SWarner Losh **/
1811*0d1ba665SWarner Losh RETURN_STATUS
1812*0d1ba665SWarner Losh EFIAPI
1813*0d1ba665SWarner Losh LibPcdSetEx16S (
1814*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1815*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1816*0d1ba665SWarner Losh   IN UINT16         Value
1817*0d1ba665SWarner Losh   );
1818*0d1ba665SWarner Losh 
1819*0d1ba665SWarner Losh /**
1820*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1821*0d1ba665SWarner Losh 
1822*0d1ba665SWarner Losh   Sets the 32-bit value for the token specified by TokenNumber
1823*0d1ba665SWarner Losh   to the value specified by Value.
1824*0d1ba665SWarner Losh 
1825*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1826*0d1ba665SWarner Losh 
1827*0d1ba665SWarner Losh   @param[in] Guid           The pointer to a 128-bit unique value that
1828*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1829*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1830*0d1ba665SWarner Losh   @param[in] Value          The 32-bit value to set.
1831*0d1ba665SWarner Losh 
1832*0d1ba665SWarner Losh   @return The status of the set operation.
1833*0d1ba665SWarner Losh 
1834*0d1ba665SWarner Losh **/
1835*0d1ba665SWarner Losh RETURN_STATUS
1836*0d1ba665SWarner Losh EFIAPI
1837*0d1ba665SWarner Losh LibPcdSetEx32S (
1838*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1839*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1840*0d1ba665SWarner Losh   IN UINT32         Value
1841*0d1ba665SWarner Losh   );
1842*0d1ba665SWarner Losh 
1843*0d1ba665SWarner Losh /**
1844*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1845*0d1ba665SWarner Losh 
1846*0d1ba665SWarner Losh   Sets the 64-bit value for the token specified by TokenNumber
1847*0d1ba665SWarner Losh   to the value specified by Value.
1848*0d1ba665SWarner Losh 
1849*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1850*0d1ba665SWarner Losh 
1851*0d1ba665SWarner Losh   @param[in] Guid           The pointer to a 128-bit unique value that
1852*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1853*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1854*0d1ba665SWarner Losh   @param[in] Value          The 64-bit value to set.
1855*0d1ba665SWarner Losh 
1856*0d1ba665SWarner Losh   @return The status of the set operation.
1857*0d1ba665SWarner Losh 
1858*0d1ba665SWarner Losh **/
1859*0d1ba665SWarner Losh RETURN_STATUS
1860*0d1ba665SWarner Losh EFIAPI
1861*0d1ba665SWarner Losh LibPcdSetEx64S (
1862*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1863*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1864*0d1ba665SWarner Losh   IN UINT64         Value
1865*0d1ba665SWarner Losh   );
1866*0d1ba665SWarner Losh 
1867*0d1ba665SWarner Losh /**
1868*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1869*0d1ba665SWarner Losh 
1870*0d1ba665SWarner Losh   Sets a buffer for the token specified by TokenNumber to the value specified by
1871*0d1ba665SWarner Losh   Buffer and SizeOfBuffer. If SizeOfBuffer is greater than the maximum size
1872*0d1ba665SWarner Losh   support by TokenNumber, then set SizeOfBuffer to the maximum size supported by
1873*0d1ba665SWarner Losh   TokenNumber and return RETURN_INVALID_PARAMETER to indicate that the set operation
1874*0d1ba665SWarner Losh   was not actually performed.
1875*0d1ba665SWarner Losh 
1876*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1877*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
1878*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1879*0d1ba665SWarner Losh 
1880*0d1ba665SWarner Losh   @param[in]      Guid          Pointer to a 128-bit unique value that
1881*0d1ba665SWarner Losh                                 designates which namespace to set a value from.
1882*0d1ba665SWarner Losh   @param[in]      TokenNumber   The PCD token number to set a current value for.
1883*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1884*0d1ba665SWarner Losh   @param[in]      Buffer        A pointer to the buffer to set.
1885*0d1ba665SWarner Losh 
1886*0d1ba665SWarner Losh   @return The status of the set operation.
1887*0d1ba665SWarner Losh 
1888*0d1ba665SWarner Losh **/
1889*0d1ba665SWarner Losh RETURN_STATUS
1890*0d1ba665SWarner Losh EFIAPI
1891*0d1ba665SWarner Losh LibPcdSetExPtrS (
1892*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1893*0d1ba665SWarner Losh   IN       UINTN    TokenNumber,
1894*0d1ba665SWarner Losh   IN OUT   UINTN    *SizeOfBuffer,
1895*0d1ba665SWarner Losh   IN       VOID     *Buffer
1896*0d1ba665SWarner Losh   );
1897*0d1ba665SWarner Losh 
1898*0d1ba665SWarner Losh /**
1899*0d1ba665SWarner Losh   This function provides a means by which to set a value for a given PCD token.
1900*0d1ba665SWarner Losh 
1901*0d1ba665SWarner Losh   Sets the boolean value for the token specified by TokenNumber
1902*0d1ba665SWarner Losh   to the value specified by Value.
1903*0d1ba665SWarner Losh 
1904*0d1ba665SWarner Losh   If Guid is NULL, then ASSERT().
1905*0d1ba665SWarner Losh 
1906*0d1ba665SWarner Losh   @param[in] Guid           The pointer to a 128-bit unique value that
1907*0d1ba665SWarner Losh                             designates which namespace to set a value from.
1908*0d1ba665SWarner Losh   @param[in] TokenNumber    The PCD token number to set a current value for.
1909*0d1ba665SWarner Losh   @param[in] Value          The boolean value to set.
1910*0d1ba665SWarner Losh 
1911*0d1ba665SWarner Losh   @return The status of the set operation.
1912*0d1ba665SWarner Losh 
1913*0d1ba665SWarner Losh **/
1914*0d1ba665SWarner Losh RETURN_STATUS
1915*0d1ba665SWarner Losh EFIAPI
1916*0d1ba665SWarner Losh LibPcdSetExBoolS (
1917*0d1ba665SWarner Losh   IN CONST GUID     *Guid,
1918*0d1ba665SWarner Losh   IN UINTN          TokenNumber,
1919*0d1ba665SWarner Losh   IN BOOLEAN        Value
1920*0d1ba665SWarner Losh   );
1921*0d1ba665SWarner Losh 
1922*0d1ba665SWarner Losh /**
1923*0d1ba665SWarner Losh   This notification function serves two purposes.
1924*0d1ba665SWarner Losh 
1925*0d1ba665SWarner Losh   Firstly, it notifies the module that did the registration that the value of this
1926*0d1ba665SWarner Losh   PCD token has been set.
1927*0d1ba665SWarner Losh   Secondly, it provides a mechanism for the module that did the registration to intercept
1928*0d1ba665SWarner Losh   the set operation and override the value been set if necessary. After the invocation of
1929*0d1ba665SWarner Losh   the callback function, TokenData will be used by PCD service PEIM or driver to modify th
1930*0d1ba665SWarner Losh   internal data in PCD database.
1931*0d1ba665SWarner Losh 
1932*0d1ba665SWarner Losh   @param[in]      CallBackGuid    The PCD token GUID being set.
1933*0d1ba665SWarner Losh   @param[in]      CallBackToken   The PCD token number being set.
1934*0d1ba665SWarner Losh   @param[in, out] TokenData       A pointer to the token data being set.
1935*0d1ba665SWarner Losh   @param[in]      TokenDataSize   The size, in bytes, of the data being set.
1936*0d1ba665SWarner Losh 
1937*0d1ba665SWarner Losh **/
1938*0d1ba665SWarner Losh typedef
1939*0d1ba665SWarner Losh VOID
1940*0d1ba665SWarner Losh (EFIAPI *PCD_CALLBACK)(
1941*0d1ba665SWarner Losh   IN        CONST GUID        *CallBackGuid, OPTIONAL
1942*0d1ba665SWarner Losh   IN        UINTN             CallBackToken,
1943*0d1ba665SWarner Losh   IN  OUT   VOID              *TokenData,
1944*0d1ba665SWarner Losh   IN        UINTN             TokenDataSize
1945*0d1ba665SWarner Losh   );
1946*0d1ba665SWarner Losh 
1947*0d1ba665SWarner Losh 
1948*0d1ba665SWarner Losh /**
1949*0d1ba665SWarner Losh   Set up a notification function that is called when a specified token is set.
1950*0d1ba665SWarner Losh 
1951*0d1ba665SWarner Losh   When the token specified by TokenNumber and Guid is set,
1952*0d1ba665SWarner Losh   then notification function specified by NotificationFunction is called.
1953*0d1ba665SWarner Losh   If Guid is NULL, then the default token space is used.
1954*0d1ba665SWarner Losh   If NotificationFunction is NULL, then ASSERT().
1955*0d1ba665SWarner Losh 
1956*0d1ba665SWarner Losh   @param[in]  Guid                  Pointer to a 128-bit unique value that designates which
1957*0d1ba665SWarner Losh                                     namespace to set a value from.  If NULL, then the default
1958*0d1ba665SWarner Losh                                     token space is used.
1959*0d1ba665SWarner Losh   @param[in]  TokenNumber           The PCD token number to monitor.
1960*0d1ba665SWarner Losh   @param[in]  NotificationFunction  The function to call when the token
1961*0d1ba665SWarner Losh                                     specified by Guid and TokenNumber is set.
1962*0d1ba665SWarner Losh 
1963*0d1ba665SWarner Losh **/
1964*0d1ba665SWarner Losh VOID
1965*0d1ba665SWarner Losh EFIAPI
1966*0d1ba665SWarner Losh LibPcdCallbackOnSet (
1967*0d1ba665SWarner Losh   IN CONST GUID               *Guid,       OPTIONAL
1968*0d1ba665SWarner Losh   IN UINTN                    TokenNumber,
1969*0d1ba665SWarner Losh   IN PCD_CALLBACK             NotificationFunction
1970*0d1ba665SWarner Losh   );
1971*0d1ba665SWarner Losh 
1972*0d1ba665SWarner Losh 
1973*0d1ba665SWarner Losh /**
1974*0d1ba665SWarner Losh   Disable a notification function that was established with LibPcdCallbackonSet().
1975*0d1ba665SWarner Losh 
1976*0d1ba665SWarner Losh   Disable a notification function that was previously established with LibPcdCallbackOnSet().
1977*0d1ba665SWarner Losh   If NotificationFunction is NULL, then ASSERT().
1978*0d1ba665SWarner Losh   If LibPcdCallbackOnSet() was not previously called with Guid, TokenNumber,
1979*0d1ba665SWarner Losh   and NotificationFunction, then ASSERT().
1980*0d1ba665SWarner Losh 
1981*0d1ba665SWarner Losh   @param[in]  Guid                 Specify the GUID token space.
1982*0d1ba665SWarner Losh   @param[in]  TokenNumber          Specify the token number.
1983*0d1ba665SWarner Losh   @param[in]  NotificationFunction The callback function to be unregistered.
1984*0d1ba665SWarner Losh 
1985*0d1ba665SWarner Losh **/
1986*0d1ba665SWarner Losh VOID
1987*0d1ba665SWarner Losh EFIAPI
1988*0d1ba665SWarner Losh LibPcdCancelCallback (
1989*0d1ba665SWarner Losh   IN CONST GUID               *Guid,       OPTIONAL
1990*0d1ba665SWarner Losh   IN UINTN                    TokenNumber,
1991*0d1ba665SWarner Losh   IN PCD_CALLBACK             NotificationFunction
1992*0d1ba665SWarner Losh   );
1993*0d1ba665SWarner Losh 
1994*0d1ba665SWarner Losh 
1995*0d1ba665SWarner Losh /**
1996*0d1ba665SWarner Losh   Retrieves the next token in a token space.
1997*0d1ba665SWarner Losh 
1998*0d1ba665SWarner Losh   Retrieves the next PCD token number from the token space specified by Guid.
1999*0d1ba665SWarner Losh   If Guid is NULL, then the default token space is used.  If TokenNumber is 0,
2000*0d1ba665SWarner Losh   then the first token number is returned.  Otherwise, the token number that
2001*0d1ba665SWarner Losh   follows TokenNumber in the token space is returned.  If TokenNumber is the last
2002*0d1ba665SWarner Losh   token number in the token space, then 0 is returned.
2003*0d1ba665SWarner Losh 
2004*0d1ba665SWarner Losh   If TokenNumber is not 0 and is not in the token space specified by Guid, then ASSERT().
2005*0d1ba665SWarner Losh 
2006*0d1ba665SWarner Losh   @param[in]  Guid        Pointer to a 128-bit unique value that designates which namespace
2007*0d1ba665SWarner Losh                           to set a value from.  If NULL, then the default token space is used.
2008*0d1ba665SWarner Losh   @param[in]  TokenNumber The previous PCD token number.  If 0, then retrieves the first PCD
2009*0d1ba665SWarner Losh                           token number.
2010*0d1ba665SWarner Losh 
2011*0d1ba665SWarner Losh   @return The next valid token number.
2012*0d1ba665SWarner Losh 
2013*0d1ba665SWarner Losh **/
2014*0d1ba665SWarner Losh UINTN
2015*0d1ba665SWarner Losh EFIAPI
2016*0d1ba665SWarner Losh LibPcdGetNextToken (
2017*0d1ba665SWarner Losh   IN CONST GUID               *Guid,       OPTIONAL
2018*0d1ba665SWarner Losh   IN UINTN                    TokenNumber
2019*0d1ba665SWarner Losh   );
2020*0d1ba665SWarner Losh 
2021*0d1ba665SWarner Losh 
2022*0d1ba665SWarner Losh 
2023*0d1ba665SWarner Losh /**
2024*0d1ba665SWarner Losh   Used to retrieve the list of available PCD token space GUIDs.
2025*0d1ba665SWarner Losh 
2026*0d1ba665SWarner Losh   Returns the PCD token space GUID that follows TokenSpaceGuid in the list of token spaces
2027*0d1ba665SWarner Losh   in the platform.
2028*0d1ba665SWarner Losh   If TokenSpaceGuid is NULL, then a pointer to the first PCD token spaces returned.
2029*0d1ba665SWarner Losh   If TokenSpaceGuid is the last PCD token space GUID in the list, then NULL is returned.
2030*0d1ba665SWarner Losh 
2031*0d1ba665SWarner Losh   @param  TokenSpaceGuid  Pointer to the a PCD token space GUID
2032*0d1ba665SWarner Losh 
2033*0d1ba665SWarner Losh   @return The next valid token namespace.
2034*0d1ba665SWarner Losh 
2035*0d1ba665SWarner Losh **/
2036*0d1ba665SWarner Losh GUID *
2037*0d1ba665SWarner Losh EFIAPI
2038*0d1ba665SWarner Losh LibPcdGetNextTokenSpace (
2039*0d1ba665SWarner Losh   IN CONST GUID  *TokenSpaceGuid
2040*0d1ba665SWarner Losh   );
2041*0d1ba665SWarner Losh 
2042*0d1ba665SWarner Losh 
2043*0d1ba665SWarner Losh /**
2044*0d1ba665SWarner Losh   Sets a value of a patchable PCD entry that is type pointer.
2045*0d1ba665SWarner Losh 
2046*0d1ba665SWarner Losh   Sets the PCD entry specified by PatchVariable to the value specified by Buffer
2047*0d1ba665SWarner Losh   and SizeOfBuffer.  Buffer is returned.  If SizeOfBuffer is greater than
2048*0d1ba665SWarner Losh   MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
2049*0d1ba665SWarner Losh   NULL to indicate that the set operation was not actually performed.
2050*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
2051*0d1ba665SWarner Losh   MaximumDatumSize and NULL must be returned.
2052*0d1ba665SWarner Losh 
2053*0d1ba665SWarner Losh   If PatchVariable is NULL, then ASSERT().
2054*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
2055*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
2056*0d1ba665SWarner Losh 
2057*0d1ba665SWarner Losh   @param[out] PatchVariable     A pointer to the global variable in a module that is
2058*0d1ba665SWarner Losh                                 the target of the set operation.
2059*0d1ba665SWarner Losh   @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
2060*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
2061*0d1ba665SWarner Losh   @param[in] Buffer             A pointer to the buffer to used to set the target variable.
2062*0d1ba665SWarner Losh 
2063*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
2064*0d1ba665SWarner Losh 
2065*0d1ba665SWarner Losh **/
2066*0d1ba665SWarner Losh VOID *
2067*0d1ba665SWarner Losh EFIAPI
2068*0d1ba665SWarner Losh LibPatchPcdSetPtr (
2069*0d1ba665SWarner Losh   OUT        VOID       *PatchVariable,
2070*0d1ba665SWarner Losh   IN        UINTN       MaximumDatumSize,
2071*0d1ba665SWarner Losh   IN OUT    UINTN       *SizeOfBuffer,
2072*0d1ba665SWarner Losh   IN CONST  VOID        *Buffer
2073*0d1ba665SWarner Losh   );
2074*0d1ba665SWarner Losh 
2075*0d1ba665SWarner Losh /**
2076*0d1ba665SWarner Losh   Sets a value of a patchable PCD entry that is type pointer.
2077*0d1ba665SWarner Losh 
2078*0d1ba665SWarner Losh   Sets the PCD entry specified by PatchVariable to the value specified
2079*0d1ba665SWarner Losh   by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
2080*0d1ba665SWarner Losh   then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
2081*0d1ba665SWarner Losh   to indicate that the set operation was not actually performed.
2082*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
2083*0d1ba665SWarner Losh   MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
2084*0d1ba665SWarner Losh 
2085*0d1ba665SWarner Losh   If PatchVariable is NULL, then ASSERT().
2086*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
2087*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
2088*0d1ba665SWarner Losh 
2089*0d1ba665SWarner Losh   @param[out] PatchVariable     A pointer to the global variable in a module that is
2090*0d1ba665SWarner Losh                                 the target of the set operation.
2091*0d1ba665SWarner Losh   @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
2092*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
2093*0d1ba665SWarner Losh   @param[in] Buffer             A pointer to the buffer to used to set the target variable.
2094*0d1ba665SWarner Losh 
2095*0d1ba665SWarner Losh   @return The status of the set operation.
2096*0d1ba665SWarner Losh 
2097*0d1ba665SWarner Losh **/
2098*0d1ba665SWarner Losh RETURN_STATUS
2099*0d1ba665SWarner Losh EFIAPI
2100*0d1ba665SWarner Losh LibPatchPcdSetPtrS (
2101*0d1ba665SWarner Losh   OUT      VOID     *PatchVariable,
2102*0d1ba665SWarner Losh   IN       UINTN    MaximumDatumSize,
2103*0d1ba665SWarner Losh   IN OUT   UINTN    *SizeOfBuffer,
2104*0d1ba665SWarner Losh   IN CONST VOID     *Buffer
2105*0d1ba665SWarner Losh   );
2106*0d1ba665SWarner Losh 
2107*0d1ba665SWarner Losh /**
2108*0d1ba665SWarner Losh   Sets a value and size of a patchable PCD entry that is type pointer.
2109*0d1ba665SWarner Losh 
2110*0d1ba665SWarner Losh   Sets the PCD entry specified by PatchVariable to the value specified by Buffer
2111*0d1ba665SWarner Losh   and SizeOfBuffer. Buffer is returned.  If SizeOfBuffer is greater than
2112*0d1ba665SWarner Losh   MaximumDatumSize, then set SizeOfBuffer to MaximumDatumSize and return
2113*0d1ba665SWarner Losh   NULL to indicate that the set operation was not actually performed.
2114*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
2115*0d1ba665SWarner Losh   MaximumDatumSize and NULL must be returned.
2116*0d1ba665SWarner Losh 
2117*0d1ba665SWarner Losh   If PatchVariable is NULL, then ASSERT().
2118*0d1ba665SWarner Losh   If SizeOfPatchVariable is NULL, then ASSERT().
2119*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
2120*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
2121*0d1ba665SWarner Losh 
2122*0d1ba665SWarner Losh   @param[out] PatchVariable     A pointer to the global variable in a module that is
2123*0d1ba665SWarner Losh                                 the target of the set operation.
2124*0d1ba665SWarner Losh   @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
2125*0d1ba665SWarner Losh   @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
2126*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
2127*0d1ba665SWarner Losh   @param[in] Buffer             A pointer to the buffer to used to set the target variable.
2128*0d1ba665SWarner Losh 
2129*0d1ba665SWarner Losh   @return Return the pointer to the Buffer that was set.
2130*0d1ba665SWarner Losh 
2131*0d1ba665SWarner Losh **/
2132*0d1ba665SWarner Losh VOID *
2133*0d1ba665SWarner Losh EFIAPI
2134*0d1ba665SWarner Losh LibPatchPcdSetPtrAndSize (
2135*0d1ba665SWarner Losh   OUT       VOID        *PatchVariable,
2136*0d1ba665SWarner Losh   OUT       UINTN       *SizeOfPatchVariable,
2137*0d1ba665SWarner Losh   IN        UINTN       MaximumDatumSize,
2138*0d1ba665SWarner Losh   IN OUT    UINTN       *SizeOfBuffer,
2139*0d1ba665SWarner Losh   IN CONST  VOID        *Buffer
2140*0d1ba665SWarner Losh   );
2141*0d1ba665SWarner Losh 
2142*0d1ba665SWarner Losh /**
2143*0d1ba665SWarner Losh   Sets a value and size of a patchable PCD entry that is type pointer.
2144*0d1ba665SWarner Losh 
2145*0d1ba665SWarner Losh   Sets the PCD entry specified by PatchVariable to the value specified
2146*0d1ba665SWarner Losh   by Buffer and SizeOfBuffer. If SizeOfBuffer is greater than MaximumDatumSize,
2147*0d1ba665SWarner Losh   then set SizeOfBuffer to MaximumDatumSize and return RETURN_INVALID_PARAMETER
2148*0d1ba665SWarner Losh   to indicate that the set operation was not actually performed.
2149*0d1ba665SWarner Losh   If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to
2150*0d1ba665SWarner Losh   MaximumDatumSize and RETURN_INVALID_PARAMETER must be returned.
2151*0d1ba665SWarner Losh 
2152*0d1ba665SWarner Losh   If PatchVariable is NULL, then ASSERT().
2153*0d1ba665SWarner Losh   If SizeOfPatchVariable is NULL, then ASSERT().
2154*0d1ba665SWarner Losh   If SizeOfBuffer is NULL, then ASSERT().
2155*0d1ba665SWarner Losh   If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
2156*0d1ba665SWarner Losh 
2157*0d1ba665SWarner Losh   @param[out] PatchVariable     A pointer to the global variable in a module that is
2158*0d1ba665SWarner Losh                                 the target of the set operation.
2159*0d1ba665SWarner Losh   @param[out] SizeOfPatchVariable A pointer to the size, in bytes, of PatchVariable.
2160*0d1ba665SWarner Losh   @param[in] MaximumDatumSize   The maximum size allowed for the PCD entry specified by PatchVariable.
2161*0d1ba665SWarner Losh   @param[in, out] SizeOfBuffer  A pointer to the size, in bytes, of Buffer.
2162*0d1ba665SWarner Losh   @param[in] Buffer             A pointer to the buffer to used to set the target variable.
2163*0d1ba665SWarner Losh 
2164*0d1ba665SWarner Losh   @return The status of the set operation.
2165*0d1ba665SWarner Losh 
2166*0d1ba665SWarner Losh **/
2167*0d1ba665SWarner Losh RETURN_STATUS
2168*0d1ba665SWarner Losh EFIAPI
2169*0d1ba665SWarner Losh LibPatchPcdSetPtrAndSizeS (
2170*0d1ba665SWarner Losh   OUT      VOID     *PatchVariable,
2171*0d1ba665SWarner Losh   OUT      UINTN    *SizeOfPatchVariable,
2172*0d1ba665SWarner Losh   IN       UINTN    MaximumDatumSize,
2173*0d1ba665SWarner Losh   IN OUT   UINTN    *SizeOfBuffer,
2174*0d1ba665SWarner Losh   IN CONST VOID     *Buffer
2175*0d1ba665SWarner Losh   );
2176*0d1ba665SWarner Losh 
2177*0d1ba665SWarner Losh typedef enum {
2178*0d1ba665SWarner Losh   PCD_TYPE_8,
2179*0d1ba665SWarner Losh   PCD_TYPE_16,
2180*0d1ba665SWarner Losh   PCD_TYPE_32,
2181*0d1ba665SWarner Losh   PCD_TYPE_64,
2182*0d1ba665SWarner Losh   PCD_TYPE_BOOL,
2183*0d1ba665SWarner Losh   PCD_TYPE_PTR
2184*0d1ba665SWarner Losh } PCD_TYPE;
2185*0d1ba665SWarner Losh 
2186*0d1ba665SWarner Losh typedef struct {
2187*0d1ba665SWarner Losh   ///
2188*0d1ba665SWarner Losh   /// The returned information associated with the requested TokenNumber. If
2189*0d1ba665SWarner Losh   /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
2190*0d1ba665SWarner Losh   ///
2191*0d1ba665SWarner Losh   PCD_TYPE          PcdType;
2192*0d1ba665SWarner Losh   ///
2193*0d1ba665SWarner Losh   /// The size of the data in bytes associated with the TokenNumber specified. If
2194*0d1ba665SWarner Losh   /// TokenNumber is 0, then PcdSize is set 0.
2195*0d1ba665SWarner Losh   ///
2196*0d1ba665SWarner Losh   UINTN             PcdSize;
2197*0d1ba665SWarner Losh   ///
2198*0d1ba665SWarner Losh   /// The null-terminated ASCII string associated with a given token. If the
2199*0d1ba665SWarner Losh   /// TokenNumber specified was 0, then this field corresponds to the null-terminated
2200*0d1ba665SWarner Losh   /// ASCII string associated with the token's namespace Guid. If NULL, there is no
2201*0d1ba665SWarner Losh   /// name associated with this request.
2202*0d1ba665SWarner Losh   ///
2203*0d1ba665SWarner Losh   CHAR8             *PcdName;
2204*0d1ba665SWarner Losh } PCD_INFO;
2205*0d1ba665SWarner Losh 
2206*0d1ba665SWarner Losh 
2207*0d1ba665SWarner Losh /**
2208*0d1ba665SWarner Losh   Retrieve additional information associated with a PCD token.
2209*0d1ba665SWarner Losh 
2210*0d1ba665SWarner Losh   This includes information such as the type of value the TokenNumber is associated with as well as possible
2211*0d1ba665SWarner Losh   human readable name that is associated with the token.
2212*0d1ba665SWarner Losh 
2213*0d1ba665SWarner Losh   If TokenNumber is not in the default token space specified, then ASSERT().
2214*0d1ba665SWarner Losh 
2215*0d1ba665SWarner Losh   @param[in]    TokenNumber The PCD token number.
2216*0d1ba665SWarner Losh   @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
2217*0d1ba665SWarner Losh                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
2218*0d1ba665SWarner Losh **/
2219*0d1ba665SWarner Losh VOID
2220*0d1ba665SWarner Losh EFIAPI
2221*0d1ba665SWarner Losh LibPcdGetInfo (
2222*0d1ba665SWarner Losh   IN        UINTN           TokenNumber,
2223*0d1ba665SWarner Losh   OUT       PCD_INFO        *PcdInfo
2224*0d1ba665SWarner Losh   );
2225*0d1ba665SWarner Losh 
2226*0d1ba665SWarner Losh /**
2227*0d1ba665SWarner Losh   Retrieve additional information associated with a PCD token.
2228*0d1ba665SWarner Losh 
2229*0d1ba665SWarner Losh   This includes information such as the type of value the TokenNumber is associated with as well as possible
2230*0d1ba665SWarner Losh   human readable name that is associated with the token.
2231*0d1ba665SWarner Losh 
2232*0d1ba665SWarner Losh   If TokenNumber is not in the token space specified by Guid, then ASSERT().
2233*0d1ba665SWarner Losh 
2234*0d1ba665SWarner Losh   @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.
2235*0d1ba665SWarner Losh   @param[in]    TokenNumber The PCD token number.
2236*0d1ba665SWarner Losh   @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.
2237*0d1ba665SWarner Losh                             The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.
2238*0d1ba665SWarner Losh **/
2239*0d1ba665SWarner Losh VOID
2240*0d1ba665SWarner Losh EFIAPI
2241*0d1ba665SWarner Losh LibPcdGetInfoEx (
2242*0d1ba665SWarner Losh   IN CONST  GUID            *Guid,
2243*0d1ba665SWarner Losh   IN        UINTN           TokenNumber,
2244*0d1ba665SWarner Losh   OUT       PCD_INFO        *PcdInfo
2245*0d1ba665SWarner Losh   );
2246*0d1ba665SWarner Losh 
2247*0d1ba665SWarner Losh /**
2248*0d1ba665SWarner Losh   Retrieve the currently set SKU Id.
2249*0d1ba665SWarner Losh 
2250*0d1ba665SWarner Losh   @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the
2251*0d1ba665SWarner Losh             default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU
2252*0d1ba665SWarner Losh             Id is returned.
2253*0d1ba665SWarner Losh **/
2254*0d1ba665SWarner Losh UINTN
2255*0d1ba665SWarner Losh EFIAPI
2256*0d1ba665SWarner Losh LibPcdGetSku (
2257*0d1ba665SWarner Losh   VOID
2258*0d1ba665SWarner Losh   );
2259*0d1ba665SWarner Losh 
2260*0d1ba665SWarner Losh #endif
2261