UefiCpuPkg: CpuIo2Smm: Move CpuIo2Smm driver to consume gMmst

This change replaced gSmst with gMmst to support broader compatibility
under MM environment for CpuIo2Smm driver.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>

Signed-off-by: Kun Qin <kun.q@outlook.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Kun Qin 2020-12-17 19:12:50 -08:00
parent 7a56650e2e
commit e414a3e936
4 changed files with 6 additions and 5 deletions

View File

@ -390,12 +390,12 @@ SmmCpuIo2Initialize (
//
// Copy the SMM CPU I/O Protocol instance into the System Management System Table
//
CopyMem (&gSmst->SmmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2));
CopyMem (&gMmst->MmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2));
//
// Install the SMM CPU I/O Protocol into the SMM protocol database
// Install the SMM CPU I/O Protocol into the MM protocol database
//
Status = gSmst->SmmInstallProtocolInterface (
Status = gMmst->MmInstallProtocolInterface (
&mHandle,
&gEfiSmmCpuIo2ProtocolGuid,
EFI_NATIVE_INTERFACE,

View File

@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/SmmServicesTableLib.h>
#include <Library/MmServicesTableLib.h>
#include <Library/BaseMemoryLib.h>
#define MAX_IO_PORT_ADDRESS 0xFFFF

View File

@ -34,7 +34,7 @@
BaseLib
DebugLib
IoLib
SmmServicesTableLib
MmServicesTableLib
BaseMemoryLib
[Protocols]

View File

@ -91,6 +91,7 @@
[LibraryClasses.common.DXE_SMM_DRIVER]
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf