/* If Length is not aligned on a 64-bit boundary, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). */
UINT64* EFIAPI MmioReadBuffer64(IN UINTN StartAddress, IN UINTN Length, OUT UINT64 *Buffer)
/* If Length is not aligned on a 64-bit boundary, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). */
UINT64* EFIAPI MmioReadBuffer64(IN UINTN StartAddress, IN UINTN Length, OUT 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 = Buffer;
  while (Length != 0) {
    *(Buffer++)   = MmioRead64 (StartAddress);
    StartAddress += sizeof (UINT64);
    Length       -= sizeof (UINT64);
  }
  return ReturnBuffer;
}