TianoCore EDK2 master
|
#include "FaultTolerantWriteSmmDxe.h"
Go to the source code of this file.
Variables | |
EFI_HANDLE | mHandle = NULL |
EFI_MM_COMMUNICATION2_PROTOCOL * | mMmCommunication2 = NULL |
UINTN | mPrivateDataSize = 0 |
EFI_FAULT_TOLERANT_WRITE_PROTOCOL | mFaultTolerantWriteDriver |
Implement the Fault Tolerant Write (FTW) protocol based on SMM FTW module.
Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FaultTolerantWriteSmmDxe.c.
EFI_STATUS ConvertFvbHandle | ( | IN EFI_HANDLE | FvbHandle, |
OUT EFI_PHYSICAL_ADDRESS * | FvbBaseAddress, | ||
OUT EFI_FVB_ATTRIBUTES_2 * | FvbAttributes | ||
) |
Get the FvbBaseAddress and FvbAttributes from the FVB handle FvbHandle.
[in] | FvbHandle | The handle of FVB protocol that provides services. |
[out] | FvbBaseAddress | The base address of the FVB attached with FvbHandle. |
[out] | FvbAttributes | The attributes of the FVB attached with FvbHandle. |
EFI_SUCCESS | The function completed successfully. |
Others | The function could not complete successfully. |
Definition at line 109 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FaultTolerantWriteSmmInitialize | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The driver entry point for Fault Tolerant Write driver.
The function does the necessary initialization work.
[in] | ImageHandle | The firmware allocated handle for the UEFI image. |
[in] | SystemTable | A pointer to the EFI system table. |
EFI_SUCCESS | This funtion always return EFI_SUCCESS. |
Definition at line 533 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwAbort | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This | ) |
Aborts all previously allocated writes.
[in] | This | The calling context. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
EFI_NOT_FOUND | No allocated writes exist. |
Definition at line 378 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwAllocate | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This, |
IN EFI_GUID * | CallerId, | ||
IN UINTN | PrivateDataSize, | ||
IN UINTN | NumberOfWrites | ||
) |
Allocates space for the protocol to maintain information about writes. Since writes must be completed in a fault-tolerant manner and multiple writes require more resources to be successful, this function enables the protocol to ensure that enough space exists to track information about upcoming writes.
[in] | This | A pointer to the calling context. |
[in] | CallerId | The GUID identifying the write. |
[in] | PrivateDataSize | The size of the caller's private data that must be recorded for each write. |
[in] | NumberOfWrites | The number of fault tolerant block writes that will need to occur. |
EFI_SUCCESS | The function completed successfully |
EFI_ABORTED | The function could not complete successfully. |
EFI_ACCESS_DENIED | Not all allocated writes have been completed. All writes must be completed or aborted before another fault tolerant write can occur. |
Definition at line 199 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwGetLastWrite | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This, |
OUT EFI_GUID * | CallerId, | ||
OUT EFI_LBA * | Lba, | ||
OUT UINTN * | Offset, | ||
OUT UINTN * | Length, | ||
IN OUT UINTN * | PrivateDataSize, | ||
OUT VOID * | PrivateData, | ||
OUT BOOLEAN * | Complete | ||
) |
Starts a target block update. This function records information about the write in fault-tolerant storage and completes the write in a recoverable manner, ensuring at all times that either the original contents or the modified contents are available.
[in] | This | Indicates a pointer to the calling context. |
[out] | CallerId | The GUID identifying the last write. |
[out] | Lba | The logical block address of the last write. |
[out] | Offset | The offset within the block of the last write. |
[out] | Length | The length of the last write. |
[in,out] | PrivateDataSize | On input, the size of the PrivateData buffer. On output, the size of the private data stored for this write. |
[out] | PrivateData | A pointer to a buffer. The function will copy PrivateDataSize bytes from the private data stored for this write. |
[out] | Complete | A Boolean value with TRUE indicating that the write was completed. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
EFI_NOT_FOUND | No allocated writes exist. |
Definition at line 426 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwGetMaxBlockSize | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This, |
OUT UINTN * | BlockSize | ||
) |
Get the size of the largest block that can be updated in a fault-tolerant manner.
[in] | This | Indicates a pointer to the calling context. |
[out] | BlockSize | A pointer to a caller-allocated UINTN that is updated to indicate the size of the largest block that can be updated. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
Definition at line 146 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwRestart | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This, |
IN EFI_HANDLE | FvBlockHandle | ||
) |
Restarts a previously interrupted write. The caller must provide the block protocol needed to complete the interrupted write.
[in] | This | The calling context. |
[in] | FvBlockHandle | The handle of FVB protocol that provides services. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
EFI_ACCESS_DENIED | No pending writes exist. |
Definition at line 332 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS EFIAPI FtwWrite | ( | IN EFI_FAULT_TOLERANT_WRITE_PROTOCOL * | This, |
IN EFI_LBA | Lba, | ||
IN UINTN | Offset, | ||
IN UINTN | Length, | ||
IN VOID * | PrivateData, | ||
IN EFI_HANDLE | FvBlockHandle, | ||
IN VOID * | Buffer | ||
) |
Starts a target block update. This records information about the write in fault tolerant storage, and will complete the write in a recoverable manner, ensuring at all times that either the original contents or the modified contents are available.
[in] | This | The calling context. |
[in] | Lba | The logical block address of the target block. |
[in] | Offset | The offset within the target block to place the data. |
[in] | Length | The number of bytes to write to the target block. |
[in] | PrivateData | A pointer to private data that the caller requires to complete any pending writes in the event of a fault. |
[in] | FvBlockHandle | The handle of FVB protocol that provides services for reading, writing, and erasing the target block. |
[in] | Buffer | The data to write. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
EFI_BAD_BUFFER_SIZE | The write would span a block boundary, which is not a valid action. |
EFI_ACCESS_DENIED | No writes have been allocated. |
EFI_NOT_READY | The last write has not been completed. Restart() must be called to complete it. |
Definition at line 261 of file FaultTolerantWriteSmmDxe.c.
VOID InitCommunicateBuffer | ( | OUT VOID ** | CommunicateBuffer, |
OUT VOID ** | DataPtr, | ||
IN UINTN | DataSize, | ||
IN UINTN | Function | ||
) |
Initialize the communicate buffer using DataSize and Function number.
[out] | CommunicateBuffer | The communicate buffer. Caller should free it after use. |
[out] | DataPtr | Points to the data in the communicate buffer. Caller should not free it. |
[in] | DataSize | The payload size. |
[in] | Function | The function number used to initialize the communicate header. |
Definition at line 36 of file FaultTolerantWriteSmmDxe.c.
EFI_STATUS SendCommunicateBuffer | ( | IN OUT EFI_MM_COMMUNICATE_HEADER * | SmmCommunicateHeader, |
IN UINTN | DataSize | ||
) |
Send the data in communicate buffer to SMI handler and get response.
[in,out] | SmmCommunicateHeader | The communicate buffer. |
[in] | DataSize | The payload size. |
Definition at line 75 of file FaultTolerantWriteSmmDxe.c.
SMM Fault Tolerant Write Protocol notification event handler.
Install Fault Tolerant Write Protocol.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 485 of file FaultTolerantWriteSmmDxe.c.
EFI_FAULT_TOLERANT_WRITE_PROTOCOL mFaultTolerantWriteDriver |
Definition at line 17 of file FaultTolerantWriteSmmDxe.c.
EFI_HANDLE mHandle = NULL |
Handle for the Capsule Update Policy Protocol
Definition at line 13 of file FaultTolerantWriteSmmDxe.c.
EFI_MM_COMMUNICATION2_PROTOCOL* mMmCommunication2 = NULL |
Definition at line 14 of file FaultTolerantWriteSmmDxe.c.
UINTN mPrivateDataSize = 0 |
Definition at line 15 of file FaultTolerantWriteSmmDxe.c.