/** @file\r
SMM Core Main Entry Point\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
EFI_SMM_COMMUNICATE_HEADER *CommunicateHeader;\r
BOOLEAN InLegacyBoot;\r
BOOLEAN IsOverlapped;\r
+ VOID *CommunicationBuffer;\r
+ UINTN BufferSize;\r
\r
PERF_START (NULL, "SMM", NULL, 0) ;\r
\r
// Check to see if this is a Synchronous SMI sent through the SMM Communication \r
// Protocol or an Asynchronous SMI\r
//\r
- if (gSmmCorePrivate->CommunicationBuffer != NULL) {\r
+ CommunicationBuffer = gSmmCorePrivate->CommunicationBuffer;\r
+ BufferSize = gSmmCorePrivate->BufferSize;\r
+ if (CommunicationBuffer != NULL) {\r
//\r
// Synchronous SMI for SMM Core or request from Communicate protocol\r
//\r
IsOverlapped = InternalIsBufferOverlapped (\r
- (UINT8 *) gSmmCorePrivate->CommunicationBuffer,\r
- gSmmCorePrivate->BufferSize,\r
+ (UINT8 *) CommunicationBuffer,\r
+ BufferSize,\r
(UINT8 *) gSmmCorePrivate,\r
sizeof (*gSmmCorePrivate)\r
);\r
- if (!SmmIsBufferOutsideSmmValid ((UINTN)gSmmCorePrivate->CommunicationBuffer, gSmmCorePrivate->BufferSize) || IsOverlapped) {\r
+ if (!SmmIsBufferOutsideSmmValid ((UINTN)CommunicationBuffer, BufferSize) || IsOverlapped) {\r
//\r
// If CommunicationBuffer is not in valid address scope,\r
// or there is overlap between gSmmCorePrivate and CommunicationBuffer,\r
gSmmCorePrivate->CommunicationBuffer = NULL;\r
gSmmCorePrivate->ReturnStatus = EFI_INVALID_PARAMETER;\r
} else {\r
- CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)gSmmCorePrivate->CommunicationBuffer;\r
- gSmmCorePrivate->BufferSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);\r
+ CommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *)CommunicationBuffer;\r
+ BufferSize -= OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);\r
Status = SmiManage (\r
&CommunicateHeader->HeaderGuid, \r
NULL, \r
CommunicateHeader->Data, \r
- &gSmmCorePrivate->BufferSize\r
+ &BufferSize\r
);\r
//\r
// Update CommunicationBuffer, BufferSize and ReturnStatus\r
// Communicate service finished, reset the pointer to CommBuffer to NULL\r
//\r
- gSmmCorePrivate->BufferSize += OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);\r
+ gSmmCorePrivate->BufferSize = BufferSize + OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);\r
gSmmCorePrivate->CommunicationBuffer = NULL;\r
gSmmCorePrivate->ReturnStatus = (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;\r
}\r
\r
SmmCoreInitializeMemoryAttributesTable ();\r
\r
+ SmmCoreInitializeSmiHandlerProfile ();\r
+\r
return EFI_SUCCESS;\r
}\r