summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuIo2Smm
diff options
context:
space:
mode:
authorKun Qin <kun.q@outlook.com>2021-01-22 18:09:04 -0800
committerKun Qin <kun.q@outlook.com>2021-02-01 10:04:42 -0800
commitc2432b31edfc4cc641482ba9378ff622577de429 (patch)
tree134e44f7789ea13b5668227e2e56d8c0c6468c23 /UefiCpuPkg/CpuIo2Smm
parent1ea21af13dfcb77d443c3d1fcb17665a6ef397de (diff)
downloadedk2-c2432b31edfc4cc641482ba9378ff622577de429.tar.gz
edk2-c2432b31edfc4cc641482ba9378ff622577de429.tar.bz2
edk2-c2432b31edfc4cc641482ba9378ff622577de429.zip
UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm
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>
Diffstat (limited to 'UefiCpuPkg/CpuIo2Smm')
-rw-r--r--UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c32
-rw-r--r--UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf45
2 files changed, 77 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c
new file mode 100644
index 0000000000..9cff4b7166
--- /dev/null
+++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c
@@ -0,0 +1,32 @@
+/** @file
+ Produces the SMM CPU I/O Protocol.
+
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) Microsoft Corporation.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <PiMm.h>
+
+#include "CpuIo2Mm.h"
+
+/**
+ The module Entry Point for Standalone MM CpuIoProtocol driver
+
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.
+ @param[in] SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The entry point is executed successfully.
+ @retval Other Some error occurs when executing this entry point.
+
+**/
+EFI_STATUS
+EFIAPI
+StandaloneMmCpuIo2Initialize (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_MM_SYSTEM_TABLE *SystemTable
+ )
+{
+ return CommonCpuIo2Initialize ();
+}
diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf
new file mode 100644
index 0000000000..ec37a9d919
--- /dev/null
+++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf
@@ -0,0 +1,45 @@
+## @file
+# Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Library.
+#
+# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = CpuIo2StandaloneMm
+ FILE_GUID = E3121A26-BB1C-4A18-8E23-2EA3F0412248
+ MODULE_TYPE = MM_STANDALONE
+ VERSION_STRING = 1.0
+ PI_SPECIFICATION_VERSION = 0x00010032
+ ENTRY_POINT = StandaloneMmCpuIo2Initialize
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Sources]
+ CpuIo2StandaloneMm.c
+ CpuIo2Mm.c
+ CpuIo2Mm.h
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ StandaloneMmDriverEntryPoint
+ BaseLib
+ DebugLib
+ IoLib
+ MmServicesTableLib
+ BaseMemoryLib
+
+[Protocols]
+ gEfiSmmCpuIo2ProtocolGuid ## PRODUCES
+
+[Depex]
+ TRUE