summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c')
-rw-r--r--MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
index 2016af60d8..ca6967c9be 100644
--- a/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
+++ b/MdePkg/Library/SmmPeriodicSmiLib/SmmPeriodicSmiLib.c
@@ -1,7 +1,7 @@
/** @file
SMM Periodic SMI Library.
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -146,19 +146,6 @@ typedef struct {
/**
Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT
- structure based on a pointer to a RegisterContext field.
-
-**/
-#define PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_REGISTER_CONTEXT(a) \
- CR ( \
- a, \
- PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT, \
- RegisterContext, \
- PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_SIGNATURE \
- )
-
-/**
- Macro that returns a pointer to a PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT
structure based on a pointer to a Link field.
**/
@@ -280,26 +267,31 @@ LookupPeriodicSmiLibraryHandler (
/**
Internal worker function that sets that active periodic SMI handler based on
- the Context used when the periodic SMI handler was registered with the
- SMM Periodic Timer Dispatch 2 Protocol. If Context is NULL, then the
+ the DispatchHandle that was returned when the periodic SMI handler was enabled
+ with PeriodicSmiEnable(). If DispatchHandle is NULL, then the
state is updated to show that there is not active periodic SMI handler.
A pointer to the active PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure
is returned.
-
- @retval NULL Context is NULL.
+
+ @param [in] DispatchHandle DispatchHandle that was returned when the periodic
+ SMI handler was enabled with PeriodicSmiEnable().
+ This is an optional parameter that may be NULL.
+ If this parameter is NULL, then the state is updated
+ to show that there is not active periodic SMI handler.
+ @retval NULL DispatchHandle is NULL.
@retval other Pointer to the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT
- associated with Context.
+ associated with DispatchHandle.
**/
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *
SetActivePeriodicSmiLibraryHandler (
- IN CONST VOID *Context OPTIONAL
+ IN EFI_HANDLE DispatchHandle OPTIONAL
)
{
- if (Context == NULL) {
+ if (DispatchHandle == NULL) {
gActivePeriodicSmiLibraryHandler = NULL;
} else {
- gActivePeriodicSmiLibraryHandler = PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT_FROM_REGISTER_CONTEXT (Context);
+ gActivePeriodicSmiLibraryHandler = LookupPeriodicSmiLibraryHandler (DispatchHandle);
}
return gActivePeriodicSmiLibraryHandler;
}
@@ -798,7 +790,7 @@ PeriodicSmiDispatchFunction (
//
// Set the active periodic SMI handler
//
- PeriodicSmiLibraryHandler = SetActivePeriodicSmiLibraryHandler (Context);
+ PeriodicSmiLibraryHandler = SetActivePeriodicSmiLibraryHandler (DispatchHandle);
if (PeriodicSmiLibraryHandler == NULL) {
return EFI_NOT_FOUND;
}