TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
FV_MEMMAP_DEVICE_PATH | mFvMemmapDevicePathTemplate |
FV_PIWG_DEVICE_PATH | mFvPIWGDevicePathTemplate |
EFI_FW_VOL_BLOCK_DEVICE | mFwVolBlock |
Implementations for Firmware Volume Block protocol.
It consumes FV HOBs and creates read-only Firmare Volume Block protocol instances for each of them.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FwVolBlock.c.
EFI_STATUS EFIAPI CoreProcessFirmwareVolume | ( | IN VOID * | FvHeader, |
IN UINTN | Size, | ||
OUT EFI_HANDLE * | FVProtocolHandle | ||
) |
This DXE service routine is used to process a firmware volume. In particular, it can be called by BDS to process a single firmware volume found in a capsule.
Caution: The caller need validate the input firmware volume to follow PI specification. DxeCore will trust the input data and process firmware volume directly.
FvHeader | pointer to a firmware volume header |
Size | the size of the buffer pointed to by FvHeader |
FVProtocolHandle | the handle on which a firmware volume protocol was produced for the firmware volume passed in. |
EFI_OUT_OF_RESOURCES | if an FVB could not be produced due to lack of system resources |
EFI_VOLUME_CORRUPTED | if the volume was corrupted |
EFI_SUCCESS | a firmware volume protocol was produced for the firmware volume |
Definition at line 676 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockDriverInit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.
ImageHandle | The image handle. |
SystemTable | The system table. |
EFI_SUCCESS | Successfully initialized firmware volume block driver. |
Definition at line 613 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockEraseBlock | ( | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
... | |||
) |
The EraseBlock() function erases one or more blocks as denoted by the variable argument list. The entire parameter list of blocks must be verified prior to erasing any blocks. If a block is requested that does not exist within the associated firmware volume (it has a larger index than the last block of the firmware volume), the EraseBlock() function must return EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
This | Calling context |
... | Starting LBA followed by Number of Lba to erase. a -1 to terminate the list. |
EFI_SUCCESS | The erase request was successfully completed. |
EFI_ACCESS_DENIED | The firmware volume is in the WriteDisabled state. |
EFI_DEVICE_ERROR | The block device is not functioning correctly and could not be written. The firmware device may have been partially erased. |
EFI_INVALID_PARAMETER | One or more of the LBAs listed in the variable argument list do |
EFI_UNSUPPORTED | Not supported. |
Definition at line 158 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockGetAttributes | ( | IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
OUT EFI_FVB_ATTRIBUTES_2 * | Attributes | ||
) |
Retrieves Volume attributes. No polarity translations are done.
This | Calling context |
Attributes | output buffer which contains attributes |
EFI_SUCCESS | The firmware volume attributes were returned. |
Definition at line 93 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockGetBlockSize | ( | IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
IN CONST EFI_LBA | Lba, | ||
IN OUT UINTN * | BlockSize, | ||
IN OUT UINTN * | NumberOfBlocks | ||
) |
Retrieves the size in bytes of a specific block within a firmware volume.
This | Indicates the calling context. |
Lba | Indicates the block for which to return the size. |
BlockSize | Pointer to a caller-allocated UINTN in which the size of the block is returned. |
NumberOfBlocks | Pointer to a caller-allocated UINTN in which the number of consecutive blocks starting with Lba is returned. All blocks in this range have a size of BlockSize. |
EFI_SUCCESS | The firmware volume base address is returned. |
EFI_INVALID_PARAMETER | The requested LBA is out of range. |
Definition at line 339 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockGetPhysicalAddress | ( | IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
OUT EFI_PHYSICAL_ADDRESS * | Address | ||
) |
Get Fvb's base address.
This | Indicates the calling context. |
Address | Fvb device base address. |
EFI_SUCCESS | Successfully got Fvb's base address. |
EFI_UNSUPPORTED | Not supported. |
Definition at line 303 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockReadBlock | ( | IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
IN CONST EFI_LBA | Lba, | ||
IN CONST UINTN | Offset, | ||
IN OUT UINTN * | NumBytes, | ||
IN OUT UINT8 * | Buffer | ||
) |
Read the specified number of bytes from the block to the input buffer.
This | Indicates the calling context. |
Lba | The starting logical block index to read. |
Offset | Offset into the block at which to begin reading. |
NumBytes | Pointer to a UINT32. At entry, *NumBytes contains the total size of the buffer. At exit, NumBytes contains the total number of bytes actually read. |
Buffer | Pinter to a caller-allocated buffer that contains the destine for the read. |
EFI_SUCCESS | The firmware volume was read successfully. |
EFI_BAD_BUFFER_SIZE | The read was attempted across an LBA boundary. |
EFI_ACCESS_DENIED | Access denied. |
EFI_DEVICE_ERROR | The block device is malfunctioning and could not be read. |
Definition at line 188 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockSetAttributes | ( | IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
IN CONST EFI_FVB_ATTRIBUTES_2 * | Attributes | ||
) |
Modifies the current settings of the firmware volume according to the input parameter.
This | Calling context |
Attributes | input buffer which contains attributes |
EFI_SUCCESS | The firmware volume attributes were returned. |
EFI_INVALID_PARAMETER | The attributes requested are in conflict with the capabilities as declared in the firmware volume header. |
EFI_UNSUPPORTED | Not supported. |
Definition at line 125 of file FwVolBlock.c.
EFI_STATUS EFIAPI FwVolBlockWriteBlock | ( | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | This, |
IN EFI_LBA | Lba, | ||
IN UINTN | Offset, | ||
IN OUT UINTN * | NumBytes, | ||
IN UINT8 * | Buffer | ||
) |
Writes the specified number of bytes from the input buffer to the block.
This | Indicates the calling context. |
Lba | The starting logical block index to write to. |
Offset | Offset into the block at which to begin writing. |
NumBytes | Pointer to a UINT32. At entry, *NumBytes contains the total size of the buffer. At exit, NumBytes contains the total number of bytes actually written. |
Buffer | Pinter to a caller-allocated buffer that contains the source for the write. |
EFI_SUCCESS | The firmware volume was written successfully. |
EFI_BAD_BUFFER_SIZE | The write was attempted across an LBA boundary. On output, NumBytes contains the total number of bytes actually written. |
EFI_ACCESS_DENIED | The firmware volume is in the WriteDisabled state. |
EFI_DEVICE_ERROR | The block device is malfunctioning and could not be written. |
EFI_UNSUPPORTED | Not supported. |
Definition at line 280 of file FwVolBlock.c.
UINT32 GetFvbAuthenticationStatus | ( | IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL * | FvbProtocol | ) |
Get FVB authentication status
FvbProtocol | FVB protocol. |
Definition at line 396 of file FwVolBlock.c.
EFI_STATUS ProduceFVBProtocolOnBuffer | ( | IN EFI_PHYSICAL_ADDRESS | BaseAddress, |
IN UINT64 | Length, | ||
IN EFI_HANDLE | ParentHandle, | ||
IN UINT32 | AuthenticationStatus, | ||
OUT EFI_HANDLE *FvProtocol | OPTIONAL | ||
) |
This routine produces a firmware volume block protocol on a given buffer.
BaseAddress | base address of the firmware volume image |
Length | length of the firmware volume image |
ParentHandle | handle of parent firmware volume, if this image came from an FV image file and section in another firmware volume (ala capsules) |
AuthenticationStatus | Authentication status inherited, if this image came from an FV image file and section in another firmware volume. |
FvProtocol | Firmware volume block protocol produced. |
EFI_VOLUME_CORRUPTED | Volume corrupted. |
EFI_OUT_OF_RESOURCES | No enough buffer to be allocated. |
EFI_SUCCESS | Successfully produced a FVB protocol on given buffer. |
Definition at line 432 of file FwVolBlock.c.
FV_MEMMAP_DEVICE_PATH mFvMemmapDevicePathTemplate |
Definition at line 15 of file FwVolBlock.c.
FV_PIWG_DEVICE_PATH mFvPIWGDevicePathTemplate |
Definition at line 39 of file FwVolBlock.c.
EFI_FW_VOL_BLOCK_DEVICE mFwVolBlock |
Definition at line 61 of file FwVolBlock.c.