Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17044
6f19259b-4bc3-4df7-8a09-
765794883524
UEFI and Tiano Custom Decompress Library \r
It will do Tiano or UEFI decompress with different verison parameter.\r
\r
UEFI and Tiano Custom Decompress Library \r
It will do Tiano or UEFI decompress with different verison parameter.\r
\r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
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
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
- // Caculate additional bit count read to update mBitCount\r
+ // Calculate additional bit count read to update mBitCount\r
//\r
Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);\r
\r
//\r
Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);\r
\r
Sd->mSrcBase = (UINT8 *)Src;\r
Sd->mDstBase = Dst;\r
//\r
Sd->mSrcBase = (UINT8 *)Src;\r
Sd->mDstBase = Dst;\r
//\r
- // CompSize and OrigSize are caculated in bytes\r
+ // CompSize and OrigSize are calculated in bytes\r
//\r
Sd->mCompSize = CompSize;\r
Sd->mOrigSize = OrigSize;\r
//\r
Sd->mCompSize = CompSize;\r
Sd->mOrigSize = OrigSize;\r
/** @file\r
Common defines and definitions for a FwVolDxe driver.\r
\r
/** @file\r
Common defines and definitions for a FwVolDxe driver.\r
\r
- Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
#define MAX_FILES 32\r
\r
//\r
#define MAX_FILES 32\r
\r
//\r
-// Used to caculate from address -> Lba\r
+// Used to calculate from address -> Lba\r
//\r
typedef struct {\r
LIST_ENTRY Link;\r
//\r
typedef struct {\r
LIST_ENTRY Link;\r
- Caculate the checksum for the FFS header.\r
+ Calculate the checksum for the FFS header.\r
- @param FfsHeader FFS File Header which needs to caculate the checksum\r
+ @param FfsHeader FFS File Header which needs to calculate the checksum\r
- Caculate the checksum for the FFS File.\r
+ Calculate the checksum for the FFS File.\r
- @param FfsHeader FFS File Header which needs to caculate the checksum\r
+ @param FfsHeader FFS File Header which needs to calculate the checksum\r
@param ActualFileSize The whole Ffs File Length.\r
\r
**/\r
@param ActualFileSize The whole Ffs File Length.\r
\r
**/\r
/** @file\r
Implements write firmware file.\r
\r
/** @file\r
Implements write firmware file.\r
\r
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
#include "FwVolDriver.h"\r
\r
/**\r
#include "FwVolDriver.h"\r
\r
/**\r
- Caculate the checksum for the FFS header.\r
+ Calculate the checksum for the FFS header.\r
- @param FfsHeader FFS File Header which needs to caculate the checksum\r
+ @param FfsHeader FFS File Header which needs to calculate the checksum\r
- Caculate the checksum for the FFS File.\r
+ Calculate the checksum for the FFS File.\r
- @param FfsHeader FFS File Header which needs to caculate the checksum\r
+ @param FfsHeader FFS File Header which needs to calculate the checksum\r
@param ActualFileSize The whole Ffs File Length.\r
\r
**/\r
@param ActualFileSize The whole Ffs File Length.\r
\r
**/\r
- Caculate the leading Pad file size to meet the alignment requirement.\r
+ Calculate the leading Pad file size to meet the alignment requirement.\r
\r
@param FvDevice Cached Firmware Volume.\r
@param StartAddress The starting address to write the FFS File.\r
\r
@param FvDevice Cached Firmware Volume.\r
@param StartAddress The starting address to write the FFS File.\r
+CalculatePadFileSize (\r
IN FV_DEVICE *FvDevice,\r
IN EFI_PHYSICAL_ADDRESS StartAddress,\r
IN UINTN BufferSize,\r
IN FV_DEVICE *FvDevice,\r
IN EFI_PHYSICAL_ADDRESS StartAddress,\r
IN UINTN BufferSize,\r
// required the file size\r
//\r
while ((LIST_ENTRY *) FreeSpaceListEntry != &FvDevice->FreeSpaceHeader) {\r
// required the file size\r
//\r
while ((LIST_ENTRY *) FreeSpaceListEntry != &FvDevice->FreeSpaceHeader) {\r
- PadFileSize = CaculatePadFileSize (\r
+ PadFileSize = CalculatePadFileSize (\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FreeSpaceListEntry->StartingAddress,\r
Size,\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FreeSpaceListEntry->StartingAddress,\r
Size,\r
PadAreaLength = FFS_FILE_SIZE (FileHeader) - HeaderSize;\r
}\r
\r
PadAreaLength = FFS_FILE_SIZE (FileHeader) - HeaderSize;\r
}\r
\r
- PadFileSize = CaculatePadFileSize (\r
+ PadFileSize = CalculatePadFileSize (\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FileHeader + HeaderSize,\r
Size,\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FileHeader + HeaderSize,\r
Size,\r
TotalSize = 0;\r
\r
for (Index = 0; Index < NumOfFiles; Index++) {\r
TotalSize = 0;\r
\r
for (Index = 0; Index < NumOfFiles; Index++) {\r
- PadSize[Index] = CaculatePadFileSize (\r
+ PadSize[Index] = CalculatePadFileSize (\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FileHeader + HeaderSize + TotalSize,\r
BufferSize[Index],\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FileHeader + HeaderSize + TotalSize,\r
BufferSize[Index],\r
StartAddr = FreeSpaceListEntry->StartingAddress;\r
\r
//\r
StartAddr = FreeSpaceListEntry->StartingAddress;\r
\r
//\r
- // Caculate the totalsize we need\r
+ // Calculate the totalsize we need\r
//\r
for (Index = 0; Index < NumOfFiles; Index++) {\r
//\r
// Perhaps we don't need an EFI_FFS_FILE_HEADER, the first file\r
// have had its leading pad file.\r
//\r
//\r
for (Index = 0; Index < NumOfFiles; Index++) {\r
//\r
// Perhaps we don't need an EFI_FFS_FILE_HEADER, the first file\r
// have had its leading pad file.\r
//\r
- PadSize[Index] = CaculatePadFileSize (\r
+ PadSize[Index] = CalculatePadFileSize (\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) StartAddr + TotalSize,\r
BufferSize[Index],\r
FvDevice,\r
(EFI_PHYSICAL_ADDRESS) (UINTN) StartAddr + TotalSize,\r
BufferSize[Index],\r
FreeSpaceEntry->Length -= (BufferSize - HeaderSize);\r
\r
//\r
FreeSpaceEntry->Length -= (BufferSize - HeaderSize);\r
\r
//\r
- // Caculate File Checksum\r
+ // Calculate File Checksum\r
//\r
SetFileChecksum (FileHeader, ActualFileSize);\r
\r
//\r
SetFileChecksum (FileHeader, ActualFileSize);\r
\r