TianoCore EDK2 master
Loading...
Searching...
No Matches
Pcd.c
Go to the documentation of this file.
1
11#include "Service.h"
12
17
24
32
40
47
54
59};
60
84};
85
94};
95
103};
104
105EFI_HANDLE mPcdHandle = NULL;
106UINTN mVpdBaseAddress = 0;
107
120EFIAPI
122 IN EFI_HANDLE ImageHandle,
123 IN EFI_SYSTEM_TABLE *SystemTable
124 )
125{
126 EFI_STATUS Status;
127 VOID *Registration;
128
129 //
130 // Make sure the Pcd Protocol is not already installed in the system
131 //
132
133 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gPcdProtocolGuid);
134
136
137 //
138 // Install PCD_PROTOCOL to handle dynamic type PCD
139 // Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
140 //
141 Status = gBS->InstallMultipleProtocolInterfaces (
142 &mPcdHandle,
143 &gPcdProtocolGuid,
145 &gEfiPcdProtocolGuid,
147 NULL
148 );
149 ASSERT_EFI_ERROR (Status);
150
151 //
152 // Install GET_PCD_INFO_PROTOCOL to handle dynamic type PCD
153 // Install EFI_GET_PCD_INFO_PROTOCOL to handle dynamicEx type PCD
154 //
155 Status = gBS->InstallMultipleProtocolInterfaces (
156 &mPcdHandle,
157 &gGetPcdInfoProtocolGuid,
159 &gEfiGetPcdInfoProtocolGuid,
161 NULL
162 );
163 ASSERT_EFI_ERROR (Status);
164
165 //
166 // Register callback function upon VariableLockProtocol
167 // to lock the variables referenced by DynamicHii PCDs with RO property set in *.dsc.
168 //
170 &gEdkiiVariableLockProtocolGuid,
171 TPL_CALLBACK,
173 NULL,
174 &Registration
175 );
176
177 //
178 // Cache VpdBaseAddress in entry point for the following usage.
179 //
180
181 //
182 // PcdVpdBaseAddress64 is DynamicEx PCD only. So, DxePcdGet64Ex() is used to get its value.
183 //
184 mVpdBaseAddress = (UINTN)DxePcdGet64Ex (&gEfiMdeModulePkgTokenSpaceGuid, PcdToken (PcdVpdBaseAddress64));
185 if (mVpdBaseAddress == 0) {
186 //
187 // PcdVpdBaseAddress64 is not set, get value from PcdVpdBaseAddress.
188 //
189 mVpdBaseAddress = (UINTN)PcdGet32 (PcdVpdBaseAddress);
190 }
191
192 return Status;
193}
194
209EFIAPI
211 IN UINTN TokenNumber,
212 OUT EFI_PCD_INFO *PcdInfo
213 )
214{
215 return DxeGetPcdInfo (NULL, TokenNumber, PcdInfo);
216}
217
233EFIAPI
235 IN CONST EFI_GUID *Guid,
236 IN UINTN TokenNumber,
237 OUT EFI_PCD_INFO *PcdInfo
238 )
239{
240 return DxeGetPcdInfo (Guid, TokenNumber, PcdInfo);
241}
242
250UINTN
251EFIAPI
253 VOID
254 )
255{
256 return (UINTN)mPcdDatabase.DxeDb->SystemSkuId;
257}
258
280VOID
281EFIAPI
283 IN UINTN SkuId
284 )
285{
286 SKU_ID *SkuIdTable;
287 UINTN Index;
288 EFI_STATUS Status;
289
290 DEBUG ((DEBUG_INFO, "PcdDxe - SkuId 0x%lx is to be set.\n", (SKU_ID)SkuId));
291
292 if (SkuId == mPcdDatabase.DxeDb->SystemSkuId) {
293 //
294 // The input SKU Id is equal to current SKU Id, return directly.
295 //
296 DEBUG ((DEBUG_INFO, "PcdDxe - SkuId is same to current system Sku.\n"));
297 return;
298 }
299
300 if (mPcdDatabase.DxeDb->SystemSkuId != (SKU_ID)0) {
301 DEBUG ((DEBUG_ERROR, "PcdDxe - The SKU Id could be changed only once."));
302 DEBUG ((
303 DEBUG_ERROR,
304 "PcdDxe - The SKU Id was set to 0x%lx already, it could not be set to 0x%lx any more.",
305 mPcdDatabase.DxeDb->SystemSkuId,
306 (SKU_ID)SkuId
307 ));
308 ASSERT (FALSE);
309 return;
310 }
311
312 SkuIdTable = (SKU_ID *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->SkuIdTableOffset);
313 for (Index = 0; Index < SkuIdTable[0]; Index++) {
314 if (SkuId == SkuIdTable[Index + 1]) {
315 DEBUG ((DEBUG_INFO, "PcdDxe - SkuId is found in SkuId table.\n"));
316 Status = UpdatePcdDatabase (SkuId, TRUE);
317 if (!EFI_ERROR (Status)) {
318 mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID)SkuId;
319 DEBUG ((DEBUG_INFO, "PcdDxe - Set current SKU Id to 0x%lx.\n", (SKU_ID)SkuId));
320 return;
321 }
322 }
323 }
324
325 //
326 // Invalid input SkuId, the default SKU Id will be still used for the system.
327 //
328 DEBUG ((DEBUG_ERROR, "PcdDxe - Invalid input SkuId, the default SKU Id will be still used.\n"));
329 return;
330}
331
343UINT8
344EFIAPI
346 IN UINTN TokenNumber
347 )
348{
349 return *((UINT8 *)GetWorker (TokenNumber, sizeof (UINT8)));
350}
351
363UINT16
364EFIAPI
366 IN UINTN TokenNumber
367 )
368{
369 return ReadUnaligned16 (GetWorker (TokenNumber, sizeof (UINT16)));
370}
371
383UINT32
384EFIAPI
386 IN UINTN TokenNumber
387 )
388{
389 return ReadUnaligned32 (GetWorker (TokenNumber, sizeof (UINT32)));
390}
391
403UINT64
404EFIAPI
406 IN UINTN TokenNumber
407 )
408{
409 return ReadUnaligned64 (GetWorker (TokenNumber, sizeof (UINT64)));
410}
411
425VOID *
426EFIAPI
428 IN UINTN TokenNumber
429 )
430{
431 return GetWorker (TokenNumber, 0);
432}
433
447BOOLEAN
448EFIAPI
450 IN UINTN TokenNumber
451 )
452{
453 return *((BOOLEAN *)GetWorker (TokenNumber, sizeof (BOOLEAN)));
454}
455
467UINTN
468EFIAPI
470 IN UINTN TokenNumber
471 )
472{
473 UINTN Size;
474 UINT32 *LocalTokenNumberTable;
475 BOOLEAN IsPeiDb;
476 UINTN MaxSize;
477 UINTN TmpTokenNumber;
478
479 //
480 // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
481 // We have to decrement TokenNumber by 1 to make it usable
482 // as the array index.
483 //
484 TokenNumber--;
485
486 //
487 // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
488 //
489 TmpTokenNumber = TokenNumber;
490
491 // EBC compiler is very choosy. It may report warning about comparison
492 // between UINTN and 0 . So we add 1 in each size of the
493 // comparison.
494 ASSERT (TokenNumber + 1 < mPcdTotalTokenCount + 1);
495
496 // EBC compiler is very choosy. It may report warning about comparison
497 // between UINTN and 0 . So we add 1 in each size of the
498 // comparison.
499 IsPeiDb = (BOOLEAN)(TokenNumber + 1 < mPeiLocalTokenCount + 1);
500
501 TokenNumber = IsPeiDb ? TokenNumber :
502 (TokenNumber - mPeiLocalTokenCount);
503
504 LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset)
505 : (UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
506
507 Size = (LocalTokenNumberTable[TokenNumber] & PCD_DATUM_TYPE_ALL_SET) >> PCD_DATUM_TYPE_SHIFT;
508
509 if (Size == 0) {
510 //
511 // For pointer type, we need to scan the SIZE_TABLE to get the current size.
512 //
513 return GetPtrTypeSize (TmpTokenNumber, &MaxSize);
514 } else {
515 return Size;
516 }
517}
518
533UINT8
534EFIAPI
536 IN CONST EFI_GUID *Guid,
537 IN UINTN ExTokenNumber
538 )
539{
540 return *((UINT8 *)ExGetWorker (Guid, ExTokenNumber, sizeof (UINT8)));
541}
542
557UINT16
558EFIAPI
560 IN CONST EFI_GUID *Guid,
561 IN UINTN ExTokenNumber
562 )
563{
564 return ReadUnaligned16 (ExGetWorker (Guid, ExTokenNumber, sizeof (UINT16)));
565}
566
581UINT32
582EFIAPI
584 IN CONST EFI_GUID *Guid,
585 IN UINTN ExTokenNumber
586 )
587{
588 return ReadUnaligned32 (ExGetWorker (Guid, ExTokenNumber, sizeof (UINT32)));
589}
590
605UINT64
606EFIAPI
608 IN CONST EFI_GUID *Guid,
609 IN UINTN ExTokenNumber
610 )
611{
612 return ReadUnaligned64 (ExGetWorker (Guid, ExTokenNumber, sizeof (UINT64)));
613}
614
629VOID *
630EFIAPI
632 IN CONST EFI_GUID *Guid,
633 IN UINTN ExTokenNumber
634 )
635{
636 return ExGetWorker (Guid, ExTokenNumber, 0);
637}
638
653BOOLEAN
654EFIAPI
656 IN CONST EFI_GUID *Guid,
657 IN UINTN ExTokenNumber
658 )
659{
660 return *((BOOLEAN *)ExGetWorker (Guid, ExTokenNumber, sizeof (BOOLEAN)));
661}
662
675UINTN
676EFIAPI
678 IN CONST EFI_GUID *Guid,
679 IN UINTN ExTokenNumber
680 )
681{
682 return DxePcdGetSize (GetExPcdTokenNumber (Guid, (UINT32)ExTokenNumber));
683}
684
703EFIAPI
705 IN UINTN TokenNumber,
706 IN UINT8 Value
707 )
708{
709 return SetValueWorker (TokenNumber, &Value, sizeof (Value));
710}
711
730EFIAPI
732 IN UINTN TokenNumber,
733 IN UINT16 Value
734 )
735{
736 return SetValueWorker (TokenNumber, &Value, sizeof (Value));
737}
738
757EFIAPI
759 IN UINTN TokenNumber,
760 IN UINT32 Value
761 )
762{
763 return SetValueWorker (TokenNumber, &Value, sizeof (Value));
764}
765
784EFIAPI
786 IN UINTN TokenNumber,
787 IN UINT64 Value
788 )
789{
790 return SetValueWorker (TokenNumber, &Value, sizeof (Value));
791}
792
815EFIAPI
817 IN UINTN TokenNumber,
818 IN OUT UINTN *SizeOfBuffer,
819 IN VOID *Buffer
820 )
821{
822 return SetWorker (TokenNumber, Buffer, SizeOfBuffer, TRUE);
823}
824
843EFIAPI
845 IN UINTN TokenNumber,
846 IN BOOLEAN Value
847 )
848{
849 return SetValueWorker (TokenNumber, &Value, sizeof (Value));
850}
851
871EFIAPI
873 IN CONST EFI_GUID *Guid,
874 IN UINTN ExTokenNumber,
875 IN UINT8 Value
876 )
877{
878 return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
879}
880
900EFIAPI
902 IN CONST EFI_GUID *Guid,
903 IN UINTN ExTokenNumber,
904 IN UINT16 Value
905 )
906{
907 //
908 // PcdSetNvStoreDefaultId should be set in PEI phase to take effect.
909 //
910 ASSERT (
911 !(CompareGuid (Guid, &gEfiMdeModulePkgTokenSpaceGuid) &&
912 (ExTokenNumber == PcdToken (PcdSetNvStoreDefaultId)))
913 );
914 return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
915}
916
936EFIAPI
938 IN CONST EFI_GUID *Guid,
939 IN UINTN ExTokenNumber,
940 IN UINT32 Value
941 )
942{
943 return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
944}
945
965EFIAPI
967 IN CONST EFI_GUID *Guid,
968 IN UINTN ExTokenNumber,
969 IN UINT64 Value
970 )
971{
972 return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
973}
974
998EFIAPI
1000 IN CONST EFI_GUID *Guid,
1001 IN UINTN ExTokenNumber,
1002 IN OUT UINTN *SizeOfBuffer,
1003 IN VOID *Buffer
1004 )
1005{
1006 return ExSetWorker (ExTokenNumber, Guid, Buffer, SizeOfBuffer, TRUE);
1007}
1008
1028EFIAPI
1030 IN CONST EFI_GUID *Guid,
1031 IN UINTN ExTokenNumber,
1032 IN BOOLEAN Value
1033 )
1034{
1035 return ExSetValueWorker (ExTokenNumber, Guid, &Value, sizeof (Value));
1036}
1037
1051EFIAPI
1053 IN CONST EFI_GUID *Guid OPTIONAL,
1054 IN UINTN TokenNumber,
1055 IN PCD_PROTOCOL_CALLBACK CallBackFunction
1056 )
1057{
1058 EFI_STATUS Status;
1059
1060 if (CallBackFunction == NULL) {
1061 return EFI_INVALID_PARAMETER;
1062 }
1063
1064 //
1065 // Aquire lock to prevent reentrance from TPL_CALLBACK level
1066 //
1068
1069 Status = DxeRegisterCallBackWorker (TokenNumber, Guid, CallBackFunction);
1070
1072
1073 return Status;
1074}
1075
1089EFIAPI
1091 IN CONST EFI_GUID *Guid OPTIONAL,
1092 IN UINTN TokenNumber,
1093 IN PCD_PROTOCOL_CALLBACK CallBackFunction
1094 )
1095{
1096 EFI_STATUS Status;
1097
1098 if (CallBackFunction == NULL) {
1099 return EFI_INVALID_PARAMETER;
1100 }
1101
1102 //
1103 // Aquire lock to prevent reentrance from TPL_CALLBACK level
1104 //
1106
1107 Status = DxeUnRegisterCallBackWorker (TokenNumber, Guid, CallBackFunction);
1108
1110
1111 return Status;
1112}
1113
1141EFIAPI
1143 IN CONST EFI_GUID *Guid OPTIONAL,
1144 IN OUT UINTN *TokenNumber
1145 )
1146{
1147 EFI_STATUS Status;
1148 BOOLEAN PeiExMapTableEmpty;
1149 BOOLEAN DxeExMapTableEmpty;
1150
1151 Status = EFI_NOT_FOUND;
1152 PeiExMapTableEmpty = mPeiExMapTableEmpty;
1153 DxeExMapTableEmpty = mDxeExMapTableEmpty;
1154
1155 //
1156 // Scan the local token space
1157 //
1158 if (Guid == NULL) {
1159 // EBC compiler is very choosy. It may report warning about comparison
1160 // between UINTN and 0 . So we add 1 in each size of the
1161 // comparison.
1162 if (((*TokenNumber + 1 > mPeiNexTokenCount + 1) && (*TokenNumber + 1 <= mPeiLocalTokenCount + 1)) ||
1163 ((*TokenNumber + 1 > (mPeiLocalTokenCount + mDxeNexTokenCount + 1))))
1164 {
1165 return EFI_NOT_FOUND;
1166 }
1167
1168 (*TokenNumber)++;
1169 if ((*TokenNumber + 1 > mPeiNexTokenCount + 1) &&
1170 (*TokenNumber + 1 <= mPeiLocalTokenCount + 1))
1171 {
1172 //
1173 // The first Non-Ex type Token Number for DXE PCD
1174 // database is mPeiLocalTokenCount + 1
1175 //
1176 if (mDxeNexTokenCount > 0) {
1177 *TokenNumber = mPeiLocalTokenCount + 1;
1178 } else {
1179 *TokenNumber = PCD_INVALID_TOKEN_NUMBER;
1180 return EFI_NOT_FOUND;
1181 }
1182 } else if (*TokenNumber + 1 > mDxeNexTokenCount + mPeiLocalTokenCount + 1) {
1183 *TokenNumber = PCD_INVALID_TOKEN_NUMBER;
1184 return EFI_NOT_FOUND;
1185 }
1186
1187 return EFI_SUCCESS;
1188 }
1189
1190 if (PeiExMapTableEmpty && DxeExMapTableEmpty) {
1191 return EFI_NOT_FOUND;
1192 }
1193
1194 if (!PeiExMapTableEmpty) {
1195 Status = ExGetNextTokeNumber (
1196 Guid,
1197 TokenNumber,
1198 (EFI_GUID *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->GuidTableOffset),
1199 mPeiGuidTableSize,
1200 (DYNAMICEX_MAPPING *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->ExMapTableOffset),
1201 mPeiExMapppingTableSize
1202 );
1203 }
1204
1205 if (Status == EFI_SUCCESS) {
1206 return Status;
1207 }
1208
1209 if (!DxeExMapTableEmpty) {
1210 Status = ExGetNextTokeNumber (
1211 Guid,
1212 TokenNumber,
1213 (EFI_GUID *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->GuidTableOffset),
1214 mDxeGuidTableSize,
1215 (DYNAMICEX_MAPPING *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->ExMapTableOffset),
1216 mDxeExMapppingTableSize
1217 );
1218 }
1219
1220 return Status;
1221}
1222
1233EFI_GUID **
1235 IN OUT UINTN *ExMapTableSize,
1236 IN DYNAMICEX_MAPPING *ExMapTable,
1237 IN EFI_GUID *GuidTable
1238 )
1239{
1240 EFI_GUID **DistinctTokenSpace;
1241 UINTN OldGuidIndex;
1242 UINTN TsIdx;
1243 UINTN TempTsIdx;
1244 UINTN Idx;
1245 BOOLEAN Match;
1246
1247 DistinctTokenSpace = AllocateZeroPool (*ExMapTableSize * sizeof (EFI_GUID *));
1248 ASSERT (DistinctTokenSpace != NULL);
1249
1250 TsIdx = 0;
1251 OldGuidIndex = ExMapTable[0].ExGuidIndex;
1252 DistinctTokenSpace[TsIdx] = &GuidTable[OldGuidIndex];
1253 for (Idx = 1; Idx < *ExMapTableSize; Idx++) {
1254 Match = FALSE;
1255 OldGuidIndex = ExMapTable[Idx].ExGuidIndex;
1256 for (TempTsIdx = 0; TempTsIdx <= TsIdx; TempTsIdx++) {
1257 if (&GuidTable[OldGuidIndex] == DistinctTokenSpace[TempTsIdx]) {
1258 //
1259 // Have recorded this GUID.
1260 //
1261 Match = TRUE;
1262 break;
1263 }
1264 }
1265
1266 if (!Match) {
1267 DistinctTokenSpace[++TsIdx] = &GuidTable[OldGuidIndex];
1268 }
1269 }
1270
1271 //
1272 // The total number of Distinct Token Space
1273 // is TsIdx + 1 because we use TsIdx as a index
1274 // to the DistinctTokenSpace[]
1275 //
1276 *ExMapTableSize = TsIdx + 1;
1277 return DistinctTokenSpace;
1278}
1279
1297EFIAPI
1299 IN OUT CONST EFI_GUID **Guid
1300 )
1301{
1302 UINTN Idx;
1303 UINTN Idx2;
1304 UINTN Idx3;
1305 UINTN PeiTokenSpaceTableSize;
1306 UINTN DxeTokenSpaceTableSize;
1307 EFI_GUID **PeiTokenSpaceTable;
1308 EFI_GUID **DxeTokenSpaceTable;
1309 BOOLEAN Match;
1310 BOOLEAN PeiExMapTableEmpty;
1311 BOOLEAN DxeExMapTableEmpty;
1312
1313 ASSERT (Guid != NULL);
1314
1315 PeiExMapTableEmpty = mPeiExMapTableEmpty;
1316 DxeExMapTableEmpty = mDxeExMapTableEmpty;
1317
1318 if (PeiExMapTableEmpty && DxeExMapTableEmpty) {
1319 return EFI_NOT_FOUND;
1320 }
1321
1322 if (TmpTokenSpaceBuffer[0] == NULL) {
1323 PeiTokenSpaceTableSize = 0;
1324
1325 if (!PeiExMapTableEmpty) {
1326 PeiTokenSpaceTableSize = mPeiExMapppingTableSize / sizeof (DYNAMICEX_MAPPING);
1327 PeiTokenSpaceTable = GetDistinctTokenSpace (
1328 &PeiTokenSpaceTableSize,
1329 (DYNAMICEX_MAPPING *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->ExMapTableOffset),
1330 (EFI_GUID *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->GuidTableOffset)
1331 );
1332 CopyMem (TmpTokenSpaceBuffer, PeiTokenSpaceTable, sizeof (EFI_GUID *) * PeiTokenSpaceTableSize);
1333 TmpTokenSpaceBufferCount = PeiTokenSpaceTableSize;
1334 FreePool (PeiTokenSpaceTable);
1335 }
1336
1337 if (!DxeExMapTableEmpty) {
1338 DxeTokenSpaceTableSize = mDxeExMapppingTableSize / sizeof (DYNAMICEX_MAPPING);
1339 DxeTokenSpaceTable = GetDistinctTokenSpace (
1340 &DxeTokenSpaceTableSize,
1341 (DYNAMICEX_MAPPING *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->ExMapTableOffset),
1342 (EFI_GUID *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->GuidTableOffset)
1343 );
1344
1345 //
1346 // Make sure EFI_GUID in DxeTokenSpaceTable does not exist in PeiTokenSpaceTable
1347 //
1348 for (Idx2 = 0, Idx3 = PeiTokenSpaceTableSize; Idx2 < DxeTokenSpaceTableSize; Idx2++) {
1349 Match = FALSE;
1350 for (Idx = 0; Idx < PeiTokenSpaceTableSize; Idx++) {
1351 if (CompareGuid (TmpTokenSpaceBuffer[Idx], DxeTokenSpaceTable[Idx2])) {
1352 Match = TRUE;
1353 break;
1354 }
1355 }
1356
1357 if (!Match) {
1358 TmpTokenSpaceBuffer[Idx3++] = DxeTokenSpaceTable[Idx2];
1359 }
1360 }
1361
1362 TmpTokenSpaceBufferCount = Idx3;
1363 FreePool (DxeTokenSpaceTable);
1364 }
1365 }
1366
1367 if (*Guid == NULL) {
1368 *Guid = TmpTokenSpaceBuffer[0];
1369 return EFI_SUCCESS;
1370 }
1371
1372 for (Idx = 0; Idx < TmpTokenSpaceBufferCount; Idx++) {
1373 if (CompareGuid (*Guid, TmpTokenSpaceBuffer[Idx])) {
1374 if (Idx == TmpTokenSpaceBufferCount - 1) {
1375 //
1376 // It has been the last token namespace.
1377 //
1378 *Guid = NULL;
1379 return EFI_NOT_FOUND;
1380 } else {
1381 Idx++;
1382 *Guid = TmpTokenSpaceBuffer[Idx];
1383 return EFI_SUCCESS;
1384 }
1385 }
1386 }
1387
1388 return EFI_NOT_FOUND;
1389}
UINT64 UINTN
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
Definition: Unaligned.c:204
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
Definition: Unaligned.c:29
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
Definition: Unaligned.c:145
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
GET_PCD_INFO_PROTOCOL mGetPcdInfoInstance
Definition: Pcd.c:90
VOID *EFIAPI DxePcdGetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:631
UINTN EFIAPI DxePcdGetSizeEx(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:677
BOOLEAN EFIAPI DxePcdGetBool(IN UINTN TokenNumber)
Definition: Pcd.c:449
EFI_STATUS EFIAPI DxePcdGetNextToken(IN CONST EFI_GUID *Guid OPTIONAL, IN OUT UINTN *TokenNumber)
Definition: Pcd.c:1142
UINTN EFIAPI DxePcdGetSize(IN UINTN TokenNumber)
Definition: Pcd.c:469
EFI_STATUS EFIAPI DxePcdSet32(IN UINTN TokenNumber, IN UINT32 Value)
Definition: Pcd.c:758
UINT32 EFIAPI DxePcdGet32(IN UINTN TokenNumber)
Definition: Pcd.c:385
UINT16 EFIAPI DxePcdGet16Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:559
UINT32 EFIAPI DxePcdGet32Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:583
EFI_STATUS EFIAPI DxePcdSet16(IN UINTN TokenNumber, IN UINT16 Value)
Definition: Pcd.c:731
EFI_LOCK mPcdDatabaseLock
Definition: Pcd.c:16
BOOLEAN EFIAPI DxePcdGetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:655
EFI_STATUS EFIAPI DxeGetPcdInfoGetInfoEx(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:234
EFI_STATUS EFIAPI DxePcdSetBoolEx(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:1029
UINTN EFIAPI DxeGetPcdInfoGetSku(VOID)
Definition: Pcd.c:252
EFI_STATUS EFIAPI DxePcdSetBool(IN UINTN TokenNumber, IN BOOLEAN Value)
Definition: Pcd.c:844
EFI_STATUS EFIAPI DxePcdSet8(IN UINTN TokenNumber, IN UINT8 Value)
Definition: Pcd.c:704
EFI_STATUS EFIAPI DxeUnRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Pcd.c:1090
EFI_STATUS EFIAPI DxePcdSet16Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINT16 Value)
Definition: Pcd.c:901
EFI_STATUS EFIAPI DxePcdSetPtrEx(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:999
EFI_STATUS EFIAPI DxePcdSet64(IN UINTN TokenNumber, IN UINT64 Value)
Definition: Pcd.c:785
EFI_GUID ** GetDistinctTokenSpace(IN OUT UINTN *ExMapTableSize, IN DYNAMICEX_MAPPING *ExMapTable, IN EFI_GUID *GuidTable)
Definition: Pcd.c:1234
EFI_GET_PCD_INFO_PROTOCOL mEfiGetPcdInfoInstance
Definition: Pcd.c:100
EFI_STATUS EFIAPI DxeGetPcdInfoGetInfo(IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Pcd.c:210
VOID EFIAPI DxePcdSetSku(IN UINTN SkuId)
Definition: Pcd.c:282
UINT8 EFIAPI DxePcdGet8Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:535
UINT8 EFIAPI DxePcdGet8(IN UINTN TokenNumber)
Definition: Pcd.c:345
EFI_STATUS EFIAPI DxePcdSet8Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINT8 Value)
Definition: Pcd.c:872
EFI_STATUS EFIAPI DxePcdSet32Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINT32 Value)
Definition: Pcd.c:937
UINT64 EFIAPI DxePcdGet64Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber)
Definition: Pcd.c:607
VOID *EFIAPI DxePcdGetPtr(IN UINTN TokenNumber)
Definition: Pcd.c:427
EFI_STATUS EFIAPI DxePcdSet64Ex(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINT64 Value)
Definition: Pcd.c:966
EFI_STATUS EFIAPI DxePcdGetNextTokenSpace(IN OUT CONST EFI_GUID **Guid)
Definition: Pcd.c:1298
EFI_STATUS EFIAPI DxeRegisterCallBackOnSet(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN TokenNumber, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Pcd.c:1052
EFI_STATUS EFIAPI DxePcdSetPtr(IN UINTN TokenNumber, IN OUT UINTN *SizeOfBuffer, IN VOID *Buffer)
Definition: Pcd.c:816
EFI_STATUS EFIAPI PcdDxeInit(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Pcd.c:121
PCD_PROTOCOL mPcdInstance
Definition: Pcd.c:22
EFI_PCD_PROTOCOL mEfiPcdInstance
Definition: Pcd.c:65
UINT64 EFIAPI DxePcdGet64(IN UINTN TokenNumber)
Definition: Pcd.c:405
UINT16 EFIAPI DxePcdGet16(IN UINTN TokenNumber)
Definition: Pcd.c:365
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS DxeGetPcdInfo(IN CONST EFI_GUID *Guid, IN UINTN TokenNumber, OUT EFI_PCD_INFO *PcdInfo)
Definition: Service.c:276
EFI_STATUS DxeRegisterCallBackWorker(IN UINTN TokenNumber, IN CONST EFI_GUID *Guid OPTIONAL, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Service.c:528
EFI_STATUS ExSetValueWorker(IN UINTN ExTokenNumber, IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN SetSize)
Definition: Service.c:1320
UINTN GetExPcdTokenNumber(IN CONST EFI_GUID *Guid, IN UINT32 ExTokenNumber)
Definition: Service.c:1585
EFI_STATUS DxeUnRegisterCallBackWorker(IN UINTN TokenNumber, IN CONST EFI_GUID *Guid OPTIONAL, IN PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: Service.c:588
VOID * GetWorker(IN UINTN TokenNumber, IN UINTN GetSize)
Definition: Service.c:366
VOID BuildPcdDxeDataBase(VOID)
Definition: Service.c:858
VOID * ExGetWorker(IN CONST EFI_GUID *Guid, IN UINTN ExTokenNumber, IN UINTN GetSize)
Definition: Service.c:1299
EFI_STATUS ExSetWorker(IN UINTN ExTokenNumber, IN CONST EFI_GUID *Guid, IN VOID *Data, IN OUT UINTN *SetSize, IN BOOLEAN PtrType)
Definition: Service.c:1349
EFI_STATUS ExGetNextTokeNumber(IN CONST EFI_GUID *Guid, IN OUT UINTN *TokenNumber, IN EFI_GUID *GuidTable, IN UINTN SizeOfGuidTable, IN DYNAMICEX_MAPPING *ExMapTable, IN UINTN SizeOfExMapTable)
Definition: Service.c:657
UINTN GetPtrTypeSize(IN UINTN LocalTokenNumberTableIdx, OUT UINTN *MaxSize)
Definition: Service.c:1709
VOID EFIAPI VariableLockCallBack(IN EFI_EVENT Event, IN VOID *Context)
Definition: Service.c:1910
EFI_STATUS SetValueWorker(IN UINTN TokenNumber, IN VOID *Data, IN UINTN Size)
Definition: Service.c:1082
EFI_STATUS SetWorker(IN UINTN TokenNumber, IN VOID *Data, IN OUT UINTN *Size, IN BOOLEAN PtrType)
Definition: Service.c:1108
EFI_STATUS UpdatePcdDatabase(IN SKU_ID SkuId, IN BOOLEAN IsPeiDb)
Definition: Service.c:777
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
Definition: DebugLib.h:535
#define PcdToken(TokenName)
Definition: PcdLib.h:36
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
VOID(EFIAPI * PCD_PROTOCOL_CALLBACK)(IN CONST EFI_GUID *CallBackGuid OPTIONAL, IN UINTN CallBackToken, IN OUT VOID *TokenData, IN UINTN TokenDataSize)
Definition: Pcd.h:654
EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_CANCEL_CALLBACK)(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: PiPcd.h:354
EFI_STATUS(EFIAPI * EFI_PCD_PROTOCOL_CALLBACK_ON_SET)(IN CONST EFI_GUID *Guid OPTIONAL, IN UINTN CallBackToken, IN EFI_PCD_PROTOCOL_CALLBACK CallBackFunction)
Definition: PiPcd.h:336
STATIC BOOLEAN Match(IN CONST CHAR16 *Translated, IN UINTN TranslatedLength, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
#define EFI_INITIALIZE_LOCK_VARIABLE(Priority)
Definition: UefiLib.h:313
VOID EFIAPI EfiReleaseLock(IN EFI_LOCK *Lock)
Definition: UefiLib.c:499
VOID EFIAPI EfiAcquireLock(IN EFI_LOCK *Lock)
Definition: UefiLib.c:434
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
Definition: UefiLib.c:134
Definition: Base.h:213