diff options
-rw-r--r-- | EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h | 8 | ||||
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/PiSmmCore.c | 4 | ||||
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 4 | ||||
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/Smi.c | 83 | ||||
-rw-r--r-- | MdePkg/Include/Pi/PiSmmCis.h | 8 |
5 files changed, 49 insertions, 58 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h index 981b61bfee..350b1374f7 100644 --- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h +++ b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h @@ -5,7 +5,7 @@ runtime s3 boot Script. This header file is to definied PI SMM related definition to locate
SmmSaveState Protocol
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -192,10 +192,10 @@ EFI_STATUS @param[in,out] CommBuffer Points to the optional communication buffer.
@param[in,out] CommBufferSize Points to the size of the optional communication buffer.
- @retval EFI_SUCCESS Interrupt source was processed successfully but not quiesced.
+ @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced.
@retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was not handled or quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
+ @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced.
+ @retval EFI_SUCCESS Interrupt source was handled and quiesced.
**/
typedef
EFI_STATUS
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c index a5e4b6e980..9c7dd83223 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmCore.c @@ -1,7 +1,7 @@ /** @file
SMM Core Main Entry Point
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2012, 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
@@ -297,7 +297,7 @@ SmmEntryPoint ( //
gSmmCorePrivate->BufferSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
gSmmCorePrivate->CommunicationBuffer = NULL;
- gSmmCorePrivate->ReturnStatus = (Status == EFI_WARN_INTERRUPT_SOURCE_QUIESCED) ? EFI_SUCCESS : EFI_NOT_FOUND;
+ gSmmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
} else {
//
// Asynchronous SMI
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c index 84b9f73ecb..bda9996dc8 100644 --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c @@ -1,7 +1,7 @@ /** @file
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2012, 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
@@ -504,7 +504,7 @@ SmmCommunicationCommunicate ( //
gSmmCorePrivate->InSmm = OldInSmm;
- return (Status == EFI_WARN_INTERRUPT_SOURCE_QUIESCED) ? EFI_SUCCESS : EFI_NOT_FOUND;
+ return (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
}
/**
diff --git a/MdeModulePkg/Core/PiSmmCore/Smi.c b/MdeModulePkg/Core/PiSmmCore/Smi.c index 62c1cf6073..1868bbf9e1 100644 --- a/MdeModulePkg/Core/PiSmmCore/Smi.c +++ b/MdeModulePkg/Core/PiSmmCore/Smi.c @@ -1,7 +1,7 @@ /** @file
SMI management.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2012, 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
@@ -109,10 +109,10 @@ SmmCoreFindSmiEntry ( @param CommBuffer Points to the optional communication buffer.
@param CommBufferSize Points to the size of the optional communication buffer.
- @retval EFI_SUCCESS Interrupt source was processed successfully but not quiesced.
+ @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced.
@retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was not handled or quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
+ @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced.
+ @retval EFI_SUCCESS Interrupt source was handled and quiesced.
**/
EFI_STATUS
@@ -131,42 +131,29 @@ SmiManage ( BOOLEAN InterruptQuiesced;
EFI_STATUS Status;
+ Status = EFI_NOT_FOUND;
+ InterruptQuiesced = FALSE;
if (HandlerType == NULL) {
//
// Root SMI handler
//
- Status = EFI_WARN_INTERRUPT_SOURCE_PENDING;
Head = &mRootSmiHandlerList;
- 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
- );
- if (Status == EFI_SUCCESS || Status == EFI_INTERRUPT_PENDING) {
- return Status;
- }
- }
- return Status;
- }
-
- //
- // Non-root SMI handler
- //
- SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, FALSE);
- if (SmiEntry == NULL) {
+ } else {
//
- // There is no handler registered for this interrupt source
+ // Non-root SMI handler
//
- return EFI_WARN_INTERRUPT_SOURCE_PENDING;
+ SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, FALSE);
+ if (SmiEntry == NULL) {
+ //
+ // There is no handler registered for this interrupt source
+ //
+ return Status;
+ }
+
+ Head = &SmiEntry->SmiHandlers;
}
- InterruptQuiesced = FALSE;
- Head = &SmiEntry->SmiHandlers;
for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
@@ -180,42 +167,46 @@ SmiManage ( switch (Status) {
case EFI_INTERRUPT_PENDING:
//
- // If a handler returns EFI_INTERRUPT_PENDING, the interrupt could not be
- // quiesced, then no additional handlers will be processed,
- // and EFI_INTERRUPT_PENDING will be returned
+ // If a handler returns EFI_INTERRUPT_PENDING then no additional handlers
+ // will be processed and EFI_INTERRUPT_PENDING will be returned.
//
return EFI_INTERRUPT_PENDING;
case EFI_SUCCESS:
//
- // If handler return EFI_SUCCESS, the interrupt was handled and quiesced,
- // no other handlers should still be called,
- // and EFI_WARN_INTERRUPT_SOURCE_QUIESCED will be returned
+ // If a handler returns EFI_SUCCESS then no additional handlers will be processed.
+ // then the function will return EFI_SUCCESS.
//
- return EFI_WARN_INTERRUPT_SOURCE_QUIESCED;
+ return EFI_SUCCESS;
case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
//
- // If at least one of the handlers report EFI_WARN_INTERRUPT_SOURCE_QUIESCED,
- // then this function will return 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.
//
InterruptQuiesced = 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;
}
}
if (InterruptQuiesced) {
- Status = EFI_WARN_INTERRUPT_SOURCE_QUIESCED;
- } else {
- //
- // If no handler report EFI_WARN_INTERRUPT_SOURCE_QUIESCED, then this
- // function will return EFI_INTERRUPT_PENDING
- //
- Status = EFI_INTERRUPT_PENDING;
+ Status = EFI_SUCCESS;
}
+
return Status;
}
diff --git a/MdePkg/Include/Pi/PiSmmCis.h b/MdePkg/Include/Pi/PiSmmCis.h index 21246d5ba6..25dd51471b 100644 --- a/MdePkg/Include/Pi/PiSmmCis.h +++ b/MdePkg/Include/Pi/PiSmmCis.h @@ -2,7 +2,7 @@ Common definitions in the Platform Initialization Specification version 1.2
VOLUME 4 System Management Mode Core Interface version.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2012, 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
@@ -131,10 +131,10 @@ EFI_STATUS @param[in,out] CommBuffer Points to the optional communication buffer.
@param[in,out] CommBufferSize Points to the size of the optional communication buffer.
- @retval EFI_SUCCESS Interrupt source was processed successfully but not quiesced.
+ @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced.
@retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was not handled or quiesced.
- @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
+ @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced.
+ @retval EFI_SUCCESS Interrupt source was handled and quiesced.
**/
typedef
EFI_STATUS
|