]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
UefiCpuPkg/RegisterCpuFeaturesLib: Separate semaphore container.
[mirror_edk2.git] / UefiCpuPkg / Library / RegisterCpuFeaturesLib / CpuFeaturesInitialize.c
index e61ace9bade84a954f6475b7dd6040e907b4f2f4..0a74d448c88bd3c8dc00f785aba649af7cc43ab9 100644 (file)
@@ -269,8 +269,10 @@ CpuInitDataInitialize (
     DEBUG ((DEBUG_INFO, "Package: %d, Valid Core : %d\n", Index, ValidCoreCountPerPackage[Index]));\r
   }\r
 \r
-  CpuFeaturesData->CpuFlags.SemaphoreCount = AllocateZeroPool (sizeof (UINT32) * CpuStatus->PackageCount * CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount);\r
-  ASSERT (CpuFeaturesData->CpuFlags.SemaphoreCount != NULL);\r
+  CpuFeaturesData->CpuFlags.CoreSemaphoreCount = AllocateZeroPool (sizeof (UINT32) * CpuStatus->PackageCount * CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount);\r
+  ASSERT (CpuFeaturesData->CpuFlags.CoreSemaphoreCount != NULL);\r
+  CpuFeaturesData->CpuFlags.PackageSemaphoreCount = AllocateZeroPool (sizeof (UINT32) * CpuStatus->PackageCount * CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount);\r
+  ASSERT (CpuFeaturesData->CpuFlags.PackageSemaphoreCount != NULL);\r
 \r
   //\r
   // Get support and configuration PCDs\r
@@ -963,9 +965,9 @@ ProgramProcessorRegister (
       //  V(0...n)       V(0...n)      ...           V(0...n)\r
       //  n * P(0)       n * P(1)      ...           n * P(n)\r
       //\r
-      SemaphorePtr = CpuFlags->SemaphoreCount;\r
       switch (RegisterTableEntry->Value) {\r
       case CoreDepType:\r
+        SemaphorePtr = CpuFlags->CoreSemaphoreCount;\r
         //\r
         // Get Offset info for the first thread in the core which current thread belongs to.\r
         //\r
@@ -986,6 +988,7 @@ ProgramProcessorRegister (
         break;\r
 \r
       case PackageDepType:\r
+        SemaphorePtr = CpuFlags->PackageSemaphoreCount;\r
         ValidCoreCountPerPackage = (UINT32 *)(UINTN)CpuStatus->ValidCoreCountPerPackage;\r
         //\r
         // Get Offset info for the first thread in the package which current thread belongs to.\r