summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c
diff options
context:
space:
mode:
authorKun Qin <kun.q@outlook.com>2020-12-18 00:38:50 +0300
committerKun Qin <kun.q@outlook.com>2021-02-01 21:01:03 +0300
commit5625c1fdf7258888fc26ddebe8353d3e5240701b (patch)
tree053caf18d3a81d0e01394757750c89800399e3f8 /MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c
parente35fce8adadb4141c05d5365abc56e9bd96b9fce (diff)
downloadedk2-5625c1fdf7258888fc26ddebe8353d3e5240701b.tar.xz
MdeModulePkg: SmmReportStatusCodeLib: ReportStatusCodeLib in StandaloneMm
This change added support of StandaloneMm for ReportStatusCodeLib. It adds a new instance of ReportStatusCodeLib for MM_STANDALONE type, and abstracts the references of gMmst and gSmst functionalities into separate files in order to link in proper Service Table for SMM core/drivers. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Kun Qin <kun.q@outlook.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c')
-rw-r--r--MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c
new file mode 100644
index 0000000000..603e222f55
--- /dev/null
+++ b/MdeModulePkg/Library/SmmReportStatusCodeLib/ReportStatusCodeLibTraditional.c
@@ -0,0 +1,38 @@
+/** @file
+ Abstraction layer for SMM service table used by SMM ReportStatusCodeLib.
+
+ Copyright (c) Microsoft Corporation.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <PiMm.h>
+
+#include <Library/SmmServicesTableLib.h>
+
+/**
+ Returns the first protocol instance that matches the given protocol.
+
+ @param[in] Protocol Provides the protocol to search for.
+ @param[in] Registration Optional registration key returned from
+ RegisterProtocolNotify().
+ @param[out] Interface On return, a pointer to the first interface that matches Protocol and
+ Registration.
+
+ @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in
+ Interface.
+ @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and
+ Registration.
+ @retval EFI_INVALID_PARAMETER Interface is NULL.
+ Protocol is NULL.
+
+**/
+EFI_STATUS
+InternalLocateProtocol (
+ IN EFI_GUID *Protocol,
+ IN VOID *Registration, OPTIONAL
+ OUT VOID **Interface
+ )
+{
+ return gSmst->SmmLocateProtocol (Protocol, Registration, Interface);
+}