summaryrefslogtreecommitdiffstats
path: root/StandaloneMmPkg/Core/Mmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'StandaloneMmPkg/Core/Mmi.c')
-rw-r--r--StandaloneMmPkg/Core/Mmi.c133
1 files changed, 68 insertions, 65 deletions
diff --git a/StandaloneMmPkg/Core/Mmi.c b/StandaloneMmPkg/Core/Mmi.c
index fed8480020..8252355a48 100644
--- a/StandaloneMmPkg/Core/Mmi.c
+++ b/StandaloneMmPkg/Core/Mmi.c
@@ -20,11 +20,11 @@
#define MMI_ENTRY_SIGNATURE SIGNATURE_32('m','m','i','e')
typedef struct {
- UINTN Signature;
- LIST_ENTRY AllEntries; // All entries
+ UINTN Signature;
+ LIST_ENTRY AllEntries; // All entries
- EFI_GUID HandlerType; // Type of interrupt
- LIST_ENTRY MmiHandlers; // All handlers
+ EFI_GUID HandlerType; // Type of interrupt
+ LIST_ENTRY MmiHandlers; // All handlers
} MMI_ENTRY;
#define MMI_HANDLER_SIGNATURE SIGNATURE_32('m','m','i','h')
@@ -65,8 +65,8 @@ MmCoreFindMmiEntry (
MmiEntry = NULL;
for (Link = mMmiEntryList.ForwardLink;
Link != &mMmiEntryList;
- Link = Link->ForwardLink) {
-
+ Link = Link->ForwardLink)
+ {
Item = CR (Link, MMI_ENTRY, AllEntries, MMI_ENTRY_SIGNATURE);
if (CompareGuid (&Item->HandlerType, HandlerType)) {
//
@@ -97,6 +97,7 @@ MmCoreFindMmiEntry (
InsertTailList (&mMmiEntryList, &MmiEntry->AllEntries);
}
}
+
return MmiEntry;
}
@@ -130,7 +131,7 @@ MmiManage (
BOOLEAN SuccessReturn;
EFI_STATUS Status;
- Status = EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
SuccessReturn = FALSE;
if (HandlerType == NULL) {
//
@@ -142,7 +143,7 @@ MmiManage (
//
// Non-root MMI handler
//
- MmiEntry = MmCoreFindMmiEntry ((EFI_GUID *) HandlerType, FALSE);
+ MmiEntry = MmCoreFindMmiEntry ((EFI_GUID *)HandlerType, FALSE);
if (MmiEntry == NULL) {
//
// There is no handler registered for this interrupt source
@@ -157,56 +158,58 @@ MmiManage (
MmiHandler = CR (Link, MMI_HANDLER, Link, MMI_HANDLER_SIGNATURE);
Status = MmiHandler->Handler (
- (EFI_HANDLE) MmiHandler,
- Context,
- CommBuffer,
- CommBufferSize
- );
+ (EFI_HANDLE)MmiHandler,
+ Context,
+ CommBuffer,
+ CommBufferSize
+ );
switch (Status) {
- case EFI_INTERRUPT_PENDING:
- //
- // If a handler returns EFI_INTERRUPT_PENDING and HandlerType is not NULL then
- // no additional handlers will be processed and EFI_INTERRUPT_PENDING will be returned.
- //
- if (HandlerType != NULL) {
- return EFI_INTERRUPT_PENDING;
- }
- break;
-
- case EFI_SUCCESS:
- //
- // If at least one of the handlers returns EFI_SUCCESS then the function will return
- // EFI_SUCCESS. If a handler returns EFI_SUCCESS and HandlerType is not NULL then no
- // additional handlers will be processed.
- //
- if (HandlerType != NULL) {
- return EFI_SUCCESS;
- }
- SuccessReturn = TRUE;
- break;
-
- case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
- //
- // If at least one of the handlers returns EFI_WARN_INTERRUPT_SOURCE_QUIESCED
- // then the function will return EFI_SUCCESS.
- //
- SuccessReturn = TRUE;
- break;
-
- case EFI_WARN_INTERRUPT_SOURCE_PENDING:
- //
- // If all the handlers returned EFI_WARN_INTERRUPT_SOURCE_PENDING
- // then EFI_WARN_INTERRUPT_SOURCE_PENDING will be returned.
- //
- break;
-
- default:
- //
- // Unexpected status code returned.
- //
- ASSERT (FALSE);
- break;
+ case EFI_INTERRUPT_PENDING:
+ //
+ // If a handler returns EFI_INTERRUPT_PENDING and HandlerType is not NULL then
+ // no additional handlers will be processed and EFI_INTERRUPT_PENDING will be returned.
+ //
+ if (HandlerType != NULL) {
+ return EFI_INTERRUPT_PENDING;
+ }
+
+ break;
+
+ case EFI_SUCCESS:
+ //
+ // If at least one of the handlers returns EFI_SUCCESS then the function will return
+ // EFI_SUCCESS. If a handler returns EFI_SUCCESS and HandlerType is not NULL then no
+ // additional handlers will be processed.
+ //
+ if (HandlerType != NULL) {
+ return EFI_SUCCESS;
+ }
+
+ SuccessReturn = TRUE;
+ break;
+
+ case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
+ //
+ // If at least one of the handlers returns EFI_WARN_INTERRUPT_SOURCE_QUIESCED
+ // then the function will return EFI_SUCCESS.
+ //
+ SuccessReturn = TRUE;
+ break;
+
+ case EFI_WARN_INTERRUPT_SOURCE_PENDING:
+ //
+ // If all the handlers returned EFI_WARN_INTERRUPT_SOURCE_PENDING
+ // then EFI_WARN_INTERRUPT_SOURCE_PENDING will be returned.
+ //
+ break;
+
+ default:
+ //
+ // Unexpected status code returned.
+ //
+ ASSERT (FALSE);
+ break;
}
}
@@ -231,16 +234,16 @@ MmiManage (
EFI_STATUS
EFIAPI
MmiHandlerRegister (
- IN EFI_MM_HANDLER_ENTRY_POINT Handler,
- IN CONST EFI_GUID *HandlerType OPTIONAL,
- OUT EFI_HANDLE *DispatchHandle
+ IN EFI_MM_HANDLER_ENTRY_POINT Handler,
+ IN CONST EFI_GUID *HandlerType OPTIONAL,
+ OUT EFI_HANDLE *DispatchHandle
)
{
MMI_HANDLER *MmiHandler;
MMI_ENTRY *MmiEntry;
LIST_ENTRY *List;
- if (Handler == NULL || DispatchHandle == NULL) {
+ if ((Handler == NULL) || (DispatchHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -250,19 +253,19 @@ MmiHandlerRegister (
}
MmiHandler->Signature = MMI_HANDLER_SIGNATURE;
- MmiHandler->Handler = Handler;
+ MmiHandler->Handler = Handler;
if (HandlerType == NULL) {
//
// This is root MMI handler
//
MmiEntry = NULL;
- List = &mRootMmiHandlerList;
+ List = &mRootMmiHandlerList;
} else {
//
// None root MMI handler
//
- MmiEntry = MmCoreFindMmiEntry ((EFI_GUID *) HandlerType, TRUE);
+ MmiEntry = MmCoreFindMmiEntry ((EFI_GUID *)HandlerType, TRUE);
if (MmiEntry == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -273,7 +276,7 @@ MmiHandlerRegister (
MmiHandler->MmiEntry = MmiEntry;
InsertTailList (List, &MmiHandler->Link);
- *DispatchHandle = (EFI_HANDLE) MmiHandler;
+ *DispatchHandle = (EFI_HANDLE)MmiHandler;
return EFI_SUCCESS;
}
@@ -296,7 +299,7 @@ MmiHandlerUnRegister (
MMI_HANDLER *MmiHandler;
MMI_ENTRY *MmiEntry;
- MmiHandler = (MMI_HANDLER *) DispatchHandle;
+ MmiHandler = (MMI_HANDLER *)DispatchHandle;
if (MmiHandler == NULL) {
return EFI_INVALID_PARAMETER;