]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add module that produces the SMM CPU I/O 2 Protocol
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 04:24:00 +0000 (04:24 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 04:24:00 +0000 (04:24 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9737 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c [new file with mode: 0644]
UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf [new file with mode: 0644]
UefiCpuPkg/UefiCpuPkg.dsc

diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
new file mode 100644 (file)
index 0000000..da470a0
--- /dev/null
@@ -0,0 +1,442 @@
+/** @file\r
+  Produces the SMM CPU I/O Protocol.\r
+\r
+Copyright (c) 2009 - 2010, Intel Corporation\r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+**/\r
+\r
+#include <PiSmm.h>\r
+\r
+#include <Protocol/SmmCpuIo2.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/SmmServicesTableLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+\r
+#define MAX_IO_PORT_ADDRESS   0xFFFF\r
+\r
+//\r
+// Function Prototypes\r
+//\r
+EFI_STATUS\r
+EFIAPI\r
+CpuMemoryServiceRead (\r
+  IN  CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN  EFI_SMM_IO_WIDTH                Width,\r
+  IN  UINT64                          Address,\r
+  IN  UINTN                           Count,\r
+  OUT VOID                            *Buffer\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+CpuMemoryServiceWrite (\r
+  IN CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN EFI_SMM_IO_WIDTH                Width,\r
+  IN UINT64                          Address,\r
+  IN UINTN                           Count,\r
+  IN VOID                            *Buffer\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+CpuIoServiceRead (\r
+  IN  CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN  EFI_SMM_IO_WIDTH                Width,\r
+  IN  UINT64                          Address,\r
+  IN  UINTN                           Count,\r
+  OUT VOID                            *Buffer\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+CpuIoServiceWrite (\r
+  IN CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN EFI_SMM_IO_WIDTH                Width,\r
+  IN UINT64                          Address,\r
+  IN UINTN                           Count,\r
+  IN VOID                            *Buffer\r
+  );\r
+\r
+//\r
+// Handle for the SMM CPU I/O Protocol\r
+//\r
+EFI_HANDLE  mHandle = NULL;\r
+\r
+//\r
+// SMM CPU I/O Protocol instance\r
+//\r
+EFI_SMM_CPU_IO2_PROTOCOL mSmmCpuIo2 = {\r
+  {\r
+    CpuMemoryServiceRead,\r
+    CpuMemoryServiceWrite\r
+  },\r
+  {\r
+    CpuIoServiceRead,\r
+    CpuIoServiceWrite\r
+  }\r
+};\r
+\r
+//\r
+// Lookup table for increment values based on transfer widths\r
+//\r
+UINT8 mStride[] = {\r
+  1, // SMM_IO_UINT8\r
+  2, // SMM_IO_UINT16\r
+  4, // SMM_IO_UINT32\r
+  8  // SMM_IO_UINT64\r
+};\r
+\r
+/**\r
+  Check parameters to a SMM CPU I/O Protocol service request.\r
+\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memory operation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+  @param  MmioOperation         TRUE for an MMIO operation, FALSE for I/O Port operation.\r
+  \r
+  @retval EFI_SUCCESS           The parameters for this request pass the checks.\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is not valid.\r
+  @retval EFI_UNSUPPORTED       The address range specified by Address, Width, and Count exceeds Limit.\r
+                                The Buffer is not aligned for the given Width.\r
+\r
+**/\r
+EFI_STATUS\r
+CpuIoCheckParameter (\r
+  IN BOOLEAN           MmioOperation,\r
+  IN EFI_SMM_IO_WIDTH  Width,\r
+  IN UINT64            Address,\r
+  IN UINTN             Count,\r
+  IN VOID              *Buffer\r
+  )\r
+{\r
+  UINT64  MaxCount;\r
+  UINT64  Limit;\r
+\r
+  //\r
+  // Check to see if Buffer is NULL\r
+  //\r
+  if (Buffer == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Check to see if Width is in the valid range\r
+  //\r
+  if (Width > SMM_IO_UINT64) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Check to see if Width is in the valid range for I/O Port operations\r
+  //\r
+  if (!MmioOperation && (Width == SMM_IO_UINT64)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  \r
+  //\r
+  // Check to see if any address associated with this transfer exceeds the maximum \r
+  // allowed address.  The maximum address implied by the parameters passed in is\r
+  // Address + Size * Count.  If the following condition is met, then the transfer\r
+  // is not supported.\r
+  //\r
+  //    Address + Size * Count > (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS) + 1\r
+  //\r
+  // Since MAX_ADDRESS can be the maximum integer value supported by the CPU and Count \r
+  // can also be the maximum integer value supported by the CPU, this range\r
+  // check must be adjusted to avoid all oveflow conditions.\r
+  //   \r
+  // The follwing form of the range check is equivalent but assumes that \r
+  // MAX_ADDRESS and MAX_IO_PORT_ADDRESS are of the form (2^n - 1).\r
+  //\r
+  Limit = (MmioOperation ? MAX_ADDRESS : MAX_IO_PORT_ADDRESS);\r
+  if (Count == 0) {\r
+    if (Address > Limit) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+  } else {  \r
+    MaxCount = RShiftU64 (Limit, Width);\r
+    if (MaxCount < (Count - 1)) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+    if (Address > LShiftU64 (MaxCount - Count + 1, Width)) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+  }\r
+  \r
+  //\r
+  // Check to see if Address is aligned\r
+  //\r
+  if ((Address & (UINT64)(mStride[Width] - 1)) != 0) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Reads memory-mapped registers.\r
+\r
+  @param  This                  A pointer to the EFI_SMM_CPU_IO2_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memoryoperation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
+                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CpuMemoryServiceRead (\r
+  IN  CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN  EFI_SMM_IO_WIDTH                Width,\r
+  IN  UINT64                          Address,\r
+  IN  UINTN                           Count,\r
+  OUT VOID                            *Buffer\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  UINT8       Stride;\r
+  UINT8       *Uint8Buffer;\r
+\r
+  Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Select loop based on the width of the transfer\r
+  //\r
+  Stride = mStride[Width];\r
+  for (Uint8Buffer = Buffer; Count > 0; Address += Stride, Uint8Buffer += Stride, Count--) {\r
+    if (Width == SMM_IO_UINT8) {\r
+      *Uint8Buffer = MmioRead8 ((UINTN)Address);\r
+    } else if (Width == SMM_IO_UINT16) {\r
+      *((UINT16 *)Uint8Buffer) = MmioRead16 ((UINTN)Address);\r
+    } else if (Width == SMM_IO_UINT32) {\r
+      *((UINT32 *)Uint8Buffer) = MmioRead32 ((UINTN)Address);\r
+    } else if (Width == SMM_IO_UINT64) {\r
+      *((UINT64 *)Uint8Buffer) = MmioRead64 ((UINTN)Address);\r
+    }\r
+  }\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Writes memory-mapped registers.\r
+\r
+  @param  This                  A pointer to the EFI_SMM_CPU_IO2_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memoryoperation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
+                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CpuMemoryServiceWrite (\r
+  IN CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN EFI_SMM_IO_WIDTH                Width,\r
+  IN UINT64                          Address,\r
+  IN UINTN                           Count,\r
+  IN VOID                            *Buffer\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  UINT8       Stride;\r
+  UINT8       *Uint8Buffer;\r
+\r
+  Status = CpuIoCheckParameter (TRUE, Width, Address, Count, Buffer);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Select loop based on the width of the transfer\r
+  //\r
+  Stride = mStride[Width];\r
+  for (Uint8Buffer = Buffer; Count > 0; Address += Stride, Uint8Buffer += Stride, Count--) {\r
+    if (Width == SMM_IO_UINT8) {\r
+      MmioWrite8 ((UINTN)Address, *Uint8Buffer);\r
+    } else if (Width == SMM_IO_UINT16) {\r
+      MmioWrite16 ((UINTN)Address, *((UINT16 *)Uint8Buffer));\r
+    } else if (Width == SMM_IO_UINT32) {\r
+      MmioWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));\r
+    } else if (Width == SMM_IO_UINT64) {\r
+      MmioWrite64 ((UINTN)Address, *((UINT64 *)Uint8Buffer));\r
+    }\r
+  }\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Reads I/O registers.\r
+\r
+  @param  This                  A pointer to the EFI_SMM_CPU_IO2_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memoryoperation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
+                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CpuIoServiceRead (\r
+  IN  CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN  EFI_SMM_IO_WIDTH                Width,\r
+  IN  UINT64                          Address,\r
+  IN  UINTN                           Count,\r
+  OUT VOID                            *Buffer\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  UINT8       Stride;\r
+  UINT8       *Uint8Buffer;\r
+\r
+  Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Select loop based on the width of the transfer\r
+  //\r
+  Stride = mStride[Width];\r
+  for (Uint8Buffer = Buffer; Count > 0; Address += Stride, Uint8Buffer += Stride, Count--) {\r
+    if (Width == SMM_IO_UINT8) {\r
+      *Uint8Buffer = IoRead8 ((UINTN)Address);\r
+    } else if (Width == SMM_IO_UINT16) {\r
+      *((UINT16 *)Uint8Buffer) = IoRead16 ((UINTN)Address);\r
+    } else if (Width == SMM_IO_UINT32) {\r
+      *((UINT32 *)Uint8Buffer) = IoRead32 ((UINTN)Address);\r
+    }\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Write I/O registers.\r
+\r
+  @param  This                  A pointer to the EFI_SMM_CPU_IO2_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memoryoperation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
+                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CpuIoServiceWrite (\r
+  IN CONST EFI_SMM_CPU_IO2_PROTOCOL  *This,\r
+  IN EFI_SMM_IO_WIDTH                Width,\r
+  IN UINT64                          Address,\r
+  IN UINTN                           Count,\r
+  IN VOID                            *Buffer\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  UINT8       Stride;\r
+  UINT8       *Uint8Buffer;\r
+\r
+  //\r
+  // Make sure the parameters are valid\r
+  //\r
+  Status = CpuIoCheckParameter (FALSE, Width, Address, Count, Buffer);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Select loop based on the width of the transfer\r
+  //\r
+  Stride = mStride[Width];\r
+  for (Uint8Buffer = (UINT8 *)Buffer; Count > 0; Address += Stride, Uint8Buffer += Stride, Count--) {\r
+    if (Width == SMM_IO_UINT8) {\r
+      IoWrite8 ((UINTN)Address, *Uint8Buffer);\r
+    } else if (Width == SMM_IO_UINT16) {\r
+      IoWrite16 ((UINTN)Address, *((UINT16 *)Uint8Buffer));\r
+    } else if (Width == SMM_IO_UINT32) {\r
+      IoWrite32 ((UINTN)Address, *((UINT32 *)Uint8Buffer));\r
+    }\r
+  }\r
+  \r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  The module Entry Point SmmCpuIoProtocol driver\r
+\r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param  SystemTable    A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS    The entry point is executed successfully.\r
+  @retval Other          Some error occurs when executing this entry point.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+SmmCpuIo2Initialize (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+ {\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Copy the SMM CPU I/O Protocol instance into the System Management System Table\r
+  //\r
+  CopyMem (&gSmst->SmmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2));\r
+\r
+  //\r
+  // Install the SMM CPU I/O Protocol into the SMM protocol database\r
+  //\r
+  Status = gSmst->SmmInstallProtocolInterface (\r
+                    &mHandle,\r
+                    &gEfiSmmCpuIo2ProtocolGuid,\r
+                    EFI_NATIVE_INTERFACE,\r
+                    &mSmmCpuIo2\r
+                    );\r
+  ASSERT_EFI_ERROR (Status);\r
+  \r
+  return Status;\r
+}\r
diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
new file mode 100644 (file)
index 0000000..d8549f9
--- /dev/null
@@ -0,0 +1,51 @@
+#/** @file\r
+# Component description file for CPU I/O SMM Driver.\r
+#\r
+# Copyright (c) 2009 - 2010, Intel Corporation.\r
+#\r
+#  All rights reserved.\r
+#  This software and associated documentation (if any) is furnished\r
+#  under a license and may only be used or copied in accordance\r
+#  with the terms of the license. Except as permitted by such\r
+#  license, no part of this software or documentation may be\r
+#  reproduced, stored in a retrieval system, or transmitted in any\r
+#  form or by any means without the express written consent of\r
+#  Intel Corporation.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = CpuIo2Smm\r
+  FILE_GUID                      = A47EE2D8-F60E-42fd-8E58-7BD65EE4C29B\r
+  MODULE_TYPE                    = DXE_SMM_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+  PI_SPECIFICATION_VERSION       = 0x0001000A\r
+  ENTRY_POINT                    = SmmCpuIo2Initialize\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 \r
+#\r
+\r
+[Sources]\r
+  CpuIo2Smm.c\r
+  \r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+  UefiDriverEntryPoint\r
+  BaseLib\r
+  DebugLib\r
+  IoLib\r
+  SmmServicesTableLib\r
+  BaseMemoryLib\r
+  \r
+[Protocols]\r
+  gEfiSmmCpuIo2ProtocolGuid                   # PROTOCOL ALWAYS_CONSUMED\r
+\r
+[Depex]\r
+  TRUE\r
index 1b978396fa65c301545f51db80b15c3c1f9c517b..ef43e1835fe26a0e65c9349308cedd775ebb4a51 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 #  UefiCpuPkg Package\r
 #\r
-#  Copyright (c) 2007 - 2009, Intel Corporation\r
+#  Copyright (c) 2007 - 2010, Intel Corporation\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,7 +19,7 @@
   PLATFORM_VERSION               = 0.1\r
   DSC_SPECIFICATION              = 0x00010005\r
   OUTPUT_DIRECTORY               = Build/UefiCpu\r
-  SUPPORTED_ARCHITECTURES        = IA32|X64\r
+  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64\r
   BUILD_TARGETS                  = DEBUG|RELEASE\r
   SKUID_IDENTIFIER               = DEFAULT\r
 \r
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
 \r
+[LibraryClasses.common.PEIM]\r
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
+  PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf\r
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
+  MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf\r
+\r
 [LibraryClasses.common.DXE_DRIVER]\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
 \r
+[LibraryClasses.common.DXE_SMM_DRIVER]\r
+  UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
+  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf\r
+  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
+  \r
 #\r
 # Drivers/Libraries within this package\r
 #\r
 \r
 [Components.common]\r
   UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf\r
+\r
+[Components.IA32, Components.X64]\r
+  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf\r
   UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf\r