summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2024-03-08 13:46:14 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-04-16 04:41:27 +0000
commit31cd5ee8c0946b62520795bdbe81f886a8b81559 (patch)
treeed2e5b928302240bb249b19d4ced1c256cc05886 /StandaloneMmPkg
parent5ba3602e4580d6b65dacf4292a031627f93e1167 (diff)
downloadedk2-31cd5ee8c0946b62520795bdbe81f886a8b81559.tar.gz
edk2-31cd5ee8c0946b62520795bdbe81f886a8b81559.tar.bz2
edk2-31cd5ee8c0946b62520795bdbe81f886a8b81559.zip
Revert 2ec8f0c6407f062441b205b900038933865c7b3c
This reverts commit "StandaloneMmPkg: Disallow unregister MMI handler in other MMI handler" for better design later. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'StandaloneMmPkg')
-rw-r--r--StandaloneMmPkg/Core/Mmi.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/StandaloneMmPkg/Core/Mmi.c b/StandaloneMmPkg/Core/Mmi.c
index 9e52072bf7..c1a1d76e85 100644
--- a/StandaloneMmPkg/Core/Mmi.c
+++ b/StandaloneMmPkg/Core/Mmi.c
@@ -36,9 +36,8 @@ typedef struct {
MMI_ENTRY *MmiEntry;
} MMI_HANDLER;
-LIST_ENTRY mRootMmiHandlerList = INITIALIZE_LIST_HEAD_VARIABLE (mRootMmiHandlerList);
-LIST_ENTRY mMmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mMmiEntryList);
-MMI_HANDLER *mCurrentMmiHandler = NULL;
+LIST_ENTRY mRootMmiHandlerList = INITIALIZE_LIST_HEAD_VARIABLE (mRootMmiHandlerList);
+LIST_ENTRY mMmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mMmiEntryList);
/**
Finds the MMI entry for the requested handler type.
@@ -162,19 +161,13 @@ MmiManage (
// get next node before handler is executed, since LIST_ENTRY that
// Link points to may be freed if unregister MMI handler.
//
- Link = Link->ForwardLink;
- //
- // Assign gCurrentMmiHandle before calling the MMI handler and
- // set to NULL when it returns.
- //
- mCurrentMmiHandler = MmiHandler;
- Status = MmiHandler->Handler (
- (EFI_HANDLE)MmiHandler,
- Context,
- CommBuffer,
- CommBufferSize
- );
- mCurrentMmiHandler = NULL;
+ Link = Link->ForwardLink;
+ Status = MmiHandler->Handler (
+ (EFI_HANDLE)MmiHandler,
+ Context,
+ CommBuffer,
+ CommBufferSize
+ );
switch (Status) {
case EFI_INTERRUPT_PENDING:
@@ -321,13 +314,6 @@ MmiHandlerUnRegister (
return EFI_INVALID_PARAMETER;
}
- //
- // Do not allow to unregister MMI Handler inside other MMI Handler
- //
- if ((mCurrentMmiHandler != NULL) && (mCurrentMmiHandler != MmiHandler)) {
- return EFI_INVALID_PARAMETER;
- }
-
MmiEntry = MmiHandler->MmiEntry;
RemoveEntryList (&MmiHandler->Link);