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