EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Data Structures | Defines | Functions

MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.h File Reference

Go to the source code of this file.

Data Structures

struct  LBA_CACHE
struct  FV_MEMMAP_DEVICE_PATH
struct  FV_PIWG_DEVICE_PATH
struct  EFI_FW_VOL_BLOCK_DEVICE

Defines

#define FVB_DEVICE_SIGNATURE   SIGNATURE_32('_','F','V','B')
#define FVB_DEVICE_FROM_THIS(a)   CR(a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)

Functions

EFI_STATUS EFIAPI FwVolBlockGetAttributes (IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, OUT EFI_FVB_ATTRIBUTES_2 *Attributes)
EFI_STATUS EFIAPI FwVolBlockSetAttributes (IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, IN CONST EFI_FVB_ATTRIBUTES_2 *Attributes)
EFI_STATUS EFIAPI FwVolBlockEraseBlock (IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,...)
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)
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)
EFI_STATUS EFIAPI FwVolBlockGetPhysicalAddress (IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, OUT EFI_PHYSICAL_ADDRESS *Address)
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)

Detailed Description

Firmware Volume Block protocol functions. Consumes FV hobs and creates appropriate block protocols.

Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file FwVolBlock.h.


Define Documentation

#define FVB_DEVICE_FROM_THIS (   a)    CR(a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)

Definition at line 53 of file FwVolBlock.h.

#define FVB_DEVICE_SIGNATURE   SIGNATURE_32('_','F','V','B')

Definition at line 20 of file FwVolBlock.h.


Function Documentation

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.

Parameters:
ThisCalling context
...Starting LBA followed by Number of Lba to erase. a -1 to terminate the list.
Return values:
EFI_SUCCESSThe erase request was successfully completed.
EFI_ACCESS_DENIEDThe firmware volume is in the WriteDisabled state.
EFI_DEVICE_ERRORThe block device is not functioning correctly and could not be written. The firmware device may have been partially erased.
EFI_INVALID_PARAMETEROne or more of the LBAs listed in the variable argument list do
EFI_UNSUPPORTEDNot supported.

Definition at line 169 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.

Parameters:
ThisCalling context
Attributesoutput buffer which contains attributes
Return values:
EFI_SUCCESSThe firmware volume attributes were returned.

Definition at line 100 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.

Parameters:
ThisIndicates the calling context.
LbaIndicates the block for which to return the size.
BlockSizePointer to a caller-allocated UINTN in which the size of the block is returned.
NumberOfBlocksPointer 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.
Return values:
EFI_SUCCESSThe firmware volume base address is returned.
EFI_INVALID_PARAMETERThe requested LBA is out of range.

Definition at line 358 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.

Parameters:
ThisIndicates the calling context.
AddressFvb device base address.
Return values:
EFI_SUCCESSSuccessfully got Fvb's base address.
EFI_UNSUPPORTEDNot supported.

Definition at line 320 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.

Parameters:
ThisIndicates the calling context.
LbaThe starting logical block index to read.
OffsetOffset into the block at which to begin reading.
NumBytesPointer to a UINT32. At entry, *NumBytes contains the total size of the buffer. At exit, NumBytes contains the total number of bytes actually read.
BufferPinter to a caller-allocated buffer that contains the destine for the read.
Return values:
EFI_SUCCESSThe firmware volume was read successfully.
EFI_BAD_BUFFER_SIZEThe read was attempted across an LBA boundary.
EFI_ACCESS_DENIEDAccess denied.
EFI_DEVICE_ERRORThe block device is malfunctioning and could not be read.

Definition at line 201 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.

Parameters:
ThisCalling context
Attributesinput buffer which contains attributes
Return values:
EFI_SUCCESSThe firmware volume attributes were returned.
EFI_INVALID_PARAMETERThe attributes requested are in conflict with the capabilities as declared in the firmware volume header.
EFI_UNSUPPORTEDNot supported.

Definition at line 134 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.

Parameters:
ThisIndicates the calling context.
LbaThe starting logical block index to write to.
OffsetOffset into the block at which to begin writing.
NumBytesPointer to a UINT32. At entry, *NumBytes contains the total size of the buffer. At exit, NumBytes contains the total number of bytes actually written.
BufferPinter to a caller-allocated buffer that contains the source for the write.
Return values:
EFI_SUCCESSThe firmware volume was written successfully.
EFI_BAD_BUFFER_SIZEThe write was attempted across an LBA boundary. On output, NumBytes contains the total number of bytes actually written.
EFI_ACCESS_DENIEDThe firmware volume is in the WriteDisabled state.
EFI_DEVICE_ERRORThe block device is malfunctioning and could not be written.
EFI_UNSUPPORTEDNot supported.

Definition at line 295 of file FwVolBlock.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines