/* Get BurstCount by reading the burstCount field of a TIS register in the time of default TIS_TIMEOUT_D. */
EFI_STATUS EFIAPI TisPcReadBurstCount(IN TIS_PC_REGISTERS_PTR TisReg, OUT UINT16 *BurstCount)
/* Get BurstCount by reading the burstCount field of a TIS register in the time of default TIS_TIMEOUT_D. */
EFI_STATUS EFIAPI TisPcReadBurstCount(IN TIS_PC_REGISTERS_PTR TisReg, OUT UINT16 *BurstCount)
{
  UINT32  WaitTime;
  UINT8   DataByte0;
  UINT8   DataByte1;
  if ((BurstCount == NULL) || (TisReg == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  WaitTime = 0;
  do {
    DataByte0   = MmioRead8 ((UINTN)&TisReg->BurstCount);
    DataByte1   = MmioRead8 ((UINTN)&TisReg->BurstCount + 1);
    *BurstCount = (UINT16)((DataByte1 << 8) + DataByte0);
    if (*BurstCount != 0) {
      return EFI_SUCCESS;
    }
    MicroSecondDelay (30);
    WaitTime += 30;
  } while (WaitTime < TIS_TIMEOUT_D);
  return EFI_TIMEOUT;
}