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

Function GetWorker

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

Get the PCD entry pointer in PCD database. This routine will visit PCD database to find the PCD entry according to given token number. The given token number is autogened by build tools and it will be translated to local token number. Local token number contains PCD's type and offset of PCD entry in PCD database. @param TokenNumber Token's number, it is autogened by build to

Source from the content-addressed store, hash-verified

359
360**/
361VOID *
362GetWorker (
363 IN UINTN TokenNumber,
364 IN UINTN GetSize
365 )
366{
367 EFI_GUID *GuidTable;
368 UINT8 *StringTable;
369 EFI_GUID *Guid;
370 UINT16 *Name;
371 VARIABLE_HEAD *VariableHead;
372 UINT8 *VaraiableDefaultBuffer;
373 UINT8 *Data;
374 VPD_HEAD *VpdHead;
375 UINT8 *PcdDb;
376 VOID *RetPtr;
377 UINTN TmpTokenNumber;
378 UINTN DataSize;
379 EFI_STATUS Status;
380 UINT32 LocalTokenNumber;
381 UINT32 Offset;
382 STRING_HEAD StringTableIdx;
383 BOOLEAN IsPeiDb;
384
385 //
386 // Aquire lock to prevent reentrance from TPL_CALLBACK level
387 //
388 EfiAcquireLock (&mPcdDatabaseLock);
389
390 RetPtr = NULL;
391
392 ASSERT (TokenNumber > 0);
393 //
394 // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
395 // We have to decrement TokenNumber by 1 to make it usable
396 // as the array index.
397 //
398 TokenNumber--;
399
400 TmpTokenNumber = TokenNumber;
401
402 //
403 // EBC compiler is very choosy. It may report warning about comparison
404 // between UINTN and 0 . So we add 1 in each size of the
405 // comparison.
406 //
407 ASSERT (TokenNumber + 1 < mPcdTotalTokenCount + 1);
408
409 ASSERT ((GetSize == DxePcdGetSize (TokenNumber + 1)) || (GetSize == 0));
410
411 // EBC compiler is very choosy. It may report warning about comparison
412 // between UINTN and 0 . So we add 1 in each size of the
413 // comparison.
414 IsPeiDb = (BOOLEAN) ((TokenNumber + 1 < mPeiLocalTokenCount + 1) ? TRUE : FALSE);
415
416 LocalTokenNumber = GetLocalTokenNumber (IsPeiDb, TokenNumber + 1);
417
418 PcdDb = IsPeiDb ? ((UINT8 *) mPcdDatabase.PeiDb) : ((UINT8 *) mPcdDatabase.DxeDb);

Callers 7

ExGetWorkerFunction · 0.70
DxePcdGet8Function · 0.70
DxePcdGet16Function · 0.70
DxePcdGet32Function · 0.70
DxePcdGet64Function · 0.70
Pcd.cFile · 0.70
DxePcdGetBoolFunction · 0.70

Calls 8

EfiAcquireLockFunction · 0.85
DxePcdGetSizeFunction · 0.85
EfiReleaseLockFunction · 0.85
GetLocalTokenNumberFunction · 0.70
GetHiiVariableFunction · 0.70
GetPtrTypeSizeFunction · 0.70
CopyMemFunction · 0.50
FreePoolFunction · 0.50

Tested by

no test coverage detected