mirror of https://github.com/acidanthera/audk.git
Change returned status codes for SmiManage() per PI 1.2.1 spec.
Signed-off-by: Sun Rui <rui.sun@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13394 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
139259bcc2
commit
d5b339a9e7
|
@ -5,7 +5,7 @@
|
||||||
runtime s3 boot Script. This header file is to definied PI SMM related definition to locate
|
runtime s3 boot Script. This header file is to definied PI SMM related definition to locate
|
||||||
SmmSaveState Protocol
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions
|
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] CommBuffer Points to the optional communication buffer.
|
||||||
@param[in,out] CommBufferSize Points to the size of 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_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_NOT_FOUND Interrupt source was not handled or quiesced.
|
||||||
@retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
|
@retval EFI_SUCCESS Interrupt source was handled and quiesced.
|
||||||
**/
|
**/
|
||||||
typedef
|
typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
SMM Core Main Entry Point
|
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
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
distribution. The full text of the license may be found at
|
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->BufferSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||||
gSmmCorePrivate->CommunicationBuffer = NULL;
|
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 {
|
} else {
|
||||||
//
|
//
|
||||||
// Asynchronous SMI
|
// Asynchronous SMI
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
SMM IPL that produces SMM related runtime protocols and load the SMM Core into SMRAM
|
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
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
distribution. The full text of the license may be found at
|
distribution. The full text of the license may be found at
|
||||||
|
@ -504,7 +504,7 @@ SmmCommunicationCommunicate (
|
||||||
//
|
//
|
||||||
gSmmCorePrivate->InSmm = OldInSmm;
|
gSmmCorePrivate->InSmm = OldInSmm;
|
||||||
|
|
||||||
return (Status == EFI_WARN_INTERRUPT_SOURCE_QUIESCED) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
return (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
SMI management.
|
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
|
This program and the accompanying materials are licensed and made available
|
||||||
under the terms and conditions of the BSD License which accompanies this
|
under the terms and conditions of the BSD License which accompanies this
|
||||||
distribution. The full text of the license may be found at
|
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 CommBuffer Points to the optional communication buffer.
|
||||||
@param CommBufferSize Points to the size of 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_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_NOT_FOUND Interrupt source was not handled or quiesced.
|
||||||
@retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
|
@retval EFI_SUCCESS Interrupt source was handled and quiesced.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -131,42 +131,29 @@ SmiManage (
|
||||||
BOOLEAN InterruptQuiesced;
|
BOOLEAN InterruptQuiesced;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
Status = EFI_NOT_FOUND;
|
||||||
|
InterruptQuiesced = FALSE;
|
||||||
if (HandlerType == NULL) {
|
if (HandlerType == NULL) {
|
||||||
//
|
//
|
||||||
// Root SMI handler
|
// Root SMI handler
|
||||||
//
|
//
|
||||||
Status = EFI_WARN_INTERRUPT_SOURCE_PENDING;
|
|
||||||
|
|
||||||
Head = &mRootSmiHandlerList;
|
Head = &mRootSmiHandlerList;
|
||||||
for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
|
} else {
|
||||||
SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
//
|
||||||
|
// Non-root SMI handler
|
||||||
Status = SmiHandler->Handler (
|
//
|
||||||
(EFI_HANDLE) SmiHandler,
|
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, FALSE);
|
||||||
Context,
|
if (SmiEntry == NULL) {
|
||||||
CommBuffer,
|
//
|
||||||
CommBufferSize
|
// There is no handler registered for this interrupt source
|
||||||
);
|
//
|
||||||
if (Status == EFI_SUCCESS || Status == EFI_INTERRUPT_PENDING) {
|
return Status;
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return Status;
|
|
||||||
|
Head = &SmiEntry->SmiHandlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Non-root SMI handler
|
|
||||||
//
|
|
||||||
SmiEntry = SmmCoreFindSmiEntry ((EFI_GUID *) HandlerType, FALSE);
|
|
||||||
if (SmiEntry == NULL) {
|
|
||||||
//
|
|
||||||
// There is no handler registered for this interrupt source
|
|
||||||
//
|
|
||||||
return EFI_WARN_INTERRUPT_SOURCE_PENDING;
|
|
||||||
}
|
|
||||||
|
|
||||||
InterruptQuiesced = FALSE;
|
|
||||||
Head = &SmiEntry->SmiHandlers;
|
|
||||||
for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
|
for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
|
||||||
SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
SmiHandler = CR (Link, SMI_HANDLER, Link, SMI_HANDLER_SIGNATURE);
|
||||||
|
|
||||||
|
@ -180,42 +167,46 @@ SmiManage (
|
||||||
switch (Status) {
|
switch (Status) {
|
||||||
case EFI_INTERRUPT_PENDING:
|
case EFI_INTERRUPT_PENDING:
|
||||||
//
|
//
|
||||||
// If a handler returns EFI_INTERRUPT_PENDING, the interrupt could not be
|
// If a handler returns EFI_INTERRUPT_PENDING then no additional handlers
|
||||||
// quiesced, then no additional handlers will be processed,
|
// will be processed and EFI_INTERRUPT_PENDING will be returned.
|
||||||
// and EFI_INTERRUPT_PENDING will be returned
|
|
||||||
//
|
//
|
||||||
return EFI_INTERRUPT_PENDING;
|
return EFI_INTERRUPT_PENDING;
|
||||||
|
|
||||||
case EFI_SUCCESS:
|
case EFI_SUCCESS:
|
||||||
//
|
//
|
||||||
// If handler return EFI_SUCCESS, the interrupt was handled and quiesced,
|
// If a handler returns EFI_SUCCESS then no additional handlers will be processed.
|
||||||
// no other handlers should still be called,
|
// then the function will return EFI_SUCCESS.
|
||||||
// and EFI_WARN_INTERRUPT_SOURCE_QUIESCED will be returned
|
|
||||||
//
|
//
|
||||||
return EFI_WARN_INTERRUPT_SOURCE_QUIESCED;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
|
case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
|
||||||
//
|
//
|
||||||
// If at least one of the handlers report EFI_WARN_INTERRUPT_SOURCE_QUIESCED,
|
// If at least one of the handlers returns EFI_WARN_INTERRUPT_SOURCE_QUIESCED
|
||||||
// then this function will return EFI_WARN_INTERRUPT_SOURCE_QUIESCED
|
// then the function will return EFI_SUCCESS.
|
||||||
//
|
//
|
||||||
InterruptQuiesced = TRUE;
|
InterruptQuiesced = TRUE;
|
||||||
break;
|
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:
|
default:
|
||||||
|
//
|
||||||
|
// Unexpected status code returned.
|
||||||
|
//
|
||||||
|
ASSERT (FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InterruptQuiesced) {
|
if (InterruptQuiesced) {
|
||||||
Status = EFI_WARN_INTERRUPT_SOURCE_QUIESCED;
|
Status = EFI_SUCCESS;
|
||||||
} else {
|
|
||||||
//
|
|
||||||
// If no handler report EFI_WARN_INTERRUPT_SOURCE_QUIESCED, then this
|
|
||||||
// function will return EFI_INTERRUPT_PENDING
|
|
||||||
//
|
|
||||||
Status = EFI_INTERRUPT_PENDING;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Common definitions in the Platform Initialization Specification version 1.2
|
Common definitions in the Platform Initialization Specification version 1.2
|
||||||
VOLUME 4 System Management Mode Core Interface version.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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] CommBuffer Points to the optional communication buffer.
|
||||||
@param[in,out] CommBufferSize Points to the size of 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_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_NOT_FOUND Interrupt source was not handled or quiesced.
|
||||||
@retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED Interrupt source was handled and quiesced.
|
@retval EFI_SUCCESS Interrupt source was handled and quiesced.
|
||||||
**/
|
**/
|
||||||
typedef
|
typedef
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
|
Loading…
Reference in New Issue