MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DxeGetPcdInfo

Function DxeGetPcdInfo

MdeModulePkg/Universal/PCD/Dxe/Service.c:274–345  ·  view source on GitHub ↗

Retrieve additional information associated with a PCD token. This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token. @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. @param[in] TokenNumber The PCD token number.

Source from the content-addressed store, hash-verified

272 @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
273**/
274EFI_STATUS
275DxeGetPcdInfo (
276 IN CONST EFI_GUID *Guid,
277 IN UINTN TokenNumber,
278 OUT EFI_PCD_INFO *PcdInfo
279 )
280{
281 EFI_STATUS Status;
282 BOOLEAN PeiExMapTableEmpty;
283 BOOLEAN DxeExMapTableEmpty;
284 UINT32 LocalTokenNumber;
285 BOOLEAN IsPeiDb;
286
287 ASSERT (PcdInfo != NULL);
288
289 Status = EFI_NOT_FOUND;
290 PeiExMapTableEmpty = mPeiExMapTableEmpty;
291 DxeExMapTableEmpty = mDxeExMapTableEmpty;
292
293 if (Guid == NULL) {
294 if (((TokenNumber + 1 > mPeiNexTokenCount + 1) && (TokenNumber + 1 <= mPeiLocalTokenCount + 1)) ||
295 ((TokenNumber + 1 > (mPeiLocalTokenCount + mDxeNexTokenCount + 1)))) {
296 return EFI_NOT_FOUND;
297 } else if (TokenNumber == PCD_INVALID_TOKEN_NUMBER) {
298 //
299 // TokenNumber is 0, follow spec to set PcdType to EFI_PCD_TYPE_8,
300 // PcdSize to 0 and PcdName to NULL for default Token Space.
301 //
302 PcdInfo->PcdType = EFI_PCD_TYPE_8;
303 PcdInfo->PcdSize = 0;
304 PcdInfo->PcdName = NULL;
305 } else {
306 PcdInfo->PcdSize = DxePcdGetSize (TokenNumber);
307 IsPeiDb = FALSE;
308 if ((TokenNumber + 1 <= mPeiNexTokenCount + 1)) {
309 IsPeiDb = TRUE;
310 }
311 LocalTokenNumber = GetLocalTokenNumber (IsPeiDb, TokenNumber);
312 PcdInfo->PcdType = GetPcdType (LocalTokenNumber);
313 PcdInfo->PcdName = GetPcdName (FALSE, IsPeiDb, TokenNumber);
314 }
315 return EFI_SUCCESS;
316 }
317
318 if (PeiExMapTableEmpty && DxeExMapTableEmpty) {
319 return EFI_NOT_FOUND;
320 }
321
322 if (!PeiExMapTableEmpty) {
323 Status = ExGetPcdInfo (
324 TRUE,
325 Guid,
326 TokenNumber,
327 PcdInfo
328 );
329 }
330
331 if (Status == EFI_SUCCESS) {

Callers 2

DxeGetPcdInfoGetInfoFunction · 0.85
DxeGetPcdInfoGetInfoExFunction · 0.85

Calls 5

DxePcdGetSizeFunction · 0.85
GetLocalTokenNumberFunction · 0.70
GetPcdTypeFunction · 0.70
GetPcdNameFunction · 0.70
ExGetPcdInfoFunction · 0.70

Tested by

no test coverage detected