TianoCore EDK2 master
PcdLib.h
Go to the documentation of this file.
1
22#ifndef __PCD_LIB_H__
23#define __PCD_LIB_H__
24
36#define PcdToken(TokenName) _PCD_TOKEN_##TokenName
37
50#define FeaturePcdGet(TokenName) _PCD_GET_MODE_BOOL_##TokenName
51
64#define FixedPcdGet8(TokenName) _PCD_VALUE_##TokenName
65
78#define FixedPcdGet16(TokenName) _PCD_VALUE_##TokenName
79
92#define FixedPcdGet32(TokenName) _PCD_VALUE_##TokenName
93
106#define FixedPcdGet64(TokenName) _PCD_VALUE_##TokenName
107
120#define FixedPcdGetBool(TokenName) _PCD_VALUE_##TokenName
121
134#define FixedPcdGetPtr(TokenName) ((VOID *)_PCD_VALUE_##TokenName)
135
148#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
149
162#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
163
176#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
177
190#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
191
204#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
205
218#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
219
233#define PatchPcdSet8(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
234
248#define PatchPcdSet16(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
249
263#define PatchPcdSet32(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
264
278#define PatchPcdSet64(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
279
293#define PatchPcdSetBool(TokenName, Value) (_gPcd_BinaryPatch_##TokenName = (Value))
294
316#define PatchPcdSetPtr(TokenName, Size, Buffer) \
317 LibPatchPcdSetPtrAndSize ( \
318 (VOID *)_gPcd_BinaryPatch_##TokenName, \
319 &_gPcd_BinaryPatch_Size_##TokenName, \
320 (UINTN)_PCD_PATCHABLE_##TokenName##_SIZE, \
321 (Size), \
322 (Buffer) \
323 )
324
336#define PcdGet8(TokenName) _PCD_GET_MODE_8_##TokenName
337
349#define PcdGet16(TokenName) _PCD_GET_MODE_16_##TokenName
350
362#define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName
363
375#define PcdGet64(TokenName) _PCD_GET_MODE_64_##TokenName
376
388#define PcdGetPtr(TokenName) _PCD_GET_MODE_PTR_##TokenName
389
401#define PcdGetBool(TokenName) _PCD_GET_MODE_BOOL_##TokenName
402
414#define FixedPcdGetSize(TokenName) _PCD_SIZE_##TokenName
415
427#define PatchPcdGetSize(TokenName) _gPcd_BinaryPatch_Size_##TokenName
428
440#define PcdGetSize(TokenName) _PCD_GET_MODE_SIZE_##TokenName
441
455#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))
456
469#define PcdSet8S(TokenName, Value) _PCD_SET_MODE_8_S_##TokenName ((Value))
470
483#define PcdSet16S(TokenName, Value) _PCD_SET_MODE_16_S_##TokenName ((Value))
484
497#define PcdSet32S(TokenName, Value) _PCD_SET_MODE_32_S_##TokenName ((Value))
498
511#define PcdSet64S(TokenName, Value) _PCD_SET_MODE_64_S_##TokenName ((Value))
512
534#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \
535 _PCD_SET_MODE_PTR_S_##TokenName ((SizeOfBuffer), (Buffer))
536
549#define PcdSetBoolS(TokenName, Value) _PCD_SET_MODE_BOOL_S_##TokenName ((Value))
550
564#define PcdTokenEx(Guid, TokenName) _PCD_TOKEN_EX_##TokenName(Guid)
565
582#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
583
600#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
601
618#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
619
636#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
637
654#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
655
672#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool ((Guid), PcdTokenEx(Guid,TokenName))
673
691#define PcdSetEx8S(Guid, TokenName, Value) LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
692
710#define PcdSetEx16S(Guid, TokenName, Value) LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
711
729#define PcdSetEx32S(Guid, TokenName, Value) LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
730
748#define PcdSetEx64S(Guid, TokenName, Value) LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
749
775#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \
776 LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
777
795#define PcdSetExBoolS(Guid, TokenName, Value) \
796 LibPcdSetExBoolS ((Guid), PcdTokenEx(Guid,TokenName), (Value))
797
809UINTN
810EFIAPI
812 IN UINTN SkuId
813 );
814
825UINT8
826EFIAPI
828 IN UINTN TokenNumber
829 );
830
841UINT16
842EFIAPI
844 IN UINTN TokenNumber
845 );
846
857UINT32
858EFIAPI
860 IN UINTN TokenNumber
861 );
862
873UINT64
874EFIAPI
876 IN UINTN TokenNumber
877 );
878
889VOID *
890EFIAPI
892 IN UINTN TokenNumber
893 );
894
905BOOLEAN
906EFIAPI
908 IN UINTN TokenNumber
909 );
910
919UINTN
920EFIAPI
922 IN UINTN TokenNumber
923 );
924
939UINT8
940EFIAPI
942 IN CONST GUID *Guid,
943 IN UINTN TokenNumber
944 );
945
960UINT16
961EFIAPI
963 IN CONST GUID *Guid,
964 IN UINTN TokenNumber
965 );
966
978UINT32
979EFIAPI
981 IN CONST GUID *Guid,
982 IN UINTN TokenNumber
983 );
984
999UINT64
1000EFIAPI
1002 IN CONST GUID *Guid,
1003 IN UINTN TokenNumber
1004 );
1005
1020VOID *
1021EFIAPI
1023 IN CONST GUID *Guid,
1024 IN UINTN TokenNumber
1025 );
1026
1041BOOLEAN
1042EFIAPI
1044 IN CONST GUID *Guid,
1045 IN UINTN TokenNumber
1046 );
1047
1062UINTN
1063EFIAPI
1065 IN CONST GUID *Guid,
1066 IN UINTN TokenNumber
1067 );
1068
1081RETURN_STATUS
1082EFIAPI
1084 IN UINTN TokenNumber,
1085 IN UINT8 Value
1086 );
1087
1100RETURN_STATUS
1101EFIAPI
1103 IN UINTN TokenNumber,
1104 IN UINT16 Value
1105 );
1106
1119RETURN_STATUS
1120EFIAPI
1122 IN UINTN TokenNumber,
1123 IN UINT32 Value
1124 );
1125
1138RETURN_STATUS
1139EFIAPI
1141 IN UINTN TokenNumber,
1142 IN UINT64 Value
1143 );
1144
1167RETURN_STATUS
1168EFIAPI
1170 IN UINTN TokenNumber,
1171 IN OUT UINTN *SizeOfBuffer,
1172 IN CONST VOID *Buffer
1173 );
1174
1187RETURN_STATUS
1188EFIAPI
1190 IN UINTN TokenNumber,
1191 IN BOOLEAN Value
1192 );
1193
1210RETURN_STATUS
1211EFIAPI
1213 IN CONST GUID *Guid,
1214 IN UINTN TokenNumber,
1215 IN UINT8 Value
1216 );
1217
1234RETURN_STATUS
1235EFIAPI
1237 IN CONST GUID *Guid,
1238 IN UINTN TokenNumber,
1239 IN UINT16 Value
1240 );
1241
1258RETURN_STATUS
1259EFIAPI
1261 IN CONST GUID *Guid,
1262 IN UINTN TokenNumber,
1263 IN UINT32 Value
1264 );
1265
1282RETURN_STATUS
1283EFIAPI
1285 IN CONST GUID *Guid,
1286 IN UINTN TokenNumber,
1287 IN UINT64 Value
1288 );
1289
1312RETURN_STATUS
1313EFIAPI
1315 IN CONST GUID *Guid,
1316 IN UINTN TokenNumber,
1317 IN OUT UINTN *SizeOfBuffer,
1318 IN VOID *Buffer
1319 );
1320
1337RETURN_STATUS
1338EFIAPI
1340 IN CONST GUID *Guid,
1341 IN UINTN TokenNumber,
1342 IN BOOLEAN Value
1343 );
1344
1361typedef
1362VOID
1363(EFIAPI *PCD_CALLBACK)(
1364 IN CONST GUID *CallBackGuid OPTIONAL,
1365 IN UINTN CallBackToken,
1366 IN OUT VOID *TokenData,
1367 IN UINTN TokenDataSize
1368 );
1369
1386VOID
1387EFIAPI
1389 IN CONST GUID *Guid OPTIONAL,
1390 IN UINTN TokenNumber,
1392 );
1393
1407VOID
1408EFIAPI
1410 IN CONST GUID *Guid OPTIONAL,
1411 IN UINTN TokenNumber,
1413 );
1414
1434UINTN
1435EFIAPI
1437 IN CONST GUID *Guid OPTIONAL,
1438 IN UINTN TokenNumber
1439 );
1440
1454GUID *
1455EFIAPI
1457 IN CONST GUID *TokenSpaceGuid
1458 );
1459
1483VOID *
1484EFIAPI
1486 OUT VOID *PatchVariable,
1487 IN UINTN MaximumDatumSize,
1488 IN OUT UINTN *SizeOfBuffer,
1489 IN CONST VOID *Buffer
1490 );
1491
1515RETURN_STATUS
1516EFIAPI
1518 OUT VOID *PatchVariable,
1519 IN UINTN MaximumDatumSize,
1520 IN OUT UINTN *SizeOfBuffer,
1521 IN CONST VOID *Buffer
1522 );
1523
1549VOID *
1550EFIAPI
1552 OUT VOID *PatchVariable,
1553 OUT UINTN *SizeOfPatchVariable,
1554 IN UINTN MaximumDatumSize,
1555 IN OUT UINTN *SizeOfBuffer,
1556 IN CONST VOID *Buffer
1557 );
1558
1584RETURN_STATUS
1585EFIAPI
1587 OUT VOID *PatchVariable,
1588 OUT UINTN *SizeOfPatchVariable,
1589 IN UINTN MaximumDatumSize,
1590 IN OUT UINTN *SizeOfBuffer,
1591 IN CONST VOID *Buffer
1592 );
1593
1594typedef enum {
1595 PCD_TYPE_8,
1596 PCD_TYPE_16,
1597 PCD_TYPE_32,
1598 PCD_TYPE_64,
1599 PCD_TYPE_BOOL,
1600 PCD_TYPE_PTR
1601} PCD_TYPE;
1602
1603typedef struct {
1608 PCD_TYPE PcdType;
1620 CHAR8 *PcdName;
1621} PCD_INFO;
1622
1635VOID
1636EFIAPI
1638 IN UINTN TokenNumber,
1639 OUT PCD_INFO *PcdInfo
1640 );
1641
1655VOID
1656EFIAPI
1658 IN CONST GUID *Guid,
1659 IN UINTN TokenNumber,
1660 OUT PCD_INFO *PcdInfo
1661 );
1662
1670UINTN
1671EFIAPI
1673 VOID
1674 );
1675
1676#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI NotificationFunction(IN EFI_KEY_DATA *KeyData)
Definition: DriverSample.c:117
VOID EFIAPI LibPcdCallbackOnSet(IN CONST GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_CALLBACK NotificationFunction)
Definition: PcdLib.c:716
RETURN_STATUS EFIAPI LibPcdSetEx16S(IN CONST GUID *Guid, IN UINTN TokenNumber, IN UINT16 Value)
Definition: PcdLib.c:563
RETURN_STATUS EFIAPI LibPcdSet8S(IN UINTN TokenNumber, IN UINT8 Value)
Definition: PcdLib.c:375
RETURN_STATUS EFIAPI LibPatchPcdSetPtrS(OUT VOID *PatchVariable, IN UINTN MaximumDatumSize, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer)
Definition: PcdLib.c:881
UINTN EFIAPI LibPcdGetNextToken(IN CONST GUID *Guid OPTIONAL, IN UINTN TokenNumber)
Definition: PcdLib.c:771
UINT32 EFIAPI LibPcdGetEx32(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:247
UINT8 EFIAPI LibPcdGetEx8(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:198
VOID EFIAPI LibPcdGetInfoEx(IN CONST GUID *Guid, IN UINTN TokenNumber, OUT PCD_INFO *PcdInfo)
Definition: PcdLib.c:1056
RETURN_STATUS EFIAPI LibPatchPcdSetPtrAndSizeS(OUT VOID *PatchVariable, OUT UINTN *SizeOfPatchVariable, IN UINTN MaximumDatumSize, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer)
Definition: PcdLib.c:990
UINT16 EFIAPI LibPcdGet16(IN UINTN TokenNumber)
Definition: PcdLib.c:70
UINT64 EFIAPI LibPcdGetEx64(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:273
UINT16 EFIAPI LibPcdGetEx16(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:224
VOID(EFIAPI * PCD_CALLBACK)(IN CONST GUID *CallBackGuid OPTIONAL, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
Definition: PcdLib.h:1363
RETURN_STATUS EFIAPI LibPcdSetExPtrS(IN CONST GUID *Guid, IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: PcdLib.c:656
VOID EFIAPI LibPcdGetInfo(IN UINTN TokenNumber, OUT PCD_INFO *PcdInfo)
Definition: PcdLib.c:1033
UINTN EFIAPI LibPcdGetSize(IN UINTN TokenNumber)
Definition: PcdLib.c:173
RETURN_STATUS EFIAPI LibPcdSetPtrS(IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer)
Definition: PcdLib.c:481
UINT64 EFIAPI LibPcdGet64(IN UINTN TokenNumber)
Definition: PcdLib.c:112
UINTN EFIAPI LibPcdGetSku(VOID)
Definition: PcdLib.c:1074
GUID *EFIAPI LibPcdGetNextTokenSpace(IN CONST GUID *TokenSpaceGuid)
Definition: PcdLib.c:796
RETURN_STATUS EFIAPI LibPcdSetEx8S(IN CONST GUID *Guid, IN UINTN TokenNumber, IN UINT8 Value)
Definition: PcdLib.c:534
RETURN_STATUS EFIAPI LibPcdSetExBoolS(IN CONST GUID *Guid, IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: PcdLib.c:686
RETURN_STATUS EFIAPI LibPcdSetEx64S(IN CONST GUID *Guid, IN UINTN TokenNumber, IN UINT64 Value)
Definition: PcdLib.c:621
VOID *EFIAPI LibPatchPcdSetPtrAndSize(OUT VOID *PatchVariable, OUT UINTN *SizeOfPatchVariable, IN UINTN MaximumDatumSize, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer)
Definition: PcdLib.c:934
UINT8 EFIAPI LibPcdGet8(IN UINTN TokenNumber)
Definition: PcdLib.c:49
VOID *EFIAPI LibPatchPcdSetPtr(OUT VOID *PatchVariable, IN UINTN MaximumDatumSize, IN OUT UINTN *SizeOfBuffer, IN CONST VOID *Buffer)
Definition: PcdLib.c:830
RETURN_STATUS EFIAPI LibPcdSet32S(IN UINTN TokenNumber, IN UINT32 Value)
Definition: PcdLib.c:423
RETURN_STATUS EFIAPI LibPcdSet16S(IN UINTN TokenNumber, IN UINT16 Value)
Definition: PcdLib.c:399
VOID EFIAPI LibPcdCancelCallback(IN CONST GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_CALLBACK NotificationFunction)
Definition: PcdLib.c:741
UINT32 EFIAPI LibPcdGet32(IN UINTN TokenNumber)
Definition: PcdLib.c:91
RETURN_STATUS EFIAPI LibPcdSetEx32S(IN CONST GUID *Guid, IN UINTN TokenNumber, IN UINT32 Value)
Definition: PcdLib.c:592
VOID *EFIAPI LibPcdGetExPtr(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:299
VOID *EFIAPI LibPcdGetPtr(IN UINTN TokenNumber)
Definition: PcdLib.c:133
RETURN_STATUS EFIAPI LibPcdSet64S(IN UINTN TokenNumber, IN UINT64 Value)
Definition: PcdLib.c:447
UINTN EFIAPI LibPcdGetExSize(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:351
UINTN EFIAPI LibPcdSetSku(IN UINTN SkuId)
Definition: PcdLib.c:28
BOOLEAN EFIAPI LibPcdGetBool(IN UINTN TokenNumber)
Definition: PcdLib.c:154
RETURN_STATUS EFIAPI LibPcdSetBoolS(IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: PcdLib.c:506
BOOLEAN EFIAPI LibPcdGetExBool(IN CONST GUID *Guid, IN UINTN TokenNumber)
Definition: PcdLib.c:325
Definition: Base.h:213
CHAR8 * PcdName
Definition: PcdLib.h:1620
UINTN PcdSize
Definition: PcdLib.h:1613
PCD_TYPE PcdType
Definition: PcdLib.h:1608