UefiCpuPkg/PiSmmCpuDxeSmm: Allocate buffer for MSRs semaphores

Allocate MSRs semaphores in allocated aligned semaphores buffer.
And add it into semaphores structure.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Jeff Fan
2016-03-22 10:36:28 +08:00
committed by Michael Kinney
parent ed3d5ecb34
commit 695e62d141
3 changed files with 20 additions and 3 deletions

View File

@@ -323,6 +323,8 @@ typedef struct {
volatile BOOLEAN *CandidateBsp;
} SMM_DISPATCHER_MP_SYNC_DATA;
#define MSR_SPIN_LOCK_INIT_NUM 15
typedef struct {
SPIN_LOCK SpinLock;
UINT32 MsrIndex;
@@ -375,6 +377,13 @@ typedef struct {
volatile BOOLEAN *Present;
} SMM_CPU_SEMAPHORE_CPU;
///
/// All MSRs semaphores' pointer and counter
///
typedef struct {
SPIN_LOCK *Msr;
UINTN AvailableCounter;
} SMM_CPU_SEMAPHORE_MSR;
///
/// All semaphores' information
@@ -382,6 +391,7 @@ typedef struct {
typedef struct {
SMM_CPU_SEMAPHORE_GLOBAL SemaphoreGlobal;
SMM_CPU_SEMAPHORE_CPU SemaphoreCpu;
SMM_CPU_SEMAPHORE_MSR SemaphoreMsr;
} SMM_CPU_SEMAPHORES;
extern IA32_DESCRIPTOR gcSmiGdtr;