summaryrefslogtreecommitdiff
path: root/UnixPkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-24 06:49:35 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-24 06:49:35 +0000
commite9cf53f2f991bc84d0989c8dae35deef6fbc4526 (patch)
tree5034c6c118489a7552ac6167a3f4a02afa0a07cc /UnixPkg
parentefd542830fe0031d00985cfcb9ea333b7b65fa12 (diff)
downloadedk2-platforms-e9cf53f2f991bc84d0989c8dae35deef6fbc4526.tar.xz
Clean Unix FVB driver doesn't produce the undefined FVB extension protocol.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7633 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg')
-rw-r--r--UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c178
-rw-r--r--UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c1
-rw-r--r--UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h13
-rw-r--r--UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf1
4 files changed, 1 insertions, 192 deletions
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c b/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c
index 79f6be6ae5..5651494302 100644
--- a/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c
+++ b/UnixPkg/FvbServicesRuntimeDxe/FWBlockService.c
@@ -21,7 +21,6 @@ Revision History
#include "PiDxe.h"
#include <Guid/EventGroup.h>
-#include <Protocol/FvbExtension.h>
#include <Protocol/FirmwareVolumeBlock.h>
#include <Guid/AlternateFvBlock.h>
#include <Protocol/DevicePath.h>
@@ -79,9 +78,6 @@ EFI_FW_VOL_BLOCK_DEVICE mFvbDeviceTemplate = {
FvbProtocolWrite,
FvbProtocolEraseBlocks,
NULL
- },
- {
- FvbExtendProtocolEraseCustomBlockRange
}
};
@@ -600,113 +596,6 @@ Returns:
}
EFI_STATUS
-FvbEraseCustomBlockRange (
- IN UINTN Instance,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba,
- IN ESAL_FWB_GLOBAL *Global,
- IN BOOLEAN Virtual
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- Instance - The FV instance to be erased
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetStartLba - Offset into the last block at which to end erasing
- Global - Pointer to ESAL_FWB_GLOBAL that contains all
- instance data
- Virtual - Whether CPU is in virtual or physical mode
-
-Returns:
- EFI_SUCCESS - The firmware volume was erased successfully
- 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. Firmware device may have been
- partially erased
- EFI_INVALID_PARAMETER - Instance not found
-
---*/
-{
- EFI_LBA Index;
- UINTN LbaSize;
- UINTN ScratchLbaSizeData;
- EFI_STATUS Status;
-
- //
- // First LBA
- //
- Status = FvbGetLbaAddress (Instance, StartLba, NULL, &LbaSize, NULL, Global, Virtual);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Use the scratch space as the intermediate buffer to transfer data
- // Back up the first LBA in scratch space.
- //
- FvbReadBlock (Instance, StartLba, 0, &LbaSize, Global->FvbScratchSpace[Virtual], Global, Virtual);
-
- //
- // erase now
- //
- FvbEraseBlock (Instance, StartLba, Global, Virtual);
- ScratchLbaSizeData = OffsetStartLba;
-
- //
- // write the data back to the first block
- //
- if (ScratchLbaSizeData > 0) {
- Status = FvbWriteBlock (Instance, StartLba, 0, &ScratchLbaSizeData, Global->FvbScratchSpace[Virtual], Global, Virtual);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
- //
- // Middle LBAs
- //
- if (LastLba > (StartLba + 1)) {
- for (Index = (StartLba + 1); Index <= (LastLba - 1); Index++) {
- FvbEraseBlock (Instance, Index, Global, Virtual);
- }
- }
- //
- // Last LBAs, the same as first LBAs
- //
- if (LastLba > StartLba) {
- Status = FvbGetLbaAddress (Instance, LastLba, NULL, &LbaSize, NULL, Global, Virtual);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- FvbReadBlock (Instance, LastLba, 0, &LbaSize, Global->FvbScratchSpace[Virtual], Global, Virtual);
- FvbEraseBlock (Instance, LastLba, Global, Virtual);
- }
-
- ScratchLbaSizeData = LbaSize - (OffsetLastLba + 1);
-
- if (ScratchLbaSizeData > 0) {
- Status = FvbWriteBlock (
- Instance,
- LastLba,
- (OffsetLastLba + 1),
- &ScratchLbaSizeData,
- Global->FvbScratchSpace[Virtual] + OffsetLastLba + 1,
- Global,
- Virtual
- );
- }
-
- return Status;
-}
-
-EFI_STATUS
FvbSetVolumeAttributes (
IN UINTN Instance,
IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
@@ -1166,55 +1055,6 @@ Returns:
return FvbReadBlock (FvbDevice->Instance, Lba, Offset, NumBytes, Buffer, mFvbModuleGlobal, EfiGoneVirtual ());
}
-//
-// FVB Extension Protocols
-//
-EFI_STATUS
-EFIAPI
-FvbExtendProtocolEraseCustomBlockRange (
- IN EFI_FVB_EXTENSION_PROTOCOL *This,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- This - Calling context
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetStartLba - Offset into the last block at which to end erasing
-
-Returns:
- EFI_SUCCESS - The firmware volume was erased successfully
- 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. Firmware device may have been
- partially erased
-
---*/
-{
- EFI_FW_VOL_BLOCK_DEVICE *FvbDevice;
-
- FvbDevice = FVB_EXTEND_DEVICE_FROM_THIS (This);
-
- return FvbEraseCustomBlockRange (
- FvbDevice->Instance,
- StartLba,
- OffsetStartLba,
- LastLba,
- OffsetLastLba,
- mFvbModuleGlobal,
- EfiGoneVirtual ()
- );
-}
-
EFI_STATUS
ValidateFvHeader (
EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader
@@ -1515,13 +1355,9 @@ Returns:
//
ASSERT (FALSE);
}
- //
- // Install FVB Extension Protocol on the same handle
- //
+
Status = gBS->InstallMultipleProtocolInterfaces (
&FwbHandle,
- &gEfiFvbExtensionProtocolGuid,
- &FvbDevice->FvbExtension,
&gEfiAlternateFvBlockGuid,
NULL,
NULL
@@ -1538,17 +1374,5 @@ Returns:
FvHob.Raw = GET_NEXT_HOB (FvHob);
}
- //
- // Allocate for scratch space, an intermediate buffer for FVB extention
- //
- Status = gBS->AllocatePool (
- EfiRuntimeServicesData,
- MaxLbaSize,
- (VOID**)&mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]
- );
- ASSERT_EFI_ERROR (Status);
-
- mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL];
-
return EFI_SUCCESS;
}
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c b/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c
index 0e30004d90..b7a5a30271 100644
--- a/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c
+++ b/UnixPkg/FvbServicesRuntimeDxe/FvbInfo.c
@@ -21,7 +21,6 @@ Abstract:
--*/
#include "PiDxe.h"
#include <Guid/EventGroup.h>
-#include <Protocol/FvbExtension.h>
#include <Protocol/FirmwareVolumeBlock.h>
#include <Guid/AlternateFvBlock.h>
#include <Protocol/DevicePath.h>
diff --git a/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h b/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h
index eb868111a4..5ed8107745 100644
--- a/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h
+++ b/UnixPkg/FvbServicesRuntimeDxe/FwBlockService.h
@@ -38,7 +38,6 @@ typedef struct {
typedef struct {
UINT32 NumFv;
EFI_FW_VOL_INSTANCE *FvInstance[2];
- UINT8 *FvbScratchSpace[2];
} ESAL_FWB_GLOBAL;
//
@@ -58,7 +57,6 @@ typedef struct {
FV_DEVICE_PATH DevicePath;
UINTN Instance;
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;
- EFI_FVB_EXTENSION_PROTOCOL FvbExtension;
} EFI_FW_VOL_BLOCK_DEVICE;
EFI_STATUS
@@ -224,15 +222,4 @@ FvbProtocolEraseBlocks (
)
;
-EFI_STATUS
-EFIAPI
-FvbExtendProtocolEraseCustomBlockRange (
- IN EFI_FVB_EXTENSION_PROTOCOL *This,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-;
-
#endif
diff --git a/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf b/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf
index d79cf67614..58aee9a06b 100644
--- a/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf
+++ b/UnixPkg/FvbServicesRuntimeDxe/UnixFwh.inf
@@ -63,7 +63,6 @@
[Protocols]
- gEfiFvbExtensionProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiDevicePathProtocolGuid # PROTOCOL SOMETIMES_PRODUCED