mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 23:54:02 +02:00
1. Update PiSmmCore to always invoke SmiManage (NULL, NULL, NULL, NULL) when SMI triggered.
2. Fix issue that PlatformHookAfterSmiDispatch() and PERF_END() are not called in the case mInLegacyBoot is TRUE. signed-off-by: Jeff Fan <jeff.fan@intel.com> reviewed-by: Kinney, Michael D <michael.d.kinney@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13740 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
565b3c807c
commit
9fa90bb491
@ -261,49 +261,43 @@ SmmEntryPoint (
|
|||||||
//
|
//
|
||||||
// If a legacy boot has occured, then make sure gSmmCorePrivate is not accessed
|
// If a legacy boot has occured, then make sure gSmmCorePrivate is not accessed
|
||||||
//
|
//
|
||||||
if (mInLegacyBoot) {
|
if (!mInLegacyBoot) {
|
||||||
//
|
//
|
||||||
// Asynchronous SMI
|
// Mark the InSmm flag as TRUE, it will be used by SmmBase2 protocol
|
||||||
//
|
//
|
||||||
SmiManage (NULL, NULL, NULL, NULL);
|
gSmmCorePrivate->InSmm = TRUE;
|
||||||
return;
|
|
||||||
|
//
|
||||||
|
// Check to see if this is a Synchronous SMI sent through the SMM Communication
|
||||||
|
// Protocol or an Asynchronous SMI
|
||||||
|
//
|
||||||
|
if (gSmmCorePrivate->CommunicationBuffer != NULL) {
|
||||||
|
//
|
||||||
|
// Synchronous SMI for SMM Core or request from Communicate protocol
|
||||||
|
//
|
||||||
|
CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)gSmmCorePrivate->CommunicationBuffer;
|
||||||
|
gSmmCorePrivate->BufferSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||||
|
Status = SmiManage (
|
||||||
|
&CommunicateHeader->HeaderGuid,
|
||||||
|
NULL,
|
||||||
|
CommunicateHeader->Data,
|
||||||
|
&gSmmCorePrivate->BufferSize
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update CommunicationBuffer, BufferSize and ReturnStatus
|
||||||
|
// Communicate service finished, reset the pointer to CommBuffer to NULL
|
||||||
|
//
|
||||||
|
gSmmCorePrivate->BufferSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
||||||
|
gSmmCorePrivate->CommunicationBuffer = NULL;
|
||||||
|
gSmmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mark the InSmm flag as TRUE, it will be used by SmmBase2 protocol
|
// Process Asynchronous SMI sources
|
||||||
//
|
//
|
||||||
gSmmCorePrivate->InSmm = TRUE;
|
SmiManage (NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
//
|
|
||||||
// Check to see if this is a Synchronous SMI sent through the SMM Communication
|
|
||||||
// Protocol or an Asynchronous SMI
|
|
||||||
//
|
|
||||||
if (gSmmCorePrivate->CommunicationBuffer != NULL) {
|
|
||||||
//
|
|
||||||
// Synchronous SMI for SMM Core or request from Communicate protocol
|
|
||||||
//
|
|
||||||
CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)gSmmCorePrivate->CommunicationBuffer;
|
|
||||||
gSmmCorePrivate->BufferSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
|
||||||
Status = SmiManage (
|
|
||||||
&CommunicateHeader->HeaderGuid,
|
|
||||||
NULL,
|
|
||||||
CommunicateHeader->Data,
|
|
||||||
&gSmmCorePrivate->BufferSize
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Update CommunicationBuffer, BufferSize and ReturnStatus
|
|
||||||
// Communicate service finished, reset the pointer to CommBuffer to NULL
|
|
||||||
//
|
|
||||||
gSmmCorePrivate->BufferSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
|
|
||||||
gSmmCorePrivate->CommunicationBuffer = NULL;
|
|
||||||
gSmmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
|
|
||||||
} else {
|
|
||||||
//
|
|
||||||
// Asynchronous SMI
|
|
||||||
//
|
|
||||||
SmiManage (NULL, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Call platform hook after Smm Dispatch
|
// Call platform hook after Smm Dispatch
|
||||||
@ -311,9 +305,14 @@ SmmEntryPoint (
|
|||||||
PlatformHookAfterSmmDispatch ();
|
PlatformHookAfterSmmDispatch ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Clear the InSmm flag as we are going to leave SMM
|
// If a legacy boot has occured, then make sure gSmmCorePrivate is not accessed
|
||||||
//
|
//
|
||||||
gSmmCorePrivate->InSmm = FALSE;
|
if (!mInLegacyBoot) {
|
||||||
|
//
|
||||||
|
// Clear the InSmm flag as we are going to leave SMM
|
||||||
|
//
|
||||||
|
gSmmCorePrivate->InSmm = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
PERF_END (NULL, "SMM", NULL, 0) ;
|
PERF_END (NULL, "SMM", NULL, 0) ;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user