]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm
authorKun Qin <kun.q@outlook.com>
Sat, 23 Jan 2021 02:09:04 +0000 (18:09 -0800)
committerKun Qin <kun.q@outlook.com>
Mon, 1 Feb 2021 18:04:42 +0000 (10:04 -0800)
This change adds a new CpuIo driver instance for MM_STANDALONE type. The
new driver entrypoint is implemented in a separate file to match the
interface definition of MM_STANDALONE modules.

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: Ray Ni <ray.ni@intel.com>
UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c [new file with mode: 0644]
UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf [new file with mode: 0644]
UefiCpuPkg/UefiCpuPkg.dsc

diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c
new file mode 100644 (file)
index 0000000..9cff4b7
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  Produces the SMM CPU I/O Protocol.\r
+\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#include <PiMm.h>\r
+\r
+#include "CpuIo2Mm.h"\r
+\r
+/**\r
+  The module Entry Point for Standalone MM CpuIoProtocol driver\r
+\r
+  @param[in] ImageHandle  The firmware allocated handle for the EFI image.\r
+  @param[in] 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
+StandaloneMmCpuIo2Initialize (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_MM_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  return CommonCpuIo2Initialize ();\r
+}\r
diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf
new file mode 100644 (file)
index 0000000..ec37a9d
--- /dev/null
@@ -0,0 +1,45 @@
+## @file\r
+#  Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library.\r
+#\r
+#  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) Microsoft Corporation.\r
+#  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = CpuIo2StandaloneMm\r
+  FILE_GUID                      = E3121A26-BB1C-4A18-8E23-2EA3F0412248\r
+  MODULE_TYPE                    = MM_STANDALONE\r
+  VERSION_STRING                 = 1.0\r
+  PI_SPECIFICATION_VERSION       = 0x00010032\r
+  ENTRY_POINT                    = StandaloneMmCpuIo2Initialize\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
+  CpuIo2StandaloneMm.c\r
+  CpuIo2Mm.c\r
+  CpuIo2Mm.h\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+  StandaloneMmDriverEntryPoint\r
+  BaseLib\r
+  DebugLib\r
+  IoLib\r
+  MmServicesTableLib\r
+  BaseMemoryLib\r
+\r
+[Protocols]\r
+  gEfiSmmCpuIo2ProtocolGuid                   ## PRODUCES\r
+\r
+[Depex]\r
+  TRUE\r
index c3c27afff88e1bdae761aac0803b9b88f0c801ea..9128cef076dd18c2160c18fce7c5870ca8a1f115 100644 (file)
@@ -38,6 +38,7 @@
   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf\r
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
+  StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf\r
   DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf\r
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf\r
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
@@ -96,6 +97,9 @@
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
   CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf\r
 \r
+[LibraryClasses.common.MM_STANDALONE]\r
+  MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf\r
+\r
 [LibraryClasses.common.UEFI_APPLICATION]\r
   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
       NULL|UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf\r
   }\r
   UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf\r
+  UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf\r
   UefiCpuPkg/CpuMpPei/CpuMpPei.inf\r
   UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf\r
   UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf\r