-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\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
date items to there virtual address.\r
\r
mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] - Physical copy of instance data\r
date items to there virtual address.\r
\r
mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] - Physical copy of instance data\r
FwhInstance - The EFI_FW_VOL_INSTANCE fimrware instance structure\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
FwhInstance - The EFI_FW_VOL_INSTANCE fimrware instance structure\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
Global - Pointer to ESAL_FWB_GLOBAL that contains all\r
instance data\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
Global - Pointer to ESAL_FWB_GLOBAL that contains all\r
instance data\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
returned\r
Attributes - Output buffer which contains attributes\r
Global - Pointer to ESAL_FWB_GLOBAL that contains all\r
instance data\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
returned\r
Attributes - Output buffer which contains attributes\r
Global - Pointer to ESAL_FWB_GLOBAL that contains all\r
instance data\r
Virtual - Whether CPU is in virtual or physical mode\r
\r
of the Lba\r
LbaLength - On output, contains the length of the block\r
NumOfBlocks - A pointer to a caller allocated UINTN in which the\r
of the Lba\r
LbaLength - On output, contains the length of the block\r
NumOfBlocks - A pointer to a caller allocated UINTN in which the\r
contents are in Buffer\r
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes returned\r
in Buffer\r
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state\r
contents are in Buffer\r
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes returned\r
in Buffer\r
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state\r
EFI_SUCCESS - The firmware volume was written successfully\r
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes\r
actually written\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The firmware volume was written successfully\r
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes\r
actually written\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The erase request was successfully completed\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The erase request was successfully completed\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
begin erasing\r
LastLba - The last logical block index to be erased\r
OffsetStartLba - Offset into the last block at which to end erasing\r
begin erasing\r
LastLba - The last logical block index to be erased\r
OffsetStartLba - Offset into the last block at which to end erasing\r
EFI_SUCCESS - The firmware volume was erased successfully\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The firmware volume was erased successfully\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
containing the desired firmware volume settings.\r
On successful return, it contains the new settings\r
of the firmware volume\r
containing the desired firmware volume settings.\r
On successful return, it contains the new settings\r
of the firmware volume\r
EFI_SUCCESS - Successfully returns\r
EFI_ACCESS_DENIED - The volume setting is locked and cannot be modified\r
EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are\r
EFI_SUCCESS - Successfully returns\r
EFI_ACCESS_DENIED - The volume setting is locked and cannot be modified\r
EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are\r
EFIAPI\r
FvbProtocolEraseBlocks (\r
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
EFIAPI\r
FvbProtocolEraseBlocks (\r
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
- prior to erasing any blocks. If a block is requested that does not exist \r
- within the associated firmware volume (it has a larger index than the last \r
+ prior to erasing any blocks. If a block is requested that does not exist\r
+ within the associated firmware volume (it has a larger index than the last\r
block of the firmware volume), the EraseBlock() function must return\r
EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
\r
Arguments:\r
This - Calling context\r
block of the firmware volume), the EraseBlock() function must return\r
EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
\r
Arguments:\r
This - Calling context\r
EFI_SUCCESS - The erase request was successfully completed\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The erase request was successfully completed\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
output, indicates the actual number of bytes written\r
Buffer - Buffer containing source data for the write.\r
\r
output, indicates the actual number of bytes written\r
Buffer - Buffer containing source data for the write.\r
\r
EFI_SUCCESS - The firmware volume was written successfully\r
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes\r
actually written\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The firmware volume was written successfully\r
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes\r
actually written\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
output, indicates the actual number of bytes Read\r
Buffer - Buffer containing source data for the Read.\r
\r
output, indicates the actual number of bytes Read\r
Buffer - Buffer containing source data for the Read.\r
\r
contents are in Buffer\r
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes returned\r
in Buffer\r
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state\r
contents are in Buffer\r
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,\r
NumBytes contains the total number of bytes returned\r
in Buffer\r
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state\r
begin erasing\r
LastLba - The last logical block index to be erased\r
OffsetStartLba - Offset into the last block at which to end erasing\r
\r
begin erasing\r
LastLba - The last logical block index to be erased\r
OffsetStartLba - Offset into the last block at which to end erasing\r
\r
EFI_SUCCESS - The firmware volume was erased successfully\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The firmware volume was erased successfully\r
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state\r
EFI_SUCCESS - The firmware volume is consistent\r
EFI_NOT_FOUND - The firmware volume has corrupted. So it is not an FV\r
\r
EFI_SUCCESS - The firmware volume is consistent\r
EFI_NOT_FOUND - The firmware volume has corrupted. So it is not an FV\r
\r
// Allocate runtime services data for global variable, which contains\r
// the private data of all firmware volume block instances\r
//\r
// Allocate runtime services data for global variable, which contains\r
// the private data of all firmware volume block instances\r
//\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- sizeof (ESAL_FWB_GLOBAL),\r
- &mFvbModuleGlobal\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+ mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));\r
+ ASSERT (mFvbModuleGlobal != NULL);\r
// the private data of each FV instance. But in virtual mode or in physical\r
// mode, the address of the the physical memory may be different.\r
//\r
// the private data of each FV instance. But in virtual mode or in physical\r
// mode, the address of the the physical memory may be different.\r
//\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- BufferSize,\r
- &mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+ mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);\r
+ ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- sizeof (EFI_FW_VOL_BLOCK_DEVICE),\r
- &FvbDevice\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+ FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
+ ASSERT (FvbDevice != NULL);\r
- Status = gBS->AllocatePool (\r
- EfiRuntimeServicesData,\r
- MaxLbaSize,\r
- &mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+ mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] = AllocateRuntimePool (MaxLbaSize);\r
+ ASSERT (mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] != NULL);\r