mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
76bc52ed4f
commit
f76edcfd29
|
@ -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) +
|
||||
|
|
Loading…
Reference in New Issue