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:
		@@ -390,12 +390,12 @@ SmmCpuIo2Initialize (
 | 
				
			|||||||
  //
 | 
					  //
 | 
				
			||||||
  // Copy the SMM CPU I/O Protocol instance into the System Management System Table
 | 
					  // 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,
 | 
					                    &mHandle,
 | 
				
			||||||
                    &gEfiSmmCpuIo2ProtocolGuid,
 | 
					                    &gEfiSmmCpuIo2ProtocolGuid,
 | 
				
			||||||
                    EFI_NATIVE_INTERFACE,
 | 
					                    EFI_NATIVE_INTERFACE,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
				
			|||||||
#include <Library/BaseLib.h>
 | 
					#include <Library/BaseLib.h>
 | 
				
			||||||
#include <Library/DebugLib.h>
 | 
					#include <Library/DebugLib.h>
 | 
				
			||||||
#include <Library/IoLib.h>
 | 
					#include <Library/IoLib.h>
 | 
				
			||||||
#include <Library/SmmServicesTableLib.h>
 | 
					#include <Library/MmServicesTableLib.h>
 | 
				
			||||||
#include <Library/BaseMemoryLib.h>
 | 
					#include <Library/BaseMemoryLib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MAX_IO_PORT_ADDRESS   0xFFFF
 | 
					#define MAX_IO_PORT_ADDRESS   0xFFFF
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@
 | 
				
			|||||||
  BaseLib
 | 
					  BaseLib
 | 
				
			||||||
  DebugLib
 | 
					  DebugLib
 | 
				
			||||||
  IoLib
 | 
					  IoLib
 | 
				
			||||||
  SmmServicesTableLib
 | 
					  MmServicesTableLib
 | 
				
			||||||
  BaseMemoryLib
 | 
					  BaseMemoryLib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Protocols]
 | 
					[Protocols]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,6 +91,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[LibraryClasses.common.DXE_SMM_DRIVER]
 | 
					[LibraryClasses.common.DXE_SMM_DRIVER]
 | 
				
			||||||
  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
 | 
					  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
 | 
				
			||||||
 | 
					  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
 | 
				
			||||||
  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
 | 
					  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
 | 
				
			||||||
  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
 | 
					  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
 | 
				
			||||||
  CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
 | 
					  CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user