/* Worker function to parse CPU BIST information from Guided HOB. */
EFI_STATUS GetBistFromHob(IN OUT UINT64 *StructureSize, IN OUT VOID *StructureBuffer)
/* Worker function to parse CPU BIST information from Guided HOB. */
EFI_STATUS GetBistFromHob(IN OUT UINT64 *StructureSize, IN OUT VOID *StructureBuffer)
{
  EFI_HOB_GUID_TYPE  *GuidHob;
  VOID               *DataInHob;
  UINTN              DataSize;
  GuidHob = GetFirstGuidHob (&gEfiCallerIdGuid);
  if (GuidHob == NULL) {
    *StructureSize = 0;
    return EFI_SUCCESS;
  }
  DataInHob = GET_GUID_HOB_DATA (GuidHob);
  DataSize  = GET_GUID_HOB_DATA_SIZE (GuidHob);
  if ((*StructureSize) < (UINT64)DataSize) {
    *StructureSize = (UINT64)DataSize;
    return EFI_BUFFER_TOO_SMALL;
  }
  *StructureSize = (UINT64)DataSize;
  CopyMem (StructureBuffer, DataInHob, DataSize);
  return EFI_SUCCESS;
}