public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Xu, Wei6" <wei6.xu@intel.com>
To: devel@edk2.groups.io
Cc: Wei6 Xu <wei6.xu@intel.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>, Ray Ni <ray.ni@intel.com>
Subject: [edk2-devel] [PATCH 2/2] StandaloneMmPkg/Core: Consumes Standalone Mm Core Platform Hook Lib.
Date: Fri, 27 Oct 2023 11:28:02 +0800	[thread overview]
Message-ID: <ef652d25f2380ea7283f0ae1658304a3d66b3bed.1698375369.git.wei6.xu@intel.com> (raw)
In-Reply-To: <cover.1698375369.git.wei6.xu@intel.com>

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2023-10-27  3:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  3:28 [edk2-devel] [PATCH 0/2] Add Platform Hook Lib into StandaloneMmCore Xu, Wei6
2023-10-27  3:28 ` [edk2-devel] [PATCH 1/2] StandaloneMmPkg: Add Standalone Mm Core platform hook lib Xu, Wei6
2023-10-27  3:28 ` Xu, Wei6 [this message]
2023-10-27 16:08 ` [edk2-devel] [PATCH 0/2] Add Platform Hook Lib into StandaloneMmCore Michael Kubacki
2023-10-28 14:03   ` Laszlo Ersek
2023-10-30  0:52     ` Xu, Wei6
2023-10-30 19:27     ` Michael Kubacki
2023-10-31  1:18       ` Xu, Wei6
2023-10-31  1:40         ` Michael Kubacki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef652d25f2380ea7283f0ae1658304a3d66b3bed.1698375369.git.wei6.xu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox