/* If Buffer is not aligned on a 64-bit boundary, then ASSERT(). */
UINT64* EFIAPI MmioWriteBuffer64(IN UINTN StartAddress, IN UINTN Length, IN CONST UINT64 *Buffer)
/* If Buffer is not aligned on a 64-bit boundary, then ASSERT(). */
UINT64* EFIAPI MmioWriteBuffer64(IN UINTN StartAddress, IN UINTN Length, IN CONST UINT64 *Buffer)
{
  UINT64  *ReturnBuffer;
  ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);
  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));
  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN)Buffer));
  ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);
  ASSERT (((UINTN)Buffer & (sizeof (UINT64) - 1)) == 0);
  ReturnBuffer = (UINT64 *)Buffer;
  while (Length != 0) {
    MmioWrite64 (StartAddress, *(Buffer++));
    StartAddress += sizeof (UINT64);
    Length       -= sizeof (UINT64);
  }
  return ReturnBuffer;
}