-/*++\r
+/** @file\r
+ Firmeware Volume BLock Service Library\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ Copyright (c) 2006 - 2007, Intel Corporation.<BR>\r
+ All rights reserved. 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
+ http://opensource.org/licenses/bsd-license.php \r
\r
-Module Name:\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
\r
- EdkFvbServiceLib.h\r
+**/\r
\r
-Abstract:\r
-\r
---*/\r
#ifndef __EDK_FVB_SERVICE_LIB_H__\r
#define __EDK_FVB_SERVICE_LIB_H__\r
\r
+/**
+ Reads specified number of bytes into a buffer from the specified block\r
+
+ @param[in] Instance The FV instance to be read from
+ @param[in] Lba The logical block address to be read from
+ @param[in] Offset Offset into the block at which to begin reading
+ @param[in,out] NumBytes Pointer that on input contains the total size of\r
+ the buffer. On output, it contains the total number\r
+ of bytes read
+ @param[in] Buffer Pointer to a caller allocated buffer that will be\r
+ used to hold the data read
+
+ @retval EFI_EFI_SUCCESS Buffer contains data read from FVB
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbReadBlock (\r
IN UINTN Instance,\r
IN UINTN Offset,\r
IN OUT UINTN *NumBytes,\r
IN UINT8 *Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Reads specified number of bytes into a buffer from the specified block\r
-\r
-Arguments:\r
- Instance - The FV instance to be read from\r
- Lba - The logical block address to be read from\r
- Offset - Offset into the block at which to begin reading\r
- NumBytes - Pointer that on input contains the total size of\r
- the buffer. On output, it contains the total number\r
- of bytes read\r
- Buffer - Pointer to a caller allocated buffer that will be\r
- used to hold the data read\r
-\r
-Returns: \r
+ );\r
\r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Writes specified number of bytes from the input buffer to the block\r
+
+ @param[in] Instance The FV instance to be read from
+ @param[in] Lba The logical block address to be write to
+ @param[in] Offset Offset into the block at which to begin writing
+ @param[in,out] NumBytes Pointer that on input contains the total size of\r
+ the buffer. On output, it contains the total number\r
+ of bytes actually written.
+ @param[in] Buffer Pointer to a caller allocated buffer that contains\r
+ the source for the write
+
+ @retval EFI_EFI_SUCCESS Buffer written to FVB
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbWriteBlock (\r
IN UINTN Instance,\r
IN UINTN Offset,\r
IN OUT UINTN *NumBytes,\r
IN UINT8 *Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Writes specified number of bytes from the input buffer to the block\r
-\r
-Arguments:\r
- Instance - The FV instance to be written to\r
- Lba - The starting logical block index to write to\r
- Offset - Offset into the block at which to begin writing\r
- NumBytes - Pointer that on input contains the total size of\r
- the buffer. On output, it contains the total number\r
- of bytes actually written\r
- Buffer - Pointer to a caller allocated buffer that contains\r
- the source for the write\r
-\r
-Returns: \r
+ );\r
\r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Erases and initializes a firmware volume block\r
+
+ @param[in] Instance The FV instance to be erased
+ @param[in] Lba The logical block address to be erased
+
+ @retval EFI_EFI_SUCCESS Lba was erased
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbEraseBlock (\r
IN UINTN Instance,\r
IN EFI_LBA Lba\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Erases and initializes a firmware volume block\r
-\r
-Arguments:\r
- Instance - The FV instance to be erased\r
- Lba - The logical block index to be erased\r
- \r
-Returns: \r
-\r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
+ );\r
\r
---*/\r
-;\r
\r
+/**
+ Retrieves attributes, insures positive polarity of attribute bits, returns\r
+ resulting attributes in output parameter\r
+
+ @param[in] Instance The FV instance
+ @param[out] Attributes The FV instance whose attributes is going to be \r
+ returned
+
+ @retval EFI_EFI_SUCCESS Valid Attributes were returned
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbGetVolumeAttributes (\r
IN UINTN Instance,\r
OUT EFI_FVB_ATTRIBUTES *Attributes\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Retrieves attributes, insures positive polarity of attribute bits, returns\r
- resulting attributes in output parameter\r
+ );\r
\r
-Arguments:\r
- Instance - The FV instance whose attributes is going to be \r
- returned\r
- Attributes - Output buffer which contains attributes\r
-\r
-Returns: \r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Modifies the current settings of the firmware volume according to the \r
+ input parameter, and returns the new setting of the volume\r
+
+ @param[in] Instance The FV instance
+ @param[in] Attributes On input, it is a pointer to EFI_FVB_ATTRIBUTES \r
+ containing the desired firmware volume settings.\r
+ On successful return, it contains the new settings\r
+ of the firmware volume
+
+ @retval EFI_EFI_SUCCESS Attributes were updated
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbSetVolumeAttributes (\r
IN UINTN Instance,\r
IN EFI_FVB_ATTRIBUTES Attributes\r
- )\r
-/*++\r
+ );\r
\r
-Routine Description:\r
- Modifies the current settings of the firmware volume according to the \r
- input parameter, and returns the new setting of the volume\r
-\r
-Arguments:\r
- Instance - The FV instance whose attributes is going to be \r
- modified\r
- Attributes - On input, it is a pointer to EFI_FVB_ATTRIBUTES \r
- containing the desired firmware volume settings.\r
- On successful return, it contains the new settings\r
- of the firmware volume\r
-\r
-Returns: \r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Retrieves the physical address of a memory mapped FV\r
+
+ @param[in] Instance The FV instance
+ @param[out] BaseAddress Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r
+ that on successful return, contains the base address\r
+ of the firmware volume.
+
+ @retval EFI_EFI_SUCCESS BaseAddress was returned
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbGetPhysicalAddress (\r
IN UINTN Instance,\r
OUT EFI_PHYSICAL_ADDRESS *BaseAddress\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Retrieves the physical address of a memory mapped FV\r
-\r
-Arguments:\r
- Instance - The FV instance whose base address is going to be\r
- returned\r
- BaseAddress - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r
- that on successful return, contains the base address\r
- of the firmware volume. \r
-\r
-Returns: \r
+ );\r
\r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Retrieve the size of a logical block\r
+
+ @param[in] Instance The FV instance
+ @param[in] Lba Indicates which block to return the size for.
+ @param[out] BlockSizze A pointer to a caller allocated UINTN in which\r
+ the size of the block is returned
+ @param[out] NumOfBlocks a pointer to a caller allocated UINTN in which the\r
+ number of consecutive blocks starting with Lba is\r
+ returned. All blocks in this range have a size of\r
+ BlockSize
+
+ @retval EFI_EFI_SUCCESS BlockSize and NumOfBlocks returned
+ @retval EFI_INVALID_PARAMETER invalid parameter
+
+**/\r
EFI_STATUS\r
EfiFvbGetBlockSize (\r
IN UINTN Instance,\r
IN EFI_LBA Lba,\r
OUT UINTN *BlockSize,\r
OUT UINTN *NumOfBlocks\r
- )\r
-/*++\r
+ );\r
\r
-Routine Description:\r
- Retrieve the size of a logical block\r
-\r
-Arguments:\r
- Instance - The FV instance whose block size is going to be\r
- returned\r
- Lba - Indicates which block to return the size for.\r
- BlockSize - A pointer to a caller allocated UINTN in which\r
- the size of the block is returned\r
- NumOfBlocks - a pointer to a caller allocated UINTN in which the\r
- number of consecutive blocks starting with Lba is\r
- returned. All blocks in this range have a size of\r
- BlockSize\r
-\r
-Returns: \r
- EFI_SUCCESS - The firmware volume was read successfully and \r
- contents are in Buffer\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
-\r
---*/\r
-;\r
\r
+/**
+ Erases and initializes a specified range of a firmware volume\r
+
+ @param[in] Instance The FV instance
+ @param[in] StartLba The starting logical block index to be erased
+ @param[in] OffsetStartLba Offset into the starting block at which to \r
+ begin erasing
+ @param[in] LastLba The last logical block index to be erased
+ @param[in] OffsetLastLba Offset into the last block at which to end erasing
+
+ @retval EFI_EFI_SUCCESS Range was erased
+ @retval EFI_INVALID_PARAMETER invalid parameter
+ @retval EFI_UNSUPPORTED Range can not be erased\r
+
+**/\r
EFI_STATUS\r
EfiFvbEraseCustomBlockRange (\r
IN UINTN Instance,\r
IN UINTN OffsetStartLba,\r
IN EFI_LBA LastLba,\r
IN UINTN OffsetLastLba\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Erases and initializes a specified range of a firmware volume\r
-\r
-Arguments:\r
- Instance - The FV instance to be erased\r
- StartLba - The starting logical block index to be erased\r
- OffsetStartLba - Offset into the starting block at which to \r
- begin erasing\r
- LastLba - The last logical block index to be erased\r
- OffsetLastLba - Offset into the last block at which to end erasing\r
-\r
-Returns: \r
-\r
- Status code\r
- \r
- EFI_INVALID_PARAMETER - invalid parameter\r
- \r
- EFI_UNSUPPORTED - not support\r
- \r
---*/\r
-;\r
+ );\r
\r
#endif\r