TianoCore EDK2 master
|
#include "FaultTolerantWrite.h"
Go to the source code of this file.
Functions | |
VOID | InitializeLocalWorkSpaceHeader (IN UINTN WorkSpaceLength) |
BOOLEAN | IsValidWorkSpace (IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader) |
EFI_STATUS | InitWorkSpaceHeader (IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *WorkingHeader) |
EFI_STATUS | ReadWorkSpaceData (IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock, IN UINTN BlockSize, IN EFI_LBA Lba, IN UINTN Offset, IN UINTN Length, OUT UINT8 *Buffer) |
EFI_STATUS | WriteWorkSpaceData (IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvBlock, IN UINTN BlockSize, IN EFI_LBA Lba, IN UINTN Offset, IN UINTN Length, IN UINT8 *Buffer) |
EFI_STATUS | WorkSpaceRefresh (IN EFI_FTW_DEVICE *FtwDevice) |
EFI_STATUS | FtwReclaimWorkSpace (IN EFI_FTW_DEVICE *FtwDevice, IN BOOLEAN PreserveRecord) |
Variables | |
EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER | mWorkingBlockHeader = { ZERO_GUID, 0, 0, 0, 0, { 0, 0, 0 }, 0 } |
Internal functions to operate Working Block Space.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UpdateWorkingBlock.c.
EFI_STATUS FtwReclaimWorkSpace | ( | IN EFI_FTW_DEVICE * | FtwDevice, |
IN BOOLEAN | PreserveRecord | ||
) |
Reclaim the work space on the working block.
FtwDevice | Point to private data of FTW driver |
PreserveRecord | Whether to preserve the working record is needed |
EFI_SUCCESS | The function completed successfully |
EFI_OUT_OF_RESOURCES | Allocate memory error |
EFI_ABORTED | The function could not complete successfully |
Definition at line 366 of file UpdateWorkingBlock.c.
Initialize a local work space header.
Since Signature and WriteQueueSize have been known, Crc can be calculated out, then the work space header will be fixed.
[in] | WorkSpaceLength | Length in bytes of the FTW workspace area. |
Definition at line 24 of file UpdateWorkingBlock.c.
EFI_STATUS InitWorkSpaceHeader | ( | IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER * | WorkingHeader | ) |
Initialize a work space when there is no work space.
WorkingHeader | Pointer of working block header |
EFI_SUCCESS | The function completed successfully |
EFI_ABORTED | The function could not complete successfully. |
Definition at line 107 of file UpdateWorkingBlock.c.
BOOLEAN IsValidWorkSpace | ( | IN EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER * | WorkingHeader | ) |
Check to see if it is a valid work space.
WorkingHeader | Pointer of working block header |
TRUE | The work space is valid. |
FALSE | The work space is invalid. |
Definition at line 81 of file UpdateWorkingBlock.c.
EFI_STATUS ReadWorkSpaceData | ( | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | FvBlock, |
IN UINTN | BlockSize, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | Offset, | ||
IN UINTN | Length, | ||
OUT UINT8 * | Buffer | ||
) |
Read work space data from work block or spare block.
FvBlock | FVB Protocol interface to access the block. |
BlockSize | The size of the block. |
Lba | Lba of the block. |
Offset | The offset within the block. |
Length | The number of bytes to read from the block. |
Buffer | The data is read. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
Definition at line 135 of file UpdateWorkingBlock.c.
EFI_STATUS WorkSpaceRefresh | ( | IN EFI_FTW_DEVICE * | FtwDevice | ) |
Read from working block to refresh the work space in memory.
FtwDevice | Point to private data of FTW driver |
EFI_SUCCESS | The function completed successfully |
EFI_ABORTED | The function could not complete successfully. |
Definition at line 258 of file UpdateWorkingBlock.c.
EFI_STATUS WriteWorkSpaceData | ( | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | FvBlock, |
IN UINTN | BlockSize, | ||
IN EFI_LBA | Lba, | ||
IN UINTN | Offset, | ||
IN UINTN | Length, | ||
IN UINT8 * | Buffer | ||
) |
Write work space data to work block.
FvBlock | FVB Protocol interface to access the block. |
BlockSize | The size of the block. |
Lba | Lba of the block. |
Offset | The offset within the block to place the data. |
Length | The number of bytes to write to the block. |
Buffer | The data to write. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | The function could not complete successfully. |
Definition at line 199 of file UpdateWorkingBlock.c.
EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER mWorkingBlockHeader = { ZERO_GUID, 0, 0, 0, 0, { 0, 0, 0 }, 0 } |
Definition at line 12 of file UpdateWorkingBlock.c.