/* This function calculates and updates an UINT8 checksum. */
EFI_STATUS AcpiPlatformChecksum(IN VOID *Buffer, IN UINTN Size, IN UINTN ChecksumOffset)
/* This function calculates and updates an UINT8 checksum. */
EFI_STATUS AcpiPlatformChecksum(IN VOID *Buffer, IN UINTN Size, IN UINTN ChecksumOffset)
{
  UINT8  Sum;
  UINT8  *Ptr;
  Sum = 0;
  Ptr = Buffer;
  Ptr[ChecksumOffset] = 0;
  while ((Size--) != 0) {
    Sum = (UINT8)(Sum + (*Ptr++));
  }
  Ptr                 = Buffer;
  Ptr[ChecksumOffset] = (UINT8)(0xff - Sum + 1);
  return EFI_SUCCESS;
}