X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Nt32Pkg%2FPlatformBdsDxe%2FGeneric%2FCapsules.c;h=d56545266b8cbd1ec166b620dfe78330e318142e;hp=696eb9efadf8b34e3a47671344ae4a67344c5eb2;hb=40f18da12b2f04f42cae34a7f33db6a595f4dcd7;hpb=bc11b82964c116a64e8e453777c8b61d62e38e11 diff --git a/Nt32Pkg/PlatformBdsDxe/Generic/Capsules.c b/Nt32Pkg/PlatformBdsDxe/Generic/Capsules.c index 696eb9efad..d56545266b 100644 --- a/Nt32Pkg/PlatformBdsDxe/Generic/Capsules.c +++ b/Nt32Pkg/PlatformBdsDxe/Generic/Capsules.c @@ -19,13 +19,8 @@ Abstract: --*/ - -// -// Include common header file for this module. -// -#include "CommonHeader.h" - -#include +#include "Bds.h" +#include VOID BdsLockFv ( @@ -39,40 +34,6 @@ BdsLockFv ( IN EFI_FLASH_SUBAREA_ENTRY *FlashEntry ) { - EFI_FV_BLOCK_MAP_ENTRY *BlockMap; - EFI_FIRMWARE_VOLUME_HEADER *FvHeader; - UINT64 BaseAddress; - UINT8 Data; - UINT32 BlockLength; - UINTN Index; - - BaseAddress = FlashEntry->Base - 0x400000 + 2; - FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) (FlashEntry->Base)); - BlockMap = &(FvHeader->FvBlockMap[0]); - - while ((BlockMap->NumBlocks != 0) && (BlockMap->BlockLength != 0)) { - BlockLength = BlockMap->BlockLength; - for (Index = 0; Index < BlockMap->NumBlocks; Index++) { - CpuIo->Mem.Read ( - CpuIo, - EfiCpuIoWidthUint8, - BaseAddress, - 1, - &Data - ); - Data = (UINT8) (Data | 0x3); - CpuIo->Mem.Write ( - CpuIo, - EfiCpuIoWidthUint8, - BaseAddress, - 1, - &Data - ); - BaseAddress += BlockLength; - } - - BlockMap++; - } } VOID @@ -80,30 +41,6 @@ BdsLockNonUpdatableFlash ( VOID ) { - EFI_FLASH_MAP_ENTRY_DATA *FlashMapEntryData; - EFI_PEI_HOB_POINTERS GuidHob; - EFI_STATUS Status; - EFI_CPU_IO_PROTOCOL *CpuIo; - - Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &CpuIo); - ASSERT_EFI_ERROR (Status); - - GuidHob.Raw = GetHobList (); - while ((GuidHob.Raw = GetNextGuidHob (&gEfiFlashMapHobGuid, GuidHob.Raw)) != NULL) { - FlashMapEntryData = (EFI_FLASH_MAP_ENTRY_DATA *) GET_GUID_HOB_DATA (GuidHob.Guid); - - // - // Get the variable store area - // - if ((FlashMapEntryData->AreaType == EFI_FLASH_AREA_RECOVERY_BIOS) || - (FlashMapEntryData->AreaType == EFI_FLASH_AREA_MAIN_BIOS) - ) { - BdsLockFv (CpuIo, &(FlashMapEntryData->Entries[0])); - } - GuidHob.Raw = GET_NEXT_HOB (GuidHob); - } - - return ; } EFI_STATUS