diff options
Diffstat (limited to 'EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite')
5 files changed, 58 insertions, 73 deletions
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c index f4c7e9199c..a120c7f3dd 100644 --- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c +++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -236,7 +236,7 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (MyBuffer);
+ FreePool (MyBuffer);
return EFI_ABORTED;
}
@@ -256,7 +256,7 @@ Returns: MyLength = FtwLiteDevice->SizeOfSpareBlock;
Status = Fvb->Read (Fvb, Lba + Index, 0, &MyLength, Ptr);
if (EFI_ERROR (Status)) {
- gBS->FreePool (MyBuffer);
+ FreePool (MyBuffer);
return EFI_ABORTED;
}
@@ -276,7 +276,7 @@ Returns: SpareBufferSize = FtwLiteDevice->SpareAreaLength;
SpareBuffer = AllocatePool (SpareBufferSize);
if (SpareBuffer == NULL) {
- gBS->FreePool (MyBuffer);
+ FreePool (MyBuffer);
return EFI_OUT_OF_RESOURCES;
}
@@ -291,8 +291,8 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (MyBuffer);
- gBS->FreePool (SpareBuffer);
+ FreePool (MyBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -314,8 +314,8 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (MyBuffer);
- gBS->FreePool (SpareBuffer);
+ FreePool (MyBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -324,7 +324,7 @@ Returns: //
// Free MyBuffer
//
- gBS->FreePool (MyBuffer);
+ FreePool (MyBuffer);
//
// Set the SpareCompleteD in the FTW record,
@@ -337,7 +337,7 @@ Returns: SPARE_COMPLETED
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -349,7 +349,7 @@ Returns: //
Status = FtwWriteRecord (FtwLiteDevice, Fvb);
if (EFI_ERROR (Status)) {
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -371,7 +371,7 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -380,7 +380,7 @@ Returns: //
// All success.
//
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
DEBUG (
(EFI_D_FTW_LITE,
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa index 4e6dd26ba7..e2419a419a 100644 --- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa +++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa @@ -7,7 +7,7 @@ <Version>1.0</Version>
<Abstract>Component description file for FtwLite module.</Abstract>
<Description>This driver provides fault tolerant write capability for block devices.</Description>
- <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>
+ <Copyright>Copyright (c) 2006 - 2007, Intel Corporation</Copyright>
<License>All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,23 +24,15 @@ <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>PcdLib</Keyword>
- </LibraryClass>
- <LibraryClass Usage="ALWAYS_CONSUMED">
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED" RecommendedInstanceGuid="bda39d3a-451b-4350-8266-81ab10fa0523">
<Keyword>DebugLib</Keyword>
+ <HelpText>Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg.</HelpText>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverEntryPoint</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
- <Keyword>UefiLib</Keyword>
- </LibraryClass>
- <LibraryClass Usage="ALWAYS_CONSUMED">
- <Keyword>BaseLib</Keyword>
- </LibraryClass>
- <LibraryClass Usage="ALWAYS_CONSUMED">
- <Keyword>HobLib</Keyword>
- </LibraryClass>
- <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseMemoryLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
@@ -69,7 +61,7 @@ <Protocol Usage="ALWAYS_PRODUCED">
<ProtocolCName>gEfiFaultTolerantWriteLiteProtocolGuid</ProtocolCName>
</Protocol>
- <Protocol Usage="SOMETIMES_CONSUMED">
+ <Protocol Usage="ALWAYS_CONSUMED" SupArchList="IA32 EBC">
<ProtocolCName>gEfiPciRootBridgeIoProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
@@ -78,9 +70,6 @@ </Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
- <GuidCName>gEfiFlashMapHobGuid</GuidCName>
- </GuidCNames>
- <GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>gEfiSystemNvDataFvGuid</GuidCName>
</GuidCNames>
</Guids>
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwMisc.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwMisc.c index 025ec33f7b..eb334eaedd 100644 --- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwMisc.c +++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwMisc.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -229,7 +229,7 @@ Returns: }
}
- gBS->FreePool (HandleBuffer);
+ FreePool (HandleBuffer);
return Status;
}
@@ -329,7 +329,7 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -340,7 +340,7 @@ Returns: //
Status = FtwEraseBlock (FtwLiteDevice, FvBlock, Lba);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return EFI_ABORTED;
}
//
@@ -352,14 +352,14 @@ Returns: Status = FvBlock->Write (FvBlock, Lba + Index, 0, &Count, Ptr);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_FTW_LITE, "FtwLite: FVB Write block - %r\n", Status));
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
Ptr += Count;
}
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -433,7 +433,7 @@ Notes: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -463,7 +463,7 @@ Notes: WORKING_BLOCK_INVALID
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return EFI_ABORTED;
}
@@ -478,7 +478,7 @@ Notes: FtwLiteDevice->FtwWorkBlockLba
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return EFI_ABORTED;
}
//
@@ -496,7 +496,7 @@ Notes: );
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_FTW_LITE, "FtwLite: FVB Write block - %r\n", Status));
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -505,7 +505,7 @@ Notes: //
// Since the memory buffer will not be used, free memory Buffer.
//
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
//
// Update the VALID of the working block
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c index 40e56ad1fb..00d7d8e912 100644 --- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c +++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwWorkSpace.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -417,17 +417,11 @@ Returns: // Read all original data from working block to a memory buffer
//
TempBufferSize = FtwLiteDevice->SpareAreaLength;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- TempBufferSize,
- (VOID **) &TempBuffer
- );
- if (EFI_ERROR (Status)) {
+ TempBuffer = AllocateZeroPool (TempBufferSize);
+ if (TempBuffer != NULL) {
return EFI_OUT_OF_RESOURCES;
}
- ZeroMem (TempBuffer, TempBufferSize);
-
Ptr = TempBuffer;
for (Index = 0; Index < FtwLiteDevice->NumberOfSpareBlock; Index += 1) {
Length = FtwLiteDevice->SizeOfSpareBlock;
@@ -439,7 +433,7 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (TempBuffer);
+ FreePool (TempBuffer);
return EFI_ABORTED;
}
@@ -450,8 +444,8 @@ Returns: //
Ptr = TempBuffer +
((UINTN) (FtwLiteDevice->FtwWorkSpaceLba - FtwLiteDevice->FtwWorkBlockLba)) *
- FtwLiteDevice->SizeOfSpareBlock +
- FtwLiteDevice->FtwWorkSpaceBase;
+ FtwLiteDevice->SizeOfSpareBlock + FtwLiteDevice->FtwWorkSpaceBase;
+
Status = CleanupWorkSpace (
FtwLiteDevice,
Ptr,
@@ -480,7 +474,7 @@ Returns: SpareBufferSize = FtwLiteDevice->SpareAreaLength;
SpareBuffer = AllocatePool (SpareBufferSize);
if (SpareBuffer == NULL) {
- gBS->FreePool (TempBuffer);
+ FreePool (TempBuffer);
return EFI_OUT_OF_RESOURCES;
}
@@ -495,8 +489,8 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (TempBuffer);
- gBS->FreePool (SpareBuffer);
+ FreePool (TempBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -517,8 +511,8 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (TempBuffer);
- gBS->FreePool (SpareBuffer);
+ FreePool (TempBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
@@ -527,14 +521,14 @@ Returns: //
// Free TempBuffer
//
- gBS->FreePool (TempBuffer);
+ FreePool (TempBuffer);
//
// Write the spare block to working block
//
Status = FlushSpareBlockToWorkingBlock (FtwLiteDevice);
if (EFI_ERROR (Status)) {
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
return Status;
}
//
@@ -552,14 +546,14 @@ Returns: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
return EFI_ABORTED;
}
Ptr += Length;
}
- gBS->FreePool (SpareBuffer);
+ FreePool (SpareBuffer);
DEBUG ((EFI_D_FTW_LITE, "FtwLite: reclaim work space success\n"));
diff --git a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/Ia32/Ia32FtwMisc.c b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/Ia32/Ia32FtwMisc.c index 85fa60e348..6425f29b2c 100644 --- a/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/Ia32/Ia32FtwMisc.c +++ b/EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/Ia32/Ia32FtwMisc.c @@ -1,6 +1,6 @@ /*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -76,10 +76,12 @@ Returns: Status = PciRootBridgeIo->Pci.Read (
PciRootBridgeIo,
EfiPciWidthUint32,
- EFI_PCI_ADDRESS (LPC_BUS_NUMBER,
- LPC_DEVICE_NUMBER,
- LPC_IF,
- Offset),
+ EFI_PCI_ADDRESS (
+ LPC_BUS_NUMBER,
+ LPC_DEVICE_NUMBER,
+ LPC_IF,
+ Offset
+ ),
1,
&Value
);
@@ -295,7 +297,7 @@ Notes: Status = GetSwapState (FtwLiteDevice, &TopSwap);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "FtwLite: Get Top Swapped status - %r\n", Status));
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return EFI_ABORTED;
}
@@ -305,7 +307,7 @@ Notes: //
Status = GetFvbByAddress (FtwLiteDevice->SpareAreaAddress + FTW_BLOCK_SIZE, &BootFvb);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
//
@@ -323,7 +325,7 @@ Notes: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -345,7 +347,7 @@ Notes: Ptr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
@@ -363,7 +365,7 @@ Notes: //
Status = FtwEraseSpareBlock (FtwLiteDevice);
if (EFI_ERROR (Status)) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return EFI_ABORTED;
}
//
@@ -381,14 +383,14 @@ Notes: );
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_FTW_LITE, "FtwLite: FVB Write boot block - %r\n", Status));
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
return Status;
}
Ptr += Count;
}
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
//
// Clear TopSwap bit
|