MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -8,12 +8,12 @@
|
||||
|
||||
#include "PiSmmCore.h"
|
||||
|
||||
LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList);
|
||||
LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList);
|
||||
|
||||
SMI_ENTRY mRootSmiEntry = {
|
||||
SMI_ENTRY mRootSmiEntry = {
|
||||
SMI_ENTRY_SIGNATURE,
|
||||
INITIALIZE_LIST_HEAD_VARIABLE (mRootSmiEntry.AllEntries),
|
||||
{0},
|
||||
{ 0 },
|
||||
INITIALIZE_LIST_HEAD_VARIABLE (mRootSmiEntry.SmiHandlers),
|
||||
};
|
||||
|
||||
@@ -43,8 +43,8 @@ SmmCoreFindSmiEntry (
|
||||
SmiEntry = NULL;
|
||||
for (Link = mSmiEntryList.ForwardLink;
|
||||
Link != &mSmiEntryList;
|
||||
Link = Link->ForwardLink) {
|
||||
|
||||
Link = Link->ForwardLink)
|
||||
{
|
||||
Item = CR (Link, SMI_ENTRY, AllEntries, SMI_ENTRY_SIGNATURE);
|
||||
if (CompareGuid (&Item->HandlerType, HandlerType)) {
|
||||
//
|
||||
@@ -60,7 +60,7 @@ SmmCoreFindSmiEntry (
|
||||
// allocate a new entry
|
||||
//
|
||||
if ((SmiEntry == NULL) && Create) {
|
||||
SmiEntry = AllocatePool (sizeof(SMI_ENTRY));
|
||||
SmiEntry = AllocatePool (sizeof (SMI_ENTRY));
|
||||
if (SmiEntry != NULL) {
|
||||
//
|
||||
// Initialize new SMI entry structure
|
||||
@@ -75,6 +75,7 @@ SmmCoreFindSmiEntry (
|
||||
InsertTailList (&mSmiEntryList, &SmiEntry->AllEntries);
|
||||
}
|
||||
}
|
||||
|
||||
return SmiEntry;
|
||||
}
|
||||
|
||||
@@ -108,7 +109,7 @@ SmiManage (
|
||||
BOOLEAN SuccessReturn;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
Status = EFI_NOT_FOUND;
|
||||
SuccessReturn = FALSE;
|
||||
if (HandlerType == NULL) {
|
||||
//
|
||||
@@ -119,7 +120,7 @@ SmiManage (
|
||||
//
|
||||
// Non-root SMI handler
|
||||
//
|
||||
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, FALSE);
|
||||
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *)HandlerType, FALSE);
|
||||
if (SmiEntry == NULL) {
|
||||
//
|
||||
// There is no handler registered for this interrupt source
|
||||
@@ -127,62 +128,65 @@ SmiManage (
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
Head = &SmiEntry->SmiHandlers;
|
||||
|
||||
for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
|
||||
SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
||||
|
||||
Status = SmiHandler->Handler (
|
||||
(EFI_HANDLE) SmiHandler,
|
||||
Context,
|
||||
CommBuffer,
|
||||
CommBufferSize
|
||||
);
|
||||
(EFI_HANDLE)SmiHandler,
|
||||
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_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;
|
||||
}
|
||||
|
||||
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;
|
||||
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_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;
|
||||
}
|
||||
|
||||
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;
|
||||
SuccessReturn = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
// Unexpected status code returned.
|
||||
//
|
||||
ASSERT (FALSE);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +220,7 @@ SmiHandlerRegister (
|
||||
SMI_ENTRY *SmiEntry;
|
||||
LIST_ENTRY *List;
|
||||
|
||||
if (Handler == NULL || DispatchHandle == NULL) {
|
||||
if ((Handler == NULL) || (DispatchHandle == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -225,8 +229,8 @@ SmiHandlerRegister (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
SmiHandler->Signature = SMI_HANDLER_SIGNATURE;
|
||||
SmiHandler->Handler = Handler;
|
||||
SmiHandler->Signature = SMI_HANDLER_SIGNATURE;
|
||||
SmiHandler->Handler = Handler;
|
||||
SmiHandler->CallerAddr = (UINTN)RETURN_ADDRESS (0);
|
||||
|
||||
if (HandlerType == NULL) {
|
||||
@@ -238,17 +242,18 @@ SmiHandlerRegister (
|
||||
//
|
||||
// None root SMI handler
|
||||
//
|
||||
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, TRUE);
|
||||
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *)HandlerType, TRUE);
|
||||
if (SmiEntry == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
List = &SmiEntry->SmiHandlers;
|
||||
|
||||
SmiHandler->SmiEntry = SmiEntry;
|
||||
InsertTailList (List, &SmiHandler->Link);
|
||||
|
||||
*DispatchHandle = (EFI_HANDLE) SmiHandler;
|
||||
*DispatchHandle = (EFI_HANDLE)SmiHandler;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -282,9 +287,10 @@ SmiHandlerUnRegister (
|
||||
//
|
||||
SmiHandler = NULL;
|
||||
for ( HandlerLink = GetFirstNode (&mRootSmiEntry.SmiHandlers)
|
||||
; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && ((EFI_HANDLE) SmiHandler != DispatchHandle)
|
||||
; HandlerLink = GetNextNode (&mRootSmiEntry.SmiHandlers, HandlerLink)
|
||||
) {
|
||||
; !IsNull (&mRootSmiEntry.SmiHandlers, HandlerLink) && ((EFI_HANDLE)SmiHandler != DispatchHandle)
|
||||
; HandlerLink = GetNextNode (&mRootSmiEntry.SmiHandlers, HandlerLink)
|
||||
)
|
||||
{
|
||||
SmiHandler = CR (HandlerLink, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
||||
}
|
||||
|
||||
@@ -292,19 +298,21 @@ SmiHandlerUnRegister (
|
||||
// Look for it in non-root SMI handlers
|
||||
//
|
||||
for ( EntryLink = GetFirstNode (&mSmiEntryList)
|
||||
; !IsNull (&mSmiEntryList, EntryLink) && ((EFI_HANDLE) SmiHandler != DispatchHandle)
|
||||
; EntryLink = GetNextNode (&mSmiEntryList, EntryLink)
|
||||
) {
|
||||
; !IsNull (&mSmiEntryList, EntryLink) && ((EFI_HANDLE)SmiHandler != DispatchHandle)
|
||||
; EntryLink = GetNextNode (&mSmiEntryList, EntryLink)
|
||||
)
|
||||
{
|
||||
SmiEntry = CR (EntryLink, SMI_ENTRY, AllEntries, SMI_ENTRY_SIGNATURE);
|
||||
for ( HandlerLink = GetFirstNode (&SmiEntry->SmiHandlers)
|
||||
; !IsNull (&SmiEntry->SmiHandlers, HandlerLink) && ((EFI_HANDLE) SmiHandler != DispatchHandle)
|
||||
; HandlerLink = GetNextNode (&SmiEntry->SmiHandlers, HandlerLink)
|
||||
) {
|
||||
; !IsNull (&SmiEntry->SmiHandlers, HandlerLink) && ((EFI_HANDLE)SmiHandler != DispatchHandle)
|
||||
; HandlerLink = GetNextNode (&SmiEntry->SmiHandlers, HandlerLink)
|
||||
)
|
||||
{
|
||||
SmiHandler = CR (HandlerLink, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
||||
}
|
||||
}
|
||||
|
||||
if ((EFI_HANDLE) SmiHandler != DispatchHandle) {
|
||||
if ((EFI_HANDLE)SmiHandler != DispatchHandle) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user