Implement the Fault Tolerant Write (FTW) protocol based on SMM FTW \r
module.\r
\r
-Copyright (c) 2011, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
/**\r
Send the data in communicate buffer to SMI handler and get response.\r
\r
- @param[out] SmmCommunicateHeader The communicate buffer.\r
+ @param[in, out] SmmCommunicateHeader The communicate buffer.\r
@param[in] DataSize The payload size.\r
\r
**/\r
EFI_STATUS\r
SendCommunicateBuffer (\r
- IN EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader,\r
+ IN OUT EFI_SMM_COMMUNICATE_HEADER *SmmCommunicateHeader,\r
IN UINTN DataSize\r
)\r
{\r
/**\r
Get the FvbBaseAddress and FvbAttributes from the FVB handle FvbHandle.\r
\r
- @param[in] FvBlockHandle The handle of FVB protocol that provides services.\r
- @param[in] FvbBaseAddress The base address of the FVB attached with FvBlockHandle.\r
- @param[out] FvbAttributes The attributes of the FVB attached with FvBlockHandle.\r
+ @param[in] FvbHandle The handle of FVB protocol that provides services.\r
+ @param[out] FvbBaseAddress The base address of the FVB attached with FvbHandle.\r
+ @param[out] FvbAttributes The attributes of the FVB attached with FvbHandle.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval Others The function could not complete successfully.\r
// Get data from SMM\r
//\r
*PrivateDataSize = SmmFtwGetLastWriteHeader->PrivateDataSize;\r
- if (!EFI_ERROR (Status)) {\r
+ if (Status == EFI_SUCCESS || Status == EFI_BUFFER_TOO_SMALL) {\r
*Lba = SmmFtwGetLastWriteHeader->Lba;\r
*Offset = SmmFtwGetLastWriteHeader->Offset; \r
*Length = SmmFtwGetLastWriteHeader->Length;\r
*Complete = SmmFtwGetLastWriteHeader->Complete;\r
CopyGuid (CallerId, &SmmFtwGetLastWriteHeader->CallerId);\r
- CopyMem (PrivateData, SmmFtwGetLastWriteHeader->Data, *PrivateDataSize);\r
+ if (Status == EFI_SUCCESS) {\r
+ CopyMem (PrivateData, SmmFtwGetLastWriteHeader->Data, *PrivateDataSize);\r
+ }\r
+ } else if (Status == EFI_NOT_FOUND) {\r
+ *Complete = SmmFtwGetLastWriteHeader->Complete;\r
}\r
\r
FreePool (SmmCommunicateHeader); \r