summaryrefslogtreecommitdiff
path: root/DuetPkg/Library/DuetBdsLib
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 02:32:30 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-24 02:32:30 +0000
commit86608df41220ccb6e5116b9ba0be349292b5f57c (patch)
treefe3621d2432ba76890bddfc160786005d9a4ecfc /DuetPkg/Library/DuetBdsLib
parent7e038442a84e882ddc8a6b2e23243c6d4e371090 (diff)
remove the self-implementation on checksum() in this module by using BaseLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8638 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/Library/DuetBdsLib')
-rw-r--r--DuetPkg/Library/DuetBdsLib/BdsPlatform.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c
index 7949cedff..da0613017 100644
--- a/DuetPkg/Library/DuetBdsLib/BdsPlatform.c
+++ b/DuetPkg/Library/DuetBdsLib/BdsPlatform.c
@@ -1462,38 +1462,6 @@ Returns:
return EFI_UNSUPPORTED;
}
-UINT8
-GetBufferCheckSum (
- IN VOID * Buffer,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Caculate buffer checksum (8-bit)
-
-Arguments:
- Buffer - Pointer to Buffer that to be caculated
- Length - How many bytes are to be caculated
-
-Returns:
- Checksum of the buffer
-
---*/
-{
- UINT8 CheckSum;
- UINT8 *Ptr8;
-
- CheckSum = 0;
- Ptr8 = (UINT8 *) Buffer;
-
- while (Length > 0) {
- CheckSum = (UINT8) (CheckSum + *Ptr8++);
- Length--;
- }
-
- return (UINT8)((0xFF - CheckSum) + 1);
-}
EFI_STATUS
ConvertAcpiTable (
@@ -1628,7 +1596,7 @@ Returns:
SmbiosTableNew->TableAddress = (UINT32)BufferPtr;
SmbiosTableNew->IntermediateChecksum = 0;
SmbiosTableNew->IntermediateChecksum =
- GetBufferCheckSum ((UINT8*)SmbiosTableNew + 0x10, SmbiosEntryLen -0x10);
+ CalculateCheckSum8 ((UINT8*)SmbiosTableNew + 0x10, SmbiosEntryLen -0x10);
//
// Change the SMBIOS pointer
//
@@ -1727,10 +1695,10 @@ Returns:
MpsTableNew->OemTablePointer = (UINT32)(UINTN)OemTableNew;
}
MpsTableNew->Checksum = 0;
- MpsTableNew->Checksum = GetBufferCheckSum (MpsTableNew, MpsTableOri->BaseTableLength);
+ MpsTableNew->Checksum = CalculateCheckSum8 (MpsTableNew, MpsTableOri->BaseTableLength);
MpsFloatingPointerNew->PhysicalAddress = (UINT32)(UINTN)MpsTableNew;
MpsFloatingPointerNew->Checksum = 0;
- MpsFloatingPointerNew->Checksum = GetBufferCheckSum (MpsFloatingPointerNew, FPLength);
+ MpsFloatingPointerNew->Checksum = CalculateCheckSum8 (MpsFloatingPointerNew, FPLength);
}
//
// Change the pointer