diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-12 20:13:55 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-12 20:13:55 +0000 |
commit | 60428d0000da41bb55b41984f785761fcd6320be (patch) | |
tree | 1f3b9929e31aa5aa9f11516756d848f187557568 /EmbeddedPkg/Library/EfiFileLib | |
parent | 135ec2db42941107fc2ec69107784828a1f81e91 (diff) | |
download | edk2-platforms-60428d0000da41bb55b41984f785761fcd6320be.tar.xz |
Fix help command scroll issue. Also add FV space used, and free space to dir command.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9996 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/Library/EfiFileLib')
-rw-r--r-- | EmbeddedPkg/Library/EfiFileLib/EfiFileLib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/EmbeddedPkg/Library/EfiFileLib/EfiFileLib.c b/EmbeddedPkg/Library/EfiFileLib/EfiFileLib.c index d3d9596413..8d51fcf9c3 100644 --- a/EmbeddedPkg/Library/EfiFileLib/EfiFileLib.c +++ b/EmbeddedPkg/Library/EfiFileLib/EfiFileLib.c @@ -519,6 +519,8 @@ EblFvFileDevicePath ( EFI_LBA Lba; UINTN BlockSize; UINTN NumberOfBlocks; + EFI_FIRMWARE_VOLUME_HEADER *FvHeader = NULL; + UINTN Index; Status = gBS->HandleProtocol (File->EfiHandle, &gEfiFirmwareVolume2ProtocolGuid, (VOID **)&File->Fv); @@ -531,7 +533,13 @@ EblFvFileDevicePath ( if (!EFI_ERROR (Status)) { Status = Fvb->GetPhysicalAddress (Fvb, &File->FvStart); if (!EFI_ERROR (Status)) { - for (Lba = 0, File->FvSize = 0; ; File->FvSize += (BlockSize * NumberOfBlocks), Lba += NumberOfBlocks) { + FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)File->FvStart; + File->FvHeaderSize = sizeof (EFI_FIRMWARE_VOLUME_HEADER); + for (Index = 0; FvHeader->BlockMap[Index].Length !=0; Index++) { + File->FvHeaderSize += sizeof (EFI_FV_BLOCK_MAP_ENTRY); + } + + for (Lba = 0, File->FvSize = 0, NumberOfBlocks = 0; ; File->FvSize += (BlockSize * NumberOfBlocks), Lba += NumberOfBlocks) { Status = Fvb->GetBlockSize (Fvb, Lba, &BlockSize, &NumberOfBlocks); if (EFI_ERROR (Status)) { break; |