/* Initialize PackageBsp Info. Processor specified by mPackageFirstThreadIndex will do the package-scope register programming. Set default CpuIndex to (UINT32)-1, which means not specified yet.  */
VOID InitPackageFirstThreadIndexInfo(VOID)
/* Initialize PackageBsp Info. Processor specified by mPackageFirstThreadIndex will do the package-scope register programming. Set default CpuIndex to (UINT32)-1, which means not specified yet.  */
VOID InitPackageFirstThreadIndexInfo(VOID)
{
  UINT32  Index;
  UINT32  PackageId;
  UINT32  PackageCount;
  PackageId    = 0;
  PackageCount = 0;
  for (Index = 0; Index < mNumberOfCpus; Index++) {
    if (PackageId < gSmmCpuPrivate->ProcessorInfo[Index].Location.Package) {
      PackageId = gSmmCpuPrivate->ProcessorInfo[Index].Location.Package;
    }
  }
  PackageCount = PackageId + 1;
  mPackageFirstThreadIndex = (UINT32 *)AllocatePool (sizeof (UINT32) * PackageCount);
  ASSERT (mPackageFirstThreadIndex != NULL);
  if (mPackageFirstThreadIndex == NULL) {
    return;
  }
  SetMem32 (mPackageFirstThreadIndex, sizeof (UINT32) * PackageCount, (UINT32)-1);
}