summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-05 09:28:48 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-05 09:28:48 +0000
commitf76edcfd29669e594fb2899ba41d06e33228aeba (patch)
tree4765a0e767686be3648928353ab387c544fdab51 /EdkCompatibilityPkg
parent76bc52ed4f98749ea0b22ede9401a6f32c0adfe3 (diff)
downloadedk2-platforms-f76edcfd29669e594fb2899ba41d06e33228aeba.tar.xz
Fix bugs in SmmBaseHelper driver.
1. Should use sizeof(EFI_SMM_CPU_SAVE_STATE) instead of sizeof (EFI_SMI_CPU_SAVE_STATE) to allocate buffer for CpuSaveState in Framework SMST; 2. The type of Width parameter for ReadSaveState() and WriteSaveState() functions of SMM CPU Protocol is UINTN instead of an enumeration type. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9678 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
index 381f6ae2ed..3443ac63ab 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
@@ -124,11 +124,11 @@ ConstructFrameworkSmst (
Status = gSmst->SmmAllocatePool (
EfiRuntimeServicesData,
- gSmst->NumberOfCpus * sizeof (EFI_SMI_CPU_SAVE_STATE),
+ gSmst->NumberOfCpus * sizeof (EFI_SMM_CPU_SAVE_STATE),
(VOID **)&FrameworkSmst->CpuSaveState
);
ASSERT_EFI_ERROR (Status);
- ZeroMem (FrameworkSmst->CpuSaveState, gSmst->NumberOfCpus * sizeof (EFI_SMI_CPU_SAVE_STATE));
+ ZeroMem (FrameworkSmst->CpuSaveState, gSmst->NumberOfCpus * sizeof (EFI_SMM_CPU_SAVE_STATE));
///
/// Do not support floating point state now
@@ -430,7 +430,7 @@ CallbackThunk (
///
Status = mSmmCpu->ReadSaveState (
mSmmCpu,
- EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32,
+ (UINTN)sizeof (UINT32),
mCpuSaveStateConvTable[Index].Register,
CpuIndex,
((UINT8 *)SaveState) + mCpuSaveStateConvTable[Index].Offset
@@ -462,7 +462,7 @@ CallbackThunk (
for (Index = 0; Index < sizeof (mCpuSaveStateConvTable) / sizeof (CPU_SAVE_STATE_CONVERSION); Index++) {
Status = mSmmCpu->WriteSaveState (
mSmmCpu,
- EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32,
+ (UINTN)sizeof (UINT32),
mCpuSaveStateConvTable[Index].Register,
CpuIndex,
((UINT8 *)&mFrameworkSmst->CpuSaveState[CpuIndex].Ia32SaveState) +