Call platform hooks before and after invoking registered MMI handlers.
Platform can perform specific tasks in the hooks.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
---
StandaloneMmPkg/Core/StandaloneMmCore.c | 7 ++++++-
StandaloneMmPkg/Core/StandaloneMmCore.h | 1 +
StandaloneMmPkg/Core/StandaloneMmCore.inf | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core/StandaloneMmCore.c
index d221f1d1115d..43d8694fa9ef 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.c
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
@@ -351,7 +351,7 @@ MmEntryPoint (
//
// Call platform hook before Mm Dispatch
//
- // PlatformHookBeforeMmDispatch ();
+ PlatformHookBeforeMmDispatch ();
//
// If a legacy boot has occurred, then make sure gMmCorePrivate is not accessed
@@ -400,6 +400,11 @@ MmEntryPoint (
//
MmiManage (NULL, NULL, NULL, NULL);
+ //
+ // Call platform hook after Mm Dispatch
+ //
+ PlatformHookAfterMmDispatch ();
+
//
// TBD: Do not use private data structure ?
//
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h
index 822d95358c39..08ea178bfe76 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.h
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.h
@@ -40,6 +40,7 @@
#include <Library/ReportStatusCodeLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
+#include <Library/StandaloneMmCorePlatformHookLib.h>
#include <Library/StandaloneMmMemLib.h>
#include <Library/HobLib.h>
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index c44b9ff33303..ac2f07610d04 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -52,6 +52,7 @@ [LibraryClasses]
PeCoffLib
ReportStatusCodeLib
StandaloneMmCoreEntryPoint
+ StandaloneMmCorePlatformHookLib
[Protocols]
gEfiDxeMmReadyToLockProtocolGuid ## UNDEFINED # SmiHandlerRegister
--
2.29.2.windows.2
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110179): https://edk2.groups.io/g/devel/message/110179
Mute This Topic: https://groups.io/mt/102214570/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-