// Flags used when program the register.\r
//\r
typedef struct {\r
- volatile UINTN ConsoleLogLock; // Spinlock used to control console.\r
- volatile UINTN MemoryMappedLock; // Spinlock used to program mmio\r
- volatile UINT32 *SemaphoreCount; // Semaphore used to program semaphore.\r
+ volatile UINTN ConsoleLogLock; // Spinlock used to control console.\r
+ volatile UINTN MemoryMappedLock; // Spinlock used to program mmio\r
+ volatile UINT32 *CoreSemaphoreCount; // Semaphore container used to program\r
+ // core level semaphore.\r
+ volatile UINT32 *PackageSemaphoreCount; // Semaphore container used to program\r
+ // package level semaphore.\r
} PROGRAM_CPU_REGISTER_FLAGS;\r
\r
//\r
ASSERT (\r
(ApLocation != NULL) &&\r
(CpuStatus->ValidCoreCountPerPackage != 0) &&\r
- (CpuFlags->SemaphoreCount) != NULL\r
+ (CpuFlags->CoreSemaphoreCount != NULL) &&\r
+ (CpuFlags->PackageSemaphoreCount != NULL)\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
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
ASSERT (mAcpiCpuData.ApLocation != 0);\r
}\r
if (CpuStatus->PackageCount != 0) {\r
- mCpuFlags.SemaphoreCount = AllocateZeroPool (\r
- sizeof (UINT32) * CpuStatus->PackageCount *\r
- CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount);\r
- ASSERT (mCpuFlags.SemaphoreCount != NULL);\r
+ mCpuFlags.CoreSemaphoreCount = AllocateZeroPool (\r
+ sizeof (UINT32) * CpuStatus->PackageCount *\r
+ CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount\r
+ );\r
+ ASSERT (mCpuFlags.CoreSemaphoreCount != NULL);\r
+ mCpuFlags.PackageSemaphoreCount = AllocateZeroPool (\r
+ sizeof (UINT32) * CpuStatus->PackageCount *\r
+ CpuStatus->MaxCoreCount * CpuStatus->MaxThreadCount\r
+ );\r
+ ASSERT (mCpuFlags.PackageSemaphoreCount != NULL);\r
}\r
InitializeSpinLock((SPIN_LOCK*) &mCpuFlags.MemoryMappedLock);\r
InitializeSpinLock((SPIN_LOCK*) &mCpuFlags.ConsoleLogLock);\r